Repository: bernardladenthin/BitcoinAddressFinder Branch: main Commit: 18a012001d4c Files: 284 Total size: 4.3 MB Directory structure: gitextract_rp99wxvr/ ├── .claude/ │ └── skills/ │ ├── java-tdd-guide/ │ │ └── SKILL.md │ └── tdd/ │ └── SKILL.md ├── .github/ │ ├── dependabot.yml │ └── workflows/ │ ├── assembly.yml │ ├── claude-code-review.yml │ ├── claude.yml │ ├── codeql.yml │ ├── coverage.yml │ └── matrixci.yml ├── .gitignore ├── .mvn/ │ └── jvm.config ├── CLAUDE.md ├── CODE_OF_CONDUCT.md ├── CODE_WRITING_GUIDE.md ├── LICENSE ├── README.md ├── TEST_WRITING_GUIDE.md ├── build.bat ├── examples/ │ ├── addresses/ │ │ ├── fileContainingAddresses0.txt │ │ ├── fileContainingAddresses1.tsv │ │ └── fileContainingAddresses2.csv │ ├── config_AddressFilesToLMDB.json │ ├── config_Find_1OpenCLDevice.json │ ├── config_Find_1OpenCLDeviceAnd2CPUProducer.json │ ├── config_Find_8CPUProducer.json │ ├── config_Find_SecretsFile.json │ ├── config_LMDBToAddressFile.json │ ├── config_OpenCLInfo.json │ ├── logbackConfiguration.xml │ ├── run_AddressFilesToLMDB.bat │ ├── run_Find_1OpenCLDevice.bat │ ├── run_Find_1OpenCLDeviceAnd2CPUProducer.bat │ ├── run_Find_8CPUProducer.bat │ ├── run_Find_SecretsFile.bat │ ├── run_LMDBToAddressFile.bat │ ├── run_OpenCLInfo.bat │ ├── secrets/ │ │ ├── fileContainingSecrets_BIG_INTEGER.txt │ │ ├── fileContainingSecrets_DUMPED_RIVATE_KEY.txt │ │ ├── fileContainingSecrets_SHA256.txt │ │ └── fileContainingSecrets_STRING_DO_SHA256.txt │ └── websocket.html ├── helper/ │ ├── bitinfocharts_com_scraping/ │ │ ├── scraping.py │ │ └── start.bat │ └── dumpwallet/ │ └── dumpwallet.py ├── pom.xml ├── skills/ │ └── tdd.md ├── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── net/ │ │ │ └── ladenthin/ │ │ │ └── bitcoinaddressfinder/ │ │ │ ├── AbstractPlaintextFile.java │ │ │ ├── AbstractProducer.java │ │ │ ├── AddressFile.java │ │ │ ├── AddressFilesToLMDB.java │ │ │ ├── AddressFormatNotAcceptedException.java │ │ │ ├── AddressToCoin.java │ │ │ ├── AddressTxtLine.java │ │ │ ├── AddressType.java │ │ │ ├── BIP39KeyProducer.java │ │ │ ├── BIP39Wordlist.java │ │ │ ├── Base36Decoder.java │ │ │ ├── Bech32Helper.java │ │ │ ├── BitHelper.java │ │ │ ├── ByteBufferUtility.java │ │ │ ├── ByteConversion.java │ │ │ ├── Consumer.java │ │ │ ├── ConsumerJava.java │ │ │ ├── EndiannessConverter.java │ │ │ ├── FileHelper.java │ │ │ ├── Finder.java │ │ │ ├── Interruptable.java │ │ │ ├── KeyUtility.java │ │ │ ├── LMDBToAddressFile.java │ │ │ ├── NetworkParameterFactory.java │ │ │ ├── OpenCLContext.java │ │ │ ├── OpenCLGridResult.java │ │ │ ├── OpenClTask.java │ │ │ ├── PrivateKeyTooLargeException.java │ │ │ ├── PrivateKeyValidator.java │ │ │ ├── Producer.java │ │ │ ├── ProducerJava.java │ │ │ ├── ProducerJavaSecretsFiles.java │ │ │ ├── ProducerOpenCL.java │ │ │ ├── ProducerState.java │ │ │ ├── ProducerStateProvider.java │ │ │ ├── PublicKeyBytes.java │ │ │ ├── RandomSecretSupplier.java │ │ │ ├── ReadStatistic.java │ │ │ ├── ReleaseCLObject.java │ │ │ ├── SecretSupplier.java │ │ │ ├── SecretsFile.java │ │ │ ├── SeparatorFormat.java │ │ │ ├── Shutdown.java │ │ │ ├── Statistics.java │ │ │ ├── cli/ │ │ │ │ └── Main.java │ │ │ ├── configuration/ │ │ │ │ ├── CAddressFileOutputFormat.java │ │ │ │ ├── CAddressFilesToLMDB.java │ │ │ │ ├── CCommand.java │ │ │ │ ├── CConfiguration.java │ │ │ │ ├── CConsumerJava.java │ │ │ │ ├── CFinder.java │ │ │ │ ├── CKeyProducerJava.java │ │ │ │ ├── CKeyProducerJavaBip39.java │ │ │ │ ├── CKeyProducerJavaIncremental.java │ │ │ │ ├── CKeyProducerJavaRandom.java │ │ │ │ ├── CKeyProducerJavaRandomInstance.java │ │ │ │ ├── CKeyProducerJavaReceiver.java │ │ │ │ ├── CKeyProducerJavaSocket.java │ │ │ │ ├── CKeyProducerJavaWebSocket.java │ │ │ │ ├── CKeyProducerJavaZmq.java │ │ │ │ ├── CLMDBConfigurationReadOnly.java │ │ │ │ ├── CLMDBConfigurationWrite.java │ │ │ │ ├── CLMDBToAddressFile.java │ │ │ │ ├── CProducer.java │ │ │ │ ├── CProducerJava.java │ │ │ │ ├── CProducerJavaSecretsFiles.java │ │ │ │ ├── CProducerOpenCL.java │ │ │ │ ├── CSecretFormat.java │ │ │ │ └── UnknownSecretFormatException.java │ │ │ ├── eckey/ │ │ │ │ └── Secp256k1.java │ │ │ ├── keyproducer/ │ │ │ │ ├── AbstractKeyProducer.java │ │ │ │ ├── AbstractKeyProducerQueueBuffered.java │ │ │ │ ├── ConnectionUtils.java │ │ │ │ ├── KeyProducer.java │ │ │ │ ├── KeyProducerIdIsNotUniqueException.java │ │ │ │ ├── KeyProducerIdNullException.java │ │ │ │ ├── KeyProducerIdUnknownException.java │ │ │ │ ├── KeyProducerJava.java │ │ │ │ ├── KeyProducerJavaBip39.java │ │ │ │ ├── KeyProducerJavaIncremental.java │ │ │ │ ├── KeyProducerJavaRandom.java │ │ │ │ ├── KeyProducerJavaSocket.java │ │ │ │ ├── KeyProducerJavaWebSocket.java │ │ │ │ ├── KeyProducerJavaZmq.java │ │ │ │ └── NoMoreSecretsAvailableException.java │ │ │ ├── opencl/ │ │ │ │ ├── OpenCLBuilder.java │ │ │ │ ├── OpenCLDevice.java │ │ │ │ ├── OpenCLDeviceSelection.java │ │ │ │ ├── OpenCLPlatform.java │ │ │ │ └── OpenCLPlatformSelector.java │ │ │ └── persistence/ │ │ │ ├── Persistence.java │ │ │ ├── PersistenceUtils.java │ │ │ └── lmdb/ │ │ │ └── LMDBPersistence.java │ │ └── resources/ │ │ ├── copyfromhashcat/ │ │ │ ├── inc_common.cl │ │ │ ├── inc_common.h │ │ │ ├── inc_ecc_secp256k1.cl │ │ │ ├── inc_ecc_secp256k1.h │ │ │ ├── inc_hash_ripemd160.cl │ │ │ ├── inc_hash_ripemd160.h │ │ │ ├── inc_hash_sha256.cl │ │ │ ├── inc_hash_sha256.h │ │ │ ├── inc_platform.cl │ │ │ ├── inc_platform.h │ │ │ ├── inc_types.h │ │ │ └── inc_vendor.h │ │ ├── inc_defines.h │ │ ├── inc_ecc_secp256k1custom.cl │ │ ├── mnemonic/ │ │ │ └── wordlist/ │ │ │ ├── chinese_simplified.txt │ │ │ ├── chinese_traditional.txt │ │ │ ├── czech.txt │ │ │ ├── english.txt │ │ │ ├── french.txt │ │ │ ├── italian.txt │ │ │ ├── japanese.txt │ │ │ ├── korean.txt │ │ │ ├── portuguese.txt │ │ │ ├── russian.txt │ │ │ ├── spanish.txt │ │ │ └── turkish.txt │ │ ├── simplelogger.properties │ │ └── unused/ │ │ ├── calc_addrs.cl │ │ ├── calc_addrs_fix_zero.cl │ │ └── gpu.cl │ └── test/ │ ├── java/ │ │ └── net/ │ │ └── ladenthin/ │ │ └── bitcoinaddressfinder/ │ │ ├── AbstractPlaintextFileTest.java │ │ ├── AbstractProducerTest.java │ │ ├── AbstractProducerTestImpl.java │ │ ├── AddressFileTest.java │ │ ├── AddressFilesToLMDBTest.java │ │ ├── AddressFormatNotAcceptedExceptionTest.java │ │ ├── AddressToCoinTest.java │ │ ├── AddressTxtLineTest.java │ │ ├── AddressTypeTest.java │ │ ├── AwaitTimeTest.java │ │ ├── AwaitTimeTests.java │ │ ├── BIP39DataProvider.java │ │ ├── BIP39KeyProducerTest.java │ │ ├── BIP39WordlistTest.java │ │ ├── Base36DecoderTest.java │ │ ├── Bech32HelperTest.java │ │ ├── BitHelperTest.java │ │ ├── ByteBufferUtilityTest.java │ │ ├── ByteConversionTest.java │ │ ├── CommonDataProvider.java │ │ ├── ConsumerJavaTest.java │ │ ├── EndiannessConverterTest.java │ │ ├── EqualHashCodeToStringTestHelper.java │ │ ├── FileHelperTest.java │ │ ├── FinderTest.java │ │ ├── HexEncodeTest.java │ │ ├── KeyUtilityTest.java │ │ ├── LMDBBase.java │ │ ├── LMDBPersistencePerformanceTest.java │ │ ├── LMDBPersistenceTest.java │ │ ├── LMDBPlatformAssume.java │ │ ├── LMDBToAddressFileTest.java │ │ ├── LogLevelChange.java │ │ ├── MainTest.java │ │ ├── ManualDebugConstants.java │ │ ├── MockConsumer.java │ │ ├── MockKeyProducer.java │ │ ├── MockKeyProducerTest.java │ │ ├── NetworkParameterFactoryTest.java │ │ ├── OpenCLBuilderTest.java │ │ ├── OpenCLContextTest.java │ │ ├── OpenCLDeviceTest.java │ │ ├── OpenCLGridResultTest.java │ │ ├── OpenCLPlatformAssume.java │ │ ├── OpenCLPlatformSelectorTest.java │ │ ├── OpenCLPlatformTest.java │ │ ├── OpenCLTest.java │ │ ├── PlatformAssume.java │ │ ├── PrivateKeyTooLargeExceptionTest.java │ │ ├── PrivateKeyValidatorTest.java │ │ ├── ProbeAddressesOpenCLTest.java │ │ ├── ProducerJavaSecretsFilesTest.java │ │ ├── ProducerJavaTest.java │ │ ├── ProducerOpenCLTest.java │ │ ├── ProducerStateTest.java │ │ ├── PublicKeyBytesTest.java │ │ ├── RandomSecretSupplierTest.java │ │ ├── ReadStatisticTest.java │ │ ├── SecretsFileTest.java │ │ ├── SeparatorFormatTest.java │ │ ├── StatisticsTest.java │ │ ├── ToStringTest.java │ │ ├── configuration/ │ │ │ ├── CKeyProducerJavaIncrementalTest.java │ │ │ ├── CProducerTest.java │ │ │ └── UnknownSecretFormatExceptionTest.java │ │ ├── eckey/ │ │ │ └── Secp256k1Test.java │ │ ├── keyproducer/ │ │ │ ├── AbstractKeyProducerQueueBufferedTest.java │ │ │ ├── ConnectionUtilsTest.java │ │ │ ├── KeyProducerIdIsNotUniqueExceptionTest.java │ │ │ ├── KeyProducerIdNullExceptionTest.java │ │ │ ├── KeyProducerIdUnknownExceptionTest.java │ │ │ ├── KeyProducerJavaBip39Test.java │ │ │ ├── KeyProducerJavaIncrementalTest.java │ │ │ ├── KeyProducerJavaRandomTest.java │ │ │ ├── KeyProducerJavaSocketTest.java │ │ │ ├── KeyProducerJavaTest.java │ │ │ ├── KeyProducerJavaWebSocketTest.java │ │ │ ├── KeyProducerJavaZmqTest.java │ │ │ ├── KeyProducerTestUtility.java │ │ │ ├── NoMoreSecretsAvailableExceptionTest.java │ │ │ └── TestTimeProvider.java │ │ ├── persistence/ │ │ │ └── PersistenceUtilsTest.java │ │ └── staticaddresses/ │ │ ├── AbstractTestAddresses.java │ │ ├── AddressesFileSpecialUsecases.java │ │ ├── AddressesFiles.java │ │ ├── StaticAddressesFiles.java │ │ ├── StaticKey.java │ │ ├── TestAddresses.java │ │ ├── TestAddresses1337.java │ │ ├── TestAddresses42.java │ │ ├── TestAddressesFiles.java │ │ ├── TestAddressesLMDB.java │ │ └── enums/ │ │ ├── P2PKH.java │ │ ├── P2SH.java │ │ ├── P2WPKH.java │ │ ├── PublicAddress.java │ │ └── StaticUnsupportedAddress.java │ └── resources/ │ ├── testOpenCLInfo/ │ │ ├── config_OpenCLInfo.js │ │ ├── config_OpenCLInfo.json │ │ ├── config_OpenCLInfo.yaml │ │ └── config_OpenCLInfo.yml │ ├── testRoundtrip/ │ │ ├── addresses/ │ │ │ ├── fileContainingAddresses0.txt │ │ │ ├── fileContainingAddresses1.tsv │ │ │ └── fileContainingAddresses2.csv │ │ ├── config_AddressFilesToLMDB.json │ │ ├── config_Find_1OpenCLDevice.json │ │ ├── config_Find_SecretsFile.json │ │ ├── config_LMDBToAddressFile.json │ │ └── secrets/ │ │ ├── fileContainingSecrets_BIG_INTEGER.txt │ │ ├── fileContainingSecrets_DUMPED_RIVATE_KEY.txt │ │ ├── fileContainingSecrets_SHA256.txt │ │ └── fileContainingSecrets_STRING_DO_SHA256.txt │ └── vectors.json ├── testAddressTxtLineTest.bat └── update.bat ================================================ FILE CONTENTS ================================================ ================================================ FILE: .claude/skills/java-tdd-guide/SKILL.md ================================================ --- name: java-tdd-guide description: Bernard Ladenthin's personal Java Test-Driven Development skill — version 1.0.0 — Red → Green → Refactor workflow with project-independent conventions --- # Java TDD Skill — Test-Driven Development **Author:** Bernard Ladenthin **Version:** 1.0.0 **License:** Apache 2.0 This is a personal, reusable Java TDD guide for use across multiple projects. All examples are generic and project-independent. Project-specific patterns and constants are documented separately in each project's CLAUDE.md. --- ## TDD Workflow — Red → Green → Refactor Follow the **Red → Green → Refactor** cycle rigorously. Every new behaviour must be covered by a failing test *before* the production code is written. ### 1 — Red (failing test first) Write one test that precisely describes the next desired behaviour. The test must compile but **must fail** when run. Do not write any production code yet. ### 2 — Green (minimum production code) Write the smallest change to production code that makes the failing test pass. Do not add code that is not driven by a test. ### 3 — Refactor Improve the implementation and the test code without changing observable behaviour. All tests must stay green. Repeat for each behaviour increment. --- ## Test File Structure ### File Header — Apache 2.0 License Every test file **must** start with the formatter-off block enclosing the Apache 2.0 license header: ```java // @formatter:off /** * Copyright * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // @formatter:on package com.example.foo; ``` - The `// @formatter:off` / `// @formatter:on` pair wraps **only** the license block. - The year must match the file creation year (not the current year). --- ## Test Framework Stack | Concern | Mandatory choice | |---|---| | Runner | JUnit 4 (`@Test`, `@Before`, `@Rule`) | | Parameterized | `@RunWith(DataProviderRunner.class)` + `@UseDataProvider` (only when the class has at least one `@UseDataProvider` method) | | Assertions | Hamcrest only — `assertThat(actual, is(equalTo(expected)))` | | Mocking | Mockito — `mock()`, `when()`, `verify()`, `ArgumentCaptor` | | Temp files | `@Rule public TemporaryFolder folder = new TemporaryFolder()` | **Never use:** - `assertEquals`, `assertTrue`, `assertFalse`, `assertNotNull` from `org.junit.Assert` - TestNG or JUnit 5 --- ## Class Layout ```java @RunWith(DataProviderRunner.class) // only when @UseDataProvider is present public class FooTest { // shared, constructed-once immutable fields private final Bar bar = new Bar(); private final BazHelper helper = new BazHelper(); // mocks that must be fresh per test — declare field here, initialize in @Before private Logger mockLogger; @Before public void setUp() { mockLogger = mock(Logger.class); } // Omit @Before entirely when it does no meaningful work. ``` Omit `@RunWith` if no data providers are used. Omit empty `@Before` methods. --- ## Test Method Naming Pattern: **`methodUnderTest_inputOrCondition_expectedBehavior`** ``` foo_emptyInput_returnsNull bar_validArgumentsGiven_returnsExpected baz_negativeValue_throwsException interrupt_queueNotEmpty_waitedForDuration toString_whenCalled_containsClassNameAndIdentityHash ``` **Rules:** - All three segments are **required**, separated by underscores. - Use camelCase within each segment. - Exception tests end with `_throwsException` or `_exceptionThrown`. - No-op/smoke tests: `_noExceptionThrown`. - `toString` tests: describe exact content (identity hash or structured format). - Logging assertions: include `_logged` or `_logsError`. --- ## Test Body — AAA Structure Every test body **must** follow Arrange / Act / Assert with explicit section comments: ```java @Test public void methodName_conditionGiven_expectedResult() { // arrange Foo sut = new Foo(42); // act String result = sut.bar(); // assert assertThat(result, is(equalTo("expected"))); } ``` ### `// pre-assert` — two valid positions **1. Before `// act`** — assert a precondition or input invariant: ```java // arrange String input = "test-value"; // pre-assert assertThat(input, not(emptyString())); // act String result = sut.process(input); // assert assertThat(result, is(equalTo("expected"))); ``` **2. Between `// act` and `// assert`** — null-guard before accessing result fields: ```java // act FooResult result = sut.compute(); // pre-assert assertThat(result, is(notNullValue())); // assert assertThat(result.getValue(), is(equalTo(expected))); ``` **Rules:** - Do **not** use `Objects.requireNonNull(...)` in tests; use `// pre-assert` with `assertThat(x, is(notNullValue()))` instead. - The `// arrange` section may be omitted only when there is genuinely nothing to arrange. - Keep the act to a **single method call** whenever possible. --- ## Editor Folds — Mandatory Grouping Tests within a class **must** be grouped using editor fold regions, one fold per method/feature under test: ```java // @Test public void methodName_caseA_resultA() { ... } @Test public void methodName_caseB_resultB() { ... } // ``` **Rules:** - The `desc` attribute equals the method name (or a short feature label). - `defaultstate="collapsed"` is **mandatory** on every fold. - All tests for the same method go inside a single fold. - Tests for different methods **must** be in different folds. - Order folds logically (simple cases first, edge cases and exceptions last). --- ## Assertions — Hamcrest Style All assertions use Hamcrest `assertThat`: ```java // equality assertThat(result, is(equalTo(expected))); // null / not null assertThat(result, is(nullValue())); assertThat(result, is(notNullValue())); // boolean assertThat(flag, is(true)); assertThat(flag, is(false)); // negation assertThat(result, is(not(equalTo(unexpected)))); // strings assertThat(message, containsString("substring")); assertThat(message, matchesPattern("Regex\\d+")); assertThat(output, not(emptyOrNullString())); // collections assertThat(list, hasSize(3)); assertThat(list, is(empty())); assertThat(list, hasItems("a", "b")); // numbers / comparable assertThat(index, is(lessThan(colonIndex))); assertThat(waitTime, is(greaterThan(minExpected))); // type assertThat(obj, instanceOf(Foo.class)); ``` **Imports:** ```java import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; // when many matchers are used // or specific imports when only a few are needed ``` --- ## Exception Testing ### Pattern A — Simple (no message check) ```java @Test(expected = IllegalArgumentException.class) public void foo_nullInput_throwsException() { // act sut.foo(null); } ``` ### Pattern B — With message verification (try/catch/fail) ```java @Test public void foo_invalidInput_throwsException() { try { // act sut.foo("invalid"); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { // assert assertThat(e.getMessage(), containsString("expected error text")); } } ``` Import for `fail()`: ```java import static org.junit.Assert.fail; ``` --- ## Data Providers (Parameterized Tests) ### Centralized Pattern All data providers belong in a centralized `CommonDataProvider` class. Each provider follows this pattern: ```java // 1. Constant for the provider name public final static String DATA_PROVIDER_MY_CASES = "myCases"; // 2. Javadoc linking to which test it serves /** For {@link FooTest}. */ @DataProvider public static Object[][] myCases() { return new Object[][] { { inputA, expectedA }, { inputB, expectedB }, }; } ``` ### Consuming a data provider ```java @RunWith(DataProviderRunner.class) public class FooTest { @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_MY_CASES, location = CommonDataProvider.class) public void foo_inputGiven_returnsExpected(String input, String expected) { // arrange Foo sut = new Foo(); // act String result = sut.bar(input); // assert assertThat(result, is(equalTo(expected))); } } ``` ### Enum-based providers ```java @DataProvider public static Object[][] allEnumValues() { return transformFlatToObjectArrayArray(MyEnum.values()); } ``` ### Cartesian product providers ```java @DataProvider public static Object[][] typeAndSize() { return mergeMany(types(), sizes()); } ``` --- ## Named Constants — DRY, No Magic Literals Every semantic value must be a named `public static final` or `private static final` constant with Javadoc. **Rules:** - Every string, number, or flag literal that carries meaning **must** be a named constant. - Constants belong at the class level, before constructors and methods. - Name constants by their **meaning or role**, not the raw value. - Each constant must have **Javadoc** explaining what it represents and why. - Derived values must be computed from source constants, never duplicated. - Radix values (`16`, `10`, `2`) should be referenced through helper constants, never as bare integers. **Bad:** ```java return new BigInteger("FFFFFFFFFFFFFFFF", 16); if (batchSize > 256) { ... } ``` **Good:** ```java /** * The maximum valid size for batch processing. * Chosen based on performance testing with typical workloads. */ public static final int MAX_BATCH_SIZE = 256; /** * The hex value for all 64 bits set. * Derived from {@link #MAX_BATCH_SIZE} — do not duplicate the literal. */ public static final String MAX_VALUE_HEX = "FF".repeat(8); if (batchSize > MAX_BATCH_SIZE) { ... } ``` --- ## Logger Injection — Constructor Over Setter When a class uses an SLF4J `Logger` and tests need to inject a mock logger, prefer **constructor-based injection**. **Pattern — two constructors:** ```java public class MyService { private final Logger logger; // Production constructor — creates its own logger public MyService(Config config) { this(config, LoggerFactory.getLogger(MyService.class)); } // Test constructor — accepts an injected logger @VisibleForTesting MyService(Config config, Logger logger) { this.config = config; this.logger = logger; } } ``` **Rules:** - The `logger` field should be `private final`. - The production constructor delegates to the test constructor (or vice versa) — never duplicate initialization. - The `@VisibleForTesting` constructor has package-private visibility. - A `setLogger` method is a last resort — only if constructor injection is infeasible. **Test usage:** ```java Logger mockLogger = mock(Logger.class); MyService service = new MyService(config, mockLogger); ``` --- ## Null Safety — JSpecify Annotations Use **JSpecify** `@Nullable` annotation for optional values; `@NonNull` is the default (no annotation needed). ```java import org.jspecify.annotations.Nullable; public @Nullable String getOptional() { return null; } // Array null annotations — place between type and brackets private byte @Nullable [] buffer; // array itself may be null public byte @NonNull [] getBuffer() { } // array is guaranteed non-null ``` **Compiler enforcement:** A static checker (e.g., NullAway) enforces null safety at compile time. Missing `@Nullable` on a nullable return or field causes a **compilation failure**. --- ## @VisibleForTesting Annotation Mark package-private or protected members that are only exposed for testing: ```java @VisibleForTesting static Duration AWAIT_DURATION = Duration.ofSeconds(20); @VisibleForTesting final ExecutorService executor = Executors.newFixedThreadPool(4); ``` Tests may modify `@VisibleForTesting` static fields to shorten wait times or adjust test-specific behaviour. --- ## Mocking & Logger Verification ### Capturing and asserting log output ```java ArgumentCaptor captor = ArgumentCaptor.forClass(String.class); verify(logger, times(1)).info(captor.capture()); List arguments = captor.getAllValues(); assertThat(arguments.get(0), is(equalTo("Initialized."))); ``` ### Verifying no interaction ```java verify(logger, never()).error(anyString()); ``` ### Verifying with argument matchers ```java verify(logger).error(contains("expectedSubstring")); verify(mockLogger, times(1)).info(eq("Message"), eq(expectedValue)); ``` **Imports:** ```java import static org.mockito.Mockito.*; import static org.mockito.ArgumentMatchers.*; ``` --- ## Randomness — Always Fixed Seeds All `Random` instances in tests **must** use a fixed seed: ```java private final Random random = new Random(1337); ``` Never use `new Random()` (unseeded). Document the seed's significance when it matters: ```java /** This random produces bits: 1, 0, 1, 0 — useful for testing boundary cases. */ private final Random random = new Random(1); ``` --- ## TemporaryFolder / File System Tests Use `TemporaryFolder` for tests that create files and directories: ```java @Rule public TemporaryFolder folder = new TemporaryFolder(); @Test public void testFileHandling() throws IOException { // arrange File tempFile = folder.newFile("data.txt"); File subdir = folder.newFolder("output"); // use Files NIO for writing Files.writeString(tempFile.toPath(), "content"); // act / assert // ... } ``` **Rules:** - Always use `folder.newFile(...)` and `folder.newFolder(...)` — never create manually. - Cleanup is automatic when the test completes. --- ## Records & Immutability Use Java `record` for immutable value objects: ```java public record MyValue(@NonNull String name, int count) { // compact constructor for validation public MyValue { Objects.requireNonNull(name); } } ``` **Rules:** - `Objects.requireNonNull()` is **valid in production code** (not in tests). - Mark immutable classes with `@Immutable` annotation when appropriate. - For records containing mutable third-party types, suppress the Error Prone warning: ```java @Immutable public record Container( @SuppressWarnings("Immutable") MutableObject obj, @NonNull String name ) { } ``` --- ## Concurrency Conventions ```java // Thread-safe counters private final AtomicLong hits = new AtomicLong(); private final AtomicInteger stateCounter = new AtomicInteger(); // Work queue private final LinkedBlockingQueue workQueue; // Thread pool — never raw Thread private final ExecutorService executor = Executors.newFixedThreadPool(4); // Shutdown synchronisation private final CountDownLatch shutdownLatch = new CountDownLatch(1); ``` ### Async/Concurrent Tests Use `CountDownLatch` + `ExecutorService` + `Future` for coordinating async tests: ```java @Test public void asyncOperation_serverSendsData_clientReceives() throws Exception { // arrange int port = findFreePort(); ExecutorService executorService = Executors.newCachedThreadPool(); CountDownLatch serverStarted = new CountDownLatch(1); Future serverFuture = executorService.submit(() -> { try (ServerSocket serverSocket = new ServerSocket(port)) { serverStarted.countDown(); // signal ready try (Socket client = serverSocket.accept(); DataOutputStream out = new DataOutputStream(client.getOutputStream())) { out.write(data); } } return null; }); serverStarted.await(); // wait for server to be ready // act String result = connectAndFetch(port); // assert assertThat(result, is(equalTo(expected))); serverFuture.get(5, TimeUnit.SECONDS); // ensure server completed cleanly executorService.shutdown(); } private static int findFreePort() throws IOException { try (ServerSocket s = new ServerSocket(0)) { return s.getLocalPort(); } } ``` --- ## Equals / HashCode / ToString Contract Tests Use a generic contract test helper with four instances (two for value A, two for value B): ```java // arrange Foo a1 = new Foo(valueA); Foo a2 = new Foo(valueA); // same data, different reference Foo b1 = new Foo(valueB); Foo b2 = new Foo(valueB); // assert — A != B EqualHashCodeToStringTestHelper helper = new EqualHashCodeToStringTestHelper(a1, a2, b1, b2); helper.assertEqualsHashCodeToStringAIsDifferentToB(); // OR — A == B (same semantic content) helper.assertEqualsHashCodeToStringAIsEqualToB(); ``` For `toString()` tests verifying default object identity format: ```java assertThat(output, matchesPattern("ClassName@\\p{XDigit}+")); ``` For `toString()` tests verifying structured content: ```java assertThat(output, is(equalTo("Foo{name=bar, count=42}"))); ``` --- ## Import Style Group imports in this order (no blank lines within groups, blank line between groups): 1. Standard Java (`java.*`, `javax.*`) 2. Third-party libraries (alphabetical) 3. Project classes (`com.example.*`) 4. Static imports (last, alphabetical) ```java import java.io.IOException; import java.util.List; import org.junit.Test; import org.mockito.Mock; import com.example.foo.Foo; import com.example.foo.Bar; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; ``` Prefer **specific static imports** over wildcard when used 1–2 times. Use wildcard for Hamcrest matchers when many are used: ```java import static org.hamcrest.Matchers.*; ``` --- ## Array & Collection Assertions ### Do NOT use for-loops in assertions **Problem:** For-loop iteration in assertions reduces readability. ```java // ❌ BAD — uses for-loop for (int i = 0; i < expected.length; i++) { assertThat(result[i], is(equalTo(expected[i]))); } ``` **Solution:** Compare entire arrays directly. ```java // ✅ GOOD — compare whole array assertThat(result, is(expected)); ``` ### Exception: iterating over all enum values is allowed When verifying behaviour for **every value of an enum**, iterating via `EnumType.values()` is preferred. It ensures new enum constants are automatically covered: ```java @Test public void process_allEnumValues_succeeds() { for (MyEnum value : MyEnum.values()) { String result = sut.process(value); assertThat(result, not(emptyString())); } } ``` ### Pattern for zero-padded arrays ```java @Test public void decode_shorterInput_leftPaddedWithZeros() { // arrange byte[] original = {0x01, 0x02, 0x03}; final int targetLength = 20; final int paddingLength = targetLength - original.length; byte[] expectedPadding = new byte[paddingLength]; // act byte[] result = decoder.decode(original, targetLength); // assert assertThat(Arrays.copyOfRange(result, 0, paddingLength), is(expectedPadding)); assertThat(Arrays.copyOfRange(result, paddingLength, targetLength), is(original)); } ``` --- ## Constants Within a Fold (DRY) When the same literal appears in **two or more tests in the same fold**, extract it as a `private static final` constant: ```java // ✅ GOOD — one definition, both variants derived from it private static final String CUSTOM_HEX = "FF"; sut.value = CUSTOM_HEX.toUpperCase(); // "FF" sut.value = CUSTOM_HEX.toLowerCase(); // "ff" assertThat(result, is(equalTo(new BigInteger(CUSTOM_HEX, 16)))); ``` ```java // ❌ BAD — same literal repeated sut.value = "FF"; sut.value = "ff"; assertThat(result, is(equalTo(BigInteger.valueOf(255)))); ``` **Rule:** Constants belong to their fold. Do **not** share a constant between different folds even when values coincide — tests for different methods should remain logically independent. --- ## Preserving Existing Comments When modifying existing test code (fixing bugs, applying guide compliance): - **Keep all existing inline comments** that are correct and descriptive. - **Only remove a comment** if it is factually wrong, misleading, or describes deleted code. - **Add new comments** where added code is not self-explanatory. Example — correct preservation: ```java // arrange String address = createAddress(); // Server socket binds ← existing comment preserved ServerSocket socket = new ServerSocket(port); // act String result = sut.process(address); // assert assertThat(result, not(emptyString())); ``` **Goal:** Minimize the diff to only lines that actually need changing. --- ## Anti-Patterns — What NOT To Do | Anti-pattern | Correct alternative | |---|---| | `assertEquals(expected, actual)` | `assertThat(actual, is(equalTo(expected)))` | | `assertTrue(condition)` | `assertThat(condition, is(true))` | | `Assert.assertNotNull(x)` | `assertThat(x, is(notNullValue()))` | | `Objects.requireNonNull(x)` as guard in test | `// pre-assert` with `assertThat(x, is(notNullValue()))` | | Unseeded `new Random()` | `new Random(fixedSeed)` | | Hard-coded address/constant strings | Use project-specific static constants | | Missing `// arrange / act / assert` | Add the section comments always | | Missing editor fold | Wrap each method group in `` | | Non-conforming test name like `testme()` | Rename to `methodName_condition_expectation()` | | Empty `@Before` method | Remove it entirely | | `@RunWith(DataProviderRunner.class)` without `@UseDataProvider` | Remove the `@RunWith` | | For-loop iteration in assertions | Compare entire array at once — **exception:** `for (MyEnum v : MyEnum.values())` is allowed | | Magic numbers like `result[9]` | Use `final int` constants: `result[targetLength - 1]` | | Removing existing correct comments during fixes | Preserve comments; only remove factually wrong ones | --- ## Test Anatomy — Complete Reference Example ```java // @formatter:off /** * Copyright 2025 Your Name your.name@example.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // @formatter:on package com.example.foo; import java.io.IOException; import java.util.List; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.junit.runner.RunWith; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; @RunWith(DataProviderRunner.class) public class FooTest { @Rule public TemporaryFolder folder = new TemporaryFolder(); private Bar bar; @Before public void setUp() { bar = new Bar(); } // @Test public void someMethod_validInputGiven_returnsExpectedResult() { // arrange Foo sut = new Foo(); // act String result = sut.someMethod("validInput"); // assert assertThat(result, is(equalTo("expectedResult"))); } @Test(expected = IllegalArgumentException.class) public void someMethod_nullGiven_throwsException() { // arrange Foo sut = new Foo(); // act sut.someMethod(null); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_MY_CASES, location = CommonDataProvider.class) public void someMethod_parameterizedInput_returnsExpected(String input, String expected) { // arrange Foo sut = new Foo(); // act String result = sut.someMethod(input); // assert assertThat(result, is(equalTo(expected))); } // // @Test public void toString_whenCalled_containsClassNameAndIdentityHash() { // arrange Foo sut = new Foo(); // act String output = sut.toString(); // assert assertThat(output, not(emptyOrNullString())); assertThat(output, matchesPattern("Foo@\\p{XDigit}+")); } // } ``` --- ## Completeness Checklist Before submitting code: - [ ] At least one test was written and failed **before** the production code was written. - [ ] Every production behaviour is covered by at least one test. - [ ] All tests pass: `./mvnw test` (or equivalent for your project). - [ ] Compilation is clean (no null-safety errors). - [ ] Every test class has the Apache 2.0 license header wrapped in `@formatter:off/on`. - [ ] Test method names follow the `method_condition_expected` three-segment pattern. - [ ] Every test body has `// arrange`, `// act`, `// assert` comments. - [ ] All tests for the same method/feature are inside a single `` block. - [ ] No `assertEquals` / `assertTrue` / `assertFalse` / `assertNotNull` anywhere. - [ ] Exception tests with message assertions use `try { ...; fail(...); } catch`. - [ ] All `Random` instances use a fixed seed. - [ ] Data providers are added to `CommonDataProvider` (or project equivalent), not inlined in test classes. - [ ] `@RunWith(DataProviderRunner.class)` is present **only** when `@UseDataProvider` is used. - [ ] Empty `@Before` methods are removed. - [ ] All nullable fields/returns in new production code are annotated with `@Nullable`. - [ ] Array nullable annotations follow the `byte @Nullable []` placement convention. - [ ] Logger in new production classes is `private final` with constructor injection (or setter as last resort). - [ ] `@VisibleForTesting` is applied to any member exposed solely for tests. - [ ] Async tests use `CountDownLatch` + `ExecutorService` + `Future`; no raw `Thread` or polling with `Thread.sleep`. - [ ] Async socket tests use `findFreePort()` and project-specific timeout constants — no magic port numbers. - [ ] Nested concrete implementations of abstract classes are private static inner classes inside the test class. - [ ] `Objects.requireNonNull()` is used only in production code, never in tests. - [ ] Multi-line expected strings use Java text blocks (`""" ... """`). - [ ] Records with mutable third-party fields use `@SuppressWarnings("Immutable")` on the specific field. - [ ] Behaviour injection in production constructors uses functional interfaces (`Consumer`, `Function`) rather than subclassing. - [ ] Existing correct inline comments in modified test code are preserved — only removed if factually wrong or describing deleted code. --- ## Project-Specific Extensions Each project may define additional conventions beyond this generic guide. Refer to your project's CLAUDE.md or supplementary guide files for: - Custom marker annotations (e.g., `@OpenCLTest`, `@ToStringTest`, `@AwaitTimeTest`) - Static test data constants (e.g., known addresses, keys, fixtures) - Project-specific helper classes and test utilities - Database or library-specific test patterns (LMDB, OpenCL, WebSocket, ZMQ, etc.) - Configuration POJO naming conventions (e.g., C-prefix) - Custom domain exceptions ================================================ FILE: .claude/skills/tdd/SKILL.md ================================================ --- name: tdd description: Test-Driven Development workflow for BitcoinAddressFinder — delegates to the generic Java TDD skill and adds project-specific context --- # TDD — Test-Driven Development for BitcoinAddressFinder You are working on **BitcoinAddressFinder** (group `net.ladenthin`, Java 21, Maven). ## Generic Java TDD Guide Follow all conventions from the generic Java TDD skill (`.claude/skills/java-tdd-guide/SKILL.md`). That guide covers: - Red → Green → Refactor workflow - File headers (Apache 2.0 license) - Test framework stack (JUnit 4, DataProviderRunner, Hamcrest, Mockito) - Test naming, AAA structure, editor folds - Assertions (Hamcrest only), exception testing - Data providers, named constants, DRY - Logger injection (constructor over setter) - Null safety (JSpecify + NullAway) - Records, immutability, concurrency - Import style, anti-patterns, completeness checklist ## Project-Specific Supplements For BitcoinAddressFinder-specific conventions, also follow: - **`CODE_WRITING_GUIDE.md`** — BitHelper radix constants, C-prefix configuration POJOs, custom domain exceptions, graceful shutdown (Interruptable), lambda callbacks - **`TEST_WRITING_GUIDE.md`** — Marker annotations (@AwaitTimeTest, @ToStringTest, @OpenCLTest), timing/await tests, static address constants (StaticKey, P2PKH, P2SH, P2WPKH), platform assumptions, LMDB/OpenCL test patterns, producer test helpers, socket test utilities ## Package ``` net.ladenthin.bitcoinaddressfinder ``` ## Build & Test ```bash ./mvnw compile # compile (NullAway enforced) ./mvnw test # run all tests ./mvnw test -Dnet.ladenthin.bitcoinaddressfinder.disableLMDBTest=true # skip LMDB tests ``` ================================================ FILE: .github/dependabot.yml ================================================ # To get started with Dependabot version updates, you'll need to specify which # package ecosystems to update and where the package manifests are located. # Please see the documentation for all configuration options: # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file version: 2 updates: - package-ecosystem: "maven" # See documentation for possible values directory: "/" # Location of package manifests schedule: interval: "weekly" ================================================ FILE: .github/workflows/assembly.yml ================================================ name: build assembly on: push: branches: - main - 'releases/*' pull_request: branches: - '*' env: javaversion: '21' javadistribution: 'temurin' jobs: build: runs-on: 'ubuntu-latest' steps: - uses: actions/checkout@v4 - name: Set up JDK ${{ env.javaversion }} ${{ env.javadistribution }} uses: actions/setup-java@v4 with: java-version: ${{ env.javaversion }} distribution: ${{ env.javadistribution }} cache: maven - name: Build with Maven run: mvn -B "-Dnet.ladenthin.bitcoinaddressfinder.disableLMDBTest=false" --update-snapshots test package assembly:single --file pom.xml - name: Archive binary uses: actions/upload-artifact@v4 with: name: jar binaries path: target/*.jar - name: Upload Surefire Reports and JVM Crash Logs if: always() uses: actions/upload-artifact@v4 with: name: surefire-and-crash-logs path: | target/surefire-reports/** hs_err_pid*.log ================================================ FILE: .github/workflows/claude-code-review.yml ================================================ name: Claude Code Review on: pull_request: types: [opened, synchronize, ready_for_review, reopened] # Optional: Only run on specific file changes # paths: # - "src/**/*.ts" # - "src/**/*.tsx" # - "src/**/*.js" # - "src/**/*.jsx" jobs: claude-review: # Optional: Filter by PR author # if: | # github.event.pull_request.user.login == 'external-contributor' || # github.event.pull_request.user.login == 'new-developer' || # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' runs-on: ubuntu-latest permissions: contents: read pull-requests: read issues: read id-token: write steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 1 - name: Run Claude Code Review id: claude-review uses: anthropics/claude-code-action@v1 with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} plugin_marketplaces: 'https://github.com/anthropics/claude-code.git' plugins: 'code-review@claude-code-plugins' prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}' # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://code.claude.com/docs/en/cli-reference for available options ================================================ FILE: .github/workflows/claude.yml ================================================ name: Claude Code on: issue_comment: types: [created] pull_request_review_comment: types: [created] issues: types: [opened, assigned] pull_request_review: types: [submitted] jobs: claude: if: | (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) runs-on: ubuntu-latest permissions: contents: read pull-requests: read issues: read id-token: write actions: read # Required for Claude to read CI results on PRs steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 1 - name: Run Claude Code id: claude uses: anthropics/claude-code-action@v1 with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} # This is an optional setting that allows Claude to read CI results on PRs additional_permissions: | actions: read # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it. # prompt: 'Update the pull request description to include a summary of changes.' # Optional: Add claude_args to customize behavior and configuration # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://code.claude.com/docs/en/cli-reference for available options # claude_args: '--allowed-tools Bash(gh pr:*)' ================================================ FILE: .github/workflows/codeql.yml ================================================ name: "CodeQL" on: push: branches: [ "main" ] pull_request: branches: [ "main" ] schedule: - cron: "12 1 * * 0" env: javaversion: '21' javadistribution: 'temurin' jobs: analyze: name: Analyze runs-on: ubuntu-latest permissions: actions: read contents: read security-events: write strategy: fail-fast: false matrix: language: [ java ] steps: - name: Checkout uses: actions/checkout@v3 - name: Set up JDK ${{ env.javaversion }} ${{ env.javadistribution }} uses: actions/setup-java@v4 with: java-version: ${{ env.javaversion }} distribution: ${{ env.javadistribution }} - name: Initialize CodeQL uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} queries: +security-and-quality - name: Autobuild uses: github/codeql-action/autobuild@v3 - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 with: category: "/language:${{ matrix.language }}" ================================================ FILE: .github/workflows/coverage.yml ================================================ name: code coverage on: push: branches: - main - 'releases/*' pull_request: branches: - '*' env: javaversion: '21' javadistribution: 'temurin' jobs: build: runs-on: 'ubuntu-latest' steps: - uses: actions/checkout@v4 - name: Set up JDK ${{ env.javaversion }} ${{ env.javadistribution }} uses: actions/setup-java@v4 with: java-version: ${{ env.javaversion }} distribution: ${{ env.javadistribution }} cache: maven - name: Build with Maven run: mvn -B "-Dnet.ladenthin.bitcoinaddressfinder.disableLMDBTest=true" --update-snapshots test package jacoco:report --file pom.xml - name: Upload Surefire Reports and JVM Crash Logs if: always() uses: actions/upload-artifact@v4 with: name: surefire-and-crash-logs path: | target/surefire-reports/** hs_err_pid*.log # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive - name: Update dependency graph uses: advanced-security/maven-dependency-submission-action@0b9cd8f382c5d2016fa77ebf8a0f2804452fefef # https://github.com/marketplace/actions/coveralls-github-action - name: Coveralls GitHub Action uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.COVERALLS_TOKEN }} file: target/site/jacoco/jacoco.xml format: jacoco # https://github.com/codecov/codecov-action - name: Codecov GitHub Action uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} ================================================ FILE: .github/workflows/matrixci.yml ================================================ name: matrix CI on: push: branches: - main - 'releases/*' pull_request: branches: - '*' jobs: build: strategy: # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast fail-fast: false # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs matrix: # https://github.com/actions/setup-java#supported-distributions javaversion: [ '21' ] # disabled for now for performance reason: javadistribution: ['adopt', 'adopt-openj9', 'corretto', 'dragonwell', 'liberica', 'microsoft', 'temurin', 'zulu'] # internally 'adopt-hotspot' is the same as 'adopt' javadistribution: ['temurin'] # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources # disabled for now for performance reason: os: [macos-latest, ubuntu-latest, windows-latest] os: [windows-latest] exclude: - javadistribution: 'microsoft' os: 'macos-latest' - javadistribution: 'dragonwell' os: 'macos-latest' runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.javaversion }} ${{ matrix.javadistribution }} uses: actions/setup-java@v4 with: java-version: ${{ matrix.javaversion }} distribution: ${{ matrix.javadistribution }} cache: maven - name: Build with Maven run: mvn -B --no-transfer-progress "-Dnet.ladenthin.bitcoinaddressfinder.disableLMDBTest=false" test --file pom.xml - name: Upload Surefire Reports and JVM Crash Logs if: always() uses: actions/upload-artifact@v4 with: name: surefire-reports-${{ matrix.os }}-${{ matrix.javadistribution }}-java${{ matrix.javaversion }} path: | target/surefire-reports/** hs_err_pid*.log ================================================ FILE: .gitignore ================================================ # Compiled class file *.class # Log file *.log # BlueJ files *.ctxt # Mobile Tools for Java (J2ME) .mtj.tmp/ # Package Files # *.jar *.war *.nar *.ear *.zip *.tar.gz *.rar # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* /target/ /bin/ # IDEA files /.idea/ *.iml # Eclipse files .classpath .project .settings # Netbeans files nbactions.xml ================================================ FILE: .mvn/jvm.config ================================================ --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED ================================================ FILE: CLAUDE.md ================================================ # CLAUDE.md — BitcoinAddressFinder This document provides guidance for AI assistants working on the BitcoinAddressFinder codebase. --- ## Project Overview **BitcoinAddressFinder** is a high-performance, open-source tool for scanning Bitcoin and altcoin private keys and checking whether the derived addresses have balances. It supports 100+ cryptocurrencies and uses both CPU (Java) and GPU (OpenCL) key generation strategies. - **Group ID:** `net.ladenthin` - **Artifact ID:** `bitcoinaddressfinder` - **Version:** 1.5.0 - **Java:** 21 - **License:** Apache 2.0 - **Author:** Bernard Ladenthin (Copyright 2017–2025) - **Main class:** `net.ladenthin.bitcoinaddressfinder.cli.Main` --- ## Build System The project uses **Maven** (minimum 3.6.3) with a Maven Wrapper. ### Common Commands ```bash # Compile only ./mvnw compile # Run all tests ./mvnw test # Build fat JAR with all dependencies ./mvnw package -P assembly # Build without tests ./mvnw package -DskipTests # Generate coverage report ./mvnw test jacoco:report # Skip LMDB-specific tests (useful when LMDB native libs unavailable) ./mvnw test -Dnet.ladenthin.bitcoinaddressfinder.disableLMDBTest=true ``` ### JVM / Compiler Flags Tests run with `-Xmx2g -Xms1g` and several `--add-opens` / `--add-exports` to allow LMDB and internal module access. These are configured in `pom.xml` (``) and `.mvn/jvm.config`. **Error Prone** static analysis with **NullAway** is active at compile time: - All code in `net.ladenthin` packages must carry proper `@Nullable` / `@NonNull` annotations. - Compilation will fail on potential null-pointer issues unless annotated. --- ## Project Structure ``` BitcoinAddressFinder/ ├── src/ │ ├── main/ │ │ ├── java/net/ladenthin/bitcoinaddressfinder/ │ │ │ ├── cli/ # CLI entry point (Main.java) │ │ │ ├── configuration/ # Config POJOs (C-prefixed) │ │ │ ├── keyproducer/ # Key generation strategies │ │ │ ├── persistence/ # Persistence abstraction + LMDB impl │ │ │ ├── opencl/ # OpenCL device/platform wrappers │ │ │ ├── eckey/ # Secp256k1 ECC utilities │ │ │ └── *.java # Core domain classes │ │ └── resources/ │ │ ├── *.cl / *.h # OpenCL kernels and headers │ │ └── simplelogger.properties │ └── test/ │ └── java/net/ladenthin/bitcoinaddressfinder/ │ └── *.java # JUnit 4 tests ├── examples/ # Sample JSON configs and run scripts │ ├── config_*.json │ ├── run_*.bat │ ├── logbackConfiguration.xml │ ├── addresses/ # Sample address files │ └── secrets/ # Sample secrets files ├── helper/ # Utility scripts (address scraping, wallet ops) ├── .github/workflows/ # CI/CD pipelines ├── pom.xml ├── .mvn/jvm.config └── README.md ``` --- ## Core Architecture ### Producer–Consumer Pattern The central design separates **key production** from **address checking**: ``` [Producers] → LinkedBlockingQueue → [ConsumerJava] ``` - **`Producer` (interface)** — generates private keys and pushes them to the queue. - **`Consumer` (interface)** — reads keys from the queue, derives addresses, and checks the LMDB database. - **`Finder`** — orchestrates producers and consumers, manages thread pools, and handles shutdown. ### Key Components | Class | Role | |---|---| | `cli/Main.java` | Entry point; parses args, loads config, starts `Finder` | | `Finder.java` | Orchestrator; starts/stops producers and consumer | | `ProducerJava.java` | CPU-based key generator using `KeyProducer` strategies | | `ProducerOpenCL.java` | GPU-accelerated key generator via JOCL | | `ProducerJavaSecretsFiles.java` | Reads keys from a secrets file | | `ConsumerJava.java` | Derives addresses, queries LMDB, logs hits | | `PublicKeyBytes.java` | Public key representation and address derivation | | `KeyUtility.java` | Cryptographic helpers (record class) | | `OpenCLContext.java` | OpenCL context setup and kernel management | | `OpenClTask.java` | Executes a batch of key operations on the GPU | | `AddressFilesToLMDB.java` | Imports address files into LMDB database | | `LMDBToAddressFile.java` | Exports LMDB database to address files | | `NetworkParameterFactory.java` | Creates BitcoinJ `NetworkParameters` for 100+ coins | | `SeparatorFormat.java` | Parses address file formats (various separators) | | `Shutdown.java` | Graceful shutdown logic with 30-second timeout | ### Key Producer Strategies (`keyproducer/`) | Class | Strategy | |---|---| | `KeyProducerJavaRandom` | `SecureRandom` private key generation | | `KeyProducerJavaIncremental` | Sequential range scanning | | `KeyProducerJavaBip39` | BIP39 mnemonic phrase derivation | | `KeyProducerJavaSocket` | TCP socket input | | `KeyProducerJavaWebSocket` | WebSocket server input | | `KeyProducerJavaZmq` | ZeroMQ message broker input | ### Configuration Classes (`configuration/`) All configuration POJOs are prefixed with `C`: | Class | Purpose | |---|---| | `CConfiguration` | Root config object | | `CCommand` | Command enum: `Find`, `AddressFilesToLMDB`, `LMDBToAddressFile`, `OpenCLInfo` | | `CFinder` | Finder-level settings | | `CConsumerJava` | Consumer settings | | `CProducer` | Abstract producer settings | | `CProducerJava` | Java producer settings | | `CProducerOpenCL` | OpenCL producer settings | | `CProducerJavaSecretsFiles` | Secrets file producer settings | | `CKeyProducerJava*` | Per-strategy key producer settings | | `CLMDBConfigurationReadOnly/Write` | LMDB database config | ### Persistence Layer (`persistence/`) - `Persistence` interface abstracts database operations. - `LMDBPersistence` implements high-performance O(1) address lookups using LMDB. - `PersistenceUtils` provides helper methods. ### Helper Classes (Validation & Utilities) Helper classes encapsulate single-responsibility validation and utility logic, improving testability and separation of concerns: | Class | Purpose | Injection Pattern | |---|---|---| | `PrivateKeyValidator` | Non-static validation of private keys against secp256k1 constraints | Created in constructors where needed; no external dependencies | | `KeyUtility` (record) | Cryptographic utilities requiring network/buffer context | Injected as dependency into producers/consumers | | `ByteBufferUtility` | ByteBuffer conversion utilities | Passed as constructor parameter | **Design Pattern: Static to Helper Migration** Certain utility methods that were previously static (e.g., key range validation) have been refactored into dedicated helper classes as non-static instance methods. This improves: - **Testability**: Instances are easier to mock in tests - **Clarity**: Dependencies are explicit - **Extensibility**: Future subclasses can override behavior Example: `PrivateKeyValidator` contains the following methods (formerly static in `KeyUtility`): - `getMaxPrivateKeyForBatchSize(int batchSizeInBits)` - `isInvalidWithBatchSize(BigInteger, BigInteger)` - `isOutsidePrivateKeyRange(BigInteger)` - `returnValidPrivateKey(BigInteger)` - `replaceInvalidPrivateKeys(BigInteger[])` Callers instantiate `PrivateKeyValidator` directly (stateless) or receive it via dependency injection where appropriate. --- ## Configuration Format The tool is driven entirely by JSON configuration files. The `CCommand` enum selects the operation mode. Example (find with 8 CPU producers): ```json { "command": "Find", "finder": { "producers": [ { "producerJava": { "threads": 8, "keyProducers": [{ "keyProducerJavaRandom": {} }] } } ], "consumerJava": { "lmdbConfigurationReadOnly": { "lmdbDirectory": "/path/to/lmdb" } } } } ``` See `examples/config_*.json` for all configuration variants. --- ## Testing ### Frameworks - **JUnit 4** (4.13.2) — test runner - **Hamcrest** (3.0) — matchers - **Mockito** (5.22.0) — mocking - **junit-dataprovider** (1.13.1) — data-driven tests ### Conventions - Tests use forked JVMs (1 fork, no reuse) for isolation. - Test timeout: 60 seconds per test. - Base/utility test classes: `LMDBBase`, `BIP39DataProvider`, `TestTimeProvider`, `KeyProducerTestUtility`. - LMDB tests can be skipped with system property: ``` -Dnet.ladenthin.bitcoinaddressfinder.disableLMDBTest=true ``` - Test ratio is approximately 1.7:1 (test lines to source lines). New code should have corresponding tests. --- ## Code Conventions ### Null Safety - Use **JSpecify** annotations: `@Nullable` (from `org.jspecify.annotations`) for optional values, `@NonNull` is the default. - **NullAway** enforces null safety at compile time for the entire `net.ladenthin` package tree. Unannotated code will cause compilation errors. ### Naming - Configuration POJOs: prefix `C` (e.g., `CProducerJava`, `CKeyProducerJavaRandom`). - Producer implementations: suffix with type (e.g., `ProducerJava`, `ProducerOpenCL`). - Key producer strategies: `KeyProducerJava` pattern. ### Annotations - `@VisibleForTesting` — marks package-private or protected members exposed only for testing. - `@ToStringTest` — marks fields that should be verified in `toString()` tests. - `@Nullable` / implicit `@NonNull` from JSpecify. ### License Headers All source files must include the Apache 2.0 license header. See any existing source file for the exact template. Use `// @formatter:off` / `// @formatter:on` around the header to exclude it from auto-formatting. ### Error Handling Use custom domain exceptions rather than generic ones: - `KeyProducerIdNullException` - `KeyProducerIdIsNotUniqueException` - `KeyProducerIdUnknownException` - `NoMoreSecretsAvailableException` - `PrivateKeyTooLargeException` - `UnknownSecretFormatException` ### Concurrency - `LinkedBlockingQueue` for producer → consumer communication. - `ExecutorService` / `ThreadPoolExecutor` for thread pool management. - `AtomicLong` for thread-safe statistics counters. - `CountDownLatch` for shutdown synchronization. - Do not introduce raw `Thread` usage; use executor services. ### Records Some utility classes are implemented as Java `record` types (e.g., `KeyUtility`). Prefer records for immutable value objects. --- ## OpenCL / GPU Code OpenCL kernels live in `src/main/resources/` as `.cl` and `.h` files: | File | Purpose | |---|---| | `inc_ecc_secp256k1custom.cl` | Elliptic curve scalar multiplication | | `inc_hash_sha256.cl` | SHA-256 (ported from hashcat) | | `inc_hash_ripemd160.cl` | RIPEMD-160 (ported from hashcat) | | `inc_defines.h` | Common preprocessor defines | | `inc_platform.cl` | Platform-specific abstractions | | `inc_types.h` | OpenCL type definitions | GPU code is bound through JOCL (`jocl` 2.0.6). `OpenCLBuilder` constructs the platform/device hierarchy; `OpenCLContext` manages kernel compilation and execution; `OpenClTask` processes a batch of keys on the GPU. --- ## CI/CD Pipelines (`.github/workflows/`) | Workflow | Trigger | Purpose | |---|---|---| | `assembly.yml` | Push to `main`/`releases/*`, all PRs | Compile, test, build fat JAR, upload artifacts | | `matrixci.yml` | Push/PR | Matrix test across 8 JVM distributions × 3 OS | | `coverage.yml` | Push/PR | JaCoCo coverage + Coveralls upload | | `codeql.yml` | Schedule/Push | GitHub CodeQL security scanning | | `claude-code-review.yml` | PR | AI-powered code review | | `claude.yml` | Issue/PR comment with `@claude` | Claude Code interactive assistant | The matrix CI tests Java 21 on: - **Distributions:** adopt, adopt-openj9, corretto, dragonwell, liberica, microsoft, temurin, zulu - **OS:** Ubuntu, Windows, macOS (some combos excluded for incompatibility) --- ## Dependencies Summary | Dependency | Version | Purpose | |---|---|---| | `bitcoinj-core` | 0.17 | Bitcoin crypto, address derivation | | `lmdbjava` | 0.9.3 | LMDB database bindings | | `jocl` | 2.0.6 | Java OpenCL bindings | | `gson` | 2.13.2 | JSON config parsing | | `snakeyaml` | 2.6 | YAML config parsing | | `guava` | 33.5.0-jre | Google core utilities | | `commons-codec` | 1.21.0 | Base58, hex encoding | | `commons-io` | 2.21.0 | I/O utilities | | `Java-WebSocket` | 1.6.0 | WebSocket producer | | `jeromq` | 0.6.0 | ZeroMQ producer | | `jspecify` | 1.0.0 | Nullness annotations | | `slf4j-api` | 2.0.17 | Logging facade | | `logback-classic` | 1.5.32 | SLF4J implementation | Test-only: | `junit` | 4.13.2 | Test runner | | `hamcrest` | 3.0 | Assertion matchers | | `mockito-core` | 5.22.0 | Mocking | | `junit-dataprovider` | 1.13.1 | Data-driven tests | --- ## Running the Tool ```bash # Build fat JAR ./mvnw package -P assembly -DskipTests # Run (replace config path as needed) java -jar target/bitcoinaddressfinder-1.5.0-jar-with-dependencies.jar \ examples/config_Find_8CPUProducer.json ``` Pre-built run scripts exist in `examples/` for each operation mode (`run_*.bat` for Windows). --- ## Test Writing Compliance After modifying or creating any `*Test.java` file, automatically verify that all rules from the generic Java TDD skill (`.claude/skills/java-tdd-guide/SKILL.md`) **and** the project-specific supplement (`TEST_WRITING_GUIDE.md`) are applied to the modified test class. Apply all fixable violations on your own without asking. Only report violations that cannot be resolved without a large refactoring. Consider the task complete only after all auto-fixable rules are satisfied. --- ## Code Writing Compliance After modifying or creating any production `.java` file, automatically verify that all rules from the generic Java TDD skill (`.claude/skills/java-tdd-guide/SKILL.md`) **and** the project-specific supplement (`CODE_WRITING_GUIDE.md`) are applied to the modified class. Apply all fixable violations on your own without asking. Only report violations that cannot be resolved without a large refactoring. Consider the task complete only after all auto-fixable rules are satisfied. --- ## Pull Request Workflow ### Step 1 — Detect whether `gh` is available ```bash gh --version 2>/dev/null && echo "gh available" || echo "gh not available" ``` If `gh` is **not** available (e.g. local proxy remote), inform the user and stop. Do not attempt the remaining steps. ### Step 2 — Create the PR Always create a PR immediately after the first push to a feature branch: ```bash gh pr create \ --title "" \ --body "$(cat <<'EOF' ## Summary - - ## Test plan - [ ] Affected test classes pass - [ ] Full CI matrix passes EOF )" ``` Note the PR number printed — you need it in the next steps. ### Step 3 — Wait for all checks to complete ```bash gh pr checks --watch --interval 30 ``` If `--watch` is unavailable in the installed `gh` version, poll manually: ```bash while gh pr checks | grep -qE "pending|in_progress|queued"; do sleep 30 done gh pr checks ``` ### Step 4 — Triage failures For each failing check, fetch the log: ```bash gh run list --branch --limit 10 gh run view --log-failed ``` For **CodeQL annotation** failures, pull structured annotations directly (avoids parsing raw logs): ```bash # get the annotations URL for the CodeQL check on the latest commit gh api repos/{owner}/{repo}/commits//check-runs \ --jq '.check_runs[] | select(.name | test("CodeQL")) | .output.annotations_url' # fetch the annotations (path, line number, message) gh api \ --jq '.[] | {path: .path, line: .start_line, message: .message}' ``` ### Step 5 — Fix, commit, push, repeat 1. Read the failure message or annotation. 2. Apply the fix. 3. Commit and push: ```bash git add git commit -m "Fix : " git push ``` 4. Return to **Step 3** and wait for the re-run. 5. Repeat until `gh pr checks ` shows every check as ✅ pass. ### Step 6 — Report to the user Once all checks pass, summarise what was fixed and why. If a failure **cannot** be fixed automatically (e.g. requires a large refactor, changes public API, or disabling a security check) stop, explain the situation, and ask for direction instead of silently suppressing or working around it. --- ## Key Design Principles 1. **Performance first** — key generation is the hot path; minimize allocations, use byte arrays not objects. 2. **Pluggable producers** — new key generation strategies implement `KeyProducer` and `Producer`; register in config classes. 3. **Single consumer** — `ConsumerJava` is intentionally single-threaded to avoid LMDB contention; producers are the parallelism point. 4. **Graceful shutdown** — always implement `Interruptable`; propagate interrupts from `Main` → `Finder` → all producers/consumers. 5. **Null safety is required** — NullAway is error-level; annotate all nullable return types and parameters. 6. **Configuration-driven** — behaviour changes belong in config, not in code conditionals. ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. ## Our Standards Examples of behavior that contributes to a positive environment for our community include: * Demonstrating empathy and kindness toward other people * Being respectful of differing opinions, viewpoints, and experiences * Giving and gracefully accepting constructive feedback * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience * Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: * The use of sexualized language or imagery, and sexual attention or advances of any kind * Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or email address, without their explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. ## Scope This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [bernard.ladenthin@gmail.com](mailto:bernard.ladenthin@gmail.com). All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. ## Enforcement Guidelines Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: ### 1. Correction **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. ### 2. Warning **Community Impact**: A violation through a single incident or series of actions. **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. ### 3. Temporary Ban **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within the community. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. ================================================ FILE: CODE_WRITING_GUIDE.md ================================================ # Code Writing Guide — BitcoinAddressFinder (Project-Specific Supplement) This guide contains **project-specific** production code conventions that supplement the generic Java TDD skill (`.claude/skills/java-tdd-guide.md`). For general Java conventions (named constants, logger injection, null safety, records, concurrency, etc.), refer to the generic guide. --- ## 1. Radix Constants — BitHelper Radix values (`16`, `10`, `2`) must always be referenced through `BitHelper` constants — never as bare integer literals: ```java // ❌ BAD new BigInteger("FF", 16); // ✅ GOOD new BigInteger("FF", BitHelper.RADIX_HEX); ``` Available constants: - `BitHelper.RADIX_HEX` (16) - `BitHelper.RADIX_DECIMAL` (10) - `BitHelper.RADIX_BINARY` (2) --- ## 2. Configuration Objects — C-Prefix POJOs All new features are driven by a C-prefixed configuration POJO: ```java public class CMyFeature { public int threads = 1; public @Nullable String optionalParam; } // Constructor receives the config as first argument: public MyFeature(CMyFeature config, KeyUtility keyUtility, Logger logger) { this.config = config; this.keyUtility = keyUtility; this.logger = logger; } ``` --- ## 3. Custom Domain Exceptions Use project-specific exception types rather than generic ones: | Exception | When to use | |---|---| | `KeyProducerIdNullException` | Key producer ID is null | | `KeyProducerIdIsNotUniqueException` | Duplicate key producer ID | | `KeyProducerIdUnknownException` | Unrecognized key producer ID | | `NoMoreSecretsAvailableException` | Secret source exhausted | | `PrivateKeyTooLargeException` | Private key exceeds secp256k1 range | | `UnknownSecretFormatException` | Unrecognized secret format | | `AddressFormatNotAcceptedException` | Invalid address format | Create a new domain exception rather than throwing `IllegalArgumentException` or `RuntimeException` when a more specific type makes sense. --- ## 4. Graceful Shutdown — Interruptable Interface All Producer/Consumer implementations must implement `Interruptable`: ```java public class MyProducer extends AbstractProducer implements Interruptable { @Override public void interrupt() { // signal the work loop to stop } } ``` --- ## 5. Lambda Callbacks in Production Constructors Inject behaviour via functional interfaces rather than subclassing: ```java public AddressFile( File file, ReadStatistic readStatistic, Network network, Consumer addressConsumer, Consumer rejectedLineConsumer ) { ... } ``` ================================================ FILE: LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX A: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. APPENDIX B: Additional licenses relevant to this product: This product includes a number of source files with code that has been adapted from 3rd party sources including sources that may be subject to different copyright notices and license terms. Your use of the source code for these subcomponents is subject to the terms and conditions of the following licenses. ============================================================= Apache License version 2.0 (see above) ============================================================= * [TEMPLATE-PROJECT] Code locations: ------------------------------------------------------------- * [TEMPLATE-LOCATION] ============================================================= BSD-2-Clause License ============================================================= All rights reserved. BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * [TEMPLATE-PROJECT] Code locations: ------------------------------------------------------------- * [TEMPLATE-LOCATION] ============================================================= MIT License ============================================================= Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------- * hashcat Copyright (c) 2015-2020 Jens Steube Code locations: ------------------------------------------------------------- * https://github.com/hashcat/hashcat/blob/master/OpenCL/inc_common.cl * https://github.com/hashcat/hashcat/blob/master/OpenCL/inc_common.h * https://github.com/hashcat/hashcat/blob/master/OpenCL/inc_defines.h * https://github.com/hashcat/hashcat/blob/master/OpenCL/inc_ecc_secp256k1.cl * https://github.com/hashcat/hashcat/blob/master/OpenCL/inc_ecc_secp256k1.h * https://github.com/hashcat/hashcat/blob/master/OpenCL/inc_platform.cl * https://github.com/hashcat/hashcat/blob/master/OpenCL/inc_platform.h * https://github.com/hashcat/hashcat/blob/master/OpenCL/inc_types.h * https://github.com/hashcat/hashcat/blob/master/OpenCL/inc_vendor.h * https://github.com/hashcat/hashcat/blob/master/OpenCL/inc_vendor.h ============================================================= Public Domain (optional) ============================================================= * [TEMPLATE-PROJECT] Code locations: ------------------------------------------------------------- * [TEMPLATE-LOCATION] ================================================ FILE: README.md ================================================ # BitcoinAddressFinder > 🚀 Fast address finder for Bitcoin and altcoins using OpenCL & Java – includes vanity address generation, balance checking, and offline support. [![OpenJDK](https://img.shields.io/badge/OpenJDK-21-blue)]() [![JUnit](https://img.shields.io/badge/tested%20with-JUnit4-yellow)]() [![Assembly](https://github.com/bernardladenthin/BitcoinAddressFinder/actions/workflows/assembly.yml/badge.svg)](https://github.com/bernardladenthin/BitcoinAddressFinder/actions/workflows/assembly.yml) [![Coverage](https://github.com/bernardladenthin/BitcoinAddressFinder/actions/workflows/coverage.yml/badge.svg)](https://github.com/bernardladenthin/BitcoinAddressFinder/actions/workflows/coverage.yml) [![Matrix CI](https://github.com/bernardladenthin/BitcoinAddressFinder/actions/workflows/matrixci.yml/badge.svg)](https://github.com/bernardladenthin/BitcoinAddressFinder/actions/workflows/matrixci.yml) [![Coverage Status](https://coveralls.io/repos/github/bernardladenthin/BitcoinAddressFinder/badge.svg?branch=main)](https://coveralls.io/github/bernardladenthin/BitcoinAddressFinder?branch=main) [![codecov](https://codecov.io/gh/bernardladenthin/BitcoinAddressFinder/graph/badge.svg?token=RRCR4ZC28T)](https://codecov.io/gh/bernardladenthin/BitcoinAddressFinder) [![Maven Central](https://img.shields.io/maven-central/v/net.ladenthin/bitcoinaddressfinder.svg)](https://search.maven.org/artifact/net.ladenthin/bitcoinaddressfinder) [![Release Date](https://img.shields.io/github/release-date/bernardladenthin/BitcoinAddressFinder)]() [![Last Commit](https://img.shields.io/github/last-commit/bernardladenthin/BitcoinAddressFinder)]() [![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=bernardladenthin_BitcoinAddressFinder&metric=alert_status)](https://sonarcloud.io/dashboard?id=bernardladenthin_BitcoinAddressFinder) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=bernardladenthin_BitcoinAddressFinder&metric=code_smells)](https://sonarcloud.io/dashboard?id=bernardladenthin_BitcoinAddressFinder) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=bernardladenthin_BitcoinAddressFinder&metric=security_rating)](https://sonarcloud.io/dashboard?id=bernardladenthin_BitcoinAddressFinder) [![Known Vulnerabilities](https://snyk.io/test/github/bernardladenthin/BitcoinAddressFinder/badge.svg?targetFile=pom.xml)](https://snyk.io/test/github/bernardladenthin/BitcoinAddressFinder?targetFile=pom.xml) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fbernardladenthin%2FBitcoinAddressFinder.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fbernardladenthin%2FBitcoinAddressFinder?ref=badge_shield) [![Dependencies](https://img.shields.io/librariesio/github/bernardladenthin/BitcoinAddressFinder)](https://libraries.io/github/bernardladenthin/BitcoinAddressFinder) [![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-orange)](./LICENSE) [![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/bernardladenthin/BitcoinAddressFinder) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/10413/badge)](https://www.bestpractices.dev/projects/10413) [![Treeware](https://img.shields.io/badge/dynamic/json?color=brightgreen&label=Treeware&query=%24.total&url=https%3A%2F%2Fpublic.offset.earth%2Fusers%2Ftreeware%2Ftrees)](https://treeware.earth) [![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua) --- ## Table of Contents - [About BitcoinAddressFinder](#about-bitcoinaddressfinder) - [Requirements](#requirements) - [Quickstart](#quickstart) - [Features](#features) - [Address Database](#address-database) - [Import](#import) - [Create the Database by Yourself](#create-the-database-by-yourself) - [Export](#export) - [Use My Prepared Database](#use-my-prepared-database) - [Light Database](#light-database) - [Full Database](#full-database) - [Pages and Projects for Address Lists](#pages-and-projects-to-get-lists-dumps-of-pubkeyhash-addresses) - [Find Addresses](#find-addresses) - [Mixed Modes](#mixed-modes) - [Key Range](#key-range) - [OpenCL Acceleration](#opencl-acceleration) - [Built-in Self-Test (BIST)](#built-in-self-test-bist) - [Performance Benchmarks](#performance-benchmarks) - [Collision Probability and Security Considerations](#collision-probability-and-security-considerations) - [Similar Projects](#similar-projects) - [Deep Learning Private Key Prediction](#deep-learning-private-key-prediction) - [Known Issues](#known-issues) - [Hybrid Graphics Performance (Low Throughput)](#hybrid-graphics-performance-low-throughput) - [Future Improvements](#future-improvements) - [KeyProvider](#keyprovider) - [Legal](#legal) - [Permitted Use Cases](#️-permitted-use-cases) - [Prohibited Use Cases](#-prohibited-use-cases) - [Legal References by Jurisdiction](#legal-references-by-jurisdiction) - [License](#license) --- ## About BitcoinAddressFinder **BitcoinAddressFinder** is a free, high-performance tool for scanning random private keys across a wide range of cryptocurrencies — including Bitcoin, Bitcoin Cash, Bitcoin SV, Litecoin, Dogecoin, Dash, Zcash, and many more. Its core purpose is to generate both **compressed** and **uncompressed** addresses with maximum efficiency, combining the portability of the **Java Virtual Machine (JVM)** with **OpenCL-powered GPU acceleration**. Each generated address is checked against a high-speed **LMDB** database to detect whether it has ever been used — identifying possible balances, known keyspaces, and even **RIPEMD160 hash collisions**. 🔍 Whether you're generating vanity addresses, verifying address usage, or experimenting with cryptographic edge cases, **BitcoinAddressFinder** is built for **speed**, **flexibility**, and **fully offline operation**. > 🔐 Runs air-gapped · ⚡ GPU-accelerated · 🧪 Unit-tested · 🛠️ Extensible **Made with ❤️ in Germany** Copyright (c) 2017-2025 Bernard Ladenthin ## Requirements - **Java 21 or newer** is required to run BitcoinAddressFinder. Older versions such as Java 8, 11, or 17 are not supported. - **🚀 OpenCL (optional)**: You can run this software in either **CPU-only** mode or with **GPU acceleration via OpenCL** for significantly enhanced performance. When OpenCL is enabled: - **Elliptic Curve Key Generation** is offloaded to one or more OpenCL-capable devices (e.g., GPUs), dramatically boosting key scanning throughput. - **SHA-256** and **RIPEMD-160** hashing operations are also offloaded to the GPU, further reducing CPU load and increasing overall efficiency. - **Multi-GPU setups are fully supported** — each device can be configured individually, enabling efficient parallelization and scalability across multiple GPUs. ## Quickstart 1. Download Software - Release: Download the binary (jar) from https://github.com/bernardladenthin/BitcoinAddressFinder/releases - Nightly: Download the binary (jar) newest build from github: https://nightly.link/bernardladenthin/BitcoinAddressFinder/workflows/assembly/main/jar%20binaries.zip 2. Download and extract the light database from https://github.com/bernardladenthin/BitcoinAddressFinder#use-my-prepared-database 3. Download a configuration set like: - [`logbackConfiguration.xml`](https://github.com/bernardladenthin/BitcoinAddressFinder/blob/main/examples/logbackConfiguration.xml) - [`config_Find_1OpenCLDevice.json`](https://github.com/bernardladenthin/BitcoinAddressFinder/blob/main/examples/config_Find_1OpenCLDevice.json) - [`run_Find_1OpenCLDevice.bat`](https://github.com/bernardladenthin/BitcoinAddressFinder/blob/main/examples/run_Find_1OpenCLDevice.bat) 4. Put all in one directory like the following structure * Downloads * lmdb * data.mdb * lock.mdb * bitcoinaddressfinder-1.4.0-jar-with-dependencies.jar * logbackConfiguration.xml * config_Find_1OpenCLDevice.js * run_Find_1OpenCLDevice.bat 5. Run the file run_Find_1OpenCLDevice.bat ## ✨ Features * 📐 Supports blockchain addresses based on [secp256k1](https://en.bitcoin.it/wiki/Secp256k1) * 🛡️ Unit-tested, trusted open source that can be compiled easily by yourself * 🎯 Vanity generation of Bitcoin addresses using regex patterns * 🔌 Runs entirely offline — no internet connection is required or used. Suitable for air-gapped systems and isolated environments — even in a bunker with a generator and zero connectivity. * 🤹 No synchronization required to run multiple instances. Random numbers are used, so no coordinated search strategy is needed — just run it on multiple machines * ⚡ Checks a high-performance database of known addresses to detect already used ones * 📦 Portable, platform-independent, runs on the JVM * 🔁 Generates both uncompressed and compressed keys simultaneously * 🧮 EC key generation via: * 🧵 Multiple CPU threads * 🖥️ Multiple OpenCL devices (optional) ### ⚡ ECC Scalar Multiplication Optimizations To accelerate **elliptic curve scalar multiplication** (`k·G`, i.e. private key × base point), the OpenCL kernel applies the following optimizations: - **Windowed Non-Adjacent Form (wNAF)**: The scalar `k` is converted to a signed digit representation using a **window size of 4**. This results in digits from the set `{±1, ±3, ±5, ±7}`, with at least one zero between non-zero digits. This reduces the number of costly additions during multiplication. [Further explanation of wNAF on crypto.stackexchange.com](https://crypto.stackexchange.com/questions/82013/simple-explanation-of-sliding-window-and-wnaf-methods-of-elliptic-curve-point-mu) - **Precomputed Table**: The kernel precomputes and stores the following multiples of the base point `G`: `±1·G`, `±3·G`, `±5·G`, `±7·G` These are stored in the `secp256k1_t` structure and reused during scalar multiplication. - **Left-to-Right Scalar Multiplication**: The multiplication loop scans the wNAF digits from most to least significant: - Each iteration **always doubles** the current point. - If the current digit is non-zero, it **adds the matching precomputed point**. - **Optimized for GPGPU (not constant-time)**: To prioritize speed on OpenCL/CUDA devices, this implementation is **not constant-time** and may be vulnerable to side-channel attacks in adversarial environments. - **Use of Constant Memory**: Precomputed points are stored in **constant GPU memory** (`__constant` via `CONSTANT_AS`), allowing fast access by all threads in a workgroup. ### 🔄 Scalar Walker per Kernel (`loopCount`) The OpenCL kernel supports a **loop-based scalar strategy** controlled by the `loopCount` parameter. Each GPU thread generates multiple EC keys by: - Computing the first key via full scalar multiplication: `P₀ = k₀·G` (using `point_mul_xy`) - Computing subsequent keys via efficient affine additions: `Pₙ₊₁ = Pₙ + G` (using `point_add_xy`) This enables high-throughput, grid-parallel **linear keyspace traversal** like: `k₀·G, (k₀ + 1)·G, ..., (k₀ + loopCount - 1)·G` Example: - If `loopCount = 8`, each thread generates 8 keys - Grid size is reduced by a factor of 8 - All results are written to global memory > ✅ Lower `loopCount` values like 4 or 8 are often ideal. > ❌ Higher values may reduce GPU occupancy due to fewer active threads. ### 🚀 MSB-Zero Optimization To accelerate elliptic curve multiplication, BitcoinAddressFinder applies a **160-bit private key optimization**: - The upper 96 bits of each 256-bit private key are set to zero - Only the lower 160 bits are randomized and traversed This reduction in scalar size speeds up `k·G` computations, resulting in significantly better performance during brute-force and batch-based key scanning. > ✅ Matches the size of `RIPEMD160(SHA256(pubkey))` > ✅ Especially effective when combined with OpenCL acceleration ### 🚀 Bloom Filter Address Cache (`useBloomFilter`) As of version 1.5.0, a memory-efficient Bloom filter can be used to significantly accelerate address checks: ```json "useBloomFilter": true ``` Instead of loading all addresses into a Java `HashSet`, a compact Bloom filter is loaded into RAM. This enables ultra-fast `containsAddress()` checks with minimal memory usage — even for millions or billions of entries. Advantages: - ✅ O(1) lookup speed (comparable to HashSet) - ✅ Low memory usage, even with large datasets - ✅ No false negatives (real matches are always detected) - ⚠️ Possible false positives → only trigger additional LMDB lookups #### Estimated Memory Usage: | fpp | Light Database (~132M) | Full Database (~1.37B) | |--------|------------------------|-------------------------| | 0.1 | ~**80 MB** | ~**800 MB** | | 0.05 | ~**100 MB** | ~**1024 MB** | | 0.01 | ~**151 MB** | ~**1574 MB** | #### 🔧 Tuning Accuracy with `bloomFilterFpp` The expected false positive probability (FPP) can be configured: ```json "bloomFilterFpp": 0.1 ``` | Value | Description | |-------|-------------| | `0.01` | ✅ Only ~1% false positives – high accuracy, more memory | | `0.05` | ⚖️ Balanced tradeoff between memory and performance | | `0.1`–`0.2` | 🪶 Very memory-efficient – suitable if some false positives are acceptable | ```json "useBloomFilter": true, "bloomFilterFpp": 0.1 ``` Recommended setting for best balance between speed and memory usage. ### 🔐 Public Key Hashing on GPU (SHA-256 + RIPEMD-160) The OpenCL kernel performs **blazing fast public key hashing** directly on the GPU using: - `SHA-256(pubkey.x || pubkey.y)` followed by - `RIPEMD-160(SHA-256(pubkey))` This allows each GPU thread to independently generate full Bitcoin-style public key hashes (`hash160`) **without CPU involvement**. Benefits: - No host-side post-processing needed - Fully parallelized and memory-efficient - Ideal for massive batch generation and filtering > ✅ Output is already in hash160 format, ready for address comparison ## Address Database The addresses are stored in a high-performance database: [LMDB](https://github.com/LMDB). The database can be used to check whether a generated address has ever been used. ### Address Import Support The importer supports reading multiple `.txt` or `.text` files, each containing one address per line in arbitrary order. Lines may vary in address type and format. Each line may also optionally include an associated coin amount. ⚠️ **Unsupported or malformed lines are silently skipped during import.** #### Supported Address Types * **P2PKH** – Pay to Public Key Hash Encoded using Base58. Most commonly used format for legacy Bitcoin addresses. * **P2SH** – Pay to Script Hash Base58-encoded address type used for multisig and other script-based spending conditions. * **P2WPKH** – Pay to Witness Public Key Hash Native SegWit v0 address, encoded in **Bech32**. One private key deterministically produces one address. #### Unsupported Address Types * **P2MS** – Pay to Multisig Custom format prefixed with `d-`, `m-`, or `s-` (e.g. `m- ================================================ FILE: helper/bitinfocharts_com_scraping/scraping.py ================================================ # # Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # from selenium import webdriver import time from io import BytesIO import re # pip install selenium def findAllInSource(addressPattern, driver): html = driver.page_source return re.findall(addressPattern, html) def getAllUrls(urlPattern): urls = [] for x in range(1, 100+1): pageIndex = "-"+str(x) if x == 1: pageIndex = "" fullUrl = urlPattern.format(pageIndex) urls.append(fullUrl) return urls def scrapeAddresses(urlPattern, addressPattern, driver): urls = getAllUrls(urlPattern) addresses = set() for url in urls: driver.get(url) time.sleep(2) allInSource = findAllInSource(addressPattern, driver) addresses.update(allInSource) return addresses def writeToFile(addressSet, filename): outF = open(filename, "w") for address in addressSet: outF.write(address) outF.write("\n") outF.close() driver = webdriver.Chrome('C:\\Users\\Bernard\\Desktop\\chromedriver88.exe') # manual input for captcha #driver.get("https://bitinfocharts.com/de/top-100-richest-bitcoin-addresses.html") #time.sleep(30) base58Pattern = "[a-km-zA-HJ-NP-Z1-9]{25,34}" bitcoinUrlPattern = "https://bitinfocharts.com/de/top-100-richest-bitcoin-addresses{}.html" bitcoinAddressPattern = "[13]"+base58Pattern bitcoins = scrapeAddresses(bitcoinUrlPattern, bitcoinAddressPattern, driver) writeToFile(bitcoins, "bitcoin.txt") litecoinUrlPattern = "https://bitinfocharts.com/de/top-100-richest-litecoin-addresses{}.html" litecoinAddressPattern = "[LM]"+base58Pattern litecoins = scrapeAddresses(litecoinUrlPattern, litecoinAddressPattern, driver) writeToFile(litecoins, "litecoin.txt") bitcoincashUrlPattern = "https://bitinfocharts.com/de/top-100-richest-bitcoin%20cash-addresses{}.html" bitcoincashAddressPattern = "[13]"+base58Pattern bitcoincashs = scrapeAddresses(bitcoincashUrlPattern, bitcoincashAddressPattern, driver) writeToFile(bitcoincashs, "bitcoincash.txt") bitcoinsvUrlPattern = "https://bitinfocharts.com/de/top-100-richest-bitcoin%20sv-addresses{}.html" bitcoinsvAddressPattern = "[13]"+base58Pattern bitcoinsvs = scrapeAddresses(bitcoinsvUrlPattern, bitcoinsvAddressPattern, driver) writeToFile(bitcoinsvs, "bitcoinsv.txt") dashUrlPattern = "https://bitinfocharts.com/de/top-100-richest-dash-addresses{}.html" dashAddressPattern = "[X]"+base58Pattern dashs = scrapeAddresses(dashUrlPattern, dashAddressPattern, driver) writeToFile(dashs, "dash.txt") dogecoinUrlPattern = "https://bitinfocharts.com/de/top-100-richest-dogecoin-addresses{}.html" dogecoinAddressPattern = "[D]"+base58Pattern dogecoins = scrapeAddresses(dogecoinUrlPattern, dogecoinAddressPattern, driver) writeToFile(dogecoins, "dogecoin.txt") bitcoingoldUrlPattern = "https://bitinfocharts.com/de/top-100-richest-bitcoin%20gold-addresses{}.html" bitcoingoldAddressPattern = "[G]"+base58Pattern bitcoingolds = scrapeAddresses(bitcoingoldUrlPattern, bitcoingoldAddressPattern, driver) writeToFile(bitcoingolds, "bitcoingold.txt") reddcoinUrlPattern = "https://bitinfocharts.com/de/top-100-richest-reddcoin-addresses{}.html" reddcoinAddressPattern = "[R]"+base58Pattern reddcoins = scrapeAddresses(reddcoinUrlPattern, reddcoinAddressPattern, driver) writeToFile(reddcoins, "reddcoin.txt") namecoinUrlPattern = "https://bitinfocharts.com/de/top-100-richest-namecoin-addresses{}.html" namecoinAddressPattern = "[N]"+base58Pattern namecoins = scrapeAddresses(namecoinUrlPattern, namecoinAddressPattern, driver) writeToFile(namecoins, "namecoin.txt") vertcoinUrlPattern = "https://bitinfocharts.com/de/top-100-richest-vertcoin-addresses{}.html" vertcoinAddressPattern = "[V]"+base58Pattern vertcoins = scrapeAddresses(vertcoinUrlPattern, vertcoinAddressPattern, driver) writeToFile(vertcoins, "vertcoin.txt") novacoinUrlPattern = "https://bitinfocharts.com/de/top-100-richest-novacoin-addresses{}.html" novacoinAddressPattern = "[4]"+base58Pattern novacoins = scrapeAddresses(novacoinUrlPattern, novacoinAddressPattern, driver) writeToFile(novacoins, "novacoin.txt") blackcoinUrlPattern = "https://bitinfocharts.com/de/top-100-richest-blackcoin-addresses{}.html" blackcoinAddressPattern = "[B]"+base58Pattern blackcoins = scrapeAddresses(blackcoinUrlPattern, blackcoinAddressPattern, driver) writeToFile(blackcoins, "blackcoin.txt") feathercoinUrlPattern = "https://bitinfocharts.com/de/top-100-richest-feathercoin-addresses{}.html" feathercoinAddressPattern = "[7]"+base58Pattern feathercoins = scrapeAddresses(feathercoinUrlPattern, feathercoinAddressPattern, driver) writeToFile(feathercoins, "feathercoin.txt") # time.sleep(120) if (False): ''' ''' driver.close() ================================================ FILE: helper/bitinfocharts_com_scraping/start.bat ================================================ python scraping.py ================================================ FILE: helper/dumpwallet/dumpwallet.py ================================================ #!/usr/bin/python3 # # Author......: Bernard Ladenthin, 2020 # License.....: MIT # import sys import struct from bsddb3.db import * from bitcoinaddress import Wallet # Dumps the private keys from an unencrypted wallet.dat file. # Idea from https://gist.github.com/SopaXorzTaker/e5256e9ecdce740f182093f72f05b8d2 # and https://github.com/darkwallet/python-obelisk/blob/master/obelisk/bitcoin.py # download bsddb3 from https://www.lfd.uci.edu/~gohlke/pythonlibs/#bsddb3 # pip install bsddb3-6.2.9-cp39-cp39-win_amd64.whl # pip install bitcoinaddress # Run with Python 3.9.1 # asn.1 # see https://brainwalletx.github.io/ part1Compressed = "3081d30201010420" part1Uncompressed = "308201130201010420" part3 = "a08185308182020101302c06072a8648ce3d0101022100" if not len(sys.argv) == 2: print("Usage: %s " % sys.argv[0]) sys.exit(1) db = DB() db.open(sys.argv[1], "main", DB_BTREE, DB_RDONLY) items = db.items() def getBetween(start, end, s): return (s.split(start))[1].split(end)[0] for item in items: k, v = item vAsHexStr = v.hex() if (part1Compressed in vAsHexStr): between = getBetween(part1Compressed, part3, vAsHexStr) wallet = Wallet(between) print(wallet.key.mainnet.wif) print(wallet.key.mainnet.wifc) if (part1Uncompressed in vAsHexStr): between = getBetween(part1Uncompressed, part3, vAsHexStr) wallet = Wallet(between) print(wallet.key.mainnet.wif) print(wallet.key.mainnet.wifc) db.close() ================================================ FILE: pom.xml ================================================ 4.0.0 net.ladenthin bitcoinaddressfinder 1.5.0 jar bitcoinaddressfinder Free high performance tool for fast scanning random Bitcoin, Bitcoin Cash, Bitcoin SV, Litecoin, Dogecoin, Dash, Zcash (and many more) private keys and finding addresses with balance. UTF-8 2.0.17 1.5.32 -Xmx2g -Xms1g --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED jitpack.io https://jitpack.io ${basedir}/src/main/resources org.apache.maven.plugins maven-enforcer-plugin enforce-maven enforce [3.6.3,) org.eluder.coveralls coveralls-maven-plugin org.jacoco jacoco-maven-plugin prepare-agent prepare-agent report test report org.apache.maven.plugins maven-compiler-plugin 21 21 -XDaddTypeAnnotationsToSymbol=true -XDcompilePolicy=simple --should-stop=ifError=FLOW -Xplugin:ErrorProne -Xep:NullAway:ERROR -XepOpt:NullAway:AnnotatedPackages=net.ladenthin --add-exportsjava.base/java.lang=ALL-UNNAMED --add-exportsjava.base/java.io=ALL-UNNAMED --add-exportsjava.base/java.nio=ALL-UNNAMED --add-exportsjava.base/jdk.internal.ref=ALL-UNNAMED --add-exportsjava.base/jdk.internal.misc=ALL-UNNAMED --add-exportsjava.base/sun.nio.ch=ALL-UNNAMED --add-exportsjdk.management/com.sun.management.internal=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-exportsjdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exportsjdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exportsjdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-exportsjdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED --add-exportsjdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exportsjdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-exportsjdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exportsjdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opensjdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-opensjdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED com.google.errorprone error_prone_core 2.49.0 com.uber.nullaway nullaway 0.13.3 org.apache.maven.plugins maven-surefire-plugin 1 false @{argLine} 60 org.apache.maven.plugins maven-jar-plugin net.ladenthin.bitcoinaddressfinder.cli.Main net.ladenthin.bitcoinaddressfinder org.apache.maven.plugins maven-assembly-plugin jar-with-dependencies net.ladenthin.bitcoinaddressfinder.cli.Main org.apache.maven.plugins maven-surefire-plugin 3.5.5 org.apache.maven.plugins maven-jar-plugin 3.5.0 org.apache.maven.plugins maven-assembly-plugin 3.8.0 org.apache.maven.plugins maven-enforcer-plugin 3.6.2 org.apache.maven.plugins maven-compiler-plugin 3.15.0 org.jacoco jacoco-maven-plugin 0.8.14 org.eluder.coveralls coveralls-maven-plugin 4.3.0 javax.xml.bind jaxb-api 2.3.1 org.java-websocket Java-WebSocket 1.6.0 org.zeromq jeromq 0.6.0 org.jspecify jspecify 1.0.0 org.bitcoinj bitcoinj-core 0.17.1 com.google.guava guava 33.6.0-jre com.fasterxml.jackson.core jackson-databind 2.21.2 com.fasterxml.jackson.dataformat jackson-dataformat-yaml 2.21.2 org.slf4j slf4j-api ${slf4j.version} ch.qos.logback logback-classic ${logback.version} org.lmdbjava lmdbjava 0.9.3 org.jocl jocl 2.0.6 commons-io commons-io 2.21.0 commons-codec commons-codec 1.21.0 org.apache.maven maven-artifact 3.9.15 junit junit 4.13.2 test org.hamcrest hamcrest 3.0 test org.mockito mockito-core 5.23.0 test com.tngtech.java junit-dataprovider 1.13.1 test ================================================ FILE: skills/tdd.md ================================================ # TDD Skill — BitcoinAddressFinder This skill documents **test-driven development practices and refactoring patterns** used in the BitcoinAddressFinder project. Apply these rules alongside `TEST_WRITING_GUIDE.md`, `CODE_WRITING_GUIDE.md`, and `CLAUDE.md`. --- ## 1. Extract Static Methods Into a Non-Static Helper Class ### Motivation Static utility methods embedded in a domain class (e.g. `AddressTxtLine`) are hard to unit-test in isolation and cannot be mocked or injected. Extracting them into a dedicated, non-static helper class (e.g. `Bech32Helper`) allows: - Direct, focused unit tests for each method without going through the owning class. - Easier mocking when a consumer needs to stub the helper in its own tests. - A single, named home for related utilities — consistent with the `BitHelper` pattern already established in the project. ### Pattern **Before:** static method buried in a larger class ```java // AddressTxtLine.java — hard to test in isolation private static byte[] decodeBech32CharsetToValues(String base32String) { ... } ``` **After:** non-static method on a dedicated helper class ```java // Bech32Helper.java — small, focused, testable public class Bech32Helper { public byte[] decodeBech32CharsetToValues(String base32String) { ... } } ``` The owning class holds an instance field and delegates: ```java // AddressTxtLine.java Bech32Helper bech32Helper = new Bech32Helper(); // ... byte[] payload = bech32Helper.extractPKHFromBitcoinCashAddress(address); ``` ### Naming Conventions - Helper class names end with `Helper` (e.g. `BitHelper`, `Bech32Helper`). - The corresponding test class ends with `HelperTest` (e.g. `BitHelperTest`, `Bech32HelperTest`). - Public constants on the helper follow `public static final` with a Javadoc comment as required by `CODE_WRITING_GUIDE.md`. ### When to Apply Apply this extraction when: 1. A class contains ≥ 2 closely related static (or effectively-static) methods that operate on the same concept. 2. Those methods are not yet tested directly — their test coverage is indirect, piggybacking on a higher-level test class. 3. The methods are stable enough that the refactoring does not break any public API contract. Do **not** apply this extraction for one-off utility methods that logically belong to their host class and have no reuse outside it. ### Accompanying Test Migration When the extracted methods already have tests in the original test class (e.g. `AddressTxtLineTest`), **move** those tests to the new test class: 1. Copy the test methods verbatim into `Test.java`. 2. Delete them from the original test class. 3. Clean up any imports in the original test class that are no longer needed after the removal. 4. Add new tests for any methods that were not yet directly covered (see `TEST_WRITING_GUIDE.md` for the required test structure). --- ## 2. Test Class for a Helper — Required Coverage Every helper class created by the extract pattern above **must** have a corresponding `*HelperTest` class that covers: | Category | Required tests | |---|---| | Happy path per public method | At least one test verifying correct output for representative input | | Public constants | `CHARSET`, `RADIX_*`, etc. are tested indirectly by the happy-path tests | | Boundary / error cases | E.g. invalid character → `IllegalArgumentException` | | Moved tests from original class | All tests that previously exercised these methods indirectly, now calling the helper directly | Follow all rules in `TEST_WRITING_GUIDE.md`: AAA structure, editor-fold groups, Hamcrest assertions, no raw JUnit asserts. ### Reference Example `BitHelper` and `BitHelperTest` are the canonical model for this pattern in the project. `Bech32Helper` and `Bech32HelperTest` are the second instance. When adding a new helper class, follow the same structure. ```java // Bech32HelperTest.java — canonical structure public class Bech32HelperTest { private final KeyUtility keyUtility = new KeyUtility( new NetworkParameterFactory().getNetwork(), new ByteBufferUtility(false)); // @Test public void decodeBech32CharsetToValues_fullCharset_returnsValuesZeroToThirtyOne() { // arrange Bech32Helper sut = new Bech32Helper(); byte[] expected = {0,1,2,...,31}; // act byte[] result = sut.decodeBech32CharsetToValues(Bech32Helper.CHARSET); // assert assertThat(result, is(expected)); } @Test(expected = IllegalArgumentException.class) public void decodeBech32CharsetToValues_invalidCharacter_throwsException() { // arrange Bech32Helper sut = new Bech32Helper(); // act sut.decodeBech32CharsetToValues("i"); // 'i' is not in the Bech32 character set } // } ``` --- ## 3. Real-World Example: PrivateKeyValidator The `PrivateKeyValidator` helper class is a concrete implementation of the refactoring pattern described above. ### Extraction Details **Original State:** Five related static methods in `KeyUtility`: - `getMaxPrivateKeyForBatchSize(int batchSizeInBits)` - `isInvalidWithBatchSize(BigInteger, BigInteger)` - `isOutsidePrivateKeyRange(BigInteger)` - `returnValidPrivateKey(BigInteger)` - `replaceInvalidPrivateKeys(BigInteger[])` **Refactored:** Extracted to `PrivateKeyValidator` as non-static instance methods. **Injection Locations:** - `AbstractProducer` — instantiates in constructor, inherited by `ProducerJava` and `ProducerOpenCL` - `OpenClTask` — instantiates in constructor for batch validation - `PublicKeyBytes` — instantiates for key state validation ### Test Coverage `PrivateKeyValidatorTest` provides comprehensive coverage: - **Batch size validation**: boundary tests for 0 bits, max bits, overflow cases - **Range validation**: tests for MIN/MAX boundaries and out-of-range keys - **Key correction**: tests for valid, too-small, and too-large keys - **Array correction**: tests for mixed valid/invalid arrays - **Data-provider tests**: uses `CommonDataProvider` for batch size edge cases ### Benefits Realized 1. **Isolated Testing**: Each validation method can be tested directly without instantiating higher-level classes. 2. **Clear Dependencies**: Callers explicitly pass or store the validator, making dependencies visible. 3. **Future Extension**: If validation rules change (e.g., support for alternative curves), subclassing becomes possible. 4. **Code Reuse**: Multiple call sites (`OpenClTask`, `AbstractProducer`, `PublicKeyBytes`) share the same validation logic without static coupling. ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/AbstractPlaintextFile.java ================================================ // @formatter:off /** * Copyright 2021 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.charset.StandardCharsets; import java.util.concurrent.atomic.AtomicBoolean; import org.jspecify.annotations.NonNull; import org.lmdbjava.LmdbException; public abstract class AbstractPlaintextFile implements Interruptable { @NonNull protected final File file; @NonNull protected final ReadStatistic readStatistic; @NonNull private final AtomicBoolean shouldRun = new AtomicBoolean(true); public AbstractPlaintextFile(@NonNull File file, @NonNull ReadStatistic readStatistic) { this.file = file; this.readStatistic = readStatistic; } protected double calculateFileProgress(@NonNull RandomAccessFile raf) throws IOException { return ((double)(Math.max(raf.getFilePointer(),1)) / (double)raf.length()) * 100.0d; } protected abstract void processLine(String line); public void readFile() throws IOException { try (RandomAccessFile raf = new RandomAccessFile(file, "r")) { while(shouldRun.get()) { String line = raf.readLine(); if (line == null) { return; } String utf8 = new String(line.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); readStatistic.currentFileProgress = calculateFileProgress(raf); try { processLine(utf8); } catch(LmdbException e) { // do not catch expections from LMDB (e. g. MapFullException). throw e; } catch (Exception e) { System.err.println("Error in line: " + utf8); e.printStackTrace(); readStatistic.errors.add(utf8); } } } } @Override public void interrupt() { shouldRun.set(false); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/AbstractProducer.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import net.ladenthin.bitcoinaddressfinder.configuration.CProducer; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducer; import net.ladenthin.bitcoinaddressfinder.keyproducer.NoMoreSecretsAvailableException; import org.apache.commons.codec.binary.Hex; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.math.BigInteger; import java.util.concurrent.atomic.AtomicBoolean; public abstract class AbstractProducer implements Producer { private final static int SLEEP_WAIT_TILL_RUNNING = 10; private Logger logger = LoggerFactory.getLogger(this.getClass()); protected final AtomicBoolean running = new AtomicBoolean(false); protected final CProducer cProducer; protected final Consumer consumer; protected final KeyUtility keyUtility; protected final KeyProducer keyProducer; protected final BitHelper bitHelper; protected final PrivateKeyValidator privateKeyValidator; protected volatile ProducerState state = ProducerState.UNINITIALIZED; protected final AtomicBoolean shouldRun = new AtomicBoolean(true); public AbstractProducer(CProducer cProducer, Consumer consumer, KeyUtility keyUtility, KeyProducer keyProducer, BitHelper bitHelper) { this.cProducer = cProducer; this.consumer = consumer; this.keyUtility = keyUtility; this.keyProducer = keyProducer; this.bitHelper = bitHelper; this.privateKeyValidator = new PrivateKeyValidator(); } @Override public void initProducer() { logger.info("Init producer."); this.state = ProducerState.INITIALIZED; } @Override public void releaseProducer() { logger.info("Release producer."); } @Override public void run() { if (!shouldRun.get()) { logger.info("Producer was interrupted before it started running."); state = ProducerState.NOT_RUNNING; return; } if (state != ProducerState.INITIALIZED) { throw new IllegalStateException("Producer not initialized. Current state: " + state); } state = ProducerState.RUNNING; while (shouldRun.get()) { try { produceKeys(); } catch (Exception e) { logger.error("Error in produceKeys", e); break; } if (cProducer.runOnce) { break; } } state = ProducerState.NOT_RUNNING; } @Override public void produceKeys() throws Exception { try { BigInteger[] secrets; try { secrets = keyProducer.createSecrets(cProducer.getOverallWorkSize(bitHelper), cProducer.batchUsePrivateKeyIncrement); } catch (NoMoreSecretsAvailableException ex) { logNoMoreSecretsInSecretFactory(); interrupt(); return; } // assert the requested secrets array fulfill its request parameter if (cProducer.batchUsePrivateKeyIncrement) { if(secrets.length != 1) { throw new RuntimeException("secrets.length != 1"); } } else { if(secrets.length != cProducer.getOverallWorkSize(bitHelper)) { throw new RuntimeException("secrets.length != bitHelper.convertBitsToSize(cProducer.batchSizeInBits)"); } } privateKeyValidator.replaceInvalidPrivateKeys(secrets); consumeSecrets(secrets); } catch (RuntimeException e) { logErrorInProduceKeys(e); throw e; } } void consumeSecrets(BigInteger[] secrets) { if (cProducer.batchUsePrivateKeyIncrement) { BigInteger secret = secrets[0]; BigInteger secretBase = createSecretBase(secret, cProducer.logSecretBase); processSecretBase(secretBase); } else { processSecrets(secrets); } } /** * The method fromPrivate can throw an {@link IllegalArgumentException}. * The method {@link ByteBufferUtility#freeByteBuffer} can throw an {@link java.lang.IllegalAccessError}. * @param secret the secret to be able to recover the issue */ protected void logErrorInProduceKeys(Throwable e, BigInteger secret) { logger.error("Error in produceKey for secret " + secret + ".", e); } protected void logErrorInProduceKeys(Exception e) { logger.error("Error in produceKey", e); } protected void logNoMoreSecretsInSecretFactory() { logger.error("No more keys in secret factory. Shutdown producer."); } @Override public void waitTillProducerNotRunning() { while(state == ProducerState.RUNNING) { try { Thread.sleep(SLEEP_WAIT_TILL_RUNNING); } catch (InterruptedException e) { } } } public BigInteger createSecretBase(BigInteger secret, boolean logSecretBase) { BigInteger killBits = bitHelper.getKillBits(cProducer.batchSizeInBits); BigInteger secretBase = keyUtility.killBits(secret, killBits); if(logSecretBase) { logger.info("secretBase: " + keyUtility.bigIntegerToFixedLengthHex(secretBase) + "/" + cProducer.batchSizeInBits); } if (logger.isTraceEnabled()) { logger.trace("secret BigInteger: " + secret); logger.trace("secret as byte array: " + keyUtility.bigIntegerToFixedLengthHex(secret)); logger.trace("killBits: " + Hex.encodeHexString(killBits.toByteArray())); logger.trace("secretBase: " + secretBase); logger.trace("secretBase as byte array: " + keyUtility.bigIntegerToFixedLengthHex(secretBase)); } return secretBase; } public static BigInteger calculateSecretKey(BigInteger secretBase, int keyNumber) { if (false) { // works also but a or might be faster return secretBase.add(BigInteger.valueOf(keyNumber)); } return secretBase.or(BigInteger.valueOf(keyNumber)); } Logger getLogger() { return logger; } void setLogger(Logger logger) { this.logger = logger; } @Override public void interrupt() { shouldRun.set(false); } @Override public ProducerState getState() { return state; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/AddressFile.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.io.File; import java.util.function.Consumer; import org.bitcoinj.base.Network; import org.jspecify.annotations.NonNull; public class AddressFile extends AbstractPlaintextFile { @NonNull private final Network network; @NonNull private final KeyUtility keyUtility; @NonNull private final Consumer addressConsumer; @NonNull private final Consumer unsupportedConsumer; public AddressFile(@NonNull File file, ReadStatistic readStatistic, @NonNull Network network, @NonNull Consumer addressConsumer, @NonNull Consumer unsupportedConsumer) { super(file, readStatistic); this.network = network; this.addressConsumer = addressConsumer; this.unsupportedConsumer = unsupportedConsumer; keyUtility = new KeyUtility(network, new ByteBufferUtility(true)); } @Override protected void processLine(String line) { AddressTxtLine addressTxtLine = new AddressTxtLine(); try { AddressToCoin addressToCoin = addressTxtLine.fromLine(line, keyUtility); addressConsumer.accept(addressToCoin); readStatistic.successful++; } catch (AddressFormatNotAcceptedException e) { unsupportedConsumer.accept(line); readStatistic.incrementUnsupported(e.getReason()); } } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/AddressFilesToLMDB.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import net.ladenthin.bitcoinaddressfinder.configuration.CLMDBConfigurationWrite; import net.ladenthin.bitcoinaddressfinder.persistence.PersistenceUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; import java.util.List; import java.util.Objects; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import net.ladenthin.bitcoinaddressfinder.configuration.CAddressFilesToLMDB; import net.ladenthin.bitcoinaddressfinder.persistence.lmdb.LMDBPersistence; import org.bitcoinj.base.Network; import org.jspecify.annotations.NonNull; public class AddressFilesToLMDB implements Runnable, Interruptable { private final static long PROGRESS_LOG = 100_000; private final Logger logger = LoggerFactory.getLogger(AddressFilesToLMDB.class); private final @NonNull CAddressFilesToLMDB addressFilesToLMDB; private final AtomicLong addressCounter = new AtomicLong(); private final ReadStatistic readStatistic = new ReadStatistic(); @NonNull AtomicReference currentAddressFile = new AtomicReference<>(); protected final AtomicBoolean shouldRun = new AtomicBoolean(true); public AddressFilesToLMDB( @NonNull CAddressFilesToLMDB addressFilesToLMDB) { this.addressFilesToLMDB = addressFilesToLMDB; } @Override public void run() { final Network network = new NetworkParameterFactory().getNetwork(); PersistenceUtils persistenceUtils = new PersistenceUtils(network); CLMDBConfigurationWrite lmdbConfigurationWrite = Objects.requireNonNull(addressFilesToLMDB.lmdbConfigurationWrite); try(LMDBPersistence persistence = new LMDBPersistence(lmdbConfigurationWrite, persistenceUtils)) { logger.info("Init LMDB ..."); persistence.init(); logger.info("... init LMDB done."); try { FileHelper fileHelper = new FileHelper(); List addressesFiles = Objects.requireNonNull(addressFilesToLMDB.addressesFiles); List files = fileHelper.stringsToFiles(addressesFiles); fileHelper.assertFilesExists(files); java.util.function.Consumer supported = addressToCoin -> { ByteBuffer hash160 = addressToCoin.hash160(); persistence.putNewAmount(hash160, addressToCoin.coin()); addressCounter.incrementAndGet(); if (addressCounter.get() % PROGRESS_LOG == 0) { logProgress(); } }; java.util.function.Consumer unsupported = line -> { if (readStatistic.getUnsupportedTotal() % PROGRESS_LOG == 0) { logProgress(); } }; logger.info("Iterate address files ..."); for (File file : files) { if (!shouldRun.get()) { break; } AddressFile addressFile = new AddressFile( file, readStatistic, network, supported, unsupported ); logger.info("process " + file.getAbsolutePath()); currentAddressFile.set(addressFile); addressFile.readFile(); currentAddressFile.set(null); logger.info("finished: " + file.getAbsolutePath()); logProgress(); } logProgress(); logger.info("... iterate address files done."); for (String error : readStatistic.errors) { logger.info("Error in line: " + error); } } catch (IOException e) { throw new RuntimeException(e); } } } private void logProgress() { logger.info("Progress: " + addressCounter.get() + " addresses. Unsupported: " + readStatistic.getUnsupportedTotal() + ". Errors: " + readStatistic.errors.size() + ". Current File progress: " + String.format("%.2f", readStatistic.currentFileProgress) + "%."); } @Override public void interrupt() { AddressFile addressFile = currentAddressFile.get(); if (addressFile != null) { addressFile.interrupt(); } } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/AddressFormatNotAcceptedException.java ================================================ // @formatter:off /** * Copyright 2026 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; /** * Thrown by {@link AddressTxtLine#fromLine} when an address line cannot be * accepted because its format is unsupported or malformed. * The exception message includes a human-readable reason describing why the * format was rejected. */ public class AddressFormatNotAcceptedException extends Exception { private final String reason; public AddressFormatNotAcceptedException(String reason) { super("Address format not accepted: " + reason); this.reason = reason; } public String getReason() { return reason; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/AddressToCoin.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.nio.ByteBuffer; import org.bitcoinj.base.Coin; import org.jspecify.annotations.NonNull; /** * Represents an immutable mapping from a hash160 to a Coin amount. * *

Note: hash160 is expected to be exactly {@code PublicKeyBytes.HASH160_SIZE} bytes long.

*/ public record AddressToCoin(@NonNull ByteBuffer hash160, @NonNull Coin coin, @NonNull AddressType type) { public AddressToCoin { if (hash160.limit() != PublicKeyBytes.RIPEMD160_HASH_NUM_BYTES) { throw new IllegalArgumentException("Given hash160 has not the correct size: " + hash160.limit()); } } @Override public @NonNull String toString() { return "AddressToCoin{" + "hash160=" + new ByteBufferUtility(false).getHexFromByteBuffer(hash160) + ", coin=" + coin + ", type=" + type + '}'; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/AddressTxtLine.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.google.common.hash.Hashing; import org.bitcoinj.base.Base58; import org.bitcoinj.base.Bech32; import org.bitcoinj.base.Coin; import org.bitcoinj.base.SegwitAddress; import org.bitcoinj.base.exceptions.AddressFormatException; import org.bouncycastle.util.encoders.DecoderException; import org.jspecify.annotations.NonNull; import java.nio.ByteBuffer; import java.util.Arrays; /** * Most txt files have a common format which uses Base58 address and separated * anmount. */ public class AddressTxtLine { /** * Should not be {@link Coin#ZERO} because it can't be written to LMDB. */ public static final Coin DEFAULT_COIN = Coin.SATOSHI; public static final String IGNORE_LINE_PREFIX = "#"; public static final String ADDRESS_HEADER = "address"; public static final String BITCOIN_CASH_PREFIX = "bitcoincash:"; public final static int VERSION_BYTES_REGULAR = 1; public final static int VERSION_BYTES_ZCASH = 2; public final static int CHECKSUM_BYTES_REGULAR = 4; public static final String REASON_EMPTY = "address is empty"; /** * Reason used when the line starts with {@link #IGNORE_LINE_PREFIX} ({@code "#"}). *

* This check is performed on the raw line before {@link SeparatorFormat#split}, * because {@code "#"} is also registered as {@link SeparatorFormat#HASH}. Splitting first * would always produce an empty first token for {@code "#..."} lines, masking this reason * with {@link #REASON_EMPTY} instead. */ public static final String REASON_IGNORE_PREFIX = "address starts with ignore prefix"; public static final String REASON_ADDRESS_HEADER = "address starts with address header"; public static final String REASON_P2MS_NOT_SUPPORTED = "Blockchair Multisig (P2MS) format is not supported"; public static final String REASON_P2WSH_NOT_SUPPORTED = "P2WSH is not supported"; public static final String REASON_P2TR_NOT_SUPPORTED = "P2TR is not supported"; public static final String REASON_UNSUPPORTED_WITNESS_VERSION = "unsupported witness version"; public static final String REASON_BITCOIN_CASH_Q_ADDRESS_NOT_PARSABLE = "Bitcoin Cash address is not parsable"; public static final String REASON_INVALID_BASE58 = "invalid Base58 address"; /** * Witness version 0, used for SegWit v0 addresses such as: *

    *
  • P2WPKH – Pay to Witness Public Key Hash
  • *
  • P2WSH – Pay to Witness Script Hash
  • *
* Defined in BIP-173. */ private static final int WITNESS_VERSION_0 = 0; /** * Witness version 1, introduced with Taproot (SegWit v1): *
    *
  • P2TR – Pay to Taproot
  • *
* Defined in BIP-341 and * encoded using Bech32m as specified in BIP-350. */ private static final int WITNESS_VERSION_1 = 1; Bech32Helper bech32Helper = new Bech32Helper(); /** * Parses a line containing an address and optional amount. * Throws {@link AddressFormatNotAcceptedException} if the address is unsupported, * malformed, or marked as ignored. *

* If no coin amount is specified in the line, {@link #DEFAULT_COIN} is used as a fallback. * * @param line the line to parse * @param keyUtility the {@link KeyUtility} used for conversions * @return an {@link AddressToCoin} instance — never {@code null} * @throws AddressFormatNotAcceptedException if the address format is not accepted, * with a reason message describing why */ @NonNull public AddressToCoin fromLine(String line, KeyUtility keyUtility) throws AddressFormatNotAcceptedException { // Checked before splitting: "#" is also a SeparatorFormat separator, so splitting first // would always produce an empty first token for "#..." lines, masking this reason. if (line.trim().startsWith(IGNORE_LINE_PREFIX)) { throw new AddressFormatNotAcceptedException(REASON_IGNORE_PREFIX); } // Remove the Bitcoin Cash prefix (which includes a colon) to avoid incorrect splitting. // This ensures the address is recognized properly and not misinterpreted during parsing. if(line.contains(BITCOIN_CASH_PREFIX)) { line = line.replace(BITCOIN_CASH_PREFIX, ""); } String[] lineSplitted = SeparatorFormat.split(line); String address = lineSplitted[0]; Coin amount = getCoinIfPossible(lineSplitted, DEFAULT_COIN); address = address.trim(); if (address.isEmpty()) { throw new AddressFormatNotAcceptedException(REASON_EMPTY); } if (address.startsWith(ADDRESS_HEADER)) { throw new AddressFormatNotAcceptedException(REASON_ADDRESS_HEADER); } // Riecoin: ScriptPubKey-style encoded address (hex with OP codes) { final String OP_DUP = "76"; final String OP_HASH160 = "a9"; final String OP_PUSH_20_BYTES = "14"; final int length20Bytes = PublicKeyBytes.RIPEMD160_HASH_NUM_BYTES; final String riecoinP2SHPrefix = OP_DUP + OP_HASH160 + OP_PUSH_20_BYTES; final int riecoinScriptPubKeyLengthHex = length20Bytes * 2 + riecoinP2SHPrefix.length(); if (address.length() >= riecoinScriptPubKeyLengthHex && address.startsWith(riecoinP2SHPrefix)) { final String hash160Hex = address.substring(riecoinP2SHPrefix.length(), length20Bytes*2+riecoinP2SHPrefix.length()); final ByteBuffer hash160 = keyUtility.byteBufferUtility().getByteBufferFromHex(hash160Hex); return new AddressToCoin(hash160, amount, AddressType.P2PKH_OR_P2SH); } } // Blockchair Multisig (P2MS) format is not supported if ( address.startsWith("d-") || address.startsWith("m-") || address.startsWith("s-") ) { throw new AddressFormatNotAcceptedException(REASON_P2MS_NOT_SUPPORTED); } // BitCore WKH format (Base36-encoded hash160) if (address.startsWith("wkh_")) { // BitCore (WKH) is base36 encoded hash160 String addressWKH = address.substring("wkh_".length()); byte[] hash160 = new Base36Decoder().decodeBase36ToFixedLengthBytes(addressWKH, PublicKeyBytes.RIPEMD160_HASH_NUM_BYTES); ByteBuffer hash160AsByteBuffer = keyUtility.byteBufferUtility().byteArrayToByteBuffer(hash160); return new AddressToCoin(hash160AsByteBuffer, amount, AddressType.P2WPKH); } // Bech32 decoding (P2WPKH, P2WSH, P2TR) try { Bech32.Bech32Data bechData = Bech32.decode(address); // protected: bechData.witnessVersion(); short witnessVersion = bech32Helper.getWitnessVersion(bechData); // protected: bechData.witnessProgram(); byte[] witnessProgram = bech32Helper.getWitnessPrograms(bechData); switch (witnessVersion) { case WITNESS_VERSION_0: if (witnessProgram.length == SegwitAddress.WITNESS_PROGRAM_LENGTH_PKH) { ByteBuffer hash160 = keyUtility.byteBufferUtility().byteArrayToByteBuffer(witnessProgram); return new AddressToCoin(hash160, amount, AddressType.P2WPKH); // P2WPKH supported } else if (witnessProgram.length == SegwitAddress.WITNESS_PROGRAM_LENGTH_SH) { byte[] scriptHash = witnessProgram; throw new AddressFormatNotAcceptedException(REASON_P2WSH_NOT_SUPPORTED); } break; case WITNESS_VERSION_1: if (witnessProgram.length == SegwitAddress.WITNESS_PROGRAM_LENGTH_TR) { byte[] tweakedPublicKey = witnessProgram; throw new AddressFormatNotAcceptedException(REASON_P2TR_NOT_SUPPORTED); } break; default: throw new AddressFormatNotAcceptedException(REASON_UNSUPPORTED_WITNESS_VERSION); } } catch (AddressFormatException | ReflectiveOperationException e) { // Bech32 parsing or reflection failed; continue to next format } // ZCash or Peercoin with 2-byte version if (address.startsWith("p") || address.startsWith("t")) { // p: bitcoin cash / CashAddr (P2SH), this is a unique format and does not work // p: peercoin possible // t: ZCash has two version bytes try { AddressToCoin addressToCoin = parseBase58Address(address, VERSION_BYTES_ZCASH, CHECKSUM_BYTES_REGULAR, keyUtility); return new AddressToCoin(addressToCoin.hash160(), amount, addressToCoin.type()); } catch (RuntimeException e) { // Fall through to other format checks } } try { // Bitcoin Cash 'q' prefix: convert to legacy address if (address.startsWith("q")) { byte[] payload = bech32Helper.extractPKHFromBitcoinCashAddress(address); ByteBuffer hash160 = keyUtility.byteBufferUtility().byteArrayToByteBuffer(payload); return new AddressToCoin(hash160, amount, AddressType.P2PKH_OR_P2SH); } } catch (DecoderException e) { throw e; } catch (RuntimeException | ReflectiveOperationException e) { throw new AddressFormatNotAcceptedException(REASON_BITCOIN_CASH_Q_ADDRESS_NOT_PARSABLE); } // Fallback: assume Base58 with 1-byte version prefix try { AddressToCoin addressToCoin = parseBase58Address(address, VERSION_BYTES_REGULAR, CHECKSUM_BYTES_REGULAR, keyUtility); return new AddressToCoin(addressToCoin.hash160(), amount, addressToCoin.type()); } catch (AddressFormatException e) { throw new AddressFormatNotAcceptedException(REASON_INVALID_BASE58); } } static AddressToCoin parseBase58Address(String base58, int versionBytes, int checksumBytes, KeyUtility keyUtility) { byte[] decoded = Base58.decode(base58); final byte[] version; if (versionBytes > 0) { // copy version bytes version = new byte[versionBytes]; System.arraycopy(decoded, 0, version, 0, version.length); } else { version = null; } byte[] hash160 = new byte[20]; int storedBytes = Math.min(decoded.length - versionBytes, hash160.length); { // copy hash160 System.arraycopy(decoded, versionBytes, hash160, 0, storedBytes); } final byte[] checksum; if (decoded.length >= versionBytes + hash160.length + checksumBytes) { checksum = new byte[checksumBytes]; // copy cheksum System.arraycopy(decoded, versionBytes + storedBytes, checksum, 0, checksum.length); String checksumAsHex = org.apache.commons.codec.binary.Hex.encodeHexString(checksum); } else { checksum = null; } boolean checksumMatches = false; if (version != null && checksum != null) { byte[] payload = new byte[version.length + hash160.length]; System.arraycopy(version, 0, payload, 0, version.length); System.arraycopy(hash160, 0, payload, version.length, hash160.length); byte[] firstHash = Hashing.sha256().hashBytes(payload).asBytes(); byte[] secondHash = Hashing.sha256().hashBytes(firstHash).asBytes(); byte[] calculatedChecksum = Arrays.copyOfRange(secondHash, 0, checksumBytes); checksumMatches = Arrays.equals(calculatedChecksum, checksum); if (false) { // TODO: For debugging only String versionAsHex = org.apache.commons.codec.binary.Hex.encodeHexString(version); } } if (false) { // TODO: For debugging only String decodedAsHex = org.apache.commons.codec.binary.Hex.encodeHexString(decoded); String hash160AsHex = org.apache.commons.codec.binary.Hex.encodeHexString(hash160); } ByteBuffer hash160AsByteBuffer = keyUtility.byteBufferUtility().byteArrayToByteBuffer(hash160); // fallback AddressType addressType = AddressType.P2PKH_OR_P2SH; AddressToCoin addressToCoin = new AddressToCoin(hash160AsByteBuffer, DEFAULT_COIN, addressType); return addressToCoin; } @NonNull private Coin getCoinIfPossible(@NonNull String[] lineSplitted, @NonNull Coin defaultValue) throws NumberFormatException { if (lineSplitted.length > 1) { String amountString = lineSplitted[1]; try { return Coin.valueOf(Long.parseLong(amountString)); } catch (NumberFormatException e) { return defaultValue; } } else { return defaultValue; } } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/AddressType.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; /** * Enum representing different Bitcoin/altcoin address script types. * Constants for witness program lengths are defined in {@link org.bitcoinj.base.SegwitAddress}. */ public enum AddressType { /** * Pay to Public Key Hash (Legacy Address) or * Pay to Script Hash. *

* P2PKH Format: Base58Check. Typical prefix: '1' (BTC mainnet).
* P2SH Format: Base58Check. Typical prefix: '3' (BTC mainnet).
* P2PKH Script: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
* P2SH Script: OP_HASH160 <scriptHash> OP_EQUAL *

*

Note: P2PKH and P2SH addresses use the same Base58Check format and differ only by their version byte. * This makes it impossible to distinguish them without additional context (e.g., the coin type or expected script). * Address collisions or misclassification may occur when coins use the same address format with different version bytes. *

*/ P2PKH_OR_P2SH, /** * Pay to Witness Public Key Hash (SegWit v0). * Format: Bech32. Typical prefix: 'bc1q'. * Length: {@link org.bitcoinj.base.SegwitAddress#WITNESS_PROGRAM_LENGTH_PKH} * Script: 0 <20-byte pubKeyHash> */ P2WPKH } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/BIP39KeyProducer.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import net.ladenthin.bitcoinaddressfinder.keyproducer.NoMoreSecretsAvailableException; import com.google.common.annotations.VisibleForTesting; import java.time.Instant; import java.util.ArrayList; import org.bitcoinj.crypto.ChildNumber; import org.bitcoinj.crypto.DeterministicKey; import org.bitcoinj.crypto.HDPath; import org.bitcoinj.wallet.DeterministicKeyChain; import org.bitcoinj.wallet.DeterministicSeed; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; /** * Deterministic key producer based on a BIP39 mnemonic + BIP44 path. * Allows sequential derivation of keys like Random.next() from a fixed HD wallet seed. */ public class BIP39KeyProducer extends java.util.Random { private final DeterministicKeyChain keyChain; private final List basePath; private final boolean hardened; @VisibleForTesting final AtomicInteger counter = new AtomicInteger(0); public BIP39KeyProducer(String mnemonic, String passphrase, String bip44BasePath, Instant creationTime, boolean hardened) { DeterministicSeed seed = DeterministicSeed.ofMnemonic(mnemonic, passphrase, creationTime); this.keyChain = DeterministicKeyChain.builder().seed(seed).build(); this.basePath = HDPath.parsePath(bip44BasePath); // e.g., "M/44H/0H/0H/0" this.hardened = hardened; } /** * Returns the next derived key along the BIP44 path. */ public DeterministicKey nextKey() throws NoMoreSecretsAvailableException { int index = counter.getAndIncrement(); if (index < 0) { throw new NoMoreSecretsAvailableException("Child index overflow: counter exceeded Integer.MAX_VALUE"); } List path = append(basePath, new ChildNumber(index, hardened)); return keyChain.getKeyByPath(path, true); } public static List append(List base, ChildNumber child) { List extended = new ArrayList<>(base); extended.add(child); return extended; } /** * Overrides nextBytes to produce deterministic bytes from key material. */ @Override public void nextBytes(byte[] bytes) { DeterministicKey key = nextKey(); byte[] priv = key.getPrivKeyBytes(); System.arraycopy(priv, 0, bytes, 0, Math.min(bytes.length, priv.length)); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/BIP39Wordlist.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.io.InputStream; public enum BIP39Wordlist { CHINESE_SIMPLIFIED("chinese_simplified.txt"), CHINESE_TRADITIONAL("chinese_traditional.txt"), CZECH("czech.txt"), ENGLISH("english.txt"), FRENCH("french.txt"), ITALIAN("italian.txt"), JAPANESE("japanese.txt"), KOREAN("korean.txt"), PORTUGUESE("portuguese.txt"), RUSSIAN("russian.txt"), SPANISH("spanish.txt"), TURKISH("turkish.txt"); /** * Unicode character for an ideographic space (U+3000), used in East Asian languages such as Japanese. * This space is wider than a standard space and is required for correct formatting of Japanese mnemonics. */ public static final String IDEOGRAPHIC_SPACE = "\u3000"; /** * Standard ASCII space character (U+0020). * Used as the default separator between words in most BIP39 wordlists, such as English. */ public static final String NORMAL_SPACE = " "; /** * The name of the wordlist file associated with this BIP39 language. *

* This filename is used to locate the corresponding wordlist resource file in the * {@code /mnemonic/wordlist/} directory of the classpath (e.g., {@code english.txt}). */ private final String fileName; /** * Constructs a BIP39 wordlist enum constant with the associated filename. * * @param fileName the name of the wordlist file (e.g., {@code "english.txt"}), which is used * to load the corresponding wordlist resource from the classpath */ BIP39Wordlist(String fileName) { this.fileName = fileName; } /** * Loads the BIP39 wordlist file as an {@link InputStream} for this language. *

* The wordlist file is expected to be located in the resource path: * {@code /mnemonic/wordlist/{fileName}}, where {@code fileName} corresponds * to the file name associated with the enum constant (e.g. {@code english.txt}). *

* This method is used to initialize a {@link org.bitcoinj.crypto.MnemonicCode} instance with the correct * wordlist for a given language. * * @return the input stream of the wordlist file for this language, or {@code null} * if the resource is not found. */ public InputStream getWordListStream() { return BIP39Wordlist.class.getResourceAsStream("/mnemonic/wordlist/" + fileName); } /** * Converts a filename-like language name into the corresponding {@link BIP39Wordlist} enum constant. *

* The input typically comes from wordlist filenames in the format {@code mnemonic/wordlist/{language}.txt}, * for example: *

    *
  • {@code chinese_simplified.txt} → {@code CHINESE_SIMPLIFIED}
  • *
  • {@code english.txt} → {@code ENGLISH}
  • *
*

* To perform the conversion, this method: *

    *
  • Converts the name to upper case
  • *
  • Replaces hyphens with underscores (if any)
  • *
* This enables consistent mapping between file-based wordlist identifiers and enum values. * * @param name the lowercase filename-based language identifier, e.g. {@code "english"} or {@code "chinese_simplified"} * @return the corresponding {@link BIP39Wordlist} enum constant * @throws IllegalArgumentException if no matching enum exists */ public static BIP39Wordlist fromLanguageName(String name) { return valueOf(name.toUpperCase().replace('-', '_')); } /** * Returns the word separator used in the mnemonic phrase for the given language. *

* Most languages use a single space (" ") as the separator between words. * However, Japanese uses the IDEOGRAPHIC SPACE (U+3000) to conform with the official BIP39 specification. * * @return the word separator specific to the language */ public String getSeparator() { if (this == JAPANESE) { return IDEOGRAPHIC_SPACE; } return NORMAL_SPACE; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/Base36Decoder.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.math.BigInteger; public class Base36Decoder { /** * Decodes a Base36-encoded string (e.g., from a WKH address) into a fixed-length byte array. *

* This method is typically used to convert a Base36-encoded hash representation (such as a RIPEMD-160 hash) * into a normalized {@code byte[]} of exactly {@code hashLength} bytes. * It handles BigInteger's sign-extension by trimming or zero-padding the result as needed. *

* If the decoded byte array is shorter than {@code hashLength}, the result is left-padded with zeros. * If the decoded array is longer, only the least-significant {@code hashLength} bytes are kept. * * @param base36Encoded the Base36-encoded input string (e.g., from a "wkh_" address) * @param hashLength the desired length of the output byte array (e.g., 20 for hash160) * @return a normalized byte array of length {@code hashLength}, representing the decoded hash * @throws NumberFormatException if the input string is not valid Base36 */ public byte[] decodeBase36ToFixedLengthBytes(String base36Encoded, final int hashLength) { byte[] raw = new BigInteger(base36Encoded, 36).toByteArray(); byte[] hash160 = new byte[hashLength]; int srcPos = Math.max(0, raw.length - hashLength); int destPos = hashLength - (raw.length - srcPos); int length = raw.length - srcPos; System.arraycopy(raw, srcPos, hash160, destPos, length); return hash160; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/Bech32Helper.java ================================================ // @formatter:off /** * Copyright 2026 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import org.bitcoinj.base.Bech32; import org.bitcoinj.base.exceptions.AddressFormatException; import java.lang.reflect.Method; import java.util.Arrays; import static net.ladenthin.bitcoinaddressfinder.AddressTxtLine.BITCOIN_CASH_PREFIX; public class Bech32Helper { /** * Bech32 character set as defined in BIP-0173. * The position of each character in this string defines its 5-bit integer value (0–31). * * @see BIP-173 */ public static final String CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"; /** * Lookup table for fast Bech32 character-to-value resolution. */ private static final int[] LOOKUP = new int[128]; static { Arrays.fill(LOOKUP, -1); for (int i = 0; i < CHARSET.length(); i++) { LOOKUP[CHARSET.charAt(i)] = i; } } /** * Decodes a Bech32-encoded string into an array of 5-bit integer values. * Each character is looked up in {@link #CHARSET}; its index (0–31) becomes * the corresponding byte in the result. * * @param base32String the Bech32 character string to decode; must contain only characters * present in {@link #CHARSET} * @return a byte array of 5-bit values, one per input character * @throws IllegalArgumentException if any character is not in the Bech32 character set */ public byte[] decodeBech32CharsetToValues(String base32String) { // Decode characters to 5-bit values int len = base32String.length(); byte[] result = new byte[len]; for (int i = 0; i < len; i++) { char c = base32String.charAt(i); if (c >= LOOKUP.length || LOOKUP[c] == -1) { throw new IllegalArgumentException("Invalid character in Bech32 string: " + c); } result[i] = (byte) LOOKUP[c]; } return result; } /** * Return the data, fully-decoded with 8-bits per byte. * @return The data, fully-decoded as a byte array. */ private byte[] decode5to8(byte[] bytes) throws ReflectiveOperationException { return invokeConvertBitsStatic(bytes, 0, bytes.length, 5, 8, false); } private byte[] decode5to8WithPadding(byte[] bytes) throws ReflectiveOperationException { return invokeConvertBitsStatic(bytes, 0, bytes.length, 5, 8, true); } private byte[] encode8to5(byte[] data) throws ReflectiveOperationException { return invokeConvertBitsStatic(data, 0, data.length, 8, 5, true); } @SuppressWarnings("unchecked") private byte[] invokeConvertBitsStatic(byte[] in, int inStart, int inLen, int fromBits, int toBits, boolean pad) throws ReflectiveOperationException { Method method = Bech32.class.getDeclaredMethod("convertBits", byte[].class, int.class, int.class, int.class, int.class, boolean.class); method.setAccessible(true); try { return (byte[]) method.invoke(null, in, inStart, inLen, fromBits, toBits, pad); } catch (ReflectiveOperationException e) { // rethrow AddressFormatException if it's the underlying cause Throwable cause = e.getCause(); if (cause instanceof AddressFormatException) { throw (AddressFormatException) cause; } throw e; } } /** * Extracts the raw 20-byte Public Key Hash (PKH) from a Bitcoin Cash CashAddr address. * The optional {@code bitcoincash:} prefix is stripped if present before decoding. * After Bech32 decoding, the first byte (address type/version) and the last 6 bytes * (CashAddr checksum) are discarded; the remaining bytes form the PKH. * * @param address the Bitcoin Cash CashAddr address, with or without the {@code bitcoincash:} prefix * @return the 20-byte PKH extracted from the address * @throws ReflectiveOperationException if the internal {@code Bech32.convertBits} method * cannot be accessed via reflection */ public byte[] extractPKHFromBitcoinCashAddress(String address) throws ReflectiveOperationException { if (address.startsWith(BITCOIN_CASH_PREFIX)) { address = address.substring(BITCOIN_CASH_PREFIX.length()); } byte[] decoded5 = decodeBech32CharsetToValues(address); byte[] decoded8 = decode5to8WithPadding(decoded5); // Extracts the payload portion from the decoded Bech32 data. // Skips the first byte (address type/version) and removes the last 6 bytes (checksum). // The result is the raw payload encoded in 5-bit format. return Arrays.copyOfRange(decoded8, 1, decoded8.length - 6); } /** * Returns the witness program bytes from a decoded Bech32 SegWit address. * Accesses the protected {@code witnessProgram()} method of {@link Bech32.Bech32Data} * via reflection because it is not exposed in the public API. * * @param bechData the decoded Bech32 data, typically obtained from {@link Bech32#decode(String)} * @return the raw witness program bytes (e.g., the 20-byte PKH for P2WPKH) * @throws ReflectiveOperationException if the protected method cannot be accessed */ public byte[] getWitnessPrograms(Bech32.Bech32Data bechData) throws ReflectiveOperationException { return invokeProtectedMethod(bechData, "witnessProgram", byte[].class); } /** * Returns the witness version from a decoded Bech32 SegWit address. * Accesses the protected {@code witnessVersion()} method of {@link Bech32.Bech32Data} * via reflection because it is not exposed in the public API. *

    *
  • Version 0 — P2WPKH and P2WSH (BIP-173)
  • *
  • Version 1 — P2TR / Taproot (BIP-341, encoded with Bech32m per BIP-350)
  • *
* * @param bechData the decoded Bech32 data, typically obtained from {@link Bech32#decode(String)} * @return the witness version as a {@link Short} * @throws ReflectiveOperationException if the protected method cannot be accessed */ public Short getWitnessVersion(Bech32.Bech32Data bechData) throws ReflectiveOperationException { return invokeProtectedMethod(bechData, "witnessVersion", Short.class); } @SuppressWarnings("unchecked") private T invokeProtectedMethod(Bech32.Bech32Bytes bech32Bytes, String methodName, Class returnType) throws ReflectiveOperationException { Class clazz = Bech32.Bech32Bytes.class; Method method = clazz.getDeclaredMethod(methodName); method.setAccessible(true); return (T) method.invoke(bech32Bytes); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/BitHelper.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.math.BigInteger; public class BitHelper { public static final int RADIX_HEX = 16; public int convertBitsToSize(int bits) { return 1 << bits; } public BigInteger getKillBits(int bits) { return BigInteger.valueOf(2).pow(bits).subtract(BigInteger.ONE); } public void assertBatchSizeInBitsIsInRange(int batchSizeInBits) { if (batchSizeInBits < 0) { throw new IllegalArgumentException("batchSizeInBits must higher or equal to 0."); } if (batchSizeInBits > PublicKeyBytes.BIT_COUNT_FOR_MAX_CHUNKS_ARRAY) { throw new IllegalArgumentException("batchSizeInBits must be lower or equal than " + PublicKeyBytes.BIT_COUNT_FOR_MAX_CHUNKS_ARRAY + "."); } } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/ByteBufferUtility.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.math.BigInteger; import java.nio.ByteBuffer; import java.util.Arrays; import jdk.internal.misc.Unsafe; import org.bouncycastle.util.encoders.Hex; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; public class ByteBufferUtility { /** * Decide between {@link java.nio.DirectByteBuffer} and {@link java.nio.HeapByteBuffer}. */ private final boolean allocateDirect; public ByteBufferUtility(boolean allocateDirect) { this.allocateDirect = allocateDirect; } /** * ATTENTION: The {@link Unsafe#getUnsafe} can throw an {@link java.lang.IllegalAccessError}. * https://stackoverflow.com/questions/8462200/examples-of-forcing-freeing-of-native-memory-direct-bytebuffer-has-allocated-us * https://stackoverflow.com/questions/13003871/how-do-i-get-the-instance-of-sun-misc-unsafe * https://stackoverflow.com/questions/29301755/got-securityexception-in-java * https://bugs.openjdk.org/browse/JDK-8171377 * @param byteBuffer the ByteBuffer to free */ public void freeByteBuffer(@Nullable ByteBuffer byteBuffer) { if (byteBuffer == null) { return; } if (!byteBuffer.isDirect()) { return; } Unsafe u = Unsafe.getUnsafe(); // https://bugs.openjdk.org/browse/JDK-8171377 // https://openjdk.org/jeps/8323072 // https://stackoverflow.com/questions/3496508/deallocating-direct-buffer-native-memory-in-java-for-jogl/26777380 u.invokeCleaner(byteBuffer); } // public byte[] byteBufferToBytes(ByteBuffer byteBuffer) { byte[] bytes = new byte[byteBuffer.remaining()]; byteBuffer.get(bytes); byteBuffer.rewind(); return bytes; } public ByteBuffer byteArrayToByteBuffer(byte[] bytes) { if (allocateDirect) { return byteArrayToByteBufferAllocatedDirect(bytes); } else { return byteArrayToByteBufferWrapped(bytes); } } private ByteBuffer byteArrayToByteBufferWrapped(byte[] bytes) { // wrap() delivers a buffer which is already flipped ByteBuffer wrap = ByteBuffer.wrap(bytes); return wrap; } private ByteBuffer byteArrayToByteBufferAllocatedDirect(byte[] bytes) { ByteBuffer key = ByteBuffer.allocateDirect(bytes.length); key.put(bytes).flip(); return key; } /** * Writes a BigInteger into a ByteBuffer. * * @param buffer The ByteBuffer to write to. * @param byteArray The byte array to write. */ public static void putToByteBuffer(ByteBuffer buffer, byte[] byteArray) { buffer.clear(); buffer.put(byteArray, 0, byteArray.length); buffer.rewind(); } // // public String getHexFromByteBuffer(ByteBuffer byteBuffer) { byte[] array = byteBufferToBytes(byteBuffer); String hexString = Hex.toHexString(array); return hexString; } public ByteBuffer getByteBufferFromHex(String hex) { byte[] decoded = Hex.decode(hex); // wrap() delivers a buffer which is already flipped final ByteBuffer byteBuffer = byteArrayToByteBuffer(decoded); return byteBuffer; } // // /** * Validates that the given capacity fits within Java's ByteBuffer limit. * * @param capacity the desired buffer capacity in bytes * @return the same value as an int, if within bounds * @throws IllegalArgumentException if capacity exceeds Integer.MAX_VALUE or is negative */ public static int ensureByteBufferCapacityFitsInt(long capacity) { if (capacity < 0) { throw new IllegalArgumentException("Capacity must not be negative: " + capacity); } if (capacity > Integer.MAX_VALUE) { throw new IllegalArgumentException("Capacity exceeds maximum ByteBuffer limit: " + capacity); } return (int) capacity; } // // /** * Allocates a {@link ByteBuffer} strictly using {@link ByteBuffer#allocateDirect(int)}. *

* This method enforces that {@code allocateDirect == true}. * It throws an {@link IllegalStateException} if heap allocation is enabled. * Useful when native memory access is required, e.g. for OpenCL interop. * * @param capacity the number of bytes to allocate * @return a direct {@link ByteBuffer} * @throws IllegalStateException if not configured for direct allocation */ public ByteBuffer allocateByteBufferDirectStrict(int capacity) { if (!allocateDirect) { throw new IllegalStateException("Direct allocation requested, but allocateDirect is false."); } return ByteBuffer.allocateDirect(capacity); } // /** * https://bitbucket.org/connect2id/nimbus-srp/pull-requests/6/remove-leading-zero-byte-when-converting/diff * Converts a BigInteger into a byte array ignoring the sign of the * BigInteger, according to SRP specification * * @param bigInteger BigInteger, must not be null * * @return byte array (leading byte is always != 0), empty array if * BigInteger is zero. */ public static byte[] bigIntegerToBytes(final BigInteger bigInteger) { byte[] bytes = bigInteger.toByteArray(); if (bytes[0] == 0) { return Arrays.copyOfRange(bytes, 1, bytes.length); } return bytes; } private final static boolean USE_XOR_SWAP = false; /** * https://stackoverflow.com/questions/12893758/how-to-reverse-the-byte-array-in-java */ public void reverse(byte @NonNull [] array) { if (USE_XOR_SWAP) { int len = array.length; for (int i = 0; i < len / 2; i++) { array[i] ^= array[len - i - 1]; array[len - i - 1] ^= array[i]; array[i] ^= array[len - i - 1]; } } else { int i = 0; int j = array.length - 1; byte tmp; while (j > i) { tmp = array[j]; array[j] = array[i]; array[i] = tmp; j--; i++; } } } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/ByteConversion.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; public class ByteConversion { public long mibToBytes(long mib) { return mib * 1_024L * 1_024L; } public double bytesToMib(long bytes) { return (double)bytes / (double)(1_024L * 1_024L); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/Consumer.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; public interface Consumer extends Interruptable { void consumeKeys(PublicKeyBytes[] publicKeyBytes) throws InterruptedException; void startConsumer(); } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/ConsumerJava.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.google.common.annotations.VisibleForTesting; import java.nio.ByteBuffer; import java.time.Duration; import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import java.util.regex.Matcher; import java.util.regex.Pattern; import net.ladenthin.bitcoinaddressfinder.configuration.CConsumerJava; import net.ladenthin.bitcoinaddressfinder.persistence.Persistence; import net.ladenthin.bitcoinaddressfinder.persistence.PersistenceUtils; import net.ladenthin.bitcoinaddressfinder.persistence.lmdb.LMDBPersistence; import org.apache.commons.codec.binary.Hex; import org.bitcoinj.crypto.ECKey; import org.bitcoinj.crypto.MnemonicException; import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class ConsumerJava implements Consumer { /** * We assume a queue might be empty after this amount of time. * If not, some keys in the queue are not checked before shutdow. */ @VisibleForTesting static Duration AWAIT_DURATION_QUEUE_EMPTY = Duration.ofMinutes(1); public static final String MISS_PREFIX = "miss: Could not find the address: "; public static final String HIT_PREFIX = "hit: Found the address: "; public static final String VANITY_HIT_PREFIX = "vanity pattern match: "; public static final String HIT_SAFE_PREFIX = "hit: safe log: "; private Logger logger = LoggerFactory.getLogger(this.getClass()); private final KeyUtility keyUtility; protected final AtomicLong checkedKeys = new AtomicLong(); protected final AtomicLong checkedKeysSumOfTimeToCheckContains = new AtomicLong(); protected final AtomicLong emptyConsumer = new AtomicLong(); protected final AtomicLong hits = new AtomicLong(); protected long startTime = 0; protected final CConsumerJava consumerJava; @VisibleForTesting ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(); protected @Nullable Persistence persistence; private final PersistenceUtils persistenceUtils; private final List> consumers = new ArrayList<>(); protected final LinkedBlockingQueue keysQueue; private final ByteBufferUtility byteBufferUtility = new ByteBufferUtility(true); protected final AtomicLong vanityHits = new AtomicLong(); private final @Nullable Pattern vanityPattern; @VisibleForTesting final AtomicBoolean shouldRun = new AtomicBoolean(true); @VisibleForTesting final ExecutorService consumeKeysExecutorService; protected ConsumerJava(CConsumerJava consumerJava, KeyUtility keyUtility, PersistenceUtils persistenceUtils) { this.consumerJava = consumerJava; this.keysQueue = new LinkedBlockingQueue<>(consumerJava.queueSize); this.keyUtility = keyUtility; this.persistenceUtils = persistenceUtils; if (consumerJava.enableVanity && consumerJava.vanityPattern != null) { this.vanityPattern = Pattern.compile(consumerJava.vanityPattern); } else { vanityPattern = null; } consumeKeysExecutorService = Executors.newFixedThreadPool(consumerJava.threads); } Logger getLogger() { return logger; } void setLogger(Logger logger) { this.logger = logger; } protected void initLMDB() { persistence = new LMDBPersistence(consumerJava.lmdbConfigurationReadOnly, persistenceUtils); persistence.init(); } protected void startStatisticsTimer() { long period = consumerJava.printStatisticsEveryNSeconds; if (period <= 0) { throw new IllegalArgumentException("period must be greater than 0."); } startTime = System.currentTimeMillis(); scheduledExecutorService.scheduleAtFixedRate(() -> { // get transient information long uptime = Math.max(System.currentTimeMillis() - startTime, 1); String message = new Statistics().createStatisticsMessage(uptime, checkedKeys.get(), checkedKeysSumOfTimeToCheckContains.get(), emptyConsumer.get(), keysQueue.size(), hits.get()); // log the information logger.info(message); }, period, period, TimeUnit.SECONDS); } @Override public void startConsumer() { logger.debug("Starting {} consumer threads...", consumerJava.threads); for (int i = 0; i < consumerJava.threads; i++) { consumers.add(consumeKeysExecutorService.submit( () -> { consumeKeysRunner(); return null; })); } logger.debug("Successfully started {} consumer threads.", consumers.size()); } /** * This method runs in multiple threads. */ private void consumeKeysRunner() { logger.info("start consumeKeysRunner"); final ByteBuffer threadLocalReuseableByteBuffer = ByteBuffer.allocateDirect(PublicKeyBytes.RIPEMD160_HASH_NUM_BYTES); while (shouldRun.get()) { if (keysQueue.size() >= consumerJava.queueSize) { logger.warn("Attention, queue is full. Please increase queue size."); } try { consumeKeys(threadLocalReuseableByteBuffer); // the consumeKeys method is looped inside, if the method returns it means the queue is empty emptyConsumer.incrementAndGet(); Thread.sleep(consumerJava.delayEmptyConsumer); } catch (InterruptedException e) { // we need to catch the exception to not break the thread logger.error("Ignore InterruptedException during Thread.sleep.", e); } catch (Exception e) { // log every Exception because it's hard to debug and we do not break down the thread loop logger.error("Error in consumeKeysRunner()." , e); } } byteBufferUtility.freeByteBuffer(threadLocalReuseableByteBuffer); logger.info("end consumeKeysRunner"); } void consumeKeys(ByteBuffer threadLocalReuseableByteBuffer) throws MnemonicException.MnemonicLengthException { logger.trace("consumeKeys"); PublicKeyBytes[] publicKeyBytesArray = keysQueue.poll(); while (publicKeyBytesArray != null) { for (PublicKeyBytes publicKeyBytes : publicKeyBytesArray) { if (publicKeyBytes.isOutsidePrivateKeyRange()) { continue; } byte[] hash160Uncompressed = publicKeyBytes.getUncompressedKeyHash(); boolean containsAddressUncompressed = containsAddress(threadLocalReuseableByteBuffer, hash160Uncompressed); byte[] hash160Compressed = publicKeyBytes.getCompressedKeyHash(); boolean containsAddressCompressed = containsAddress(threadLocalReuseableByteBuffer, hash160Compressed); if (consumerJava.runtimePublicKeyCalculationCheck) { publicKeyBytes.runtimePublicKeyCalculationCheck(logger); } if (containsAddressUncompressed) { // immediately log the secret safeLog(publicKeyBytes, hash160Uncompressed, hash160Compressed); hits.incrementAndGet(); ECKey ecKeyUncompressed = ECKey.fromPrivateAndPrecalculatedPublic(publicKeyBytes.getSecretKey().toByteArray(), publicKeyBytes.getUncompressed()); String hitMessageUncompressed = HIT_PREFIX + keyUtility.createKeyDetails(ecKeyUncompressed); logger.info(hitMessageUncompressed); } if (containsAddressCompressed) { // immediately log the secret safeLog(publicKeyBytes, hash160Uncompressed, hash160Compressed); hits.incrementAndGet(); ECKey ecKeyCompressed = ECKey.fromPrivateAndPrecalculatedPublic(publicKeyBytes.getSecretKey().toByteArray(), publicKeyBytes.getCompressed()); String hitMessageCompressed = HIT_PREFIX + keyUtility.createKeyDetails(ecKeyCompressed); logger.info(hitMessageCompressed); } if (consumerJava.enableVanity) { var localVanityPattern = Objects.requireNonNull(vanityPattern); String uncompressedKeyHashAsBase58 = publicKeyBytes.getUncompressedKeyHashAsBase58(keyUtility); Matcher uncompressedKeyHashAsBase58Matcher = localVanityPattern.matcher(uncompressedKeyHashAsBase58); if (uncompressedKeyHashAsBase58Matcher.matches()) { // immediately log the secret safeLog(publicKeyBytes, hash160Uncompressed, hash160Compressed); vanityHits.incrementAndGet(); ECKey ecKeyUncompressed = ECKey.fromPrivateAndPrecalculatedPublic(publicKeyBytes.getSecretKey().toByteArray(), publicKeyBytes.getUncompressed()); String vanityHitMessageUncompressed = VANITY_HIT_PREFIX + keyUtility.createKeyDetails(ecKeyUncompressed); logger.info(vanityHitMessageUncompressed); } String compressedKeyHashAsBase58 = publicKeyBytes.getCompressedKeyHashAsBase58(keyUtility); Matcher compressedKeyHashAsBase58Matcher = vanityPattern.matcher(compressedKeyHashAsBase58); if (compressedKeyHashAsBase58Matcher.matches()) { // immediately log the secret safeLog(publicKeyBytes, hash160Uncompressed, hash160Compressed); vanityHits.incrementAndGet(); ECKey ecKeyCompressed = ECKey.fromPrivateAndPrecalculatedPublic(publicKeyBytes.getSecretKey().toByteArray(), publicKeyBytes.getCompressed()); String vanityHitMessageCompressed = VANITY_HIT_PREFIX + keyUtility.createKeyDetails(ecKeyCompressed); logger.info(vanityHitMessageCompressed); } } if (!containsAddressUncompressed && !containsAddressCompressed) { if (logger.isTraceEnabled()) { ECKey ecKeyUncompressed = ECKey.fromPrivateAndPrecalculatedPublic(publicKeyBytes.getSecretKey().toByteArray(), publicKeyBytes.getUncompressed()); String missMessageUncompressed = MISS_PREFIX + keyUtility.createKeyDetails(ecKeyUncompressed); logger.trace(missMessageUncompressed); ECKey ecKeyCompressed = ECKey.fromPrivateAndPrecalculatedPublic(publicKeyBytes.getSecretKey().toByteArray(), publicKeyBytes.getCompressed()); String missMessageCompressed = MISS_PREFIX + keyUtility.createKeyDetails(ecKeyCompressed); logger.trace(missMessageCompressed); } } } publicKeyBytesArray = keysQueue.poll(); } } public boolean containsAddress(ByteBuffer threadLocalReuseableByteBuffer, byte[] hash160) { threadLocalReuseableByteBuffer.rewind(); threadLocalReuseableByteBuffer.put(hash160); threadLocalReuseableByteBuffer.flip(); return containsAddress(threadLocalReuseableByteBuffer); } /** * Logs key information in a safe and robust way to avoid losing critical data * in case of a runtime exception. *

* The primary goal of this method is to ensure that if a valid secret key (i.e., a hit) * is found, its corresponding BigInteger value is immediately logged. Since logging a * BigInteger is unlikely to fail, this is the first and most essential piece of information. *

* Logging additional details such as the uncompressed/compressed public keys and their * hash160 values may theoretically trigger runtime exceptions (e.g., due to malformed data * or encoding issues). To mitigate the risk of losing the crucial secret value in such rare * cases, it is logged first. *

* All logs are prefixed consistently with {@code HIT_SAFE_PREFIX} to make hits easily searchable. * * @param publicKeyBytes the public key bytes wrapper * @param hash160Uncompressed the hash160 of the uncompressed public key * @param hash160Compressed the hash160 of the compressed public key */ private void safeLog(PublicKeyBytes publicKeyBytes, byte[] hash160Uncompressed, byte[] hash160Compressed) { logger.info(HIT_SAFE_PREFIX +"publicKeyBytes.getSecretKey(): " + publicKeyBytes.getSecretKey()); logger.info(HIT_SAFE_PREFIX +"publicKeyBytes.getUncompressed(): " + Hex.encodeHexString(publicKeyBytes.getUncompressed())); logger.info(HIT_SAFE_PREFIX +"publicKeyBytes.getCompressed(): " + Hex.encodeHexString(publicKeyBytes.getCompressed())); logger.info(HIT_SAFE_PREFIX +"hash160Uncompressed: " + Hex.encodeHexString(hash160Uncompressed)); logger.info(HIT_SAFE_PREFIX +"hash160Compressed: " + Hex.encodeHexString(hash160Compressed)); } private boolean containsAddress(ByteBuffer hash160AsByteBuffer) { long timeBefore = System.currentTimeMillis(); if (logger.isTraceEnabled()) { logger.trace("Time before persistence.containsAddress: " + timeBefore); } Persistence localPersistence = Objects.requireNonNull(persistence); boolean containsAddress = localPersistence.containsAddress(hash160AsByteBuffer); long timeAfter = System.currentTimeMillis(); long timeDelta = timeAfter - timeBefore; checkedKeys.incrementAndGet(); checkedKeysSumOfTimeToCheckContains.addAndGet(timeDelta); if (logger.isTraceEnabled()) { logger.trace("Time after persistence.containsAddress: " + timeAfter); logger.trace("Time delta: " + timeDelta); } return containsAddress; } @Override public void consumeKeys(PublicKeyBytes[] publicKeyBytes) throws InterruptedException { if(logger.isDebugEnabled()){ logger.debug("keysQueue.put(publicKeyBytes) with length: " + publicKeyBytes.length); } keysQueue.put(publicKeyBytes); if(logger.isDebugEnabled()){ logger.debug("keysQueue.size(): " + keysQueue.size()); } } /** * Initiates a graceful shutdown of the consumer: *

    *
  • Stops internal execution by setting the control flag
  • *
  • Shuts down scheduled tasks and consumer thread pool
  • *
  • Waits for all consumer threads to finish within a defined timeout
  • *
  • Logs any unclean terminations
  • *
  • Closes LMDB persistence and releases resources
  • *
* * This method ensures a clean and deterministic shutdown without relying on thread interruption signals. */ @Override public void interrupt() { logger.info("Interrupt initiated: stopping consumer execution..."); shouldRun.set(false); scheduledExecutorService.shutdown(); consumeKeysExecutorService.shutdown(); logger.info("Waiting for termination of {} consumer threads (timeout: {} seconds)...", consumers.size(), AWAIT_DURATION_QUEUE_EMPTY.getSeconds()); try { boolean terminated = consumeKeysExecutorService.awaitTermination(AWAIT_DURATION_QUEUE_EMPTY.getSeconds(), TimeUnit.SECONDS); if (!terminated) { logger.warn("Timeout reached. Some consumer threads may not have terminated cleanly."); } } catch (InterruptedException e) { logger.error("Interrupted while awaiting consumer termination.", e); throw new RuntimeException(e); } try { if(persistence != null){ Persistence localPersistence = Objects.requireNonNull(persistence); localPersistence.close(); persistence = null; } } catch (Exception e) { throw new RuntimeException(e); } logger.debug("Interrupt complete: resources released and persistence closed."); } @VisibleForTesting int keysQueueSize() { return keysQueue.size(); } @Override public String toString() { return "ConsumerJava@" + Integer.toHexString(System.identityHashCode(this)); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/EndiannessConverter.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.nio.ByteOrder; /** * Utility class for converting byte arrays between different endianness formats. *

* The conversion is based on a {@code sourceOrder} and a {@code targetOrder}. * If they differ, the array is reversed. *

*/ public class EndiannessConverter { private final ByteOrder sourceOrder; private final ByteOrder targetOrder; private final ByteBufferUtility byteBufferUtility; /** * Creates a converter based on source and target byte orders. * * @param sourceOrder * The byte order of the input data. * @param targetOrder * The desired byte order after conversion. * @param byteBufferUtility * The {@link ByteBufferUtility} instance used for reversing byte arrays. */ EndiannessConverter(ByteOrder sourceOrder, ByteOrder targetOrder, ByteBufferUtility byteBufferUtility) { this.sourceOrder = sourceOrder; this.targetOrder = targetOrder; this.byteBufferUtility = byteBufferUtility; } /** * Converts the byte array if the source and target endianness differ. * The array may be modified in place. * * @param array The byte array to convert. */ public void convertEndian(byte[] array) { if (mustConvert()) { byteBufferUtility.reverse(array); } } /** * Checks if a byte order conversion is required. * * @return true if source and target orders differ, false otherwise */ public boolean mustConvert() { return sourceOrder != targetOrder; } public ByteOrder getSourceOrder() { return sourceOrder; } public ByteOrder getTargetOrder() { return targetOrder; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/FileHelper.java ================================================ // @formatter:off /** * Copyright 2021 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.io.File; import java.util.ArrayList; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class FileHelper { private final Logger logger = LoggerFactory.getLogger(FileHelper.class); public List stringsToFiles(List strings) { List files = new ArrayList<>(); for (String string : strings) { files.add(new File(string)); } return files; } public void assertFilesExists(List files) throws IllegalArgumentException { logger.info("Validating that all input files exist..."); for (File file : files) { if (!file.exists()) { throw new IllegalArgumentException("Missing file: " + file); } logger.debug("Found file: {}", file); } logger.info("All input files verified successfully."); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/Finder.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableMap; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.*; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import net.ladenthin.bitcoinaddressfinder.configuration.CConsumerJava; import net.ladenthin.bitcoinaddressfinder.configuration.CFinder; import net.ladenthin.bitcoinaddressfinder.configuration.CProducer; import net.ladenthin.bitcoinaddressfinder.persistence.PersistenceUtils; import org.bitcoinj.base.Network; import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.function.*; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducer; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducerIdIsNotUniqueException; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducerIdNullException; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducerIdUnknownException; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducerJavaBip39; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducerJavaIncremental; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducerJavaRandom; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducerJavaSocket; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducerJavaWebSocket; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducerJavaZmq; public class Finder implements Interruptable { /** * We must define a maximum time to wait for terminate. Wait for 100 thousand years is enough. */ @VisibleForTesting static Duration AWAIT_DURATION_TERMINATE = Duration.ofDays(365L * 1000L); protected Logger logger = LoggerFactory.getLogger(this.getClass()); private final CFinder finder; private final Map keyProducers = new HashMap<>(); @Nullable private ConsumerJava consumerJava; private final List openCLProducers = new ArrayList<>(); private final List javaProducers = new ArrayList<>(); private final List javaProducersSecretsFiles = new ArrayList<>(); @VisibleForTesting final ExecutorService producerExecutorService = Executors.newCachedThreadPool(); private final Network network = new NetworkParameterFactory().getNetwork(); private final KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); private final PersistenceUtils persistenceUtils = new PersistenceUtils(network); private final BitHelper bitHelper = new BitHelper(); public Finder(CFinder finder) { this.finder = finder; } public void startKeyProducer() { logger.info("startKeyProducer"); processKeyProducers( finder.keyProducerJavaRandom, cKeyProducerJavaRandom -> new KeyProducerJavaRandom(cKeyProducerJavaRandom, keyUtility, bitHelper, LoggerFactory.getLogger(KeyProducerJavaRandom.class)), cKeyProducerJavaRandom -> cKeyProducerJavaRandom.keyProducerId, keyProducers ); processKeyProducers( finder.keyProducerJavaBip39, cKeyProducerJavaBip39 -> new KeyProducerJavaBip39(cKeyProducerJavaBip39, keyUtility, bitHelper, LoggerFactory.getLogger(KeyProducerJavaBip39.class)), cKeyProducerJavaBip39 -> cKeyProducerJavaBip39.keyProducerId, keyProducers ); processKeyProducers( finder.keyProducerJavaIncremental, cKeyProducerJavaIncremental -> new KeyProducerJavaIncremental(cKeyProducerJavaIncremental, keyUtility, bitHelper, LoggerFactory.getLogger(KeyProducerJavaIncremental.class)), cKeyProducerJavaIncremental -> cKeyProducerJavaIncremental.keyProducerId, keyProducers ); processKeyProducers( finder.keyProducerJavaSocket, cKeyProducerJavaSocket -> new KeyProducerJavaSocket(cKeyProducerJavaSocket, keyUtility, bitHelper, LoggerFactory.getLogger(KeyProducerJavaSocket.class)), cKeyProducerJavaSocket -> cKeyProducerJavaSocket.keyProducerId, keyProducers ); processKeyProducers( finder.keyProducerJavaWebSocket, cKeyProducerJavaWebSocket -> new KeyProducerJavaWebSocket(cKeyProducerJavaWebSocket, keyUtility, bitHelper, LoggerFactory.getLogger(KeyProducerJavaWebSocket.class)), cKeyProducerJavaWebSocket -> cKeyProducerJavaWebSocket.keyProducerId, keyProducers ); processKeyProducers( finder.keyProducerJavaZmq, cKeyProducerJavaZmq -> new KeyProducerJavaZmq(cKeyProducerJavaZmq, keyUtility, bitHelper, LoggerFactory.getLogger(KeyProducerJavaZmq.class)), cKeyProducerJavaZmq -> cKeyProducerJavaZmq.keyProducerId, keyProducers ); } private void processKeyProducers( List configList, Function constructor, Function getId, Map keyProducers ) { if (configList != null) { for (T config : configList) { String keyProducerId = getId.apply(config); if (keyProducerId == null) { throw new KeyProducerIdNullException(); } if (keyProducers.containsKey(keyProducerId)) { throw new KeyProducerIdIsNotUniqueException(keyProducerId); } K keyProducer = constructor.apply(config); keyProducers.put(keyProducerId, keyProducer); } } } public void startConsumer() { logger.info("startConsumer"); CConsumerJava localCConsumerJava = Objects.requireNonNull(finder.consumerJava); consumerJava = new ConsumerJava(localCConsumerJava, keyUtility, persistenceUtils); consumerJava.initLMDB(); consumerJava.startConsumer(); consumerJava.startStatisticsTimer(); } public void configureProducer() { logger.info("configureProducer"); var localConsumerJava = Objects.requireNonNull(consumerJava); processProducers( finder.producerJava, bitHelper::assertBatchSizeInBitsIsInRange, this::getKeyProducer, (config, keyProducer) -> new ProducerJava(config, localConsumerJava, keyUtility, keyProducer, bitHelper), javaProducers ); processProducers( finder.producerJavaSecretsFiles, bitHelper::assertBatchSizeInBitsIsInRange, this::getKeyProducer, (config, keyProducer) -> new ProducerJavaSecretsFiles(config, localConsumerJava, keyUtility, keyProducer, bitHelper), javaProducersSecretsFiles ); processProducers( finder.producerOpenCL, bitHelper::assertBatchSizeInBitsIsInRange, this::getKeyProducer, (config, keyProducer) -> new ProducerOpenCL(config, localConsumerJava, keyUtility, keyProducer, bitHelper), openCLProducers ); } private void processProducers( List configs, java.util.function.Consumer batchSizeAssert, Function getKeyProducer, BiFunction producerConstructor, Collection

targetCollection ) { if (configs != null) { for (T config : configs) { batchSizeAssert.accept(config.batchSizeInBits); KeyProducer keyProducer = getKeyProducer.apply(config); P producer = producerConstructor.apply(config, keyProducer); targetCollection.add(producer); } } } public KeyProducer getKeyProducer(CProducer cProducer) throws RuntimeException { KeyProducer keyProducer = keyProducers.get(cProducer.keyProducerId); if(keyProducer == null) { throw new KeyProducerIdUnknownException(cProducer.keyProducerId); } return keyProducer; } public void initProducer() { logger.info("initProducer"); for (Producer producer : getAllProducers()) { producer.initProducer(); } } public void startProducer() { logger.info("startProducer"); for (Producer producer : getAllProducers()) { producerExecutorService.submit(producer); } } public void shutdownAndAwaitTermination() { logger.info("shutdownAndAwaitTermination"); try { producerExecutorService.shutdown(); producerExecutorService.awaitTermination(AWAIT_DURATION_TERMINATE.get(ChronoUnit.SECONDS), TimeUnit.SECONDS); } catch (InterruptedException e) { throw new RuntimeException(e); } // no producers are running anymore, the consumer can be interrupted if (consumerJava != null) { logger.info("Interrupt: " + consumerJava); consumerJava.interrupt(); consumerJava = null; } logger.info("consumerJava released."); } @Override public void interrupt() { logger.info("interrupt called: delegate interrupt to all keyProducers and producers"); // Interrupt all Producers for (Producer producer : getAllProducers()) { logger.info("Interrupt Producer: " + producer.toString()); producer.interrupt(); logger.info("waitTillProducerNotRunning ..."); producer.waitTillProducerNotRunning(); producer.releaseProducer(); } freeAllProducers(); // Interrupt all KeyProducers for (KeyProducer keyProducer : getKeyProducers().values()) { logger.info("Interrupt KeyProducer: " + keyProducer.toString()); keyProducer.interrupt(); } freeAllKeyProducers(); logger.info("All producers released and freed."); } public Map getKeyProducers() { return ImmutableMap.copyOf(keyProducers); } public List getAllProducers() { List producers = new ArrayList<>(); producers.addAll(javaProducers); producers.addAll(javaProducersSecretsFiles); producers.addAll(openCLProducers); return producers; } public void freeAllProducers() { javaProducers.clear(); javaProducersSecretsFiles.clear(); openCLProducers.clear(); } public void freeAllKeyProducers() { keyProducers.clear(); } public List getAllConsumers() { List consumers = new ArrayList<>(); if (consumerJava != null) { consumers.add(consumerJava); } return consumers; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/Interruptable.java ================================================ // @formatter:off /** * Copyright 2021 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; public interface Interruptable { void interrupt(); } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/KeyUtility.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import net.ladenthin.bitcoinaddressfinder.keyproducer.NoMoreSecretsAvailableException; import java.io.IOException; import java.math.BigInteger; import java.nio.ByteBuffer; import java.util.Arrays; import java.util.List; import java.util.Random; import static net.ladenthin.bitcoinaddressfinder.PublicKeyBytes.INVALID_PRIVATE_KEY_REPLACEMENT; import org.bitcoinj.base.LegacyAddress; import org.bitcoinj.base.Network; import org.bitcoinj.crypto.ECKey; import org.bitcoinj.crypto.MnemonicCode; import org.bitcoinj.crypto.MnemonicException; import org.bouncycastle.util.encoders.Hex; import org.jspecify.annotations.NonNull; /** * https://stackoverflow.com/questions/5399798/byte-array-and-int-conversion-in-java/11419863 * https://stackoverflow.com/questions/21087651/how-to-efficiently-change-endianess-of-byte-array-in-java * https://stackoverflow.com/questions/7619058/convert-a-byte-array-to-integer-in-java-and-vice-versa */ public record KeyUtility(@NonNull Network network, @NonNull ByteBufferUtility byteBufferUtility) { public BigInteger killBits(BigInteger bigInteger, BigInteger killBits) { return bigInteger.andNot(killBits); } /** * Require networkParameters. */ public ByteBuffer getHash160ByteBufferFromBase58String(String base58) { LegacyAddress address = LegacyAddress.fromBase58(base58, network); byte[] hash160 = address.getHash(); return byteBufferUtility.byteArrayToByteBuffer(hash160); } public String toBase58(byte[] hash160) { LegacyAddress address = LegacyAddress.fromPubKeyHash(network, hash160); return address.toBase58(); } public BigInteger createSecret(int maximumBitLength, Random random) { BigInteger secret = new BigInteger(maximumBitLength, random); return secret; } public ECKey createECKey(BigInteger bi, boolean compressed) { return ECKey.fromPrivate(bi, compressed); } public String createKeyDetails(ECKey key) throws MnemonicException.MnemonicLengthException { BigInteger privateKeyBigInteger = key.getPrivKey(); byte[] privateKeyBytes = key.getPrivKeyBytes(); String privateKeyHex = key.getPrivateKeyAsHex(); String privateKeyAsWiF = key.getPrivateKeyAsWiF(network); byte[] hash160 = key.getPubKeyHash(); String publicKeyHash160Hex = Hex.toHexString(hash160); String publicKeyHash160Base58 = toBase58(hash160); String logprivateKeyBigInteger = "privateKeyBigInteger: [" + privateKeyBigInteger + "]"; String logprivateKeyBytes = "privateKeyBytes: [" + Arrays.toString(privateKeyBytes) + "]"; String logprivateKeyHex = "privateKeyHex: [" + privateKeyHex + "]"; String logWiF = "WiF: [" + privateKeyAsWiF + "]"; String logPublicKeyAsHex = "publicKeyAsHex: [" + key.getPublicKeyAsHex() + "]"; String logPublicKeyHash160 = "publicKeyHash160Hex: [" + publicKeyHash160Hex + "]"; String logPublicKeyHash160Base58 = "publicKeyHash160Base58: [" + publicKeyHash160Base58 + "]"; String logCompressed = "Compressed: [" + key.isCompressed() + "]"; String logMnemonic = createMnemonics(privateKeyBytes); String space = " "; return logprivateKeyBigInteger + space + logprivateKeyBytes + space + logprivateKeyHex + space + logWiF + space + logPublicKeyAsHex + space + logPublicKeyHash160 + space + logPublicKeyHash160Base58 + space + logCompressed + space + logMnemonic; } public String createMnemonics(byte[] privateKeyBytes) { StringBuilder logMnemonic = new StringBuilder("Mnemonic:"); for (BIP39Wordlist wordList : BIP39Wordlist.values()) { try { MnemonicCode mnemonicCode = new MnemonicCode(wordList.getWordListStream(), null); List mnemonics = mnemonicCode.toMnemonic(privateKeyBytes); logMnemonic.append(" "); logMnemonic.append(wordList.name()); logMnemonic.append(": ["); boolean first = true; for (String mnemonic : mnemonics) { if (!first) { logMnemonic.append(wordList.getSeparator()); } logMnemonic.append(mnemonic); first = false; } logMnemonic.append("]"); } catch (IOException | IllegalArgumentException ex) { throw new RuntimeException(ex); } } return logMnemonic.toString(); } // public ByteBuffer addressToByteBuffer(LegacyAddress address) { ByteBuffer byteBuffer = byteBufferUtility.byteArrayToByteBuffer(address.getHash()); return byteBuffer; } /** * Require networkParameters. */ public LegacyAddress byteBufferToAddress(ByteBuffer byteBuffer) { return LegacyAddress.fromPubKeyHash(network, byteBufferUtility.byteBufferToBytes(byteBuffer)); } // public BigInteger[] createSecrets(int overallWorkSize, boolean returnStartSecretOnly, int privateKeyMaxNumBits, SecretSupplier supplier) throws NoMoreSecretsAvailableException { int length = returnStartSecretOnly ? 1 : overallWorkSize; BigInteger[] secrets = new BigInteger[length]; for (int i = 0; i < secrets.length; i++) { secrets[i] = supplier.nextSecret(privateKeyMaxNumBits); } return secrets; } @Deprecated static int byteArrayToInt(byte[] b) { return byteArrayToInt(b, 0); } @Deprecated static int byteArrayToInt(byte[] b, int offsetByteArray) { return b[3 + offsetByteArray] & 0xFF | (b[2 + offsetByteArray] & 0xFF) << 8 | (b[1 + offsetByteArray] & 0xFF) << 16 | (b[offsetByteArray] & 0xFF) << 24; } @Deprecated static void byteArrayToIntArray(byte[] b, int offsetByteArray, int[] i, int offsetIntArray) { i[offsetIntArray] = byteArrayToInt(b, offsetByteArray); } @Deprecated static byte[] intToByteArray(int a) { byte[] b = new byte[4]; intToByteArray(a, b, 0); return b; } @Deprecated static void intToByteArray(int a, byte[] b, int offset) { b[offset] = (byte) ((a >> 24) & 0xFF); b[1 + offset] = (byte) ((a >> 16) & 0xFF); b[2 + offset] = (byte) ((a >> 8) & 0xFF); b[3 + offset] = (byte) (a & 0xFF); } @Deprecated private static void swapIntBytes(byte[] bytes) { assert bytes.length % 4 == 0; for (int i = 0; i < bytes.length; i += 4) { // swap 0 and 3 byte tmp = bytes[i]; bytes[i] = bytes[i + 3]; bytes[i + 3] = tmp; // swap 1 and 2 byte tmp2 = bytes[i + 1]; bytes[i + 1] = bytes[i + 2]; bytes[i + 2] = tmp2; } } /** * Converts a BigInteger to a fixed-length 64-character (32-byte) lowercase * hex string. Preserves leading zeros, which are otherwise dropped by * BigInteger.toByteArray(). * * @param value The BigInteger to convert. * @return A 64-character hex string representing the value as a 256-bit * number. */ public String bigIntegerToFixedLengthHex(BigInteger value) { byte[] raw = value.toByteArray(); byte[] result = new byte[PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES]; int srcPos = Math.max(0, raw.length - result.length); int length = Math.min(result.length, raw.length); System.arraycopy(raw, srcPos, result, result.length - length, length); return Hex.toHexString(result); } /** * Converts a 32-byte array into a positive BigInteger, preserving leading * zeros. The array must be exactly * {@link PublicKeyBytes#PRIVATE_KEY_MAX_NUM_BYTES} bytes. * * @param buffer a 32-byte array representing the unsigned big-endian * integer * @return a positive BigInteger constructed from the buffer */ public BigInteger bigIntegerFromUnsignedByteArray(byte[] buffer) { if (buffer.length != PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES) { throw new IllegalArgumentException("Expected buffer of length " + PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES); } return new BigInteger(1, buffer); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/LMDBToAddressFile.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import net.ladenthin.bitcoinaddressfinder.persistence.PersistenceUtils; import net.ladenthin.bitcoinaddressfinder.persistence.lmdb.LMDBPersistence; import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; import java.util.concurrent.atomic.AtomicBoolean; import net.ladenthin.bitcoinaddressfinder.configuration.CLMDBToAddressFile; import org.bitcoinj.base.Network; public class LMDBToAddressFile implements Runnable, Interruptable { private final Logger logger = LoggerFactory.getLogger(LMDBToAddressFile.class); private final Network network = new NetworkParameterFactory().getNetwork(); private final CLMDBToAddressFile lmdbToAddressFile; private final AtomicBoolean shouldRun = new AtomicBoolean(true); public LMDBToAddressFile(CLMDBToAddressFile lmdbToAddressFile) { this.lmdbToAddressFile = lmdbToAddressFile; } @Override public void run() { PersistenceUtils persistenceUtils = new PersistenceUtils(network); try (LMDBPersistence persistence = new LMDBPersistence(lmdbToAddressFile.lmdbConfigurationReadOnly, persistenceUtils)) { persistence.init(); logger.info("writeAllAmounts ..."); File addressesFile = new File(lmdbToAddressFile.addressesFile); // delete before write all addresses boolean deleted = addressesFile.delete(); if(deleted) { logger.info("deleted existing address file " + addressesFile); } persistence.writeAllAmountsToAddressFile(addressesFile, lmdbToAddressFile.addressFileOutputFormat, shouldRun); logger.info("writeAllAmounts done"); } catch (IOException e) { throw new RuntimeException(e); } } @Override public void interrupt() { shouldRun.set(false); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/NetworkParameterFactory.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import org.bitcoinj.base.Network; import org.bitcoinj.core.NetworkParameters; import org.bitcoinj.params.MainNetParams; public class NetworkParameterFactory { public Network getNetwork() { return getNetworkParameters().network(); } private NetworkParameters getNetworkParameters() { NetworkParameters networkParameters = MainNetParams.get(); return networkParameters; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/OpenCLContext.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.google.common.annotations.VisibleForTesting; import com.google.common.io.Resources; import java.io.IOException; import java.math.BigInteger; import java.net.URL; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import java.util.Objects; import net.ladenthin.bitcoinaddressfinder.configuration.CProducerOpenCL; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLBuilder; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLDevice; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLDeviceSelection; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLPlatform; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLPlatformSelector; import static org.jocl.CL.clBuildProgram; import static org.jocl.CL.clCreateCommandQueueWithProperties; import static org.jocl.CL.clCreateContext; import static org.jocl.CL.clCreateKernel; import static org.jocl.CL.clCreateProgramWithSource; import static org.jocl.CL.clReleaseCommandQueue; import static org.jocl.CL.clReleaseContext; import org.jocl.cl_command_queue; import org.jocl.cl_context; import org.jocl.cl_context_properties; import org.jocl.cl_device_id; import org.jocl.cl_kernel; import org.jocl.cl_program; import org.jocl.cl_queue_properties; import org.jocl.CL; import static org.jocl.CL.clReleaseKernel; import static org.jocl.CL.clReleaseProgram; import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class OpenCLContext implements ReleaseCLObject { private final Logger logger; public String[] getOpenCLPrograms() throws IOException { List resourceNamesContent = getResourceNamesContent(getResourceNames()); List resourceNamesContentWithReplacements = new ArrayList<>(); for (String content : resourceNamesContent) { String contentWithReplacements = content; contentWithReplacements = contentWithReplacements.replaceAll("#include.*", ""); resourceNamesContentWithReplacements.add(contentWithReplacements); } String[] openClPrograms = resourceNamesContentWithReplacements.toArray(new String[0]); return openClPrograms; } private List getResourceNames() { List resourceNames = new ArrayList<>(); resourceNames.add("inc_defines.h"); resourceNames.add("copyfromhashcat/inc_vendor.h"); resourceNames.add("copyfromhashcat/inc_types.h"); resourceNames.add("copyfromhashcat/inc_platform.h"); resourceNames.add("copyfromhashcat/inc_platform.cl"); resourceNames.add("copyfromhashcat/inc_common.h"); resourceNames.add("copyfromhashcat/inc_common.cl"); resourceNames.add("copyfromhashcat/inc_hash_sha256.h"); resourceNames.add("copyfromhashcat/inc_hash_sha256.cl"); resourceNames.add("copyfromhashcat/inc_hash_ripemd160.h"); resourceNames.add("copyfromhashcat/inc_hash_ripemd160.cl"); resourceNames.add("copyfromhashcat/inc_ecc_secp256k1.h"); resourceNames.add("copyfromhashcat/inc_ecc_secp256k1.cl"); resourceNames.add("inc_ecc_secp256k1custom.cl"); return resourceNames; } private final static String KERNEL_NAME = "generateKeysKernel_grid"; private final static boolean EXCEPTIONS_ENABLED = true; private final CProducerOpenCL producerOpenCL; private final BitHelper bitHelper; private @Nullable OpenCLDevice device; private @Nullable cl_context context; private @Nullable cl_command_queue commandQueue; private @Nullable cl_program program; private @Nullable cl_kernel kernel; private @Nullable OpenClTask openClTask; private final ByteBufferUtility byteBufferUtility = new ByteBufferUtility(true); private boolean closed = false; public OpenCLContext(CProducerOpenCL producerOpenCL, BitHelper bitHelper) { this(producerOpenCL, bitHelper, LoggerFactory.getLogger(OpenCLContext.class)); } @VisibleForTesting OpenCLContext(CProducerOpenCL producerOpenCL, BitHelper bitHelper, Logger logger) { this.producerOpenCL = producerOpenCL; this.bitHelper = bitHelper; this.logger = logger; } public void init() throws IOException { // #################### general #################### // Enable exceptions and subsequently omit error checks in this sample CL.setExceptionsEnabled(EXCEPTIONS_ENABLED); List platforms = new OpenCLBuilder().build(); OpenCLPlatformSelector platformSelector = new OpenCLPlatformSelector(); OpenCLDeviceSelection selection = platformSelector.select( platforms, producerOpenCL.platformIndex, producerOpenCL.deviceType, producerOpenCL.deviceIndex ); device = selection.device(); logger.info("Selected OpenCL device:\n{}", device.toStringPretty()); cl_context_properties contextProperties = selection.contextProperties(); cl_device_id[] cl_device_ids = new cl_device_id[]{device.device()}; // Create a context for the selected device context = clCreateContext(contextProperties, 1, cl_device_ids, null, null, null); // Create a command-queue for the selected device cl_queue_properties properties = new cl_queue_properties(); commandQueue = clCreateCommandQueueWithProperties(context, device.device(), properties, null); // #################### kernel specifix #################### String[] openCLPrograms = getOpenCLPrograms(); // Create the program from the source code program = clCreateProgramWithSource(context, openCLPrograms.length, openCLPrograms, null, null); // Build the program clBuildProgram(program, 0, null, null, null, null); // Create the kernel kernel = clCreateKernel(program, KERNEL_NAME, null); openClTask = new OpenClTask(context, producerOpenCL, bitHelper, byteBufferUtility); } @Nullable OpenClTask getOpenClTask() { return openClTask; } @Override public boolean isClosed() { return closed; } @Override public void close() { device = null; if (!closed) { if (openClTask != null) { openClTask = null; } if (kernel != null) { clReleaseKernel(kernel); kernel = null; } if (program != null) { clReleaseProgram(program); program = null; } if (commandQueue != null) { clReleaseCommandQueue(commandQueue); commandQueue = null; } if (context != null) { clReleaseContext(context); context = null; } closed = true; } } public OpenCLGridResult createKeys(BigInteger privateKeyBase) { OpenClTask localOpenClTask = Objects.requireNonNull(openClTask); cl_kernel localKernel = Objects.requireNonNull(kernel); cl_command_queue localCommandQueue = Objects.requireNonNull(commandQueue); localOpenClTask.setSrcPrivateKeyChunk(privateKeyBase); ByteBuffer dstByteBuffer = localOpenClTask.executeKernel(localKernel, localCommandQueue); OpenCLGridResult openCLGridResult = new OpenCLGridResult(privateKeyBase, producerOpenCL.getOverallWorkSize(bitHelper), dstByteBuffer); return openCLGridResult; } private static List getResourceNamesContent(List resourceNames) throws IOException { List contents = new ArrayList<>(); for (String resourceName : resourceNames) { URL url = Resources.getResource(resourceName); String content = Resources.toString(url, StandardCharsets.UTF_8); contents.add(content); } return contents; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/OpenCLGridResult.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.util.Arrays; import java.math.BigInteger; import java.nio.ByteBuffer; import net.ladenthin.bitcoinaddressfinder.configuration.CConsumerJava; public class OpenCLGridResult { /** * Enable additional validation to check if generated uncompressed keys are not all zero. *

* This should remain disabled in production to avoid unnecessary performance overhead. * Useful only during debugging or when validating OpenCL/GPU kernel correctness. *

*

* Superseded by {@link PublicKeyBytes#runtimePublicKeyCalculationCheck(org.slf4j.Logger)} * and its activation via {@link CConsumerJava#runtimePublicKeyCalculationCheck}. *

*/ private static final boolean ENABLE_UNCOMPRESSED_KEY_VALIDATION = false; private final BigInteger secretKeyBase; private final int workSize; private final ByteBuffer result; OpenCLGridResult(BigInteger secretKeyBase, int workSize, ByteBuffer result) { this.secretKeyBase = secretKeyBase; this.workSize = workSize; this.result = result; } public BigInteger getSecretKeyBase() { return secretKeyBase; } public int getWorkSize() { return workSize; } public ByteBuffer getResult() { return result; } /** * Reads the computed public keys from the OpenCL result buffer and converts them into the correct format. *

* OpenCL writes 32-bit integers (u32) into memory using the device's native endianness (typically Little-Endian). * However, Bitcoin/ECC standards expect public keys in Big-Endian (MSB-first) byte order. *

* Therefore, after reading X and Y coordinates for each public key, the bytes of each coordinate * must be reversed if the device endianness differs from the target Big-Endian format. *

* The resulting format matches the uncompressed SEC (Standards for Efficient Cryptography) format: *

    *
  • Prefix byte 0x04
  • *
  • Followed by 32 bytes for X coordinate (Big-Endian)
  • *
  • Followed by 32 bytes for Y coordinate (Big-Endian)
  • *
*

* Note: This operation is relatively time-consuming because it involves memory copying and per-key byte order correction. * * @return an array of {@link PublicKeyBytes} containing the reconstructed public keys. */ public PublicKeyBytes[] getPublicKeyBytes() { ByteBuffer readOnlyResult = result.asReadOnlyBuffer(); PublicKeyBytes[] publicKeys = new PublicKeyBytes[workSize]; for (int i = 0; i < workSize; i++) { PublicKeyBytes publicKeyBytes = getPublicKeyFromByteBufferXY(readOnlyResult, i, secretKeyBase); publicKeys[i] = publicKeyBytes; } return publicKeys; } public static byte[] trimU32PrefixBytes(byte[] fullArray) { final int PREFIX_BYTES_TO_SKIP = 3; return Arrays.copyOfRange(fullArray, PREFIX_BYTES_TO_SKIP, fullArray.length); } /** * Reconstructs a {@link PublicKeyBytes} object from the OpenCL kernel output. *

* This method extracts a block of bytes for one key from the given {@link ByteBuffer}, * based on the work-item index ({@code keyNumber}). The layout of each chunk is defined * by constants in {@link PublicKeyBytes}: *

    *
  • {@code CHUNK_SIZE_00_NUM_BYTES_BIG_ENDIAN_X}: X coordinate (Big-Endian)
  • *
  • {@code CHUNK_SIZE_01_NUM_BYTES_BIG_ENDIAN_Y}: Y coordinate (Big-Endian)
  • *
  • {@code CHUNK_SIZE_10_NUM_BYTES_RIPEMD160_UNCOMPRESSED}: RIPEMD-160 hash of the uncompressed key
  • *
  • {@code CHUNK_SIZE_11_NUM_BYTES_RIPEMD160_COMPRESSED}: RIPEMD-160 hash of the compressed key
  • *
*

* The method reads and assembles the uncompressed public key in SEC format * ({@code 04 || X || Y}) using the provided X and Y coordinates. It also * extracts the precomputed RIPEMD-160 hashes for both uncompressed and * compressed formats from the buffer. *

* If the reconstructed secret key is zero, a predefined fallback key is returned. * * @param resultBuffer the buffer containing OpenCL results for all keys * @param keyNumber the zero-based index of the key to extract * @param secretKeyBase the base secret key used to derive the current key * @return the reconstructed {@link PublicKeyBytes} object * @throws RuntimeException if the key bytes are invalid (e.g. all coordinate bytes are zero) */ private static final PublicKeyBytes getPublicKeyFromByteBufferXY(ByteBuffer resultBuffer, int keyNumber, BigInteger secretKeyBase) { BigInteger secret = AbstractProducer.calculateSecretKey(secretKeyBase, keyNumber); if(BigInteger.ZERO.equals(secret)) { // the calculated key is invalid, return a fallback return PublicKeyBytes.INVALID_KEY_ONE; } final int keyOffsetInByteBuffer = PublicKeyBytes.CHUNK_SIZE_NUM_BYTES * keyNumber; // Get X byte[] xFromBigEndian = new byte[PublicKeyBytes.CHUNK_SIZE_00_NUM_BYTES_BIG_ENDIAN_X]; resultBuffer.get(keyOffsetInByteBuffer + PublicKeyBytes.CHUNK_OFFSET_00_NUM_BYTES_BIG_ENDIAN_X, xFromBigEndian, 0, xFromBigEndian.length); // Get Y byte[] yFromBigEndian = new byte[PublicKeyBytes.CHUNK_SIZE_01_NUM_BYTES_BIG_ENDIAN_Y]; resultBuffer.get(keyOffsetInByteBuffer + PublicKeyBytes.CHUNK_OFFSET_01_NUM_BYTES_BIG_ENDIAN_Y, yFromBigEndian, 0, yFromBigEndian.length); // Assemble uncompressed key byte[] uncompressedFromBigEndian = PublicKeyBytes.assembleUncompressedPublicKey(xFromBigEndian, yFromBigEndian); // Get RIPEMD160 for uncompressed key byte[] ripemd160Uncompressed = new byte[PublicKeyBytes.CHUNK_SIZE_10_NUM_BYTES_RIPEMD160_UNCOMPRESSED]; resultBuffer.get(keyOffsetInByteBuffer + PublicKeyBytes.CHUNK_OFFSET_10_NUM_BYTES_RIPEMD160_UNCOMPRESSED, ripemd160Uncompressed, 0, ripemd160Uncompressed.length); // Get RIPEMD160 for uncompressed key byte[] ripemd160Compressed = new byte[PublicKeyBytes.CHUNK_SIZE_11_NUM_BYTES_RIPEMD160_COMPRESSED]; resultBuffer.get(keyOffsetInByteBuffer + PublicKeyBytes.CHUNK_OFFSET_11_NUM_BYTES_RIPEMD160_COMPRESSED, ripemd160Compressed, 0, ripemd160Compressed.length); if (ENABLE_UNCOMPRESSED_KEY_VALIDATION) { boolean allZero = PublicKeyBytes.isAllCoordinateBytesZero(uncompressedFromBigEndian); if (allZero) { throw new RuntimeException("Invalid GPU result: all coordinate bytes are zero in uncompressed public key."); } } PublicKeyBytes publicKeyBytes = new PublicKeyBytes(secret, uncompressedFromBigEndian, ripemd160Uncompressed, ripemd160Compressed); return publicKeyBytes; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/OpenClTask.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.google.common.annotations.VisibleForTesting; import java.math.BigInteger; import java.nio.ByteBuffer; import java.nio.ByteOrder; import net.ladenthin.bitcoinaddressfinder.configuration.CProducer; import net.ladenthin.bitcoinaddressfinder.configuration.CProducerOpenCL; import static org.jocl.CL.CL_MEM_READ_ONLY; import static org.jocl.CL.CL_MEM_USE_HOST_PTR; import static org.jocl.CL.CL_MEM_WRITE_ONLY; import static org.jocl.CL.CL_TRUE; import static org.jocl.CL.clCreateBuffer; import static org.jocl.CL.clEnqueueNDRangeKernel; import static org.jocl.CL.clEnqueueReadBuffer; import static org.jocl.CL.clEnqueueWriteBuffer; import static org.jocl.CL.clFinish; import static org.jocl.CL.clReleaseMemObject; import static org.jocl.CL.clSetKernelArg; import org.jocl.Pointer; import org.jocl.Sizeof; import org.jocl.cl_command_queue; import org.jocl.cl_context; import org.jocl.cl_kernel; import org.jocl.cl_mem; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class OpenClTask implements ReleaseCLObject { protected Logger logger = LoggerFactory.getLogger(this.getClass()); private final static int PRIVATE_KEY_SOURCE_SIZE_IN_BYTES = PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES; private final CProducerOpenCL cProducer; private final cl_context context; private final SourceArgument privateKeySourceArgument; private final BitHelper bitHelper; private final ByteBufferUtility byteBufferUtility; private final BigInteger maxPrivateKeyForBatchSize; private final PrivateKeyValidator privateKeyValidator; private boolean closed = false; public abstract static class CLByteBufferPointerArgument implements ReleaseCLObject { /** * Controls how memory is allocated for the OpenCL output buffer. * * If set to {@link org.jocl.CL#CL_MEM_USE_HOST_PTR}, the OpenCL buffer is created using a host pointer, * meaning the host's {@link ByteBuffer} is directly used by the device (zero-copy if supported). * This may reduce memory copy overhead on some platforms, but: *

    *
  • It requires the buffer to remain valid and pinned in memory.
  • *
  • On some OpenCL implementations or devices (e.g. discrete GPUs), it may cause slower access due to lack of true zero-copy support.
  • *
  • Debugging and compatibility issues can arise if host memory alignment or page-locking requirements aren't met.
  • *
* * If set to {@link org.jocl.CL#CL_MEM_WRITE_ONLY}, the buffer is created with no reference to host memory, * and OpenCL manages the memory internally. This is typically safer and potentially faster on discrete GPUs, * although it requires an explicit copy back to the host after kernel execution. * * In most cases, {@link org.jocl.CL#CL_MEM_WRITE_ONLY} (i.e. setting this flag to {@code false}) is more robust and portable. */ protected static final boolean USE_HOST_PTR = false; protected final ByteBuffer byteBuffer; protected final Pointer hostMemoryPointer; protected final cl_mem mem; protected final Pointer clMemPointer; private boolean closed = false; public CLByteBufferPointerArgument(ByteBuffer byteBuffer, Pointer hostMemoryPointer, cl_mem mem, Pointer clMemPointer) { this.byteBuffer = byteBuffer; this.hostMemoryPointer = hostMemoryPointer; this.mem = mem; this.clMemPointer = clMemPointer; } public ByteBuffer getByteBuffer() { return byteBuffer; } /** Used for reading/writing data to the host via clEnqueueRead/WriteBuffer. */ public Pointer getHostMemoryPointer() { return hostMemoryPointer; } /** Used to pass the buffer to the kernel via clSetKernelArg. */ public Pointer getClMemPointer() { return clMemPointer; } public cl_mem getMem() { return mem; } @Override public boolean isClosed() { return closed; } @Override public void close() { if (!closed) { clReleaseMemObject(mem); closed = true; } } } public static class DestinationArgument extends CLByteBufferPointerArgument { private DestinationArgument(ByteBuffer byteBuffer, Pointer hostMemoryPointer, cl_mem mem, Pointer clMemPointer) { super(byteBuffer, hostMemoryPointer, mem, clMemPointer); } public static DestinationArgument create(cl_context context, long sizeInBytes) { final ByteBuffer byteBuffer = ByteBuffer.allocateDirect(ByteBufferUtility.ensureByteBufferCapacityFitsInt(sizeInBytes)); final Pointer hostMemoryPointer = Pointer.to(byteBuffer); final cl_mem mem; if (USE_HOST_PTR) { mem = clCreateBuffer(context, CL_MEM_USE_HOST_PTR, sizeInBytes, hostMemoryPointer, null); } else { mem = clCreateBuffer(context, CL_MEM_WRITE_ONLY, sizeInBytes, null, null); } final Pointer clMemPointer = Pointer.to(mem); return new DestinationArgument(byteBuffer, hostMemoryPointer, mem, clMemPointer); } } public static class SourceArgument extends CLByteBufferPointerArgument { private SourceArgument(ByteBuffer byteBuffer, Pointer hostMemoryPointer, cl_mem mem, Pointer clMemPointer) { super(byteBuffer, hostMemoryPointer, mem, clMemPointer); } public static SourceArgument create(cl_context context, long sizeInBytes) { final ByteBuffer byteBuffer = ByteBuffer.allocateDirect(ByteBufferUtility.ensureByteBufferCapacityFitsInt(sizeInBytes)); final Pointer hostMemoryPointer = Pointer.to(byteBuffer); final cl_mem mem = clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR, sizeInBytes, hostMemoryPointer, null); final Pointer clMemPointer = Pointer.to(mem); return new SourceArgument(byteBuffer, hostMemoryPointer, mem, clMemPointer); } } // Only available after init public OpenClTask(cl_context context, CProducerOpenCL cProducer, BitHelper bitHelper, ByteBufferUtility byteBufferUtility) { this.context = context; this.cProducer = cProducer; this.bitHelper = bitHelper; this.byteBufferUtility = byteBufferUtility; this.privateKeyValidator = new PrivateKeyValidator(); this.maxPrivateKeyForBatchSize = privateKeyValidator.getMaxPrivateKeyForBatchSize(cProducer.batchSizeInBits); this.privateKeySourceArgument = SourceArgument.create(context, PRIVATE_KEY_SOURCE_SIZE_IN_BYTES); } public long getDstSizeInBytes() { return (long) PublicKeyBytes.CHUNK_SIZE_NUM_BYTES * cProducer.getOverallWorkSize(bitHelper); } /** * Writes the base private key to the source buffer in the format expected by the OpenCL kernel. *

* The method ensures that the provided private key is valid for the current batch size. If it exceeds * the allowed range, a {@link PrivateKeyTooLargeException} is thrown. *

* Internally, the private key is first converted to a byte array in Big-Endian format (as returned * by {@link BigInteger#toByteArray()}). Because the OpenCL kernel expects the private key as a * {@code __global const u32 *k} array in Little-Endian word order, the byte array * is then converted from Big-Endian to Little-Endian before being written to the OpenCL input buffer. *

* This matches the behavior of the OpenCL kernel {@code generateKeysKernel_grid}, which reads the key * using {@code copy_u32_array(k_littleEndian_local, k, ...)} assuming Little-Endian input and applies * the work-item ID to the least-significant word. * * @param privateKeyBase the base private key used as input to the OpenCL kernel * @throws PrivateKeyTooLargeException if the key is too large for the current batch size */ public void setSrcPrivateKeyChunk(BigInteger privateKeyBase) { if (privateKeyValidator.isInvalidWithBatchSize(privateKeyBase, maxPrivateKeyForBatchSize)) { throw new PrivateKeyTooLargeException(privateKeyBase, maxPrivateKeyForBatchSize, cProducer.batchSizeInBits); } // BigInteger.toByteArray() always returns a big-endian (MSB-first) representation, // meaning the most significant byte (MSB) comes first. // Therefore, the source format is always Big Endian. final byte[] byteArray = ByteBufferUtility.bigIntegerToBytes(privateKeyBase); EndiannessConverter endiannessConverter = new EndiannessConverter(ByteOrder.BIG_ENDIAN, ByteOrder.LITTLE_ENDIAN, byteBufferUtility); endiannessConverter.convertEndian(byteArray); ByteBufferUtility.putToByteBuffer(privateKeySourceArgument.getByteBuffer(), byteArray); } @VisibleForTesting public SourceArgument getPrivateKeySourceArgument() { return privateKeySourceArgument; } public ByteBuffer executeKernel(cl_kernel kernel, cl_command_queue commandQueue) { final long dstSizeInBytes = getDstSizeInBytes(); // Allocate a new destination buffer so that cloning after kernel execution is unnecessary try (final DestinationArgument destinationArgument = DestinationArgument.create(context, dstSizeInBytes) ) { // Set the work-item dimensions final long totalResultCount = bitHelper.convertBitsToSize(cProducer.batchSizeInBits); final int loopCount = cProducer.loopCount; final long adjustedWorkSize = totalResultCount / loopCount; // Validate loopCount constraints if (loopCount < 1) { throw new IllegalArgumentException("loopCount must be >= 1."); } if (loopCount > totalResultCount) { throw new IllegalArgumentException("loopCount must not exceed total result count. Given: " + loopCount + ", max: " + totalResultCount); } if (totalResultCount % loopCount != 0) { throw new IllegalArgumentException("batchSizeInBits is not divisible by loopCount; result count would be invalid."); } final long[] global_work_size = new long[]{adjustedWorkSize}; final long[] localWorkSize = null; // new long[]{1}; // enabling the system to choose the work-group size. final int workDim = 1; // Set the arguments for the kernel clSetKernelArg(kernel, 0, Sizeof.cl_mem, destinationArgument.getClMemPointer()); clSetKernelArg(kernel, 1, Sizeof.cl_mem, privateKeySourceArgument.getClMemPointer()); clSetKernelArg(kernel, 2, Sizeof.cl_uint, Pointer.to(new int[] { loopCount })); { // write src buffer clEnqueueWriteBuffer(commandQueue, privateKeySourceArgument.getMem(), CL_TRUE, 0, PRIVATE_KEY_SOURCE_SIZE_IN_BYTES, privateKeySourceArgument.getHostMemoryPointer(), 0, null, null ); clFinish(commandQueue); } { // execute the kernel final long beforeExecute = System.currentTimeMillis(); clEnqueueNDRangeKernel( commandQueue, kernel, workDim, null, global_work_size, localWorkSize, 0, null, null ); clFinish(commandQueue); final long afterExecute = System.currentTimeMillis(); if (logger.isTraceEnabled()) { logger.trace("Executed OpenCL kernel in " + (afterExecute - beforeExecute) + "ms"); } } { // read the dst buffer final long beforeRead = System.currentTimeMillis(); clEnqueueReadBuffer(commandQueue, destinationArgument.getMem(), CL_TRUE, 0, dstSizeInBytes, destinationArgument.getHostMemoryPointer(), 0, null, null ); clFinish(commandQueue); destinationArgument.close(); final long afterRead = System.currentTimeMillis(); if (logger.isTraceEnabled()) { logger.trace("Read OpenCL data "+((dstSizeInBytes / 1024) / 1024) + "Mb in " + (afterRead - beforeRead) + "ms"); } } return destinationArgument.getByteBuffer(); } } @Override public boolean isClosed() { return closed; } @Override public void close() { if(!closed) { privateKeySourceArgument.close(); closed = true; // hint: destinationArgument will be released immediately } } /** * https://stackoverflow.com/questions/3366925/deep-copy-duplicate-of-javas-bytebuffer/4074089 */ private static ByteBuffer cloneByteBuffer(final ByteBuffer original) { // Create clone with same capacity as original. final ByteBuffer clone = (original.isDirect()) ? ByteBuffer.allocateDirect(original.capacity()) : ByteBuffer.allocate(original.capacity()); // Create a read-only copy of the original. // This allows reading from the original without modifying it. final ByteBuffer readOnlyCopy = original.asReadOnlyBuffer(); // Flip and read from the original. readOnlyCopy.flip(); clone.put(readOnlyCopy); return clone; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/PrivateKeyTooLargeException.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.math.BigInteger; /** * Exception thrown when a given private key exceeds the safe upper bound * for use in grid-based key chunking (incrementing the base key). *

* The maximum allowed private key is {@link PublicKeyBytes#MAX_PRIVATE_KEY}. * This exception is typically thrown if the base key plus the chunk range (2^bits) exceeds this bound. */ public class PrivateKeyTooLargeException extends IllegalArgumentException { private final BigInteger providedKey; private final BigInteger maxAllowedKey; private final int batchSizeInBits; public PrivateKeyTooLargeException(BigInteger providedKey, BigInteger maxAllowedKey, int batchSizeInBits) { super(buildMessage(providedKey, maxAllowedKey, batchSizeInBits)); this.providedKey = providedKey; this.maxAllowedKey = maxAllowedKey; this.batchSizeInBits = batchSizeInBits; } private static String buildMessage(BigInteger providedKey, BigInteger maxAllowedKey, int batchSizeInBits) { return "Private key exceeds maximum allowed range for chunked grid mode: " + "\nProvided key: 0x" + providedKey.toString(16) + "\nMaximum allowed key: 0x" + maxAllowedKey.toString(16) + "\n(batchSizeInBits = " + batchSizeInBits + ")" + "\nThe maximum private key is defined in: PublicKeyBytes.MAX_PRIVATE_KEY"; } public BigInteger getProvidedKey() { return providedKey; } public BigInteger getMaxAllowedKey() { return maxAllowedKey; } public int getBatchSizeInBits() { return batchSizeInBits; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/PrivateKeyValidator.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.math.BigInteger; import org.jspecify.annotations.NonNull; /** * Validates and manipulates private keys according to secp256k1 constraints. *

* This helper class encapsulates logic for checking if private keys fall within * valid ranges, and for correcting invalid keys to a known replacement value. * It is particularly useful for grid-based key generation where batch sizes must * be carefully bounded to avoid exceeding the secp256k1 private key limit. */ public class PrivateKeyValidator { /** * Calculates the maximum allowed private key value that can safely be used as a base * for grid-based key generation without exceeding the secp256k1 private key limit. *

* This is necessary for chunked or grid-based generation where the base key is incremented * by up to 2^batchSizeInBits - 1. * * @param batchSizeInBits The number of bits used for batch size (i.e., the number of keys generated in one grid chunk). * Must be in the range [0, {@link PublicKeyBytes#PRIVATE_KEY_MAX_NUM_BITS}]. * @return The maximum base private key that will not overflow when incremented by the grid. * @throws IllegalArgumentException if batchSizeInBits is outside the valid range * @throws IllegalStateException if batchSizeInBits is too large and no valid keys remain */ public BigInteger getMaxPrivateKeyForBatchSize(int batchSizeInBits) { if (batchSizeInBits < 0 || batchSizeInBits > PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS) { throw new IllegalArgumentException("batchSizeInBits must be between 0 and " + PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS); } // 2^batchSizeInBits represents the maximum offset (grid size) BigInteger maxOffset = BigInteger.ONE.shiftLeft(batchSizeInBits); // Subtract maxOffset - 1 to ensure that baseKey + (2^bits - 1) ≤ MAX_PRIVATE_KEY BigInteger maxSafeKey = PublicKeyBytes.MAX_PRIVATE_KEY.subtract(maxOffset).add(BigInteger.ONE); if (maxSafeKey.signum() < 0) { throw new IllegalStateException("batchSizeInBits too large; no valid private keys remain."); } return maxSafeKey; } /** * Checks whether a private key base exceeds the maximum allowed value for a given batch size. * * @param privateKeyBase the base private key to check * @param maxPrivateKeyForBatchSize the maximum allowed value for the batch size * @return true if the key exceeds the maximum; false otherwise */ public boolean isInvalidWithBatchSize(@NonNull BigInteger privateKeyBase, @NonNull BigInteger maxPrivateKeyForBatchSize) { return privateKeyBase.compareTo(maxPrivateKeyForBatchSize) > 0; } /** * Checks whether a private key falls outside the valid range for secp256k1. *

* Valid private keys are in the range [{@link PublicKeyBytes#MIN_VALID_PRIVATE_KEY}, {@link PublicKeyBytes#MAX_PRIVATE_KEY}]. * * @param secret the private key to check * @return true if the key is outside the valid range; false otherwise */ public boolean isOutsidePrivateKeyRange(@NonNull BigInteger secret) { return secret.compareTo(PublicKeyBytes.MIN_VALID_PRIVATE_KEY) < 0 || secret.compareTo(PublicKeyBytes.MAX_PRIVATE_KEY) > 0; } /** * Returns a valid private key, or a replacement value if the input is invalid. *

* If the input key is outside the valid range, this method returns * {@link PublicKeyBytes#INVALID_PRIVATE_KEY_REPLACEMENT}. Otherwise, it returns the input unchanged. * * @param secret the private key to validate * @return the input key if valid, or the replacement value if invalid */ public @NonNull BigInteger returnValidPrivateKey(@NonNull BigInteger secret) { if (isOutsidePrivateKeyRange(secret)) { return PublicKeyBytes.INVALID_PRIVATE_KEY_REPLACEMENT; } return secret; } /** * Replaces invalid private keys in an array with a known replacement value. *

* Each element in the array is checked and, if invalid, replaced with * {@link PublicKeyBytes#INVALID_PRIVATE_KEY_REPLACEMENT}. Valid keys are left unchanged. * * @param secrets the array of private keys to validate and correct (modified in-place) */ public void replaceInvalidPrivateKeys(@NonNull BigInteger[] secrets) { for (int i = 0; i < secrets.length; i++) { secrets[i] = returnValidPrivateKey(secrets[i]); } } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/Producer.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.math.BigInteger; import java.util.Random; public interface Producer extends Runnable, Interruptable, ProducerStateProvider { /** * Initialize the producer to procue keys with * {@link #produceKeys()} continuously. */ void initProducer(); /** * Release the producer. */ void releaseProducer(); /** * Create multiple keys for a specific bit length using {@link Random} and * push them to the {@link Consumer}. * * Specifically, any 256-bit number between {@code 0x1} and {@link PublicKeyBytes#MAX_PRIVATE_KEY} is a valid private key. */ void produceKeys() throws Exception; /** * Processes a provided secret base, which may be used for key generation or other cryptographic * operations in the implementation of the producer. * * @param secretBase the secret base value to be processed, represented as a {@link BigInteger} */ void processSecretBase(BigInteger secretBase); /** * Processes an array of secrets represented as BigInteger values. * * @param secrets an array of BigInteger objects representing the secrets to be processed */ void processSecrets(BigInteger[] secrets); /** * Blocks till the producer is not running anymore. */ void waitTillProducerNotRunning(); } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/ProducerJava.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.math.BigInteger; import net.ladenthin.bitcoinaddressfinder.configuration.CProducerJava; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducer; public class ProducerJava extends AbstractProducer { protected final CProducerJava producerJava; public ProducerJava(CProducerJava producerJava, Consumer consumer, KeyUtility keyUtility, KeyProducer keyProducer, BitHelper bitHelper) { super(producerJava, consumer, keyUtility, keyProducer, bitHelper); this.producerJava = producerJava; } @Override public void processSecretBase(BigInteger secretBase) { try { PublicKeyBytes[] publicKeyBytesArray = createGrid(secretBase); consumer.consumeKeys(publicKeyBytesArray); } catch (Exception e) { logErrorInProduceKeys(e, secretBase); } } @Override public void processSecrets(BigInteger[] secrets) { try { PublicKeyBytes[] publicKeyBytesArray = new PublicKeyBytes[secrets.length]; for (int i = 0; i < secrets.length; i++) { publicKeyBytesArray[i] = PublicKeyBytes.fromPrivate(secrets[i]); } consumer.consumeKeys(publicKeyBytesArray); } catch (Exception e) { logErrorInProduceKeys(e); } } protected PublicKeyBytes[] createGrid(final BigInteger secretBase) { PublicKeyBytes[] publicKeyBytesArray = new PublicKeyBytes[producerJava.getOverallWorkSize(bitHelper)]; for (int i = 0; i < publicKeyBytesArray.length; i++) { // create uncompressed BigInteger gridSecret = calculateSecretKey(secretBase, i); if (privateKeyValidator.isOutsidePrivateKeyRange(gridSecret)) { publicKeyBytesArray[i] = PublicKeyBytes.INVALID_KEY_ONE; continue; } publicKeyBytesArray[i] = PublicKeyBytes.fromPrivate(gridSecret); } return publicKeyBytesArray; } @Override public String toString() { return "ProducerJava@" + Integer.toHexString(System.identityHashCode(this)); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/ProducerJavaSecretsFiles.java ================================================ // @formatter:off /** * Copyright 2021 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.io.File; import java.io.IOException; import java.math.BigInteger; import java.util.List; import java.util.concurrent.atomic.AtomicReference; import net.ladenthin.bitcoinaddressfinder.configuration.CProducerJavaSecretsFiles; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducer; import org.bitcoinj.base.Network; import org.jspecify.annotations.NonNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class ProducerJavaSecretsFiles extends ProducerJava { private final Logger logger = LoggerFactory.getLogger(ProducerJavaSecretsFiles.class); private final Network network = new NetworkParameterFactory().getNetwork(); private final CProducerJavaSecretsFiles producerJavaSecretsFiles; private final ReadStatistic readStatistic = new ReadStatistic(); @NonNull AtomicReference currentSecretsFile = new AtomicReference<>(); public ProducerJavaSecretsFiles(CProducerJavaSecretsFiles producerJavaSecretsFiles, Consumer consumer, KeyUtility keyUtility, KeyProducer keyProducer, BitHelper bitHelper) { super(producerJavaSecretsFiles, consumer, keyUtility, keyProducer, bitHelper); this.producerJavaSecretsFiles = producerJavaSecretsFiles; } @Override public void produceKeys() { try { FileHelper fileHelper = new FileHelper(); List files = fileHelper.stringsToFiles(producerJavaSecretsFiles.files); fileHelper.assertFilesExists(files); logger.info("Starting secrets file processing..."); for (File file : files) { if (!shouldRun.get()) { logger.info("Key production stopped by flag."); break; } SecretsFile secretsFile = new SecretsFile( network, file, producerJavaSecretsFiles.secretFormat, readStatistic, this::consumeSecrets ); logger.info("Processing secrets file: {}", file); currentSecretsFile.set(secretsFile); secretsFile.readFile(); currentSecretsFile.set(null); logger.info("Finished processing: {}", file); logProgress(); } logger.info("All secrets files processed."); } catch (IOException e) { throw new RuntimeException(e); } } @Override public void processSecrets(BigInteger[] secrets) { throw new UnsupportedOperationException("Not supported yet."); } private void logProgress() { logger.info("Progress: Unsupported: " + readStatistic.getUnsupportedTotal() + ". Errors: " + readStatistic.errors.size() + ". Current File progress: " + String.format("%.2f", readStatistic.currentFileProgress) + "%."); } @Override public void interrupt() { super.interrupt(); SecretsFile secretsFile = currentSecretsFile.get(); if (secretsFile != null) { secretsFile.interrupt(); } } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/ProducerOpenCL.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.google.common.annotations.VisibleForTesting; import java.io.IOException; import java.math.BigInteger; import java.util.concurrent.Executors; import java.util.concurrent.ThreadPoolExecutor; import net.ladenthin.bitcoinaddressfinder.configuration.CProducerOpenCL; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducer; import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class ProducerOpenCL extends AbstractProducer { private final CProducerOpenCL producerOpenCL; @VisibleForTesting final ThreadPoolExecutor resultReaderThreadPoolExecutor; @VisibleForTesting @Nullable OpenCLContext openCLContext; public ProducerOpenCL(CProducerOpenCL producerOpenCL, Consumer consumer, KeyUtility keyUtility, KeyProducer keyProducer, BitHelper bitHelper) { super(producerOpenCL, consumer, keyUtility, keyProducer, bitHelper); this.producerOpenCL = producerOpenCL; this.resultReaderThreadPoolExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(producerOpenCL.maxResultReaderThreads); if (false) { int prestartedThreads = resultReaderThreadPoolExecutor.prestartAllCoreThreads(); if (prestartedThreads != producerOpenCL.maxResultReaderThreads) { throw new RuntimeException("Unable to prestart core threads."); } } } @Override public void initProducer() { super.initProducer(); openCLContext = new OpenCLContext(producerOpenCL, bitHelper); try { openCLContext.init(); } catch (IOException e) { throw new RuntimeException(e); } } @Override public void processSecretBase(BigInteger secretBase) { if (openCLContext == null) { throw new IllegalStateException("ProducerOpenCL not initialized"); } try { waitTillFreeThreadsInPool(); if(getLogger().isDebugEnabled()) { getLogger().debug("openCLContext.createKeys for secretBase: " + secretBase); } OpenCLGridResult openCLGridResult = openCLContext.createKeys(secretBase); ResultReaderRunnable resultReaderRunnable = new ResultReaderRunnable(openCLGridResult, consumer, secretBase, this); if(getLogger().isDebugEnabled()) { getLogger().debug("submit resultReaderRunnable for secretBase: " + secretBase); } resultReaderThreadPoolExecutor.submit(resultReaderRunnable, openCLContext); } catch (Exception e) { logErrorInProduceKeys(e, secretBase); } } @Override public void processSecrets(BigInteger[] secrets) { throw new UnsupportedOperationException("Not supported yet."); } protected static class ResultReaderRunnable implements Runnable { private final Logger logger = LoggerFactory.getLogger(this.getClass()); private final OpenCLGridResult openCLGridResult; private final Consumer consumer; private final BigInteger secretBase; private final AbstractProducer abstractProducer; ResultReaderRunnable(OpenCLGridResult openCLGridResult, Consumer consumer, BigInteger secretBase, AbstractProducer abstractProducer) { this.openCLGridResult = openCLGridResult; this.consumer = consumer; this.secretBase = secretBase; this.abstractProducer = abstractProducer; } @Override public void run() { logger.trace("ResultReaderRunnable started"); try { PublicKeyBytes[] publicKeyBytesArray = openCLGridResult.getPublicKeyBytes(); final ByteBufferUtility byteBufferUtility = new ByteBufferUtility(true); byteBufferUtility.freeByteBuffer(openCLGridResult.getResult()); consumer.consumeKeys(publicKeyBytesArray); } catch (Throwable e) { abstractProducer.logErrorInProduceKeys(e, secretBase); } logger.trace("ResultReaderRunnable finished"); } } @VisibleForTesting void waitTillFreeThreadsInPool() throws InterruptedException { while(getFreeThreads() < 1) { Thread.sleep(producerOpenCL.delayBlockedReader); getLogger().trace("No possible free threads to read OpenCL results. May increase maxResultReaderThreads."); } } @VisibleForTesting int getFreeThreads() { return resultReaderThreadPoolExecutor.getMaximumPoolSize() - resultReaderThreadPoolExecutor.getActiveCount(); } @Override public void releaseProducer() { super.releaseProducer(); resultReaderThreadPoolExecutor.shutdown(); if (openCLContext != null) { openCLContext.close(); openCLContext = null; } } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/ProducerState.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; public enum ProducerState { UNINITIALIZED, INITIALIZED, RUNNING, NOT_RUNNING } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/ProducerStateProvider.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; public interface ProducerStateProvider { ProducerState getState(); } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/PublicKeyBytes.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.google.common.hash.Hashing; import java.math.BigInteger; import java.util.Arrays; import java.util.Objects; import org.apache.commons.codec.digest.DigestUtils; import org.bitcoinj.core.Utils; import org.bitcoinj.crypto.ECKey; import org.bitcoinj.crypto.internal.CryptoUtils; import org.bouncycastle.crypto.digests.RIPEMD160Digest; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; import org.slf4j.Logger; public class PublicKeyBytes { /** * Use {@link com.google.common.hash.Hashing} and * {@link org.bouncycastle.crypto.digests.RIPEMD160Digest} instead * {@link org.bitcoinj.crypto.internal.CryptoUtils#sha256hash160(byte[])}. */ public static final boolean USE_SHA256_RIPEMD160_FAST = true; public static final BigInteger MAX_TECHNICALLY_PRIVATE_KEY = BigInteger.valueOf(2).pow(PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS).subtract(BigInteger.ONE); public static final BigInteger MIN_PRIVATE_KEY = BigInteger.ONE; /** * The minimum valid private key that can be safely used in this implementation. *

* While the secp256k1 specification allows private keys in the range * {@code [0x1, MAX_PRIVATE_KEY]} (i.e., including {@code 1}), this implementation * deliberately excludes {@code 1} for practical safety and compatibility reasons. * The constant {@code MIN_VALID_PRIVATE_KEY} is therefore defined as {@code 2}. *

*

* This avoids edge cases or known issues in downstream libraries or certain * ECKey handling implementations (e.g., {@link org.bitcoinj.crypto.ECKey#fromPrivate(BigInteger, boolean)}) * that may throw exceptions or produce inconsistent results for {@code 1}. *

* * @see #MAX_PRIVATE_KEY * @see org.bitcoinj.crypto.ECKey#fromPrivate(BigInteger, boolean) */ public static final BigInteger MIN_VALID_PRIVATE_KEY = BigInteger.TWO; public static final String MIN_VALID_PRIVATE_KEY_HEX = MIN_VALID_PRIVATE_KEY.toString(BitHelper.RADIX_HEX).toUpperCase(); public static final String MAX_PRIVATE_KEY_HEX = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141"; /** * The maximum valid private key according to the secp256k1 specification. *

* The valid range for secp256k1 private keys is technically defined as * {@code 0x1} to {@link #MAX_PRIVATE_KEY_HEX} (inclusive). * This value represents the order of the secp256k1 curve (also called the group order). *

*

* However, this implementation deliberately defines {@link PublicKeyBytes#MIN_VALID_PRIVATE_KEY} as {@code 0x2}, * excluding {@code 0x1} due to its potential to cause inconsistencies or exceptions in certain cryptographic * libraries such as {@link org.bitcoinj.crypto.ECKey#fromPrivate(BigInteger, boolean)}. *

* * @see #MIN_VALID_PRIVATE_KEY * @see org.bitcoinj.crypto.ECKey */ public static final BigInteger MAX_PRIVATE_KEY = new BigInteger(MAX_PRIVATE_KEY_HEX, BitHelper.RADIX_HEX); /** * I choose a random value for a replacement. */ public static final BigInteger INVALID_PRIVATE_KEY_REPLACEMENT = BigInteger.valueOf(2); // ==== BEGIN: SYNCHRONIZED WITH OpenCL CONSTANTS (Do not modify without updating OpenCL) ==== public static final int BITS_PER_BYTE = 8; public static final int U32_PER_WORD = 1; public static final int U32_NUM_BYTES = 4; public static final int BYTE_SHIFT_TO_U32_MSB = 24; // === private key === public static final int PRIVATE_KEY_MAX_NUM_BITS = 256; public static final int PRIVATE_KEY_MAX_NUM_BYTES = PRIVATE_KEY_MAX_NUM_BITS / BITS_PER_BYTE; // 32 public static final int PRIVATE_KEY_MAX_NUM_WORDS = PRIVATE_KEY_MAX_NUM_BYTES / U32_NUM_BYTES; // 8 // === SEC format prefixes === public static final int SEC_PREFIX_NUM_BITS = BITS_PER_BYTE; public static final int SEC_PREFIX_NUM_BYTES = 1; public static final int SEC_PREFIX_NUM_WORDS = U32_PER_WORD; public static final int SEC_PREFIX_UNCOMPRESSED_ECDSA_POINT = 0x04; public static final int SEC_PREFIX_COMPRESSED_ECDSA_POINT_EVEN_Y = 0x02; public static final int SEC_PREFIX_COMPRESSED_ECDSA_POINT_ODD_Y = 0x03; // ==== SEC format prefixes shifted versions (for use in u32[0] with MSB-first layout) ==== public static final int SEC_PREFIX_SHIFTED_NUM_BYTES = U32_NUM_BYTES; public static final int SEC_PREFIX_UNCOMPRESSED_ECDSA_POINT_SHIFTED = (SEC_PREFIX_UNCOMPRESSED_ECDSA_POINT << BYTE_SHIFT_TO_U32_MSB); public static final int SEC_PREFIX_COMPRESSED_ECDSA_POINT_EVEN_Y_SHIFTED = (SEC_PREFIX_COMPRESSED_ECDSA_POINT_EVEN_Y << BYTE_SHIFT_TO_U32_MSB); public static final int SEC_PREFIX_COMPRESSED_ECDSA_POINT_ODD_Y_SHIFTED = (SEC_PREFIX_COMPRESSED_ECDSA_POINT_ODD_Y << BYTE_SHIFT_TO_U32_MSB); // ==== x, y coordinate length ==== public static final int ONE_COORDINATE_NUM_BITS = 256; public static final int ONE_COORDINATE_NUM_BYTES = ONE_COORDINATE_NUM_BITS / BITS_PER_BYTE; // 32 public static final int TWO_COORDINATES_NUM_BITS = ONE_COORDINATE_NUM_BITS * 2; // 512 public static final int TWO_COORDINATES_NUM_BYTES = ONE_COORDINATE_NUM_BYTES * 2; // 64 public static final int ONE_COORDINATE_NUM_WORDS = ONE_COORDINATE_NUM_BYTES / U32_NUM_BYTES; // 8 public static final int TWO_COORDINATE_NUM_WORDS = ONE_COORDINATE_NUM_WORDS * 2; // 16 // ==== public key length ==== public static final int SEC_PUBLIC_KEY_UNCOMPRESSED_NUM_BITS = SEC_PREFIX_NUM_BITS + TWO_COORDINATES_NUM_BITS; // 520 public static final int SEC_PUBLIC_KEY_UNCOMPRESSED_NUM_BYTES = SEC_PREFIX_NUM_BYTES + TWO_COORDINATES_NUM_BYTES; // 65 public static final int SEC_PUBLIC_KEY_UNCOMPRESSED_WORDS = SEC_PREFIX_NUM_WORDS + TWO_COORDINATE_NUM_WORDS; // 17 public static final int SEC_PUBLIC_KEY_COMPRESSED_NUM_BITS = SEC_PREFIX_NUM_BITS + ONE_COORDINATE_NUM_BITS; // 264 public static final int SEC_PUBLIC_KEY_COMPRESSED_NUM_BYTES = SEC_PREFIX_NUM_BYTES + ONE_COORDINATE_NUM_BYTES; // 33 public static final int SEC_PUBLIC_KEY_COMPRESSED_WORDS = SEC_PREFIX_NUM_WORDS + ONE_COORDINATE_NUM_WORDS; // 9 // === Hash sizes in bytes === public static final int SHA256_INPUT_BLOCK_SIZE_BITS = 512; public static final int SHA256_INPUT_BLOCK_SIZE_BYTES = SHA256_INPUT_BLOCK_SIZE_BITS / BITS_PER_BYTE; // 64 public static final int SHA256_INPUT_BLOCK_SIZE_WORDS = SHA256_INPUT_BLOCK_SIZE_BYTES / U32_NUM_BYTES; // 16 public static final int RIPEMD160_INPUT_BLOCK_SIZE_BITS = 512; public static final int RIPEMD160_INPUT_BLOCK_SIZE_BYTES = RIPEMD160_INPUT_BLOCK_SIZE_BITS / BITS_PER_BYTE; // 64 public static final int RIPEMD160_INPUT_BLOCK_SIZE_WORDS = RIPEMD160_INPUT_BLOCK_SIZE_BYTES / U32_NUM_BYTES; // 16 public static final int SHA256_HASH_NUM_BITS = 256; public static final int SHA256_HASH_NUM_BYTES = SHA256_HASH_NUM_BITS / BITS_PER_BYTE; // 32 public static final int SHA256_HASH_NUM_WORDS = SHA256_HASH_NUM_BYTES / U32_NUM_BYTES; // 8 public static final int RIPEMD160_HASH_NUM_BITS = 160; public static final int RIPEMD160_HASH_NUM_BYTES = RIPEMD160_HASH_NUM_BITS / BITS_PER_BYTE; // 20 public static final int RIPEMD160_HASH_NUM_WORDS = RIPEMD160_HASH_NUM_BYTES / U32_NUM_BYTES; // 5 public static final int SHA256_INPUT_BLOCKS_FOR_UNCOMPRESSED_SEC = 2; public static final int SHA256_INPUT_TOTAL_BITS_UNCOMPRESSED = SHA256_INPUT_BLOCKS_FOR_UNCOMPRESSED_SEC * SHA256_INPUT_BLOCK_SIZE_BITS; // 1024 public static final int SHA256_INPUT_TOTAL_BYTES_UNCOMPRESSED = SHA256_INPUT_BLOCKS_FOR_UNCOMPRESSED_SEC * SHA256_INPUT_BLOCK_SIZE_BYTES; // 128 public static final int SHA256_INPUT_TOTAL_WORDS_UNCOMPRESSED = SHA256_INPUT_BLOCKS_FOR_UNCOMPRESSED_SEC * SHA256_INPUT_BLOCK_SIZE_WORDS; // 32 public static final int SHA256_INPUT_BLOCKS_FOR_COMPRESSED_SEC = 1; public static final int SHA256_INPUT_TOTAL_BITS_COMPRESSED = SHA256_INPUT_BLOCKS_FOR_COMPRESSED_SEC * SHA256_INPUT_BLOCK_SIZE_BITS; // 512 public static final int SHA256_INPUT_TOTAL_BYTES_COMPRESSED = SHA256_INPUT_BLOCKS_FOR_COMPRESSED_SEC * SHA256_INPUT_BLOCK_SIZE_BYTES; // 64 public static final int SHA256_INPUT_TOTAL_WORDS_COMPRESSED = SHA256_INPUT_BLOCKS_FOR_COMPRESSED_SEC * SHA256_INPUT_BLOCK_SIZE_WORDS; // 16 // ==== Individual Chunk Sizes (Bytes in Java) ==== public static final int CHUNK_SIZE_00_NUM_BYTES_BIG_ENDIAN_X = ONE_COORDINATE_NUM_BYTES; public static final int CHUNK_SIZE_01_NUM_BYTES_BIG_ENDIAN_Y = ONE_COORDINATE_NUM_BYTES; public static final int CHUNK_SIZE_10_NUM_BYTES_RIPEMD160_UNCOMPRESSED = RIPEMD160_HASH_NUM_BYTES; public static final int CHUNK_SIZE_11_NUM_BYTES_RIPEMD160_COMPRESSED = RIPEMD160_HASH_NUM_BYTES; // ==== Offsets Within a Chunk ==== public static final int CHUNK_OFFSET_00_NUM_BYTES_BIG_ENDIAN_X = 0; public static final int CHUNK_OFFSET_01_NUM_BYTES_BIG_ENDIAN_Y = CHUNK_OFFSET_00_NUM_BYTES_BIG_ENDIAN_X + CHUNK_SIZE_00_NUM_BYTES_BIG_ENDIAN_X; public static final int CHUNK_OFFSET_10_NUM_BYTES_RIPEMD160_UNCOMPRESSED = CHUNK_OFFSET_01_NUM_BYTES_BIG_ENDIAN_Y + CHUNK_SIZE_01_NUM_BYTES_BIG_ENDIAN_Y; public static final int CHUNK_OFFSET_11_NUM_BYTES_RIPEMD160_COMPRESSED = CHUNK_OFFSET_10_NUM_BYTES_RIPEMD160_UNCOMPRESSED + CHUNK_SIZE_10_NUM_BYTES_RIPEMD160_UNCOMPRESSED; public static final int CHUNK_OFFSET_99_NUM_BYTES_END_OF_CHUNK = CHUNK_OFFSET_11_NUM_BYTES_RIPEMD160_COMPRESSED + CHUNK_SIZE_11_NUM_BYTES_RIPEMD160_COMPRESSED; // ==== Total Chunk Size ==== public static final int CHUNK_SIZE_NUM_BYTES = CHUNK_OFFSET_99_NUM_BYTES_END_OF_CHUNK; // ==== END: SYNCHRONIZED WITH OpenCL CONSTANTS ==== /** * Computes the maximum permissible length for an array intended to store pairs of coordinates within a 32-bit system. * This constant represents the upper limit on array length, factoring in the memory constraint imposed by the maximum * integer value addressable in Java ({@link Integer#MAX_VALUE}) and the storage requirement for two coordinates. *

* The calculation divides {@link Integer#MAX_VALUE} by the number of bytes needed to store a OpenCL chunk, * as defined by {@link PublicKeyBytes#CHUNK_SIZE_NUM_BYTES}, ensuring the array's indexing does not surpass * Java's maximum allowable array length. *

*/ public static final int MAXIMUM_CHUNK_ELEMENTS = Integer.MAX_VALUE / CHUNK_SIZE_NUM_BYTES; /** * Determines the minimum number of bits required to address the maximum array length for storing chunks. * This value is crucial for efficiently allocating memory without exceeding the 32-bit system's limitations. *

* The calculation employs a bit manipulation strategy to find the exponent of the nearest superior power of 2 * capable of accommodating the maximum array length. By decrementing the maximum array length by 1 and * calculating 32 minus the count of leading zeros in the decremented value, we obtain the closest superior power of 2. * This technique, derived from a common bit manipulation trick (source: https://stackoverflow.com/questions/5242533/fast-way-to-find-exponent-of-nearest-superior-power-of-2), * ensures the calculated bit count represents the smallest possible number that can address all potential array indices * without breaching the 32-bit address space limitation. *

*/ public static final int BIT_COUNT_FOR_MAX_CHUNKS_ARRAY = MAXIMUM_CHUNK_ELEMENTS == 0 ? 0 : 32 - Integer.numberOfLeadingZeros(MAXIMUM_CHUNK_ELEMENTS - 1) - 1; public static final int LAST_Y_COORDINATE_BYTE_INDEX = SEC_PREFIX_NUM_BYTES + TWO_COORDINATES_NUM_BYTES - 1; public final static int PUBLIC_KEY_UNCOMPRESSED_BYTES = SEC_PREFIX_NUM_BYTES + TWO_COORDINATES_NUM_BYTES; public final static int PUBLIC_KEY_COMPRESSED_BYTES = SEC_PREFIX_NUM_BYTES + ONE_COORDINATE_NUM_BYTES; private final byte @NonNull [] uncompressed; private final byte @NonNull [] compressed; /** * Lazy initialization. */ private byte @Nullable [] uncompressedKeyHash; /** * Lazy initialization. */ private byte @Nullable [] compressedKeyHash; /** * Lazy initialization. */ private @Nullable String uncompressedKeyHashBase58; /** * Lazy initialization. */ private @Nullable String compressedKeyHashBase58; private final BigInteger secretKey; private final PrivateKeyValidator privateKeyValidator; // [4, 121, -66, 102, 126, -7, -36, -69, -84, 85, -96, 98, -107, -50, -121, 11, 7, 2, -101, -4, -37, 45, -50, 40, -39, 89, -14, -127, 91, 22, -8, 23, -104, 72, 58, -38, 119, 38, -93, -60, 101, 93, -92, -5, -4, 14, 17, 8, -88, -3, 23, -76, 72, -90, -123, 84, 25, -100, 71, -48, -113, -5, 16, -44, -72] // Hex.decodeHex("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8") public static final PublicKeyBytes INVALID_KEY_ONE = new PublicKeyBytes(BigInteger.ONE, new byte[] {4, 121, -66, 102, 126, -7, -36, -69, -84, 85, -96, 98, -107, -50, -121, 11, 7, 2, -101, -4, -37, 45, -50, 40, -39, 89, -14, -127, 91, 22, -8, 23, -104, 72, 58, -38, 119, 38, -93, -60, 101, 93, -92, -5, -4, 14, 17, 8, -88, -3, 23, -76, 72, -90, -123, 84, 25, -100, 71, -48, -113, -5, 16, -44, -72}); public BigInteger getSecretKey() { return secretKey; } public byte[] getCompressed() { return compressed; } public byte[] getUncompressed() { return uncompressed; } public boolean isOutsidePrivateKeyRange() { return privateKeyValidator.isOutsidePrivateKeyRange(secretKey); } public PublicKeyBytes(BigInteger secretKey, byte[] uncompressed) { this(secretKey, uncompressed, createCompressedBytes(uncompressed)); } public PublicKeyBytes(BigInteger secretKey, byte[] uncompressed, byte[] uncompressedKeyHash, byte[] compressedKeyHash) { this(secretKey, uncompressed, createCompressedBytes(uncompressed), uncompressedKeyHash, compressedKeyHash); } public PublicKeyBytes(BigInteger secretKey, byte @NonNull [] uncompressed, byte @NonNull [] compressed) { this.secretKey = secretKey; this.uncompressed = uncompressed; this.compressed = compressed; this.privateKeyValidator = new PrivateKeyValidator(); } public PublicKeyBytes(BigInteger secretKey, byte @NonNull [] uncompressed, byte @NonNull [] compressed, byte @Nullable [] uncompressedKeyHash, byte @Nullable [] compressedKeyHash) { this.secretKey = secretKey; this.uncompressed = uncompressed; this.compressed = compressed; this.uncompressedKeyHash = uncompressedKeyHash; this.compressedKeyHash = compressedKeyHash; this.privateKeyValidator = new PrivateKeyValidator(); } public static PublicKeyBytes fromPrivate(BigInteger secretKey) { ECKey ecKey = ECKey.fromPrivate(secretKey, false); return new PublicKeyBytes(ecKey.getPrivKey(), ecKey.getPubKey()); } /** * Creates a compressed public key from an uncompressed public key byte array in SEC format. *

* The method extracts the X coordinate and calculates the appropriate compression prefix * based on the parity (evenness) of the Y coordinate. *

* The resulting compressed key is structured as: *

    *
  • 1 byte prefix: {@code 0x02} if Y is even, {@code 0x03} if Y is odd
  • *
  • 32 bytes: X coordinate (Big-Endian) (MSB-first)
  • *
*

* This format follows the Bitcoin and general ECC compressed public key convention, * where the full Y coordinate is not transmitted, but can later be recovered. * * @param uncompressed the full uncompressed public key byte array in SEC format ({@code 04 || X || Y}) * @return the compressed public key byte array in SEC format */ public static byte @NonNull [] createCompressedBytes(byte @NonNull [] uncompressed) { // add one byte for format sign byte[] compressed = new byte[PUBLIC_KEY_COMPRESSED_BYTES]; // parity boolean even = uncompressed[LAST_Y_COORDINATE_BYTE_INDEX] % 2 == 0; if (even) { compressed[0] = SEC_PREFIX_COMPRESSED_ECDSA_POINT_EVEN_Y; } else { compressed[0] = SEC_PREFIX_COMPRESSED_ECDSA_POINT_ODD_Y; } // x System.arraycopy(uncompressed, SEC_PREFIX_NUM_BYTES, compressed, SEC_PREFIX_NUM_BYTES, PublicKeyBytes.ONE_COORDINATE_NUM_BYTES); return compressed; } /** * Assembles an uncompressed public key in SEC (Standards for Efficient Cryptography) format * from the X and Y coordinate byte arrays. *

* The method expects both the X and Y coordinates to be in Big-Endian (MSB-first) order, * which is the standard byte ordering for Bitcoin public keys. *

* The resulting byte array is structured as: *

    *
  • 1 byte prefix: {@code 0x04} indicating an uncompressed public key
  • *
  • 32 bytes: X coordinate (Big-Endian) (MSB-first)
  • *
  • 32 bytes: Y coordinate (Big-Endian) (MSB-first)
  • *
*

* This format complies with Bitcoin, Ethereum, and general ECC usage where * uncompressed public keys are transmitted as {@code 04 || X || Y}. * * @param x the X coordinate in Big-Endian (MSB-first) order * @param y the Y coordinate in Big-Endian (MSB-first) order * @return the assembled uncompressed public key byte array in SEC format */ public static byte @NonNull [] assembleUncompressedPublicKey(byte @NonNull [] x, byte @NonNull [] y) { byte[] uncompressed = new byte[PublicKeyBytes.PUBLIC_KEY_UNCOMPRESSED_BYTES]; // prefix uncompressed[0] = SEC_PREFIX_UNCOMPRESSED_ECDSA_POINT; // x System.arraycopy(x, 0, uncompressed, SEC_PREFIX_NUM_BYTES, ONE_COORDINATE_NUM_BYTES); // y System.arraycopy(y, 0, uncompressed, SEC_PREFIX_NUM_BYTES + ONE_COORDINATE_NUM_BYTES, ONE_COORDINATE_NUM_BYTES); return uncompressed; } /** * Checks whether all coordinate bytes (excluding the prefix byte) are zero. *

* This is used to detect critical failures such as a broken OpenCL kernel execution or invalid GPU output. *

* * @param uncompressed the full uncompressed public key byte array (prefix + X + Y) * @return true if all coordinate bytes are zero, false otherwise */ public static boolean isAllCoordinateBytesZero(byte[] uncompressed) { for (int i = SEC_PREFIX_NUM_BYTES; i < uncompressed.length; i++) { if (uncompressed[i] != 0) { return false; } } return true; } private static byte @NonNull [] calculateHash160(byte[] input) { if (USE_SHA256_RIPEMD160_FAST) { return sha256hash160Fast(input); } else { return CryptoUtils.sha256hash160(input); } } public byte @NonNull [] getUncompressedKeyHash() { if (uncompressedKeyHash == null) { uncompressedKeyHash = calculateHash160(uncompressed); } return uncompressedKeyHash; } public byte @NonNull [] getCompressedKeyHash() { if (compressedKeyHash == null) { compressedKeyHash = calculateHash160(compressed); } return compressedKeyHash; } /** * Calculates RIPEMD160(SHA256(input)). This is used in Address * calculations. Same as {@link org.bitcoinj.crypto.internal.CryptoUtils#sha256hash160(byte[])} but using * {@link DigestUtils}. */ public static byte[] sha256hash160Fast(byte[] input) { byte[] sha256 = Hashing.sha256().hashBytes(input).asBytes(); RIPEMD160Digest digest = new RIPEMD160Digest(); digest.update(sha256, 0, sha256.length); byte[] out = new byte[RIPEMD160_HASH_NUM_BYTES]; digest.doFinal(out, 0); return out; } public @NonNull String getCompressedKeyHashAsBase58(@NonNull KeyUtility keyUtility) { if (uncompressedKeyHashBase58 == null) { uncompressedKeyHashBase58 = keyUtility.toBase58(getCompressedKeyHash()); } return uncompressedKeyHashBase58; } public @NonNull String getUncompressedKeyHashAsBase58(@NonNull KeyUtility keyUtility) { if (compressedKeyHashBase58 == null) { compressedKeyHashBase58 = keyUtility.toBase58(getUncompressedKeyHash()); } return compressedKeyHashBase58; } public boolean runtimePublicKeyCalculationCheck(Logger logger) { byte[] hash160Uncompressed = getUncompressedKeyHash(); byte[] hash160Compressed = getCompressedKeyHash(); ECKey fromPrivateUncompressed = ECKey.fromPrivate(getSecretKey(), false); ECKey fromPrivateCompressed = ECKey.fromPrivate(getSecretKey(), true); final byte[] pubKeyUncompressedFromEcKey = fromPrivateUncompressed.getPubKey(); final byte[] pubKeyCompressedFromEcKey = fromPrivateCompressed.getPubKey(); final byte[] hash160UncompressedFromEcKey = fromPrivateUncompressed.getPubKeyHash(); final byte[] hash160CompressedFromEcKey = fromPrivateCompressed.getPubKeyHash(); boolean isValid = true; if (!Arrays.equals(hash160UncompressedFromEcKey, hash160Uncompressed)) { logger.error("fromPrivateUncompressed.getPubKeyHash() != hash160Uncompressed"); logger.error("getSecretKey: " + getSecretKey()); logger.error("pubKeyUncompressed: " + org.apache.commons.codec.binary.Hex.encodeHexString(getUncompressed())); logger.error("pubKeyUncompressedFromEcKey: " + org.apache.commons.codec.binary.Hex.encodeHexString(pubKeyUncompressedFromEcKey)); logger.error("hash160Uncompressed: " + org.apache.commons.codec.binary.Hex.encodeHexString(hash160Uncompressed)); logger.error("hash160UncompressedFromEcKey: " + org.apache.commons.codec.binary.Hex.encodeHexString(hash160UncompressedFromEcKey)); isValid = false; } if (!Arrays.equals(hash160CompressedFromEcKey, hash160Compressed)) { logger.error("fromPrivateCompressed.getPubKeyHash() != hash160Compressed"); logger.error("getSecretKey: " + getSecretKey()); logger.error("pubKeyCompressed: " + org.apache.commons.codec.binary.Hex.encodeHexString(getCompressed())); logger.error("pubKeyCompressedFromEcKey: " + org.apache.commons.codec.binary.Hex.encodeHexString(pubKeyCompressedFromEcKey)); logger.error("hash160Compressed: " + org.apache.commons.codec.binary.Hex.encodeHexString(hash160Compressed)); logger.error("hash160CompressedFromEcKey: " + org.apache.commons.codec.binary.Hex.encodeHexString(hash160CompressedFromEcKey)); isValid = false; } return isValid; } // /* * Overrides for {@code hashCode()}, {@code equals(Object)}, and {@code toString()}. *

* These methods are implemented based **only** on the {@code secretKey} field, * which uniquely identifies the {@code PublicKeyBytes} instance. *

    *
  • {@code hashCode()} – Generated using a prime multiplier and {@code secretKey} hash.
  • *
  • {@code equals(Object)} – Considers two instances equal if their {@code secretKey} values are equal.
  • *
  • {@code toString()} – Returns a string including the {@code secretKey} for debugging/logging.
  • *
*

* This design ensures that objects with the same {@code secretKey} are treated as equal, * regardless of other internal state (e.g., precomputed hash representations or compressed keys). */ // generated, based on secretKey only! @Override public int hashCode() { int hash = 3; hash = 73 * hash + Objects.hashCode(this.secretKey); return hash; } // generated, based on secretKey only! @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final PublicKeyBytes other = (PublicKeyBytes) obj; return Objects.equals(this.secretKey, other.secretKey); } // generated, based on secretKey only! @Override public String toString() { return "PublicKeyBytes{" + "secretKey=" + secretKey + '}'; } // } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/RandomSecretSupplier.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.math.BigInteger; import java.util.Random; public class RandomSecretSupplier implements SecretSupplier { private final Random random; public RandomSecretSupplier(Random random) { this.random = random; } @Override public BigInteger nextSecret(int bitLength) { return new BigInteger(bitLength, random); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/ReadStatistic.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; public class ReadStatistic { public long successful = 0; public final Map unsupportedReasons = new LinkedHashMap<>(); /** * In percent. */ public double currentFileProgress; public final List errors = new ArrayList<>(); /** * Increments the counter for the given unsupported reason by one. * If the reason has not been seen before, it is added with a count of 1. * * @param reason the reason string from {@link AddressFormatNotAcceptedException#getReason()} */ public void incrementUnsupported(String reason) { unsupportedReasons.merge(reason, 1L, Long::sum); } /** * Returns the total number of unsupported lines across all reasons. * * @return sum of all per-reason counts in {@link #unsupportedReasons} */ public long getUnsupportedTotal() { return unsupportedReasons.values().stream().mapToLong(Long::longValue).sum(); } @Override public String toString() { return "ReadStatistic{" + "successful=" + successful + ", unsupportedTotal=" + getUnsupportedTotal() + ", unsupportedReasons=" + unsupportedReasons + ", currentFileProgress=" + currentFileProgress + ", errors=" + errors + '}'; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/ReleaseCLObject.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; /** * Represents an OpenCL-related object that holds a native resource and must be explicitly released. *

* Extends {@link AutoCloseable} to support usage with Java's {@code try-with-resources} construct. * This interface is intended for resources such as {@link org.jocl.cl_mem}, {@link org.jocl.cl_kernel}, etc. * which require manual cleanup via OpenCL's native API. *

* *

* Implementations must ensure that {@link #close()} releases the underlying native resource exactly once * and that {@link #isClosed()} accurately reflects the release status. *

* * Example usage: *
{@code
 * try (ReleaseCLObject buffer = MyCLBuffer.create(context, size)) {
 *     // Use buffer safely
 * }
 * // buffer is automatically released
 * }
*/ public interface ReleaseCLObject extends AutoCloseable { /** * Indicates whether the underlying OpenCL resource has already been released. * * @return {@code true} if {@link #close()} has been called and the resource is no longer valid, * {@code false} otherwise */ boolean isClosed(); /** * Releases the native OpenCL resource if it has not been released yet. *

* This method must be idempotent, calling it multiple times should have no effect * after the first call. *

* * @throws RuntimeException if the release fails */ @Override void close(); } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/SecretSupplier.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import net.ladenthin.bitcoinaddressfinder.keyproducer.NoMoreSecretsAvailableException; import java.math.BigInteger; @FunctionalInterface public interface SecretSupplier { BigInteger nextSecret(int bitLength) throws NoMoreSecretsAvailableException; } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/SecretsFile.java ================================================ // @formatter:off /** * Copyright 2021 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.google.common.hash.Hashing; import java.io.File; import java.math.BigInteger; import java.nio.charset.StandardCharsets; import java.util.function.Consumer; import net.ladenthin.bitcoinaddressfinder.configuration.CSecretFormat; import net.ladenthin.bitcoinaddressfinder.configuration.UnknownSecretFormatException; import org.apache.commons.codec.binary.Hex; import org.bitcoinj.base.Network; import org.bitcoinj.crypto.DumpedPrivateKey; import org.jspecify.annotations.NonNull; public class SecretsFile extends AbstractPlaintextFile { private final CSecretFormat secretFormat; private final Consumer secretConsumer; private final Network network; public SecretsFile(@NonNull Network network, @NonNull File file, @NonNull CSecretFormat secretFormat, @NonNull ReadStatistic readStatistic, @NonNull Consumer secretConsumer) { super(file, readStatistic); this.network = network; this.secretFormat = secretFormat; this.secretConsumer = secretConsumer; } @Override public void processLine(String line) { final BigInteger secret; switch (secretFormat) { case STRING_DO_SHA256: byte[] sha256 = Hashing.sha256().hashString(line, StandardCharsets.UTF_8).asBytes(); String hexOfHash = Hex.encodeHexString( sha256 ); secret = new BigInteger(hexOfHash, 16); break; case BIG_INTEGER: secret = new BigInteger(line); break; case SHA256: secret = new BigInteger(line, 16); break; case DUMPED_RIVATE_KEY: DumpedPrivateKey dpk = DumpedPrivateKey.fromBase58(network, line); secret = dpk.getKey().getPrivKey(); break; default: throw new UnknownSecretFormatException(secretFormat); } final BigInteger[] secrets = new BigInteger[1]; secrets[0] = secret; secretConsumer.accept(secrets); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/SeparatorFormat.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.List; import java.util.regex.Pattern; public enum SeparatorFormat { // /** * Standard CSV separator (comma). */ COMMA(","), /** * Common in European CSV formats where comma is used as a decimal * separator. */ SEMICOLON(";"), /** * CSV variant with added space for human readability (e.g., "addr, * amount"). */ COMMA_SPACE(", "), // // /** * Common in CLI tools, configs, or simple key-value pairs (e.g., * "addr:amount"). */ COLON(":"), /** * Extended separator occasionally used in custom log or structured data * formats (e.g., "addr::amount"). */ DOUBLE_COLON("::"), /** * Key-value style separator, typically found in config or scripting files. */ EQUALS("="), /** * Visual separator often used in logs or mapping formats (e.g., * "addr->amount"). */ ARROW("->"), /** * Functional programming style or log format separator (e.g., * "addr=>amount"). */ DOUBLE_ARROW("=>"), /** * Sometimes used in URI-like or REST-style address formats (e.g., * "addr/amount"). */ SLASH("/"), // // /** * Common in logs or console output for clear vertical splitting (e.g., * "addr|amount"). */ PIPE("|"), /** * Rare scripting-style separator or used in lightweight exports. */ CARET("^"), /** * Rarely used but useful to avoid conflicts with other symbols. */ TILDE("~"), /** * Seen in logs or non-standard formats, often for inline comments or * metadata (e.g., "addr#amount"). */ HASH("#"), // // /** * Tab character separator, typically used in TSV (Tab-Separated Values) * formats. */ TAB_SPLIT("\t"), /** * Simple space separator, used in CLI tools or minimalist export formats. */ SPACE(" "); // private final String symbol; SeparatorFormat(String symbol) { this.symbol = symbol; } public String getSymbol() { return symbol; } /** * Returns the list of separator formats sorted by descending symbol length. *

* This ensures that longer separators like "::" are evaluated before * shorter ones like ":" when used in splitting or pattern matching. This * prevents premature matches on partial separators that are substrings of * longer ones. * * @return a list of SeparatorFormat values sorted by descending length of * their symbols */ public static List getSortedSeparators() { return Arrays.stream(SeparatorFormat.values()) .sorted(Comparator.comparingInt( (SeparatorFormat s) -> s.getSymbol().length() ).reversed()) .toList(); } /** * Recursively splits the given input string using all defined {@link SeparatorFormat} values, * in descending order of separator length. *

* Unlike the original {@link String#split(String)} implementation which applies only the first matching * separator, this version performs a deep, recursive traversal, ensuring that all relevant separators * (e.g., {@link SeparatorFormat#DOUBLE_COLON}, {@link SeparatorFormat#COLON}, {@link SeparatorFormat#PIPE}) * are applied in sequence. This guarantees complete and hierarchical resolution of mixed separator patterns. *

* This method is especially useful when inputs may include multiple nested or combined separators, * and all of them must be processed in order of priority. *

* Trailing and leading empty strings are preserved (e.g., {@code "|value|"} results in {@code ["", "value", ""]}). * * @param input the string to split; must not be {@code null} * @return an array of string parts resulting from full recursive splitting * @throws NullPointerException if the input is {@code null} */ public static String[] split(String input) { List result = new ArrayList<>(); splitRecursive(input, result, getSortedSeparators(), 0); return result.toArray(new String[0]); } /** * Helper method for recursively applying separators to the input. *

* Each separator is applied in turn, starting with the longest one. If the current * separator splits the input, each resulting part is passed recursively to the next separator. * If no split occurs at the current level, the method proceeds to the next separator. * * @param input the string to split * @param result the list collecting all final split segments * @param separators the list of separators to apply * @param index the current separator index in the list */ private static void splitRecursive(String input, List result, List separators, int index) { if (index >= separators.size()) { result.add(input); // No more separators, store the remaining part return; } SeparatorFormat separator = separators.get(index); String[] parts = input.split(Pattern.quote(separator.getSymbol()), -1); if (parts.length > 1) { for (String part : parts) { splitRecursive(part, result, separators, index + 1); } } else { splitRecursive(input, result, separators, index + 1); } } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/Shutdown.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; public interface Shutdown { void shutdown(); } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/Statistics.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; public class Statistics { @Deprecated public static final int ONE_SECOND_IN_MILLISECONDS = 1000; String createStatisticsMessage(long uptime, long keys, long keysSumOfTimeToCheckContains, long emptyConsumer, long keysQueueSize, long hits) { // calculate uptime long uptimeInSeconds = uptime / (long) ONE_SECOND_IN_MILLISECONDS; long uptimeInMinutes = uptimeInSeconds / 60; // calculate per time, prevent division by zero with Math.max long keysPerSecond = keys / Math.max(uptimeInSeconds, 1); long keysPerMinute = keys / Math.max(uptimeInMinutes, 1); // calculate average contains time long averageContainsTime = keysSumOfTimeToCheckContains / Math.max(keys, 1); String message = "Statistics: [Checked " + (keys / 1_000_000L) + " M keys in " + uptimeInMinutes + " minutes] [" + (keysPerSecond/1_000L) + " k keys/second] [" + (keysPerMinute / 1_000_000L) + " M keys/minute] [Times an empty consumer: " + emptyConsumer + "] [Average contains time: " + averageContainsTime + " ms] [keys queue size: " + keysQueueSize + "] [Hits: " + hits + "]"; return message; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/cli/Main.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.cli; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import com.google.common.annotations.VisibleForTesting; import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; import java.util.*; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import net.ladenthin.bitcoinaddressfinder.AddressFilesToLMDB; import net.ladenthin.bitcoinaddressfinder.Finder; import net.ladenthin.bitcoinaddressfinder.Interruptable; import net.ladenthin.bitcoinaddressfinder.LMDBToAddressFile; import net.ladenthin.bitcoinaddressfinder.configuration.CAddressFilesToLMDB; import net.ladenthin.bitcoinaddressfinder.configuration.CConfiguration; import net.ladenthin.bitcoinaddressfinder.configuration.CFinder; import net.ladenthin.bitcoinaddressfinder.configuration.CLMDBToAddressFile; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLBuilder; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLPlatform; import org.slf4j.Logger; import org.slf4j.LoggerFactory; // VM option: -Dorg.slf4j.simpleLogger.defaultLogLevel=trace public class Main implements Runnable, Interruptable { /** * File extension for JavaScript configuration files; treated identically to {@link #FILE_EXTENSION_JSON}. */ @VisibleForTesting static final String FILE_EXTENSION_JS = ".js"; /** * Standard file extension for JSON configuration files. * * @see #FILE_EXTENSION_JS */ @VisibleForTesting static final String FILE_EXTENSION_JSON = ".json"; /** * Standard long-form file extension for YAML configuration files. * * @see #FILE_EXTENSION_YML */ @VisibleForTesting static final String FILE_EXTENSION_YAML = ".yaml"; /** * Short-form file extension for YAML configuration files; treated identically to {@link #FILE_EXTENSION_YAML}. */ @VisibleForTesting static final String FILE_EXTENSION_YML = ".yml"; @VisibleForTesting public static Logger logger = LoggerFactory.getLogger(Main.class); private final List interruptables = new ArrayList<>(); private final CConfiguration configuration; CountDownLatch runLatch = new CountDownLatch(1); public Main(CConfiguration configuration) { this.configuration = configuration; } public static String readString(Path path) { try { String content = Files.readString(path, Charset.defaultCharset()); return content; } catch (IOException e) { throw new RuntimeException(e); } } public static CConfiguration fromJson(String configurationString) { try { ObjectMapper mapper = new ObjectMapper(); return mapper.readValue(configurationString, CConfiguration.class); } catch (IOException e) { throw new RuntimeException(e); } } public static CConfiguration fromYaml(String configurationString) { try { YAMLMapper mapper = new YAMLMapper(); return mapper.readValue(configurationString, CConfiguration.class); } catch (IOException e) { throw new RuntimeException(e); } } public static String configurationToJson(CConfiguration configuration) { try { ObjectMapper mapper = new ObjectMapper(); mapper.enable(SerializationFeature.INDENT_OUTPUT); return mapper.writeValueAsString(configuration); } catch (IOException e) { throw new RuntimeException(e); } } public static String configurationToYAML(CConfiguration configuration) { try { YAMLMapper mapper = new YAMLMapper(); return mapper.writeValueAsString(configuration); } catch (IOException e) { throw new RuntimeException(e); } } public static void main(String[] args) { if (args.length != 1) { logger.error("Invalid arguments. Pass path to configuration as first argument."); return; } final Path configurationPath = Path.of(args[0]); String configurationAsString = readString(configurationPath); final CConfiguration configuration; String lowerPath = configurationPath.toString().toLowerCase(); if (lowerPath.endsWith(FILE_EXTENSION_JS) || lowerPath.endsWith(FILE_EXTENSION_JSON)) { configuration = fromJson(configurationAsString); } else if (lowerPath.endsWith(FILE_EXTENSION_YAML) || lowerPath.endsWith(FILE_EXTENSION_YML)) { configuration = fromYaml(configurationAsString); } else { throw new IllegalArgumentException("Unknown file ending for: " + configurationPath); } Main main = new Main(configuration); main.logConfigurationTransformation(); main.run(); } public void logConfigurationTransformation() { String json = configurationToJson(configuration); String yaml = configurationToYAML(configuration); logger.info( "Please review the transformed configuration to ensure it aligns with your expectations and requirements before proceeding.:\n" + "########## BEGIN transformed JSON configuration ##########\n" + json + "\n" + "########## END transformed JSON configuration ##########\n" + "\n" + "########## BEGIN transformed YAML configuration ##########\n" + yaml + "\n" + "########## END transformed YAML configuration ##########\n" ); } @Override public void run() { logger.info(configuration.command.name()); addSchutdownHook(); switch (configuration.command) { case Find: CFinder cFinder = Objects.requireNonNull(configuration.finder); Finder finder = new Finder(cFinder); interruptables.add(finder); // key producer first finder.startKeyProducer(); // consumer second finder.startConsumer(); // producer last finder.configureProducer(); finder.initProducer(); finder.startProducer(); finder.shutdownAndAwaitTermination(); break; case LMDBToAddressFile: CLMDBToAddressFile cLMDBToAddressFile = Objects.requireNonNull(configuration.lmdbToAddressFile); LMDBToAddressFile lmdbToAddressFile = new LMDBToAddressFile(cLMDBToAddressFile); interruptables.add(lmdbToAddressFile); lmdbToAddressFile.run(); break; case AddressFilesToLMDB: CAddressFilesToLMDB cAddressFilesToLMDB = Objects.requireNonNull(configuration.addressFilesToLMDB); AddressFilesToLMDB addressFilesToLMDB = new AddressFilesToLMDB(cAddressFilesToLMDB); interruptables.add(addressFilesToLMDB); addressFilesToLMDB.run(); break; case OpenCLInfo: OpenCLBuilder openCLBuilder = new OpenCLBuilder(); List openCLPlatforms = openCLBuilder.build(); System.out.println(openCLPlatforms); break; default: throw new UnsupportedOperationException("Command: " + configuration.command.name() + " currently not supported." ); } logger.info("Main#run end."); runLatch.countDown(); if (false) { printAllStackTracesWithDelay(2_000L, true); } } public static void printAllStackTracesWithDelay(long delayMillis, boolean includeDaemons) { try { Thread.sleep(delayMillis); } catch (InterruptedException ignored) { Thread.currentThread().interrupt(); } Map all = Thread.getAllStackTraces(); List> entries = new ArrayList<>(all.entrySet()); entries.sort(Comparator .comparing((Map.Entry e) -> { String n = e.getKey().getName(); return n == null ? "" : n; }) .thenComparingLong(e -> e.getKey().getId())); boolean printedAny = false; for (Map.Entry e : entries) { Thread t = e.getKey(); if (!includeDaemons && t.isDaemon()) continue; // previous behavior printedAny = true; System.out.println("##################################################"); System.out.println("# Thread: " + t + " | state=" + t.getState() + " | daemon=" + t.isDaemon()); for (StackTraceElement el : e.getValue()) System.out.println(" at " + el); } if (!printedAny) { System.out.println(includeDaemons ? "No threads to print." : "No non-daemon threads found. JVM should be able to exit normally."); } } private void addSchutdownHook() { Runtime.getRuntime().addShutdownHook(new Thread(() -> { logger.info("Shutdown received via hook."); interrupt(); try { logger.info("runLatch await"); runLatch.await(30, TimeUnit.SECONDS); } catch (InterruptedException e) { throw new RuntimeException(e); } logger.info("Finish shutdown hook."); })); } @Override public void interrupt() { for (Interruptable interruptable : interruptables) { interruptable.interrupt(); } } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CAddressFileOutputFormat.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; public enum CAddressFileOutputFormat { /** * The hash160 will be written encoded in hex without the amount. Optimal to view with a viewer with a fixed width (e.g. HxD). */ HexHash, /** * The addresses will be written with a fixed width and without the amount. Optimal to view with a viewer with a fixed width (e.g. HxD). */ FixedWidthBase58BitcoinAddress, /** * The addresses will be written with amount. Separated with a {@link net.ladenthin.bitcoinaddressfinder.SeparatorFormat#COMMA}. */ DynamicWidthBase58BitcoinAddressWithAmount } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CAddressFilesToLMDB.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; import org.jspecify.annotations.Nullable; import java.util.ArrayList; import java.util.List; public class CAddressFilesToLMDB { /** * The list of addresses files which should be read. */ public List addressesFiles = new ArrayList<>(); /** * The configuration to write a LMDB database. */ public @Nullable CLMDBConfigurationWrite lmdbConfigurationWrite; } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CCommand.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; public enum CCommand { Find, LMDBToAddressFile, AddressFilesToLMDB, OpenCLInfo } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CConfiguration.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; import org.jspecify.annotations.Nullable; public class CConfiguration { public CCommand command = CCommand.OpenCLInfo; public @Nullable CLMDBToAddressFile lmdbToAddressFile; public @Nullable CAddressFilesToLMDB addressFilesToLMDB; public @Nullable CFinder finder; } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CConsumerJava.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; public class CConsumerJava { public @NonNull CLMDBConfigurationReadOnly lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); public int printStatisticsEveryNSeconds = 60; public int threads = 4; /** * in ms. */ public long delayEmptyConsumer = 100; public int queueSize = 10; /** * Enables runtime verification of public key calculation. * * This performs a full consistency check for each generated key by comparing it * against a known-correct Java-based calculation. Use this option only in very specific * debugging or validation scenarios, such as: * *

    *
  • Suspected errors in the OpenCL implementation
  • *
  • Hardware defects causing incorrect calculations
  • *
  • Regression testing during development
  • *
* * Warning: This has a significant performance impact. *
    *
  • Enabled: ~20k keys/second
  • *
  • Disabled (default): ~10 million keys/second (LMDB benchmark)
  • *
* *

Do not enable in production or performance benchmarking environments.

*/ public boolean runtimePublicKeyCalculationCheck; public boolean enableVanity = false; public @Nullable String vanityPattern; } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CFinder.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; import org.jspecify.annotations.Nullable; import java.util.ArrayList; import java.util.List; public class CFinder { public List keyProducerJavaRandom = new ArrayList<>(); public List keyProducerJavaBip39 = new ArrayList<>(); public List keyProducerJavaIncremental = new ArrayList<>(); public List keyProducerJavaSocket = new ArrayList<>(); public List keyProducerJavaWebSocket = new ArrayList<>(); public List keyProducerJavaZmq = new ArrayList<>(); public @Nullable CConsumerJava consumerJava; public List producerJava = new ArrayList<>(); public List producerJavaSecretsFiles = new ArrayList<>(); public List producerOpenCL = new ArrayList<>(); } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CKeyProducerJava.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; import net.ladenthin.bitcoinaddressfinder.PublicKeyBytes; import org.jspecify.annotations.Nullable; public class CKeyProducerJava { public @Nullable String keyProducerId; /** * (2{@code maxNumBits} - 1) can be set to a lower value to improve a search on specific ranges (e.g. the puzzle transaction bitcoin-puzzle-tx ). * {@code 1} can't be tested because {@link org.bitcoinj.crypto.ECKey#fromPrivate} throws an {@link IllegalArgumentException}. * Range: {@code 2} (inclusive) to {@link PublicKeyBytes#PRIVATE_KEY_MAX_NUM_BITS} (inclusive). */ public int privateKeyMaxNumBits = PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS; /** Maximum allowed work size (number of secrets to generate) — 2^24 = 16,777,216*/ public int maxWorkSize = 1 << PublicKeyBytes.BIT_COUNT_FOR_MAX_CHUNKS_ARRAY; } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CKeyProducerJavaBip39.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; import org.jspecify.annotations.Nullable; import java.time.Instant; public class CKeyProducerJavaBip39 extends CKeyProducerJava { public static final String DEFAULT_MNEMONIC = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"; /** Default BIP32 path used for external addresses (BIP44). */ public static final String DEFAULT_BIP32_PATH = "M/44H/0H/0H/0"; /** * Must be a valid BIP39 mnemonic phrase (typically 12 or 24 words). */ public String mnemonic = DEFAULT_MNEMONIC; /** * Optional passphrase used in combination with the BIP39 mnemonic. * Can be an empty string. */ public String passphrase = ""; /** * Indicates whether the key derivation uses "hardened" child keys. * * In BIP32 hierarchical deterministic wallets, the hardened bit (0x80000000) is set in the child index * to mark hardened keys. Hardened derivation prevents the possibility of deriving child public keys * from a parent public key alone. * * With hardened keys: * - It is impossible to derive child public keys using only the parent public key. * - This enhances security by preventing attacks where knowledge of a parent public key and a * child private key could allow recovery of the parent private key. * * With non-hardened keys: * - You can derive child public keys from a parent public key without needing any private key. * - However, this introduces a potential vulnerability: if a child private key and the parent public key * are both compromised, the parent private key can be exposed due to elliptic curve mathematics. * * Setting this flag to true enables hardened key derivation; false means non-hardened. * * See also {@link org.bitcoinj.crypto.ChildNumber#HARDENED_BIT}. */ public boolean hardened = false; /** * Optional base path for BIP32/BIP44 derivation, e.g., "M/44H/0H/0H/0". */ public String bip32Path = DEFAULT_BIP32_PATH; /** * Optional wallet creation time (in epoch seconds) used for BIP39 seed. * If not set, defaults to {@link java.time.Instant#ofEpochSecond(long)} Instant.ofEpochSecond(0). */ public @Nullable Long creationTimeSeconds; /** * Returns the creation time as an Instant. * Defaults to Instant.ofEpochSecond(0) if not set. */ public Instant getCreationTimeInstant() { return Instant.ofEpochSecond(this.creationTimeSeconds != null ? this.creationTimeSeconds : 0L); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CKeyProducerJavaIncremental.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; import java.math.BigInteger; import net.ladenthin.bitcoinaddressfinder.BitHelper; import net.ladenthin.bitcoinaddressfinder.PublicKeyBytes; public class CKeyProducerJavaIncremental extends CKeyProducerJava { public String startAddress = PublicKeyBytes.MIN_VALID_PRIVATE_KEY.toString(BitHelper.RADIX_HEX).toUpperCase(); public String endAddress = PublicKeyBytes.MAX_PRIVATE_KEY_HEX; public BigInteger getStartAddress() { return new BigInteger(startAddress, BitHelper.RADIX_HEX); } public BigInteger getEndAddress() { return new BigInteger(endAddress, BitHelper.RADIX_HEX); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CKeyProducerJavaRandom.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; import org.jspecify.annotations.Nullable; public class CKeyProducerJavaRandom extends CKeyProducerJava { /** * Selects the pseudo-random number generator (PRNG) used for private-key creation. * See {@link CKeyProducerJavaRandomInstance} for the available implementations. * Defaults to {@link CKeyProducerJavaRandomInstance#SECURE_RANDOM} to prefer security * over convenience. */ public CKeyProducerJavaRandomInstance keyProducerJavaRandomInstance = CKeyProducerJavaRandomInstance.SECURE_RANDOM; /** * Used for {@link CKeyProducerJavaRandomInstance#RANDOM_CUSTOM_SEED}. * Also optionally used by {@link CKeyProducerJavaRandomInstance#SHA1_PRNG} * if deterministic output is desired. * Nullable to simulate unset seed. */ public @Nullable Long customSeed; } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CKeyProducerJavaRandomInstance.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; /** * Enumeration of PRNG (Pseudo-Random Number Generator) strategies used for generating keys. * * From a security perspective, some options are considered cryptographically secure and suitable * for wallet generation, while others are insecure and may have been used in weak or vulnerable wallets. * * This enum is useful both for: * - Secure wallet generation (using strong entropy sources) * - Wallet cracking or forensic analysis (by replicating weak/random key generation) */ public enum CKeyProducerJavaRandomInstance { /** * Cryptographically secure PRNG provided by the OS. * * ✅ Strong entropy source, suitable for generating secure wallets. * ❌ Not suitable for brute-force reproduction (unpredictable output). * * Internally uses system sources like `/dev/urandom` or platform CSPRNG. */ SECURE_RANDOM, /** * Standard Java Random seeded with the current system time in milliseconds. * * ❌ Extremely insecure. Many compromised wallets were generated this way. * ❗ Easily brute-forced by scanning a narrow time window. * * Common mistake in early Bitcoin wallet implementations. */ RANDOM_CURRENT_TIME_MILLIS_SEED, /** * Standard Java Random seeded with a user-supplied long value. * * ❌ Insecure if the seed is low-entropy or guessable. * ❗ Useful for forensic key regeneration if the seed is known or derived. */ RANDOM_CUSTOM_SEED, /** * SHA1PRNG – an old deterministic PRNG available in some Java implementations. * * ⚠️ Not cryptographically strong by modern standards. * 🛠 Historically used on Android (notably flawed pre-2013). * ❗ Potential attack surface if used in old or custom wallets. */ SHA1_PRNG } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CKeyProducerJavaReceiver.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; public class CKeyProducerJavaReceiver extends CKeyProducerJava { /** Enable logging of each received secret as hex */ public boolean logReceivedSecret = false; } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CKeyProducerJavaSocket.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; public class CKeyProducerJavaSocket extends CKeyProducerJavaReceiver { public enum Mode { CLIENT, SERVER } /** Hostname or IP address for client mode; ignored in server mode */ public String host = "localhost"; /** Port number to connect to or listen on */ public int port = 12345; /** Operating mode: client or server */ public Mode mode = Mode.SERVER; /** Socket read and connection timeout in milliseconds */ public int timeout = 3000; /** Number of attempts to reconnect if connection fails */ public int connectionRetryCount = 5; /** Number of attempts to retry reading a secret after I/O failure */ public int readRetryCount = 5; /** Delay in milliseconds between retry attempts */ public int retryDelayMillisConnect = 1000; /** Delay in milliseconds between retry attempts */ public int retryDelayMillisRead = 1000; /** Maximum retry attempts when partially reading a single secret */ public int readPartialRetryCount = 5; /** Delay in milliseconds between partial read retry attempts */ public int readPartialRetryDelayMillis = 20; public String getHost() { return host; } public int getPort() { return port; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CKeyProducerJavaWebSocket.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; public class CKeyProducerJavaWebSocket extends CKeyProducerJavaReceiver { public int timeout = 1000; public int port = 8080; public int getPort() { return port; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CKeyProducerJavaZmq.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; public class CKeyProducerJavaZmq extends CKeyProducerJavaReceiver { public enum Mode { CONNECT, BIND } /** The ZMQ address, e.g., tcp://localhost:5555 */ public String address = "tcp://localhost:5555"; /** Whether this side binds to the address or connects */ public Mode mode = Mode.BIND; /** * Timeout for receiving secrets, in milliseconds. * *

This timeout is applied consistently to: *

    *
  • the underlying ZMQ socket receive operation (RCVTIMEO)
  • *
  • the internal secret queue polling
  • *
* *

Semantics: *

    *
  • Must be a strictly positive value (> 0)
  • *
  • Specifies the maximum time to wait for each receive operation
  • *
* *

Notes: *

    *
  • Infinite blocking is intentionally not supported
  • *
  • Values less than or equal to zero are invalid and may lead to undefined behavior
  • *
  • Timeouts are enforced to guarantee responsive shutdown and deterministic behavior
  • *
* *

This value maps directly to the ZMQ socket option {@code RCVTIMEO}. * *

Default: {@code 1000} ms */ public int timeout = 1000; } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CLMDBConfigurationReadOnly.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; public class CLMDBConfigurationReadOnly { /** * The directory of the LMDB database. */ public String lmdbDirectory = ""; /** * Whether to use the optimal LMDB proxy implementation * (see {@link org.lmdbjava.ByteBufferProxy#PROXY_OPTIMAL}). */ public boolean useProxyOptimal = true; /** * Whether to log detailed LMDB statistics when initializing the environment. * This causes a full iteration over the database, which can be expensive on large datasets, * but also results in the data being fully cached by the OS. */ public boolean logStatsOnInit = false; /** * Whether to log LMDB statistics when closing the environment. */ public boolean logStatsOnClose = false; /** * If set to true, the LMDB database will load a Bloom filter into memory on initialization. * This filter is used to perform fast probabilistic membership checks for hash160 addresses. * * The Bloom filter does not store the full set of addresses in memory, but instead uses a compact bit array * and multiple hash functions to determine whether an address might exist in the database. * * Advantages: * - Extremely fast `containsAddress()` lookups (O(1)) * - Low memory consumption even for millions or billions of entries * * Tradeoff: * - False positives are possible: an address might be reported as present, even if it is not. * This may lead to unnecessary database lookups, but never to false negatives. * * If this is set to false, LMDB will perform direct queries for each address using transactions. */ public boolean useBloomFilter = true; /** * The expected false positive probability (FPP) for the Bloom filter. *

* Lower values reduce the chance of false positives but increase memory usage. * Higher values save memory but allow more false positives, potentially causing unnecessary LMDB lookups. *

* Recommended values: *

    *
  • 0.01 – ~1% false positives: High accuracy, higher memory usage
  • *
  • 0.05 – ~5% false positives: Balanced performance and memory
  • *
  • 0.1 or 0.2 – 10–20% false positives: Very memory-efficient, suitable if occasional extra DB reads are acceptable
  • *
*

* This value is only used if {@link #useBloomFilter} is true. */ public double bloomFilterFpp = 0.1; /** * If true, {@code containsAddress(...)} will always return {@code false}, skipping both LMDB and in-memory lookups. * * This disables all address existence checks and is useful for performance benchmarking or dry-run scenarios * where address verification is intentionally omitted. */ public boolean disableAddressLookup = false; } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CLMDBConfigurationWrite.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; import org.bitcoinj.base.Coin; public class CLMDBConfigurationWrite extends CLMDBConfigurationReadOnly { /** * LMDB site in MiB (e.g. 1024). */ public int initialMapSizeInMiB = 1; /** * Enable if empty hash160s should be deleted. Empty means zero satoshis. It * has a higher priority than {@link #useStaticAmount} which means empty * addresses will be delted instead written with {@link #staticAmount}. */ public boolean deleteEmptyAddresses = false; /** * Only used if {@link #useStaticAmount} is {@code true}. * {@link Coin#ZERO} allows a smaller database. */ public long staticAmount = Coin.ZERO.value; /** * Use the static amount {@link #staticAmount} instead the imported amount * to obscure amount and allow higher database compression. */ public boolean useStaticAmount = true; public boolean increaseMapAutomatically = true; /** * LMDB site increase in MiB (e.g. 1024). Attention: If the value is too low, the increase for a full db was not enough and a {@link org.lmdbjava.Env.MapFullException} will be thrown. */ public long increaseSizeInMiB = 8; } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CLMDBToAddressFile.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; public class CLMDBToAddressFile { public CLMDBConfigurationReadOnly lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); public String addressesFile = ""; public CAddressFileOutputFormat addressFileOutputFormat = CAddressFileOutputFormat.HexHash; } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CProducer.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; import net.ladenthin.bitcoinaddressfinder.BitHelper; import net.ladenthin.bitcoinaddressfinder.PublicKeyBytes; import org.jspecify.annotations.Nullable; public class CProducer { public @Nullable String keyProducerId; /** * Range: {@code 0} (inclusive) to {@link PublicKeyBytes#BIT_COUNT_FOR_MAX_CHUNKS_ARRAY} (inclusive). */ public int batchSizeInBits = 0; /** * The batch mode will use a private key increment internal to increase the performance. */ public boolean batchUsePrivateKeyIncrement = true; /** * Enable the log output for the secret address. */ public boolean logSecretBase; /** * Enable to let the producer run one time only. */ public boolean runOnce = false; public int getOverallWorkSize(BitHelper bitHelper) { return bitHelper.convertBitsToSize(batchSizeInBits); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CProducerJava.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; public class CProducerJava extends CProducer { } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CProducerJavaSecretsFiles.java ================================================ // @formatter:off /** * Copyright 2021 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; import java.util.ArrayList; import java.util.List; public class CProducerJavaSecretsFiles extends CProducerJava { /** * The list of strings files which should be read. */ public List files = new ArrayList<>(); /** * The format of each line in the files. */ public CSecretFormat secretFormat = CSecretFormat.STRING_DO_SHA256; } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CProducerOpenCL.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; import static org.jocl.CL.CL_DEVICE_TYPE_ALL; public class CProducerOpenCL extends CProducer { public int platformIndex = 0; public long deviceType = CL_DEVICE_TYPE_ALL; public int deviceIndex = 0; public int maxResultReaderThreads = 4; /** * in ms. */ public int delayBlockedReader = 100; /** * Number of inner iterations each OpenCL work-item performs on the GPU. *

* Instead of launching one work-item per candidate key, the kernel can loop * {@code loopCount} times per work-item to reduce the total number of threads * and avoid exceeding GPU or host memory limits. *

*

* This directly reduces the number of launched work-items by a factor of {@code loopCount}, * and each work-item will compute and write {@code loopCount} results. *

*

* Requirements: *

    *
  • {@code loopCount} must be a power of two (e.g. 1, 2, 4, 8, 16, ...)
  • *
  • The total result size (workSize × loopCount × chunkSize) must not exceed {@code Integer.MAX_VALUE}
  • *
  • {@code batchSizeInBits} must be divisible by {@code loopCount}
  • *
*

*

* Performance notes: *

    *
  • Lower values (e.g. 4 or 8) are often sufficient to reduce launch overhead and register pressure.
  • *
  • Using too high a {@code loopCount} can underutilize the GPU, as fewer total work-items are launched, * which may reduce occupancy and throughput on highly parallel architectures.
  • *
  • This optimization is especially useful when using point addition in the kernel instead of full scalar multiplication.
  • *
*

*

* Example: * If {@code batchSizeInBits} = 20 (≈1 million keys) and {@code loopCount} = 8, * the kernel is launched with only 131,072 work-items (1,048,576 ÷ 8), * each performing 8 iterations internally. *

*/ public int loopCount = 1; } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/CSecretFormat.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; public enum CSecretFormat { /** * Represents a big integer. * e.g.: *
     * 72155939486846849509759369733266486982821795810448245423168957390607644363272
     * 39929263256442288830290225612580366403172818928633701045115663441379782969864
     * 42379586058257162021782620237913525000692985364990081801945649219990416465578
     * 
*/ BIG_INTEGER, /** * Also referred to as WiF (Wallet Import Format). * e.g.: *
     * 5K2YUVmWfxbmvsNxCsfvArXdGXm7d5DC9pn4yD75k2UaSYgkXTh
     * 5JVAXLpkZ21svEzwyimMHn5hAkWNqJq8uGxqUqcRrNb8F4Csp8V
     * 5JXYuGrwSbyp8sKBmiLcvokqSnxALPjKWQMPJXZYyBWKof7c2pk
     * 
*/ DUMPED_RIVATE_KEY, /** * A HEX-encoded SHA256 string. This might already be the hashed brainwallet. * e.g.: *
     * 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
     * 58472980a1d3449939eadc2652370972d5007fa9c059ce84fb3ab98f544e4a08
     * 5db1fee4b5703808c48078a76768b155b421b210c0761cd6a5d223f4d99f1eaa
     * 
*/ SHA256, /** * Also known as a brainwallet. A string is hashed using SHA256 and used as the private key. * e.g.: *
     * test
     * test with space
     * 1337
     * 
*/ STRING_DO_SHA256 } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/configuration/UnknownSecretFormatException.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; /** * Thrown by {@link net.ladenthin.bitcoinaddressfinder.SecretsFile} when a * {@link CSecretFormat} value is encountered that is not handled by the * implementation. This indicates a programming error: a new enum constant was * added to {@link CSecretFormat} but the corresponding handling branch was not * implemented. */ public class UnknownSecretFormatException extends IllegalArgumentException { private final CSecretFormat secretFormat; public UnknownSecretFormatException(CSecretFormat secretFormat) { super("Unknown secret format: " + secretFormat); this.secretFormat = secretFormat; } public CSecretFormat getSecretFormat() { return secretFormat; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/eckey/Secp256k1.java ================================================ package net.ladenthin.bitcoinaddressfinder.eckey; import java.math.BigInteger; import java.security.GeneralSecurityException; import java.security.KeyFactory; import java.security.interfaces.ECPrivateKey; import java.security.interfaces.ECPublicKey; import java.security.spec.ECField; import java.security.spec.ECFieldFp; import java.security.spec.ECParameterSpec; import java.security.spec.ECPoint; import java.security.spec.ECPublicKeySpec; import java.security.spec.EllipticCurve; // https://stackoverflow.com/questions/19673962/codes-to-generate-a-public-key-in-an-elliptic-curve-algorithm-using-a-given-priv/42797410#42797410 public class Secp256k1 { final static BigInteger FieldP_2 = BigInteger.valueOf(2); // constant for scalar operations final static BigInteger FieldP_3 = BigInteger.valueOf(3); // constant for scalar operations public static String byteArrayToHexString(byte[] a) { StringBuilder sb = new StringBuilder(a.length * 2); for (byte b : a) { sb.append(String.format("%02X", b)); } return sb.toString(); } public static byte[] hexStringToByteArray(String s) { int len = s.length(); byte[] data = new byte[len / 2]; for (int i = 0; i < len; i += 2) { data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i + 1), 16)); } return data; } // scalar operations for native java // see https://stackoverflow.com/a/42797410/8166854 // written by author: SkateScout private static ECPoint doublePoint(final BigInteger p, final BigInteger a, final ECPoint R) { if (R.equals(ECPoint.POINT_INFINITY)) { return R; } BigInteger slope = (R.getAffineX().pow(2)).multiply(FieldP_3); slope = slope.add(a); slope = slope.multiply((R.getAffineY().multiply(FieldP_2)).modInverse(p)); final BigInteger Xout = slope.pow(2).subtract(R.getAffineX().multiply(FieldP_2)).mod(p); final BigInteger Yout = (R.getAffineY().negate()).add(slope.multiply(R.getAffineX().subtract(Xout))).mod(p); return new ECPoint(Xout, Yout); } private static ECPoint addPoint(final BigInteger p, final BigInteger a, final ECPoint r, final ECPoint g) { if (r.equals(ECPoint.POINT_INFINITY)) { return g; } if (g.equals(ECPoint.POINT_INFINITY)) { return r; } if (r == g || r.equals(g)) { return doublePoint(p, a, r); } final BigInteger gX = g.getAffineX(); final BigInteger sY = g.getAffineY(); final BigInteger rX = r.getAffineX(); final BigInteger rY = r.getAffineY(); final BigInteger slope = (rY.subtract(sY)).multiply(rX.subtract(gX).modInverse(p)).mod(p); final BigInteger Xout = (slope.modPow(FieldP_2, p).subtract(rX)).subtract(gX).mod(p); BigInteger Yout = sY.negate().mod(p); Yout = Yout.add(slope.multiply(gX.subtract(Xout))).mod(p); return new ECPoint(Xout, Yout); } public static ECPoint scalmultNew(final ECParameterSpec params, final ECPoint g, final BigInteger kin) { EllipticCurve curve = params.getCurve(); final ECField field = curve.getField(); if (!(field instanceof ECFieldFp)) { throw new UnsupportedOperationException(field.getClass().getCanonicalName()); } final BigInteger p = ((ECFieldFp) field).getP(); final BigInteger a = curve.getA(); ECPoint R = ECPoint.POINT_INFINITY; // value only valid for curve secp256k1, code taken from https://www.secg.org/sec2-v2.pdf, // see "Finally the order n of G and the cofactor are: n = "FF.." BigInteger SECP256K1_Q = params.getOrder(); //BigInteger SECP256K1_Q = new BigInteger("00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",16); BigInteger k = kin.mod(SECP256K1_Q); // uses this ! // BigInteger k = kin.mod(p); // do not use this ! wrong as per comment from President James Moveon Polk final int length = k.bitLength(); final byte[] binarray = new byte[length]; for (int i = 0; i <= length - 1; i++) { binarray[i] = k.mod(FieldP_2).byteValue(); k = k.shiftRight(1); } for (int i = length - 1; i >= 0; i--) { R = doublePoint(p, a, R); if (binarray[i] == 1) { R = addPoint(p, a, R, g); } } return R; } public static ECPoint scalmultOrg(final EllipticCurve curve, final ECPoint g, final BigInteger kin) { final ECField field = curve.getField(); if (!(field instanceof ECFieldFp)) { throw new UnsupportedOperationException(field.getClass().getCanonicalName()); } final BigInteger p = ((ECFieldFp) field).getP(); final BigInteger a = curve.getA(); ECPoint R = ECPoint.POINT_INFINITY; // value only valid for curve secp256k1, code taken from https://www.secg.org/sec2-v2.pdf, // see "Finally the order n of G and the cofactor are: n = "FF.." BigInteger SECP256K1_Q = new BigInteger("00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141", 16); BigInteger k = kin.mod(SECP256K1_Q); // uses this ! // wrong as per comment from President James Moveon Polk // BigInteger k = kin.mod(p); // do not use this ! System.out.println(" SECP256K1_Q: " + SECP256K1_Q); System.out.println(" p: " + p); System.out.println("curve: " + curve); final int length = k.bitLength(); final byte[] binarray = new byte[length]; for (int i = 0; i <= length - 1; i++) { binarray[i] = k.mod(FieldP_2).byteValue(); k = k.shiftRight(1); } for (int i = length - 1; i >= 0; i--) { R = doublePoint(p, a, R); if (binarray[i] == 1) { R = addPoint(p, a, R, g); } } return R; } public static ECPublicKey getPublicKey(final ECPrivateKey pk) throws GeneralSecurityException { final ECParameterSpec params = pk.getParams(); final ECPoint w = scalmultNew(params, pk.getParams().getGenerator(), pk.getS()); //final ECPoint w = scalmult(params.getCurve(), pk.getParams().getGenerator(), pk.getS()); final KeyFactory kg = KeyFactory.getInstance("EC"); return (ECPublicKey) kg.generatePublic(new ECPublicKeySpec(w, params)); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/keyproducer/AbstractKeyProducer.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; public abstract class AbstractKeyProducer implements KeyProducer { } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/keyproducer/AbstractKeyProducerQueueBuffered.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import java.math.BigInteger; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import net.ladenthin.bitcoinaddressfinder.PublicKeyBytes; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaReceiver; import org.slf4j.Logger; /** * Base class to manage secret buffering using a blocking queue. * Intended for streaming protocols like WebSocket or ZMQ. */ public abstract class AbstractKeyProducerQueueBuffered extends KeyProducerJava { protected final KeyUtility keyUtility; protected final BlockingQueue secretQueue; protected volatile boolean shouldStop = false; public AbstractKeyProducerQueueBuffered(T config, KeyUtility keyUtility, Logger logger) { super(config, logger); this.keyUtility = keyUtility; this.secretQueue = new LinkedBlockingQueue<>(); } protected AbstractKeyProducerQueueBuffered( T config, KeyUtility keyUtility, Logger logger, BlockingQueue queue ) { super(config, logger); this.keyUtility = keyUtility; this.secretQueue = queue; } @Override public BigInteger[] createSecrets(int overallWorkSize, boolean returnStartSecretOnly) throws NoMoreSecretsAvailableException { verifyWorkSize(overallWorkSize, cKeyProducerJava.maxWorkSize); int length = returnStartSecretOnly ? 1 : overallWorkSize; BigInteger[] secrets = new BigInteger[length]; for (int i = 0; i < length; i++) { if (shouldStop) { throw new NoMoreSecretsAvailableException("Interrupted while waiting for secrets"); } try { byte[] secret = secretQueue.poll(getReadTimeout(), TimeUnit.MILLISECONDS); if (secret == null) { throw new NoMoreSecretsAvailableException("Timeout while waiting for secret"); } if (secret.length != PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES) { throw new NoMoreSecretsAvailableException("Invalid secret length: " + secret.length); } secrets[i] = keyUtility.bigIntegerFromUnsignedByteArray(secret); if (cKeyProducerJava.logReceivedSecret) { logger.info("Received key: {}", keyUtility.bigIntegerToFixedLengthHex(secrets[i])); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new NoMoreSecretsAvailableException("Interrupted while polling secret", e); } } return secrets; } protected void sleep(int millis) { try { Thread.sleep(millis); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } /** * Add a raw secret (e.g. from socket, ZMQ, websocket). */ protected void addSecret(byte[] secret) { if (!shouldStop) { if (!secretQueue.offer(secret)) { logger.error("Secret queue is full, ignore secret: {}", secret); } } } /** * Override to define how long createSecrets() should block. */ protected abstract int getReadTimeout(); } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/keyproducer/ConnectionUtils.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import java.net.InetSocketAddress; import java.net.Socket; public class ConnectionUtils { public static void waitUntilTcpPortOpen(String host, int port, int timeoutMillis) throws InterruptedException { long start = System.currentTimeMillis(); while (System.currentTimeMillis() - start < timeoutMillis) { try (Socket socket = new Socket()) { socket.connect(new InetSocketAddress(host, port), 100); return; } catch (Exception e) { Thread.sleep(50); } } throw new IllegalStateException("TCP port " + host + ":" + port + " not open after " + timeoutMillis + "ms"); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducer.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import java.math.BigInteger; import net.ladenthin.bitcoinaddressfinder.Interruptable; import org.slf4j.Logger; public interface KeyProducer extends Interruptable { BigInteger[] createSecrets(int overallWorkSize, boolean returnStartSecretOnly) throws NoMoreSecretsAvailableException; Logger getLogger(); } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerIdIsNotUniqueException.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; /** * Thrown by {@link net.ladenthin.bitcoinaddressfinder.Finder} during * producer initialisation when two or more producers share the same * {@code keyProducerId}. Each producer must be identified by a unique string * so that hits can be attributed to the correct producer. */ public class KeyProducerIdIsNotUniqueException extends RuntimeException { private final String id; public KeyProducerIdIsNotUniqueException(String id) { super("Key producer id must be unique: " + id); this.id = id; } public String getId() { return id; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerIdNullException.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; /** * Thrown by {@link net.ladenthin.bitcoinaddressfinder.Finder} during * producer initialisation when a producer's {@code keyProducerId} is * {@code null}. Every producer must carry a non-null identifier so that * hits can be attributed to the correct producer. */ public class KeyProducerIdNullException extends RuntimeException { public KeyProducerIdNullException() { super("Key producer id must not be null."); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerIdUnknownException.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import org.jspecify.annotations.Nullable; /** * Thrown by {@link net.ladenthin.bitcoinaddressfinder.Finder} when a * configured {@code keyProducerId} cannot be resolved to a registered producer. * This typically indicates a misconfiguration: the requested producer type is * not supported or the id was misspelled. */ public class KeyProducerIdUnknownException extends RuntimeException { private final @Nullable String id; public KeyProducerIdUnknownException(@Nullable String id) { super("Key producer id is unknown: " + id); this.id = id; } public @Nullable String getId() { return id; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerJava.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJava; import org.slf4j.Logger; public abstract class KeyProducerJava extends AbstractKeyProducer { protected final T cKeyProducerJava; protected final Logger logger; public KeyProducerJava(T cKeyProducerJava, Logger logger) { this.cKeyProducerJava = cKeyProducerJava; this.logger = logger; } public void verifyWorkSize(int overallWorkSize, int maxWorkSize) throws NoMoreSecretsAvailableException { if (overallWorkSize < 0 || overallWorkSize > maxWorkSize) { throw new IllegalArgumentException("Unreasonable work size: " + overallWorkSize); } } @Override public Logger getLogger() { return logger; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerJavaBip39.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import java.math.BigInteger; import net.ladenthin.bitcoinaddressfinder.BIP39KeyProducer; import net.ladenthin.bitcoinaddressfinder.BitHelper; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import net.ladenthin.bitcoinaddressfinder.RandomSecretSupplier; import net.ladenthin.bitcoinaddressfinder.SecretSupplier; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaBip39; import org.slf4j.Logger; public class KeyProducerJavaBip39 extends KeyProducerJava { private final KeyUtility keyUtility; private final BitHelper bitHelper; private final SecretSupplier randomSupplier; private final BIP39KeyProducer bip39KeyProducer; public KeyProducerJavaBip39(CKeyProducerJavaBip39 cKeyProducerJavaBip39, KeyUtility keyUtility, BitHelper bitHelper, Logger logger) { super(cKeyProducerJavaBip39, logger); this.keyUtility = keyUtility; this.bitHelper = bitHelper; bip39KeyProducer = new BIP39KeyProducer( cKeyProducerJavaBip39.mnemonic, cKeyProducerJavaBip39.passphrase, cKeyProducerJavaBip39.bip32Path, cKeyProducerJavaBip39.getCreationTimeInstant(), cKeyProducerJavaBip39.hardened ); randomSupplier = new RandomSecretSupplier(bip39KeyProducer); } @Override public BigInteger[] createSecrets(int overallWorkSize, boolean returnStartSecretOnly) throws NoMoreSecretsAvailableException { verifyWorkSize(overallWorkSize, cKeyProducerJava.maxWorkSize); return keyUtility.createSecrets(overallWorkSize, returnStartSecretOnly, this.cKeyProducerJava.privateKeyMaxNumBits, randomSupplier); } @Override public void interrupt() { } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerJavaIncremental.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import java.math.BigInteger; import net.ladenthin.bitcoinaddressfinder.BitHelper; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaIncremental; import org.jspecify.annotations.NonNull; import org.slf4j.Logger; public class KeyProducerJavaIncremental extends KeyProducerJava { @NonNull private BigInteger currentValue; public KeyProducerJavaIncremental(CKeyProducerJavaIncremental cKeyProducerJavaIncremental, KeyUtility keyUtility, BitHelper bitHelper, Logger logger) { super(cKeyProducerJavaIncremental, logger); this.currentValue = new BigInteger(cKeyProducerJavaIncremental.startAddress, BitHelper.RADIX_HEX); } @Override public BigInteger[] createSecrets(int overallWorkSize, boolean returnStartSecretOnly) throws NoMoreSecretsAvailableException { verifyWorkSize(overallWorkSize, cKeyProducerJava.maxWorkSize); final BigInteger endAddress = cKeyProducerJava.getEndAddress(); if (currentValue.compareTo(endAddress) > 0) { throw new NoMoreSecretsAvailableException(currentValue + " exceeds "); } int length = returnStartSecretOnly ? 1 : overallWorkSize; BigInteger[] secrets = new BigInteger[length]; BigInteger counter = currentValue; for (int i = 0; i < length; i++) { if (counter.compareTo(endAddress) > 0) { throw new NoMoreSecretsAvailableException(counter + " exceeds end address " + endAddress); } secrets[i] = counter; counter = counter.add(BigInteger.ONE); } currentValue = currentValue.add(BigInteger.valueOf(overallWorkSize)); return secrets; } @Override public void interrupt() { } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerJavaRandom.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import java.math.BigInteger; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.Random; import net.ladenthin.bitcoinaddressfinder.BitHelper; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import net.ladenthin.bitcoinaddressfinder.RandomSecretSupplier; import net.ladenthin.bitcoinaddressfinder.SecretSupplier; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaRandom; import org.slf4j.Logger; public class KeyProducerJavaRandom extends KeyProducerJava { private final KeyUtility keyUtility; private final BitHelper bitHelper; private final SecretSupplier randomSupplier; /** * It is already thread local, no need for {@link java.util.concurrent.ThreadLocalRandom}. */ private final Random random; @SuppressWarnings({"squid:S2245"}) public KeyProducerJavaRandom(CKeyProducerJavaRandom cKeyProducerJavaRandom, KeyUtility keyUtility, BitHelper bitHelper, Logger logger) { super(cKeyProducerJavaRandom, logger); this.keyUtility = keyUtility; this.bitHelper = bitHelper; switch (cKeyProducerJavaRandom.keyProducerJavaRandomInstance) { case SECURE_RANDOM: try { random = SecureRandom.getInstanceStrong(); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } break; case RANDOM_CURRENT_TIME_MILLIS_SEED: // EXPLOIT for: https://cwe.mitre.org/data/definitions/338 random = new Random(System.currentTimeMillis()); break; case RANDOM_CUSTOM_SEED: // EXPLOIT for: https://cwe.mitre.org/data/definitions/338 random = new Random(); if (cKeyProducerJavaRandom.customSeed != null) { random.setSeed(cKeyProducerJavaRandom.customSeed); // only if explicitly configured } break; case SHA1_PRNG: try { random = SecureRandom.getInstance("SHA1PRNG"); // To simulate bug: do NOT set a seed at all if (cKeyProducerJavaRandom.customSeed != null) { random.setSeed(cKeyProducerJavaRandom.customSeed); // only if explicitly configured } } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } break; default: throw new RuntimeException("Unknown keyProducerJavaRandomInstance: " + cKeyProducerJavaRandom.keyProducerJavaRandomInstance); } randomSupplier = new RandomSecretSupplier(random); } @Override public BigInteger[] createSecrets(int overallWorkSize, boolean returnStartSecretOnly) throws NoMoreSecretsAvailableException { verifyWorkSize(overallWorkSize, cKeyProducerJava.maxWorkSize); return keyUtility.createSecrets(overallWorkSize, returnStartSecretOnly, this.cKeyProducerJava.privateKeyMaxNumBits, randomSupplier); } @Override public void interrupt() { } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerJavaSocket.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaSocket; import java.io.DataInputStream; import java.io.IOException; import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; import java.util.Objects; import java.util.concurrent.ExecutorService; import net.ladenthin.bitcoinaddressfinder.BitHelper; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import net.ladenthin.bitcoinaddressfinder.PublicKeyBytes; import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import java.util.concurrent.*; public class KeyProducerJavaSocket extends AbstractKeyProducerQueueBuffered { private @Nullable ServerSocket serverSocket; private @Nullable Socket socket; private @Nullable DataInputStream inputStream; private Future readerFuture; private final ExecutorService readerExecutor = Executors.newSingleThreadExecutor(); public KeyProducerJavaSocket(CKeyProducerJavaSocket config, KeyUtility keyUtility, BitHelper bitHelper, Logger logger) { super(config, keyUtility, logger); setupSocket(); } private void setupSocket() { readerFuture = readerExecutor.submit(() -> { int attempts = 0; Exception lastException = null; while (!shouldStop && attempts < cKeyProducerJava.connectionRetryCount) { try { if (cKeyProducerJava.mode == CKeyProducerJavaSocket.Mode.SERVER) { if (serverSocket == null) { serverSocket = new ServerSocket(cKeyProducerJava.getPort()); serverSocket.setSoTimeout(cKeyProducerJava.timeout); } socket = serverSocket.accept(); logger.info("Accepted client connection at port {}", cKeyProducerJava.getPort()); } else { socket = new Socket(); socket.connect(new InetSocketAddress(cKeyProducerJava.getHost(), cKeyProducerJava.getPort()), cKeyProducerJava.timeout); logger.info("Connected to server at {}:{}", cKeyProducerJava.getHost(), cKeyProducerJava.getPort()); } Socket localSocket = Objects.requireNonNull(socket); localSocket.setSoTimeout(cKeyProducerJava.timeout); inputStream = new DataInputStream(localSocket.getInputStream()); byte[] buffer = new byte[PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES]; while (!shouldStop) { int read = 0; while (read < buffer.length) { int r = inputStream.read(buffer, read, buffer.length - read); if (r == -1) throw new IOException("End of stream"); read += r; } addSecret(buffer.clone()); } } catch (IOException e) { lastException = e; logger.warn("Connection attempt {} failed: {}", attempts + 1, e.getMessage()); attempts++; closeConnections(); sleep(cKeyProducerJava.retryDelayMillisConnect); } } if (!shouldStop && socket == null) { throw new RuntimeException("Unable to establish socket connection", lastException); } }); } private void closeConnections() { try { if (inputStream != null) inputStream.close(); } catch (IOException ignored) {} try { if (socket != null) socket.close(); } catch (IOException ignored) {} try { if (serverSocket != null) serverSocket.close(); } catch (IOException ignored) {} inputStream = null; socket = null; serverSocket = null; } @Override protected int getReadTimeout() { return cKeyProducerJava.timeout; } @Override public void interrupt() { shouldStop = true; if (readerFuture != null) { readerFuture.cancel(true); } readerExecutor.shutdownNow(); closeConnections(); try { readerExecutor.awaitTermination(500, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerJavaWebSocket.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import net.ladenthin.bitcoinaddressfinder.BitHelper; import net.ladenthin.bitcoinaddressfinder.PublicKeyBytes; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaWebSocket; import org.java_websocket.WebSocket; import org.java_websocket.server.WebSocketServer; import org.java_websocket.handshake.ClientHandshake; import org.slf4j.Logger; import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.util.concurrent.Executors; public class KeyProducerJavaWebSocket extends AbstractKeyProducerQueueBuffered { private WebSocketServer webSocketServer; public KeyProducerJavaWebSocket(CKeyProducerJavaWebSocket config, KeyUtility keyUtility, BitHelper bitHelper, Logger logger) { super(config, keyUtility, logger); initWebSocketServer(); } private void initWebSocketServer() { webSocketServer = new WebSocketServer(new InetSocketAddress(cKeyProducerJava.getPort())) { @Override public void onOpen(WebSocket conn, ClientHandshake handshake) { logger.info("WebSocket connection opened from: {}", conn.getRemoteSocketAddress()); } @Override public void onClose(WebSocket conn, int code, String reason, boolean remote) { logger.info("WebSocket closed: {}", conn.getRemoteSocketAddress()); } @Override public void onMessage(WebSocket conn, ByteBuffer message) { if (shouldStop) return; if (message.remaining() == PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES) { byte[] secret = new byte[PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES]; message.get(secret); addSecret(secret); } else { logger.warn("Invalid message length: {}", message.remaining()); } } @Override public void onError(WebSocket conn, Exception ex) { logger.error("WebSocket error", ex); } @Override public void onStart() { logger.info("WebSocket server started on port: {}", getPort()); } @Override public void onMessage(WebSocket ws, String string) { logger.info("onMessage: {}", string); } }; Executors.newSingleThreadExecutor().submit(webSocketServer::start); } @Override protected int getReadTimeout() { return cKeyProducerJava.timeout; } @Override public void interrupt() { shouldStop = true; if (webSocketServer != null) { try { webSocketServer.stop(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerJavaZmq.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import net.ladenthin.bitcoinaddressfinder.BitHelper; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaZmq; import net.ladenthin.bitcoinaddressfinder.PublicKeyBytes; import org.slf4j.Logger; import org.zeromq.SocketType; import org.zeromq.ZContext; import org.zeromq.ZMQ; import org.zeromq.ZMQException; public class KeyProducerJavaZmq extends AbstractKeyProducerQueueBuffered { private final ZContext context; private final ZMQ.Socket socket; private final Thread receiverThread; public KeyProducerJavaZmq(CKeyProducerJavaZmq config, KeyUtility keyUtility, BitHelper bitHelper, Logger logger) { super(config, keyUtility, logger); context = new ZContext(); socket = context.createSocket(SocketType.PULL); if (cKeyProducerJava.mode == CKeyProducerJavaZmq.Mode.BIND) { socket.bind(cKeyProducerJava.address); } else { socket.connect(cKeyProducerJava.address); } int internalTimeout = getReadTimeout(); socket.setReceiveTimeOut(internalTimeout); receiverThread = new Thread(() -> { while (!shouldStop && !Thread.currentThread().isInterrupted()) { try { byte[] msg = socket.recv(0); // blocking up to timeout if (msg != null) { if (msg.length == PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES) { addSecret(msg); } else { logger.error("Received invalid secret length: " + msg.length); } } // if msg is null: it's a timeout — just loop again } catch (ZMQException e) { if (shouldStop || e.getErrorCode() == ZMQ.Error.ETERM.getCode()) break; logger.error("ZMQ error", e); // unexpected ZMQ errors } } }, "ZMQ-Receiver"); receiverThread.setDaemon(true); receiverThread.start(); } @Override protected int getReadTimeout() { return cKeyProducerJava.timeout; } @Override public void interrupt() { shouldStop = true; receiverThread.interrupt(); // allow thread to exit if blocked try { receiverThread.join(500); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } socket.close(); context.close(); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/keyproducer/NoMoreSecretsAvailableException.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; /** * Exception thrown when no more secrets are available. * * This class extends RuntimeException because it is used with methods such as * {@link java.util.Random#nextBytes(byte[])} and {@link java.math.BigInteger#BigInteger(int, java.util.Random)}, * which require a {@code Random} instance that only throws unchecked exceptions. */ public class NoMoreSecretsAvailableException extends RuntimeException { public NoMoreSecretsAvailableException() { super(); } public NoMoreSecretsAvailableException(String message) { super(message); } public NoMoreSecretsAvailableException(String message, Throwable cause) { super(message, cause); } public NoMoreSecretsAvailableException(Throwable cause) { super(cause); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/opencl/OpenCLBuilder.java ================================================ // @formatter:off /** * Copyright 2022 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.opencl; import java.lang.reflect.Field; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.ArrayList; import java.util.List; import java.util.stream.LongStream; import com.google.common.collect.ImmutableList; import net.ladenthin.bitcoinaddressfinder.ByteBufferUtility; import org.apache.maven.artifact.versioning.ComparableVersion; import static org.jocl.CL.CL_CONTEXT_PLATFORM; import static org.jocl.CL.CL_DEVICE_ADDRESS_BITS; import static org.jocl.CL.CL_DEVICE_ENDIAN_LITTLE; import static org.jocl.CL.CL_DEVICE_ERROR_CORRECTION_SUPPORT; import static org.jocl.CL.CL_DEVICE_EXTENSIONS; import static org.jocl.CL.CL_DEVICE_GLOBAL_MEM_SIZE; import static org.jocl.CL.CL_DEVICE_IMAGE2D_MAX_HEIGHT; import static org.jocl.CL.CL_DEVICE_IMAGE2D_MAX_WIDTH; import static org.jocl.CL.CL_DEVICE_IMAGE3D_MAX_DEPTH; import static org.jocl.CL.CL_DEVICE_IMAGE3D_MAX_HEIGHT; import static org.jocl.CL.CL_DEVICE_IMAGE3D_MAX_WIDTH; import static org.jocl.CL.CL_DEVICE_IMAGE_SUPPORT; import static org.jocl.CL.CL_DEVICE_LOCAL_MEM_SIZE; import static org.jocl.CL.CL_DEVICE_LOCAL_MEM_TYPE; import static org.jocl.CL.CL_DEVICE_MAX_CLOCK_FREQUENCY; import static org.jocl.CL.CL_DEVICE_MAX_COMPUTE_UNITS; import static org.jocl.CL.CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE; import static org.jocl.CL.CL_DEVICE_MAX_MEM_ALLOC_SIZE; import static org.jocl.CL.CL_DEVICE_MAX_READ_IMAGE_ARGS; import static org.jocl.CL.CL_DEVICE_MAX_WORK_GROUP_SIZE; import static org.jocl.CL.CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS; import static org.jocl.CL.CL_DEVICE_MAX_WORK_ITEM_SIZES; import static org.jocl.CL.CL_DEVICE_MAX_WRITE_IMAGE_ARGS; import static org.jocl.CL.CL_DEVICE_NAME; import static org.jocl.CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR; import static org.jocl.CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE; import static org.jocl.CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT; import static org.jocl.CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT; import static org.jocl.CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG; import static org.jocl.CL.CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT; import static org.jocl.CL.CL_DEVICE_PROFILE; import static org.jocl.CL.CL_DEVICE_QUEUE_PROPERTIES; import static org.jocl.CL.CL_DEVICE_SINGLE_FP_CONFIG; import static org.jocl.CL.CL_DEVICE_TYPE; import static org.jocl.CL.CL_DEVICE_TYPE_ALL; import static org.jocl.CL.CL_DEVICE_VENDOR; import static org.jocl.CL.CL_DEVICE_VERSION; import static org.jocl.CL.CL_DRIVER_VERSION; import static org.jocl.CL.CL_PLATFORM_NAME; import static org.jocl.CL.clGetDeviceIDs; import static org.jocl.CL.clGetDeviceInfo; import static org.jocl.CL.clGetPlatformIDs; import static org.jocl.CL.clGetPlatformInfo; import org.jocl.Pointer; import org.jocl.Sizeof; import org.jocl.cl_context_properties; import org.jocl.cl_device_id; import org.jocl.cl_platform_id; import org.jspecify.annotations.NonNull; public class OpenCLBuilder { public static boolean TRANSFORM_TO_PRINT = true; public List build() { // Obtain the number of platforms int[] numPlatforms = new int[1]; clGetPlatformIDs(0, null, numPlatforms); // Obtain the platform IDs List openCLPlatforms = new ArrayList<>(); cl_platform_id[] platforms = new cl_platform_id[numPlatforms[0]]; clGetPlatformIDs(platforms.length, platforms, null); for (int i=0; i openCLDevices = new ArrayList<>(); for (cl_device_id device : devicesArray) { OpenCLDevice openCLDevice = createOpenCLDevice(device); openCLDevices.add(openCLDevice); } OpenCLPlatform openCLPlatform = new OpenCLPlatform(platformName, contextProperties, ImmutableList.copyOf(openCLDevices)); openCLPlatforms.add(openCLPlatform); } return openCLPlatforms; } private OpenCLDevice createOpenCLDevice(cl_device_id device) { String deviceName = getString(device, CL_DEVICE_NAME); String deviceVendor = getString(device, CL_DEVICE_VENDOR); String driverVersion = getString(device, CL_DRIVER_VERSION); String deviceProfile = getString(device, CL_DEVICE_PROFILE); String deviceVersion = getString(device, CL_DEVICE_VERSION); String deviceExtensions = getString(device, CL_DEVICE_EXTENSIONS); boolean endianLittle = getInt(device, CL_DEVICE_ENDIAN_LITTLE) == 1; long deviceType = getLong(device, CL_DEVICE_TYPE); int maxComputeUnits = getInt(device, CL_DEVICE_MAX_COMPUTE_UNITS); long maxWorkItemDimensions = getLong(device, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS); long[] maxWorkItemSizes = getSizes(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, 3); long maxWorkGroupSize = getSize(device, CL_DEVICE_MAX_WORK_GROUP_SIZE); long maxClockFrequency = getLong(device, CL_DEVICE_MAX_CLOCK_FREQUENCY); int addressBits = getInt(device, CL_DEVICE_ADDRESS_BITS); long maxMemAllocSize = getLong(device, CL_DEVICE_MAX_MEM_ALLOC_SIZE); long globalMemSize = getLong(device, CL_DEVICE_GLOBAL_MEM_SIZE); int errorCorrectionSupport = getInt(device, CL_DEVICE_ERROR_CORRECTION_SUPPORT); int localMemType = getInt(device, CL_DEVICE_LOCAL_MEM_TYPE); long localMemSize = getLong(device, CL_DEVICE_LOCAL_MEM_SIZE); long maxConstantBufferSize = getLong(device, CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE); long queueProperties = getLong(device, CL_DEVICE_QUEUE_PROPERTIES); int imageSupport = getInt(device, CL_DEVICE_IMAGE_SUPPORT); int maxReadImageArgs = getInt(device, CL_DEVICE_MAX_READ_IMAGE_ARGS); int maxWriteImageArgs = getInt(device, CL_DEVICE_MAX_WRITE_IMAGE_ARGS); long singleFpConfig = getLong(device, CL_DEVICE_SINGLE_FP_CONFIG); long image2dMaxWidth = getSize(device, CL_DEVICE_IMAGE2D_MAX_WIDTH); long image2dMaxHeight = getSize(device, CL_DEVICE_IMAGE2D_MAX_HEIGHT); long image3dMaxWidth = getSize(device, CL_DEVICE_IMAGE3D_MAX_WIDTH); long image3dMaxHeight = getSize(device, CL_DEVICE_IMAGE3D_MAX_HEIGHT); long image3dMaxDepth = getSize(device, CL_DEVICE_IMAGE3D_MAX_DEPTH); int preferredVectorWidthChar = getInt(device, CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR); int preferredVectorWidthShort = getInt(device, CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT); int preferredVectorWidthInt = getInt(device, CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT); int preferredVectorWidthLong = getInt(device, CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG); int preferredVectorWidthFloat = getInt(device, CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT); int preferredVectorWidthDouble = getInt(device, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE); OpenCLDevice openCLDevice = new OpenCLDevice( device, deviceName, deviceVendor, driverVersion, deviceProfile, deviceVersion, deviceExtensions, deviceType, endianLittle, maxComputeUnits, maxWorkItemDimensions, longsToImmutableList(maxWorkItemSizes), maxWorkGroupSize, maxClockFrequency, addressBits, maxMemAllocSize, globalMemSize, errorCorrectionSupport, localMemType, localMemSize, maxConstantBufferSize, queueProperties, imageSupport, maxReadImageArgs, maxWriteImageArgs, singleFpConfig, image2dMaxWidth, image2dMaxHeight, image3dMaxWidth, image3dMaxHeight, image3dMaxDepth, preferredVectorWidthChar, preferredVectorWidthShort, preferredVectorWidthInt, preferredVectorWidthLong, preferredVectorWidthFloat, preferredVectorWidthDouble ); return openCLDevice; } private static ImmutableList<@NonNull Long> longsToImmutableList(long[] array) { ImmutableList.Builder<@NonNull Long> b = ImmutableList.builderWithExpectedSize(array.length); for (long l : array) { b.add(l); } return b.build(); } public static boolean isOpenCLnativeLibraryLoadable() { try { Class.forName("org.jocl.CL"); Field field = org.jocl.CL.class.getDeclaredField("nativeLibraryLoaded"); field.setAccessible(true); return field.getBoolean(null); } catch(java.lang.UnsatisfiedLinkError e) { return false; } catch (java.lang.NoClassDefFoundError e) { return false; } catch (Exception e) { e.printStackTrace(); return false; } } public static boolean isOneOpenCL2_0OrGreaterDeviceAvailable(List openCLPlatforms) { for (OpenCLPlatform openCLPlatform : openCLPlatforms) { List openCLDevices = openCLPlatform.openCLDevices(); for (OpenCLDevice openCLDevice : openCLDevices) { if (isOpenCL2_0OrGreater(openCLDevice.getDeviceVersionAsComparableVersion())) { return true; } } } return false; } public static boolean isOpenCL2_0OrGreater(ComparableVersion openCLDeviceVersion) { final ComparableVersion v2_0 = new ComparableVersion("2.0"); return openCLDeviceVersion.compareTo(v2_0) >= 0; } /** * Returns the value of the device info parameter with the given name * * @param device The device * @param paramName The parameter name * @return The value */ private static int getInt(cl_device_id device, int paramName) { return getInts(device, paramName, 1)[0]; } /** * Returns the values of the device info parameter with the given name * * @param device The device * @param paramName The parameter name * @param numValues The number of values * @return The value */ private static int[] getInts(cl_device_id device, int paramName, int numValues) { int[] values = new int[numValues]; clGetDeviceInfo(device, paramName, (long)Sizeof.cl_int * numValues, Pointer.to(values), null); return values; } /** * Returns the value of the device info parameter with the given name * * @param device The device * @param paramName The parameter name * @return The value */ private static long getLong(cl_device_id device, int paramName) { return getLongs(device, paramName, 1)[0]; } /** * Returns the values of the device info parameter with the given name * * @param device The device * @param paramName The parameter name * @param numValues The number of values * @return The value */ private static long[] getLongs(cl_device_id device, int paramName, int numValues) { long[] values = new long[numValues]; clGetDeviceInfo(device, paramName, (long)Sizeof.cl_long * numValues, Pointer.to(values), null); return values; } /** * Returns the value of the device info parameter with the given name * * @param device The device * @param paramName The parameter name * @return The value */ private static String getString(cl_device_id device, int paramName) { // Obtain the length of the string that will be queried long[] size = new long[1]; clGetDeviceInfo(device, paramName, 0, null, size); // Create a buffer of the appropriate size and fill it with the info byte[] buffer = new byte[(int)size[0]]; clGetDeviceInfo(device, paramName, buffer.length, Pointer.to(buffer), null); // Create a string from the buffer (excluding the trailing \0 byte) return new String(buffer, 0, buffer.length-1); } /** * Returns the value of the platform info parameter with the given name * * @param platform The platform * @param paramName The parameter name * @return The value */ private static String getString(cl_platform_id platform, int paramName) { // Obtain the length of the string that will be queried long[] size = new long[1]; clGetPlatformInfo(platform, paramName, 0, null, size); // Create a buffer of the appropriate size and fill it with the info byte[] buffer = new byte[(int)size[0]]; clGetPlatformInfo(platform, paramName, buffer.length, Pointer.to(buffer), null); // Create a string from the buffer (excluding the trailing \0 byte) return new String(buffer, 0, buffer.length-1); } /** * Returns the value of the device info parameter with the given name * * @param device The device * @param paramName The parameter name * @return The value */ private static long getSize(cl_device_id device, int paramName) { return getSizes(device, paramName, 1)[0]; } /** * Returns the values of the device info parameter with the given name * * @param device The device * @param paramName The parameter name * @param numValues The number of values * @return The value */ static long[] getSizes(cl_device_id device, int paramName, int numValues) { // The size of the returned data has to depend on // the size of a size_t, which is handled here long size = (long)numValues * Sizeof.size_t; ByteBuffer buffer = ByteBuffer.allocate( ByteBufferUtility.ensureByteBufferCapacityFitsInt(size)).order(ByteOrder.nativeOrder()); clGetDeviceInfo(device, paramName, size, Pointer.to(buffer), null); long[] values = new long[numValues]; if (Sizeof.size_t == 4) { for (int i=0; i maxWorkItemSizes, long maxWorkGroupSize, long maxClockFrequency, int addressBits, long maxMemAllocSize, long globalMemSize, long errorCorrectionSupport, int localMemType, long localMemSize, long maxConstantBufferSize, long queueProperties, int imageSupport, int maxReadImageArgs, int maxWriteImageArgs, long singleFpConfig, long image2dMaxWidth, long image2dMaxHeight, long image3dMaxWidth, long image3dMaxHeight, long image3dMaxDepth, int preferredVectorWidthChar, int preferredVectorWidthShort, int preferredVectorWidthInt, int preferredVectorWidthLong, int preferredVectorWidthFloat, int preferredVectorWidthDouble ) implements Serializable { public ByteOrder getByteOrder() { if(endianLittle) { return ByteOrder.LITTLE_ENDIAN; } return ByteOrder.BIG_ENDIAN; } public String toStringPretty() { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final Charset charset = java.nio.charset.StandardCharsets.UTF_8; try (PrintStream ps = new PrintStream(baos, true, charset)) { ps.println("--- Info for OpenCL device: " + deviceName + " ---"); ps.printf("cl_device_id: %s%n", device); ps.printf("CL_DEVICE_NAME: %s%n", deviceName); ps.printf("CL_DEVICE_VENDOR: %s%n", deviceVendor); ps.printf("CL_DRIVER_VERSION: %s%n", driverVersion); ps.printf("CL_DEVICE_PROFILE: %s%n", deviceProfile); ps.printf("CL_DEVICE_VERSION: %s%n", deviceVersion); ps.printf("CL_DEVICE_EXTENSIONS: %s%n", deviceExtensions); ps.printf("CL_DEVICE_TYPE: %s%n", CL.stringFor_cl_device_type(deviceType)); ps.printf("CL_DEVICE_ENDIAN_LITTLE: %b%n", endianLittle); ps.printf("CL_DEVICE_MAX_COMPUTE_UNITS: %d%n", maxComputeUnits); ps.printf("CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS: %d%n", maxWorkItemDimensions); ps.printf("CL_DEVICE_MAX_WORK_ITEM_SIZES: %s%n", formatWorkItemSizes(maxWorkItemSizes)); ps.printf("CL_DEVICE_MAX_WORK_GROUP_SIZE: %d%n", maxWorkGroupSize); ps.printf("CL_DEVICE_MAX_CLOCK_FREQUENCY: %d MHz%n", maxClockFrequency); ps.printf("CL_DEVICE_ADDRESS_BITS: %d%n", addressBits); ps.printf("CL_DEVICE_MAX_MEM_ALLOC_SIZE: %d MByte%n", maxMemAllocSize / (1024 * 1024)); ps.printf("CL_DEVICE_GLOBAL_MEM_SIZE: %d MByte%n", globalMemSize / (1024 * 1024)); ps.printf("CL_DEVICE_ERROR_CORRECTION_SUPPORT: %s%n", errorCorrectionSupport != 0 ? "yes" : "no"); ps.printf("CL_DEVICE_LOCAL_MEM_TYPE: %s%n", CL.stringFor_cl_device_local_mem_type(localMemType)); ps.printf("CL_DEVICE_LOCAL_MEM_SIZE: %d KByte%n", localMemSize / 1024); ps.printf("CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE: %d KByte%n", maxConstantBufferSize / 1024); ps.printf("CL_DEVICE_QUEUE_PROPERTIES: %s%n", CL.stringFor_cl_command_queue_properties(queueProperties)); ps.printf("CL_DEVICE_IMAGE_SUPPORT: %d%n", imageSupport); ps.printf("CL_DEVICE_MAX_READ_IMAGE_ARGS: %d%n", maxReadImageArgs); ps.printf("CL_DEVICE_MAX_WRITE_IMAGE_ARGS: %d%n", maxWriteImageArgs); ps.printf("CL_DEVICE_SINGLE_FP_CONFIG: %s%n", CL.stringFor_cl_device_fp_config(singleFpConfig)); ps.printf("CL_DEVICE_IMAGE2D_MAX_WIDTH: %d%n", image2dMaxWidth); ps.printf("CL_DEVICE_IMAGE2D_MAX_HEIGHT: %d%n", image2dMaxHeight); ps.printf("CL_DEVICE_IMAGE3D_MAX_WIDTH: %d%n", image3dMaxWidth); ps.printf("CL_DEVICE_IMAGE3D_MAX_HEIGHT: %d%n", image3dMaxHeight); ps.printf("CL_DEVICE_IMAGE3D_MAX_DEPTH: %d%n", image3dMaxDepth); ps.printf("CL_DEVICE_PREFERRED_VECTOR_WIDTHS: CHAR %d, SHORT %d, INT %d, LONG %d, FLOAT %d, DOUBLE %d%n", preferredVectorWidthChar, preferredVectorWidthShort, preferredVectorWidthInt, preferredVectorWidthLong, preferredVectorWidthFloat, preferredVectorWidthDouble); } return baos.toString(charset); } public static String formatWorkItemSizes(List sizes) { if (sizes.isEmpty()) return "(none)"; StringBuilder sb = new StringBuilder(); for (int i = 0; i < sizes.size(); i++) { sb.append(sizes.get(i)); if (i < sizes.size() - 1) sb.append(" / "); } return sb.toString(); } public ComparableVersion getDeviceVersionAsComparableVersion() { return getComparableVersionFromDeviceVersion(deviceVersion()); } public static ComparableVersion getComparableVersionFromDeviceVersion(String deviceVersion) { String s = deviceVersion; s = s.replace("OpenCL ", ""); s = s.replace("CUDA", ""); return new ComparableVersion(s.trim()); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/opencl/OpenCLDeviceSelection.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.opencl; import org.jocl.cl_context_properties; public record OpenCLDeviceSelection(OpenCLPlatform platform, OpenCLDevice device, cl_context_properties contextProperties) { } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/opencl/OpenCLPlatform.java ================================================ // @formatter:off /** * Copyright 2022 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.opencl; import com.google.common.collect.ImmutableList; import com.google.errorprone.annotations.Immutable; import org.jocl.cl_context_properties; import org.jspecify.annotations.NonNull; import java.io.Serializable; /** * Represents an OpenCL platform and its associated devices. * * @param platformName the name of the OpenCL platform * @param contextProperties the context properties of the OpenCL platform * @param openCLDevices a list of associated OpenCL devices */ @Immutable public record OpenCLPlatform( @NonNull String platformName, @SuppressWarnings("Immutable") @NonNull cl_context_properties contextProperties, @NonNull ImmutableList<@NonNull OpenCLDevice> openCLDevices ) implements Serializable { public OpenCLPlatform(String platformName, cl_context_properties contextProperties, ImmutableList<@NonNull OpenCLDevice> openCLDevices) { this.platformName = platformName; this.contextProperties = contextProperties; this.openCLDevices = openCLDevices; } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/opencl/OpenCLPlatformSelector.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.opencl; import java.util.List; public class OpenCLPlatformSelector { /** * Selects an OpenCLDevice based on the platform index and device type from the given list of platforms. * * @param platforms The list of available OpenCL platforms * @param platformIndex The index of the platform to select * @param deviceType The OpenCL device type (e.g., CL_DEVICE_TYPE_GPU) * @param deviceIndex The index of the device within the platform * @return A selected OpenCLDeviceSelection containing platform, device, and context properties */ public OpenCLDeviceSelection select(List platforms, int platformIndex, long deviceType, int deviceIndex) { if (platformIndex < 0 || platformIndex >= platforms.size()) { throw new IllegalArgumentException("Invalid platform index: " + platformIndex); } OpenCLPlatform selectedPlatform = platforms.get(platformIndex); List matchingDevices = selectedPlatform.openCLDevices().stream() .filter(device -> (device.deviceType() & deviceType) != 0) .toList(); if (deviceIndex < 0 || deviceIndex >= matchingDevices.size()) { throw new IllegalArgumentException("Invalid device index: " + deviceIndex + " for deviceType: " + deviceType); } OpenCLDevice selectedDevice = matchingDevices.get(deviceIndex); return new OpenCLDeviceSelection(selectedPlatform, selectedDevice, selectedPlatform.contextProperties()); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/persistence/Persistence.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.persistence; import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; import net.ladenthin.bitcoinaddressfinder.configuration.CAddressFileOutputFormat; import org.bitcoinj.base.Coin; public interface Persistence extends AutoCloseable { void init(); boolean isClosed(); long count(); Coin getAmount(ByteBuffer hash160); boolean containsAddress(ByteBuffer hash160); void writeAllAmountsToAddressFile(File file, CAddressFileOutputFormat addressFileOutputFormat, AtomicBoolean shouldRun) throws IOException; /** * @param hash160 the hash160 to change its amount * @param amountToChange positive means add, negative means substract the amount */ void changeAmount(ByteBuffer hash160, Coin amountToChange); void putNewAmount(ByteBuffer hash160, Coin toWrite); void putAllAmounts(Map amounts) throws IOException; Coin getAllAmountsFromAddresses(List hash160s); long getDatabaseSize(); void increaseDatabaseSize(long toIncrease); /** * Retrieves the current value of the increased counter. * * @return the value of the increased counter as a long. */ long getIncreasedCounter(); /** * Returns the total sum of all increments applied to the persistence storage. * * @return the accumulated sum of all increment operations in the persistence storage */ long getIncreasedSum(); /** * Attention: This method might me take a lot of time. */ void logStats(); } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/persistence/PersistenceUtils.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.persistence; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; import net.ladenthin.bitcoinaddressfinder.ByteBufferUtility; import org.bitcoinj.base.LegacyAddress; import org.bitcoinj.base.Network; import org.bitcoinj.base.Sha256Hash; public class PersistenceUtils { @Deprecated private final ByteBuffer emptyByteBuffer = ByteBuffer.allocateDirect(0).asReadOnlyBuffer(); private final ByteBuffer zeroByteBuffer = longValueToByteBufferDirectAsReadOnlyBuffer(0L); public final Network network; public PersistenceUtils(Network network) { this.network = network; } public ByteBuffer longToByteBufferDirect(long longValue) { if (longValue == 0) { // use the cached zero value to reduce allocations return zeroByteBuffer; } ByteBuffer newValue = ByteBuffer.allocateDirect(Long.BYTES); newValue.putLong(longValue); newValue.flip(); return newValue; } @Deprecated private ByteBuffer addressListToByteBufferDirect(List addresses) { ByteBuffer byteBuffer = ByteBuffer.allocateDirect(LegacyAddress.LENGTH * addresses.size()); for (LegacyAddress address : addresses) { byteBuffer.put(address.getHash()); } byteBuffer.flip(); return byteBuffer; } @Deprecated private List byteBufferToAddressList(ByteBuffer byteBuffer) { List addresses = new ArrayList<>(); int count = byteBuffer.remaining() / LegacyAddress.LENGTH; for (int i = 0; i < count; i++) { byte[] hash160 = new byte[LegacyAddress.LENGTH]; byteBuffer.get(hash160); addresses.add(LegacyAddress.fromPubKeyHash(network, hash160)); } return addresses; } @Deprecated private ByteBuffer hashToByteBufferDirect(Sha256Hash hash) { return new ByteBufferUtility(true).byteArrayToByteBuffer(hash.getBytes()); } private ByteBuffer longValueToByteBufferDirectAsReadOnlyBuffer(long value) { ByteBuffer byteBuffer = ByteBuffer.allocateDirect(Long.BYTES); byteBuffer.putLong(value); return byteBuffer.asReadOnlyBuffer(); } } ================================================ FILE: src/main/java/net/ladenthin/bitcoinaddressfinder/persistence/lmdb/LMDBPersistence.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.persistence.lmdb; import com.google.common.hash.BloomFilter; import com.google.common.hash.Funnels; import net.ladenthin.bitcoinaddressfinder.persistence.Persistence; import net.ladenthin.bitcoinaddressfinder.persistence.PersistenceUtils; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; import org.lmdbjava.CursorIterable; import org.lmdbjava.Dbi; import org.lmdbjava.Env; import org.lmdbjava.EnvFlags; import org.lmdbjava.KeyRange; import org.lmdbjava.Txn; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.lang.reflect.Field; import java.nio.ByteBuffer; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLongArray; import net.ladenthin.bitcoinaddressfinder.ByteBufferUtility; import net.ladenthin.bitcoinaddressfinder.ByteConversion; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import net.ladenthin.bitcoinaddressfinder.SeparatorFormat; import net.ladenthin.bitcoinaddressfinder.configuration.CAddressFileOutputFormat; import net.ladenthin.bitcoinaddressfinder.configuration.CLMDBConfigurationReadOnly; import net.ladenthin.bitcoinaddressfinder.configuration.CLMDBConfigurationWrite; import org.apache.commons.codec.binary.Hex; import org.bitcoinj.base.Coin; import org.bitcoinj.base.LegacyAddress; import org.lmdbjava.BufferProxy; import org.lmdbjava.ByteBufferProxy; import static org.lmdbjava.DbiFlags.MDB_CREATE; import static org.lmdbjava.Env.create; import org.lmdbjava.EnvInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class LMDBPersistence implements Persistence { private static final String DB_NAME_HASH160_TO_COINT = "hash160toCoin"; private static final int DB_COUNT = 1; private final Logger logger = LoggerFactory.getLogger(LMDBPersistence.class); private final @NonNull PersistenceUtils persistenceUtils; private final @Nullable CLMDBConfigurationWrite lmdbConfigurationWrite; private final @Nullable CLMDBConfigurationReadOnly lmdbConfigurationReadOnly; private final @NonNull KeyUtility keyUtility; private @Nullable Env env; private @Nullable Dbi lmdb_h160ToAmount; private long increasedCounter = 0; private long increasedSum = 0; private @Nullable BloomFilter addressBloomFilter = null; public LMDBPersistence(CLMDBConfigurationWrite lmdbConfigurationWrite, PersistenceUtils persistenceUtils) { this.lmdbConfigurationReadOnly = null; this.lmdbConfigurationWrite = lmdbConfigurationWrite; this.persistenceUtils = persistenceUtils; this.keyUtility = new KeyUtility(persistenceUtils.network, new ByteBufferUtility(true)); } public LMDBPersistence(CLMDBConfigurationReadOnly lmdbConfigurationReadOnly, PersistenceUtils persistenceUtils) { this.lmdbConfigurationReadOnly = lmdbConfigurationReadOnly; lmdbConfigurationWrite = null; this.persistenceUtils = persistenceUtils; this.keyUtility = new KeyUtility(persistenceUtils.network, new ByteBufferUtility(true)); } @Override public void init() { if (lmdbConfigurationWrite != null) { initWritable(); } else if (lmdbConfigurationReadOnly != null) { initReadOnly(); } else { throw new IllegalArgumentException("Neither write nor read-only configuration provided."); } logStatsIfConfigured(true); } public void buildAddressBloomFilter() { logger.info("##### BEGIN: buildAddressBloomFilter #####"); CLMDBConfigurationReadOnly localLmdbConfigurationReadOnly = Objects.requireNonNull(lmdbConfigurationReadOnly); Dbi localLmdb_h160ToAmount = Objects.requireNonNull(lmdb_h160ToAmount); var localEnv = Objects.requireNonNull(env); // Attention: slow! long count = count(); BloomFilter filter = BloomFilter.create(Funnels.byteArrayFunnel(), count, localLmdbConfigurationReadOnly.bloomFilterFpp); long inserted = 0; try (Txn txn = localEnv.txnRead()) { try (CursorIterable iterable = localLmdb_h160ToAmount.iterate(txn, KeyRange.all())) { for (CursorIterable.KeyVal kv : iterable) { ByteBuffer key = kv.key(); byte[] keyBytes = new byte[key.remaining()]; key.get(keyBytes); key.rewind(); filter.put(keyBytes); inserted++; } } } addressBloomFilter = filter; long size = getApproximateSizeBytes(filter); logger.info("Inserted {} addresses into BloomFilter with size of {}", inserted, formatSize(size)); logger.info("##### END: buildAddressBloomFilter #####"); } public void unloadBloomFilter() { addressBloomFilter = null; } private void initReadOnly() { CLMDBConfigurationReadOnly localLmdbConfigurationReadOnly = Objects.requireNonNull(lmdbConfigurationReadOnly); BufferProxy bufferProxy = getBufferProxyByUseProxyOptimal(localLmdbConfigurationReadOnly.useProxyOptimal); env = create(bufferProxy).setMaxDbs(DB_COUNT).open(new File(localLmdbConfigurationReadOnly.lmdbDirectory), EnvFlags.MDB_RDONLY_ENV, EnvFlags.MDB_NOLOCK); lmdb_h160ToAmount = env.openDbi(DB_NAME_HASH160_TO_COINT); if (localLmdbConfigurationReadOnly.useBloomFilter) { buildAddressBloomFilter(); } } private void initWritable() { CLMDBConfigurationWrite localLmdbConfigurationWrite = Objects.requireNonNull(lmdbConfigurationWrite); // -Xmx10G -XX:MaxDirectMemorySize=5G // We always need an Env. An Env owns a physical on-disk storage file. One // Env can store many different databases (ie sorted maps). File lmdbDirectory = new File(localLmdbConfigurationWrite.lmdbDirectory); lmdbDirectory.mkdirs(); BufferProxy bufferProxy = getBufferProxyByUseProxyOptimal(localLmdbConfigurationWrite.useProxyOptimal); env = create(bufferProxy) // LMDB also needs to know how large our DB might be. Over-estimating is OK. .setMapSize(new ByteConversion().mibToBytes(localLmdbConfigurationWrite.initialMapSizeInMiB)) // LMDB also needs to know how many DBs (Dbi) we want to store in this Env. .setMaxDbs(DB_COUNT) // Now let's open the Env. The same path can be concurrently opened and // used in different processes, but do not open the same path twice in // the same process at the same time. //https://github.com/kentnl/CHI-Driver-LMDB .open(lmdbDirectory, EnvFlags.MDB_NOSYNC, EnvFlags.MDB_NOMETASYNC, EnvFlags.MDB_WRITEMAP, EnvFlags.MDB_MAPASYNC); // We need a Dbi for each DB. A Dbi roughly equates to a sorted map. The // MDB_CREATE flag causes the DB to be created if it doesn't already exist. lmdb_h160ToAmount = env.openDbi(DB_NAME_HASH160_TO_COINT, MDB_CREATE); } /** * Returns the appropriate ByteBuffer proxy implementation based on the optimization preference. *

* LMDB requires a proxy to handle direct ByteBuffers. Two implementations are available: * - PROXY_OPTIMAL: Uses JNI and unsafe operations for better performance but requires specific JVM permissions * - PROXY_SAFE: Uses pure Java implementation that's more portable but slower *

* For more details, see: https://github.com/lmdbjava/lmdbjava/wiki/Buffers * * @param useProxyOptimal true to use the optimized JNI implementation (PROXY_OPTIMAL), * false to use the safe Java implementation (PROXY_SAFE) * @return the selected {@link BufferProxy} implementation for ByteBuffer operations */ private BufferProxy getBufferProxyByUseProxyOptimal(boolean useProxyOptimal) { if (useProxyOptimal) { return ByteBufferProxy.PROXY_OPTIMAL; } else { return ByteBufferProxy.PROXY_SAFE; } } private void logStatsIfConfigured(boolean onInit) { if (isLoggingEnabled(lmdbConfigurationWrite, onInit) || isLoggingEnabled(lmdbConfigurationReadOnly, onInit)) { logStats(); } } private boolean isLoggingEnabled(@Nullable CLMDBConfigurationReadOnly config, boolean onInit) { return config != null && (onInit ? config.logStatsOnInit : config.logStatsOnClose); } @Override public void close() { Dbi localLmdb_h160ToAmount = Objects.requireNonNull(lmdb_h160ToAmount); Env localEnv = Objects.requireNonNull(env); logStatsIfConfigured(false); localLmdb_h160ToAmount.close(); localEnv.close(); } @Override public boolean isClosed() { Env localEnv = Objects.requireNonNull(env); return localEnv.isClosed(); } @Override public Coin getAmount(ByteBuffer hash160) { Dbi localLmdb_h160ToAmount = Objects.requireNonNull(lmdb_h160ToAmount); Env localEnv = Objects.requireNonNull(env); try (Txn txn = localEnv.txnRead()) { ByteBuffer byteBuffer = localLmdb_h160ToAmount.get(txn, hash160); return getCoinFromByteBuffer(byteBuffer); } } private Coin getCoinFromByteBuffer(ByteBuffer byteBuffer) { if (byteBuffer == null || byteBuffer.capacity() == 0) { return Coin.ZERO; } return Coin.valueOf(byteBuffer.getLong()); } @Override public boolean containsAddress(ByteBuffer hash160) { CLMDBConfigurationReadOnly localLmdbConfigurationReadOnly = Objects.requireNonNull(lmdbConfigurationReadOnly); Dbi localLmdb_h160ToAmount = Objects.requireNonNull(lmdb_h160ToAmount); Env localEnv = Objects.requireNonNull(env); if (localLmdbConfigurationReadOnly.disableAddressLookup) { return false; } byte[] hash160AsByteArray = new byte[hash160.remaining()]; hash160.get(hash160AsByteArray); hash160.rewind(); // Use Bloom filter if available for fast pre-check if (addressBloomFilter != null) { boolean mightContain = addressBloomFilter.mightContain(hash160AsByteArray); if (!mightContain) { return false; // definitely not present } // Possibly in DB, proceed to verify } // Perform LMDB lookup (always happens if no Bloom filter is present) try (Txn txn = localEnv.txnRead()) { ByteBuffer byteBuffer = localLmdb_h160ToAmount.get(txn, hash160); return byteBuffer != null; } } @Override public void writeAllAmountsToAddressFile(File file, CAddressFileOutputFormat addressFileOutputFormat, AtomicBoolean shouldRun) throws IOException { Dbi localLmdb_h160ToAmount = Objects.requireNonNull(lmdb_h160ToAmount); Env localEnv = Objects.requireNonNull(env); try (Txn txn = localEnv.txnRead()) { try (CursorIterable iterable = localLmdb_h160ToAmount.iterate(txn, KeyRange.all())) { try (FileWriter writer = new FileWriter(file)) { for (final CursorIterable.KeyVal kv : iterable) { if (!shouldRun.get()) { return; } ByteBuffer addressAsByteBuffer = kv.key(); if(logger.isTraceEnabled()) { String hexFromByteBuffer = new ByteBufferUtility(false).getHexFromByteBuffer(addressAsByteBuffer); logger.trace("Process address: " + hexFromByteBuffer); } LegacyAddress address = keyUtility.byteBufferToAddress(addressAsByteBuffer); final String line; switch(addressFileOutputFormat) { case HexHash: line = Hex.encodeHexString(address.getHash()) + System.lineSeparator(); break; case FixedWidthBase58BitcoinAddress: line = String.format("%-34s", address.toBase58()) + System.lineSeparator(); break; case DynamicWidthBase58BitcoinAddressWithAmount: ByteBuffer value = kv.val(); Coin coin = getCoinFromByteBuffer(value); line = address.toBase58() + SeparatorFormat.COMMA.getSymbol() + coin.getValue() + System.lineSeparator(); break; default: throw new IllegalArgumentException("Unknown addressFileOutputFormat: " + addressFileOutputFormat); } writer.write(line); } } } } } @Override public void putAllAmounts(Map amounts) throws IOException { for (Map.Entry entry : amounts.entrySet()) { ByteBuffer hash160 = entry.getKey(); Coin coin = entry.getValue(); putNewAmount(hash160, coin); } } @Override public void changeAmount(ByteBuffer hash160, Coin amountToChange) { Coin valueInDB = getAmount(hash160); Coin toWrite = valueInDB.add(amountToChange); putNewAmount(hash160, toWrite); } @Override public void putNewAmount(ByteBuffer hash160, Coin amount) { putNewAmountWithAutoIncrease(hash160, amount); } /** * Inserts a value into LMDB and optionally grows the map if it is full. * *

If {@link org.lmdbjava.Env.MapFullException} occurs and * {@link CLMDBConfigurationWrite#increaseMapAutomatically} is enabled, * the map size is increased by {@link CLMDBConfigurationWrite#increaseSizeInMiB} * and the insert is retried once. * *

If the second attempt also fails, the configured increase size is too small. * If automatic growth is disabled, the original exception is rethrown. */ private void putNewAmountWithAutoIncrease(ByteBuffer hash160, Coin amount) { CLMDBConfigurationWrite localLmdbConfigurationWrite = Objects.requireNonNull(lmdbConfigurationWrite); try { putNewAmountUnsafe(hash160, amount); } catch (org.lmdbjava.Env.MapFullException e) { if (localLmdbConfigurationWrite.increaseMapAutomatically) { increaseDatabaseSize(new ByteConversion().mibToBytes(lmdbConfigurationWrite.increaseSizeInMiB)); // It is possible that the exception will be thrown again, in this case increaseSizeInMiB should be changed and it's a configuration issue. // See {@link CLMDBConfigurationWrite#increaseSizeInMiB}. putNewAmountUnsafe(hash160, amount); } else { throw e; } } } private void putNewAmountUnsafe(ByteBuffer hash160, Coin amount) { CLMDBConfigurationWrite localLmdbConfigurationWrite = Objects.requireNonNull(lmdbConfigurationWrite); Dbi localLmdb_h160ToAmount = Objects.requireNonNull(lmdb_h160ToAmount); Env localEnv = Objects.requireNonNull(env); try (Txn txn = localEnv.txnWrite()) { if (localLmdbConfigurationWrite.deleteEmptyAddresses && amount.isZero()) { localLmdb_h160ToAmount.delete(txn, hash160); } else { long amountAsLong = amount.longValue(); if (localLmdbConfigurationWrite.useStaticAmount) { amountAsLong = lmdbConfigurationWrite.staticAmount; } localLmdb_h160ToAmount.put(txn, hash160, persistenceUtils.longToByteBufferDirect(amountAsLong)); } txn.commit(); } } @Override public Coin getAllAmountsFromAddresses(List hash160s) { Coin allAmounts = Coin.ZERO; for (ByteBuffer hash160 : hash160s) { allAmounts = allAmounts.add(getAmount(hash160)); } return allAmounts; } @Override public long count() { Dbi localLmdb_h160ToAmount = Objects.requireNonNull(lmdb_h160ToAmount); Env localEnv = Objects.requireNonNull(env); long count = 0; try (Txn txn = localEnv.txnRead()) { try (CursorIterable iterable = localLmdb_h160ToAmount.iterate(txn, KeyRange.all())) { for (final CursorIterable.KeyVal kv : iterable) { count++; } } } return count; } @Override public long getDatabaseSize() { Env localEnv = Objects.requireNonNull(env); EnvInfo info = localEnv.info(); return info.mapSize; } @Override public void increaseDatabaseSize(long toIncrease) { Env localEnv = Objects.requireNonNull(env); increasedCounter++; increasedSum += toIncrease; long newSize = getDatabaseSize() + toIncrease; localEnv.setMapSize(newSize); } @Override public long getIncreasedCounter() { return increasedCounter; } @Override public long getIncreasedSum() { return increasedSum; } @Override public void logStats() { Env localEnv = Objects.requireNonNull(env); logger.info("##### BEGIN: LMDB stats #####"); logger.info("... this may take a lot of time ..."); logger.info("DatabaseSize: " + new ByteConversion().bytesToMib(getDatabaseSize()) + " MiB"); logger.info("IncreasedCounter: " + getIncreasedCounter()); logger.info("IncreasedSum: " + new ByteConversion().bytesToMib(getIncreasedSum()) + " MiB"); logger.info("Stat: " + localEnv.stat()); // Attention: slow! long count = count(); logger.info("LMDB contains " + count + " unique entries."); logger.info("##### END: LMDB stats #####"); } public static long getApproximateSizeBytes(BloomFilter bloomFilter) { try { // Access private field: bits Field bitsField = BloomFilter.class.getDeclaredField("bits"); bitsField.setAccessible(true); Object bits = bitsField.get(bloomFilter); // Access internal AtomicLongArray: data Field dataField = bits.getClass().getDeclaredField("data"); dataField.setAccessible(true); AtomicLongArray data = (AtomicLongArray) dataField.get(bits); return (long) data.length() * Long.BYTES; // 8 bytes per long } catch (Exception e) { throw new RuntimeException("Failed to estimate BloomFilter size", e); } } public static String formatSize(long sizeInBytes) { if (sizeInBytes >= 1024 * 1024) { return String.format("%.2f MB", sizeInBytes / 1024.0 / 1024.0); } else if (sizeInBytes >= 1024) { return String.format("%.2f KB", sizeInBytes / 1024.0); } else { return sizeInBytes + " bytes"; } } } ================================================ FILE: src/main/resources/copyfromhashcat/inc_common.cl ================================================ /** * Author......: See docs/credits.txt * License.....: MIT */ #include "inc_vendor.h" #include "inc_types.h" #include "inc_platform.h" #include "inc_common.h" /** * vendor specific (or generic) functions */ DECLSPEC u8 v8a_from_v32_S (const u32 v32) { vconv32_t v; v.v32 = v32; return v.v8.a; } DECLSPEC u8 v8b_from_v32_S (const u32 v32) { vconv32_t v; v.v32 = v32; return v.v8.b; } DECLSPEC u8 v8c_from_v32_S (const u32 v32) { vconv32_t v; v.v32 = v32; return v.v8.c; } DECLSPEC u8 v8d_from_v32_S (const u32 v32) { vconv32_t v; v.v32 = v32; return v.v8.d; } DECLSPEC u8 v8a_from_v64_S (const u64 v64) { vconv64_t v; v.v64 = v64; return v.v8.a; } DECLSPEC u8 v8b_from_v64_S (const u64 v64) { vconv64_t v; v.v64 = v64; return v.v8.b; } DECLSPEC u8 v8c_from_v64_S (const u64 v64) { vconv64_t v; v.v64 = v64; return v.v8.c; } DECLSPEC u8 v8d_from_v64_S (const u64 v64) { vconv64_t v; v.v64 = v64; return v.v8.d; } DECLSPEC u8 v8e_from_v64_S (const u64 v64) { vconv64_t v; v.v64 = v64; return v.v8.e; } DECLSPEC u8 v8f_from_v64_S (const u64 v64) { vconv64_t v; v.v64 = v64; return v.v8.f; } DECLSPEC u8 v8g_from_v64_S (const u64 v64) { vconv64_t v; v.v64 = v64; return v.v8.g; } DECLSPEC u8 v8h_from_v64_S (const u64 v64) { vconv64_t v; v.v64 = v64; return v.v8.h; } DECLSPEC u8x v8a_from_v64 (u64x a) { u8x r = 0; #if VECT_SIZE == 1 r = v8a_from_v64_S (a); #endif #if VECT_SIZE >= 2 r.s0 = v8a_from_v64_S (a.s0); r.s1 = v8a_from_v64_S (a.s1); #endif #if VECT_SIZE >= 4 r.s2 = v8a_from_v64_S (a.s2); r.s3 = v8a_from_v64_S (a.s3); #endif #if VECT_SIZE >= 8 r.s4 = v8a_from_v64_S (a.s4); r.s5 = v8a_from_v64_S (a.s5); r.s6 = v8a_from_v64_S (a.s6); r.s7 = v8a_from_v64_S (a.s7); #endif #if VECT_SIZE >= 16 r.s8 = v8a_from_v64_S (a.s8); r.s9 = v8a_from_v64_S (a.s9); r.sa = v8a_from_v64_S (a.sa); r.sb = v8a_from_v64_S (a.sb); r.sc = v8a_from_v64_S (a.sc); r.sd = v8a_from_v64_S (a.sd); r.se = v8a_from_v64_S (a.se); r.sf = v8a_from_v64_S (a.sf); #endif return r; } DECLSPEC u8x v8b_from_v64 (u64x a) { u8x r = 0; #if VECT_SIZE == 1 r = v8b_from_v64_S (a); #endif #if VECT_SIZE >= 2 r.s0 = v8b_from_v64_S (a.s0); r.s1 = v8b_from_v64_S (a.s1); #endif #if VECT_SIZE >= 4 r.s2 = v8b_from_v64_S (a.s2); r.s3 = v8b_from_v64_S (a.s3); #endif #if VECT_SIZE >= 8 r.s4 = v8b_from_v64_S (a.s4); r.s5 = v8b_from_v64_S (a.s5); r.s6 = v8b_from_v64_S (a.s6); r.s7 = v8b_from_v64_S (a.s7); #endif #if VECT_SIZE >= 16 r.s8 = v8b_from_v64_S (a.s8); r.s9 = v8b_from_v64_S (a.s9); r.sa = v8b_from_v64_S (a.sa); r.sb = v8b_from_v64_S (a.sb); r.sc = v8b_from_v64_S (a.sc); r.sd = v8b_from_v64_S (a.sd); r.se = v8b_from_v64_S (a.se); r.sf = v8b_from_v64_S (a.sf); #endif return r; } DECLSPEC u8x v8c_from_v64 (u64x a) { u8x r = 0; #if VECT_SIZE == 1 r = v8c_from_v64_S (a); #endif #if VECT_SIZE >= 2 r.s0 = v8c_from_v64_S (a.s0); r.s1 = v8c_from_v64_S (a.s1); #endif #if VECT_SIZE >= 4 r.s2 = v8c_from_v64_S (a.s2); r.s3 = v8c_from_v64_S (a.s3); #endif #if VECT_SIZE >= 8 r.s4 = v8c_from_v64_S (a.s4); r.s5 = v8c_from_v64_S (a.s5); r.s6 = v8c_from_v64_S (a.s6); r.s7 = v8c_from_v64_S (a.s7); #endif #if VECT_SIZE >= 16 r.s8 = v8c_from_v64_S (a.s8); r.s9 = v8c_from_v64_S (a.s9); r.sa = v8c_from_v64_S (a.sa); r.sb = v8c_from_v64_S (a.sb); r.sc = v8c_from_v64_S (a.sc); r.sd = v8c_from_v64_S (a.sd); r.se = v8c_from_v64_S (a.se); r.sf = v8c_from_v64_S (a.sf); #endif return r; } DECLSPEC u8x v8d_from_v64 (u64x a) { u8x r = 0; #if VECT_SIZE == 1 r = v8d_from_v64_S (a); #endif #if VECT_SIZE >= 2 r.s0 = v8d_from_v64_S (a.s0); r.s1 = v8d_from_v64_S (a.s1); #endif #if VECT_SIZE >= 4 r.s2 = v8d_from_v64_S (a.s2); r.s3 = v8d_from_v64_S (a.s3); #endif #if VECT_SIZE >= 8 r.s4 = v8d_from_v64_S (a.s4); r.s5 = v8d_from_v64_S (a.s5); r.s6 = v8d_from_v64_S (a.s6); r.s7 = v8d_from_v64_S (a.s7); #endif #if VECT_SIZE >= 16 r.s8 = v8d_from_v64_S (a.s8); r.s9 = v8d_from_v64_S (a.s9); r.sa = v8d_from_v64_S (a.sa); r.sb = v8d_from_v64_S (a.sb); r.sc = v8d_from_v64_S (a.sc); r.sd = v8d_from_v64_S (a.sd); r.se = v8d_from_v64_S (a.se); r.sf = v8d_from_v64_S (a.sf); #endif return r; } DECLSPEC u8x v8e_from_v64 (u64x a) { u8x r = 0; #if VECT_SIZE == 1 r = v8e_from_v64_S (a); #endif #if VECT_SIZE >= 2 r.s0 = v8e_from_v64_S (a.s0); r.s1 = v8e_from_v64_S (a.s1); #endif #if VECT_SIZE >= 4 r.s2 = v8e_from_v64_S (a.s2); r.s3 = v8e_from_v64_S (a.s3); #endif #if VECT_SIZE >= 8 r.s4 = v8e_from_v64_S (a.s4); r.s5 = v8e_from_v64_S (a.s5); r.s6 = v8e_from_v64_S (a.s6); r.s7 = v8e_from_v64_S (a.s7); #endif #if VECT_SIZE >= 16 r.s8 = v8e_from_v64_S (a.s8); r.s9 = v8e_from_v64_S (a.s9); r.sa = v8e_from_v64_S (a.sa); r.sb = v8e_from_v64_S (a.sb); r.sc = v8e_from_v64_S (a.sc); r.sd = v8e_from_v64_S (a.sd); r.se = v8e_from_v64_S (a.se); r.sf = v8e_from_v64_S (a.sf); #endif return r; } DECLSPEC u8x v8f_from_v64 (u64x a) { u8x r = 0; #if VECT_SIZE == 1 r = v8f_from_v64_S (a); #endif #if VECT_SIZE >= 2 r.s0 = v8f_from_v64_S (a.s0); r.s1 = v8f_from_v64_S (a.s1); #endif #if VECT_SIZE >= 4 r.s2 = v8f_from_v64_S (a.s2); r.s3 = v8f_from_v64_S (a.s3); #endif #if VECT_SIZE >= 8 r.s4 = v8f_from_v64_S (a.s4); r.s5 = v8f_from_v64_S (a.s5); r.s6 = v8f_from_v64_S (a.s6); r.s7 = v8f_from_v64_S (a.s7); #endif #if VECT_SIZE >= 16 r.s8 = v8f_from_v64_S (a.s8); r.s9 = v8f_from_v64_S (a.s9); r.sa = v8f_from_v64_S (a.sa); r.sb = v8f_from_v64_S (a.sb); r.sc = v8f_from_v64_S (a.sc); r.sd = v8f_from_v64_S (a.sd); r.se = v8f_from_v64_S (a.se); r.sf = v8f_from_v64_S (a.sf); #endif return r; } DECLSPEC u8x v8g_from_v64 (u64x a) { u8x r = 0; #if VECT_SIZE == 1 r = v8g_from_v64_S (a); #endif #if VECT_SIZE >= 2 r.s0 = v8g_from_v64_S (a.s0); r.s1 = v8g_from_v64_S (a.s1); #endif #if VECT_SIZE >= 4 r.s2 = v8g_from_v64_S (a.s2); r.s3 = v8g_from_v64_S (a.s3); #endif #if VECT_SIZE >= 8 r.s4 = v8g_from_v64_S (a.s4); r.s5 = v8g_from_v64_S (a.s5); r.s6 = v8g_from_v64_S (a.s6); r.s7 = v8g_from_v64_S (a.s7); #endif #if VECT_SIZE >= 16 r.s8 = v8g_from_v64_S (a.s8); r.s9 = v8g_from_v64_S (a.s9); r.sa = v8g_from_v64_S (a.sa); r.sb = v8g_from_v64_S (a.sb); r.sc = v8g_from_v64_S (a.sc); r.sd = v8g_from_v64_S (a.sd); r.se = v8g_from_v64_S (a.se); r.sf = v8g_from_v64_S (a.sf); #endif return r; } DECLSPEC u8x v8h_from_v64 (u64x a) { u8x r = 0; #if VECT_SIZE == 1 r = v8h_from_v64_S (a); #endif #if VECT_SIZE >= 2 r.s0 = v8h_from_v64_S (a.s0); r.s1 = v8h_from_v64_S (a.s1); #endif #if VECT_SIZE >= 4 r.s2 = v8h_from_v64_S (a.s2); r.s3 = v8h_from_v64_S (a.s3); #endif #if VECT_SIZE >= 8 r.s4 = v8h_from_v64_S (a.s4); r.s5 = v8h_from_v64_S (a.s5); r.s6 = v8h_from_v64_S (a.s6); r.s7 = v8h_from_v64_S (a.s7); #endif #if VECT_SIZE >= 16 r.s8 = v8h_from_v64_S (a.s8); r.s9 = v8h_from_v64_S (a.s9); r.sa = v8h_from_v64_S (a.sa); r.sb = v8h_from_v64_S (a.sb); r.sc = v8h_from_v64_S (a.sc); r.sd = v8h_from_v64_S (a.sd); r.se = v8h_from_v64_S (a.se); r.sf = v8h_from_v64_S (a.sf); #endif return r; } DECLSPEC u16 v16a_from_v32_S (const u32 v32) { vconv32_t v; v.v32 = v32; return v.v16.a; } DECLSPEC u16 v16b_from_v32_S (const u32 v32) { vconv32_t v; v.v32 = v32; return v.v16.b; } DECLSPEC u32 v32_from_v16ab_S (const u16 v16a, const u16 v16b) { vconv32_t v; v.v16.a = v16a; v.v16.b = v16b; return v.v32; } DECLSPEC u32 v32a_from_v64_S (const u64 v64) { vconv64_t v; v.v64 = v64; return v.v32.a; } DECLSPEC u32 v32b_from_v64_S (const u64 v64) { vconv64_t v; v.v64 = v64; return v.v32.b; } DECLSPEC u64 v64_from_v32ab_S (const u32 v32a, const u32 v32b) { vconv64_t v; v.v32.a = v32a; v.v32.b = v32b; return v.v64; } // unpack function are similar, but always return u32 DECLSPEC u32x unpack_v8a_from_v32 (const u32x v32) { u32x r = 0; #if defined IS_NV && HAS_BFE == 1 #if VECT_SIZE == 1 asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r) : "r"(v32)); #endif #if VECT_SIZE >= 2 asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r.s0) : "r"(v32.s0)); asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r.s1) : "r"(v32.s1)); #endif #if VECT_SIZE >= 4 asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r.s2) : "r"(v32.s2)); asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r.s3) : "r"(v32.s3)); #endif #if VECT_SIZE >= 8 asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r.s4) : "r"(v32.s4)); asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r.s5) : "r"(v32.s5)); asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r.s6) : "r"(v32.s6)); asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r.s7) : "r"(v32.s7)); #endif #if VECT_SIZE >= 16 asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r.s8) : "r"(v32.s8)); asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r.s9) : "r"(v32.s9)); asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r.sa) : "r"(v32.sa)); asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r.sb) : "r"(v32.sb)); asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r.sc) : "r"(v32.sc)); asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r.sd) : "r"(v32.sd)); asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r.se) : "r"(v32.se)); asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r.sf) : "r"(v32.sf)); #endif //#elif (defined IS_AMD || defined IS_HIP) && HAS_VBFE == 1 //__asm__ __volatile__ ("V_BFE_U32 %0, %1, 0, 8;" : "=v"(r) : "v"(v32)); #else r = (v32 >> 0) & 0xff; #endif return r; } DECLSPEC u32x unpack_v8b_from_v32 (const u32x v32) { u32x r = 0; #if defined IS_NV && HAS_BFE == 1 #if VECT_SIZE == 1 asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r) : "r"(v32)); #endif #if VECT_SIZE >= 2 asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r.s0) : "r"(v32.s0)); asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r.s1) : "r"(v32.s1)); #endif #if VECT_SIZE >= 4 asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r.s2) : "r"(v32.s2)); asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r.s3) : "r"(v32.s3)); #endif #if VECT_SIZE >= 8 asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r.s4) : "r"(v32.s4)); asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r.s5) : "r"(v32.s5)); asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r.s6) : "r"(v32.s6)); asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r.s7) : "r"(v32.s7)); #endif #if VECT_SIZE >= 16 asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r.s8) : "r"(v32.s8)); asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r.s9) : "r"(v32.s9)); asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r.sa) : "r"(v32.sa)); asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r.sb) : "r"(v32.sb)); asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r.sc) : "r"(v32.sc)); asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r.sd) : "r"(v32.sd)); asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r.se) : "r"(v32.se)); asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r.sf) : "r"(v32.sf)); #endif //#elif (defined IS_AMD || defined IS_HIP) && HAS_VBFE == 1 //__asm__ __volatile__ ("V_BFE_U32 %0, %1, 8, 8;" : "=v"(r) : "v"(v32)); #else r = (v32 >> 8) & 0xff; #endif return r; } DECLSPEC u32x unpack_v8c_from_v32 (const u32x v32) { u32x r = 0; #if defined IS_NV && HAS_BFE == 1 #if VECT_SIZE == 1 asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r) : "r"(v32)); #endif #if VECT_SIZE >= 2 asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r.s0) : "r"(v32.s0)); asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r.s1) : "r"(v32.s1)); #endif #if VECT_SIZE >= 4 asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r.s2) : "r"(v32.s2)); asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r.s3) : "r"(v32.s3)); #endif #if VECT_SIZE >= 8 asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r.s4) : "r"(v32.s4)); asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r.s5) : "r"(v32.s5)); asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r.s6) : "r"(v32.s6)); asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r.s7) : "r"(v32.s7)); #endif #if VECT_SIZE >= 16 asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r.s8) : "r"(v32.s8)); asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r.s9) : "r"(v32.s9)); asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r.sa) : "r"(v32.sa)); asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r.sb) : "r"(v32.sb)); asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r.sc) : "r"(v32.sc)); asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r.sd) : "r"(v32.sd)); asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r.se) : "r"(v32.se)); asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r.sf) : "r"(v32.sf)); #endif //#elif (defined IS_AMD || defined IS_HIP) && HAS_VBFE == 1 //__asm__ __volatile__ ("V_BFE_U32 %0, %1, 16, 8;" : "=v"(r) : "v"(v32)); #else r = (v32 >> 16) & 0xff; #endif return r; } DECLSPEC u32x unpack_v8d_from_v32 (const u32x v32) { u32x r = 0; #if defined IS_NV && HAS_BFE == 1 #if VECT_SIZE == 1 asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r) : "r"(v32)); #endif #if VECT_SIZE >= 2 asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r.s0) : "r"(v32.s0)); asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r.s1) : "r"(v32.s1)); #endif #if VECT_SIZE >= 4 asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r.s2) : "r"(v32.s2)); asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r.s3) : "r"(v32.s3)); #endif #if VECT_SIZE >= 8 asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r.s4) : "r"(v32.s4)); asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r.s5) : "r"(v32.s5)); asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r.s6) : "r"(v32.s6)); asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r.s7) : "r"(v32.s7)); #endif #if VECT_SIZE >= 16 asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r.s8) : "r"(v32.s8)); asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r.s9) : "r"(v32.s9)); asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r.sa) : "r"(v32.sa)); asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r.sb) : "r"(v32.sb)); asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r.sc) : "r"(v32.sc)); asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r.sd) : "r"(v32.sd)); asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r.se) : "r"(v32.se)); asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r.sf) : "r"(v32.sf)); #endif //#elif (defined IS_AMD || defined IS_HIP) && HAS_VBFE == 1 //__asm__ __volatile__ ("V_BFE_U32 %0, %1, 24, 8;" : "=v"(r) : "v"(v32)); #else r = (v32 >> 24) & 0xff; #endif return r; } DECLSPEC u32 unpack_v8a_from_v32_S (const u32 v32) { u32 r = 0; #if defined IS_NV && HAS_BFE == 1 asm volatile ("bfe.u32 %0, %1, 0, 8;" : "=r"(r) : "r"(v32)); //#elif (defined IS_AMD || defined IS_HIP) && HAS_VBFE == 1 //__asm__ __volatile__ ("V_BFE_U32 %0, %1, 0, 8;" : "=v"(r) : "v"(v32)); #else r = (v32 >> 0) & 0xff; #endif return r; } DECLSPEC u32 unpack_v8b_from_v32_S (const u32 v32) { u32 r = 0; #if defined IS_NV && HAS_BFE == 1 asm volatile ("bfe.u32 %0, %1, 8, 8;" : "=r"(r) : "r"(v32)); //#elif (defined IS_AMD || defined IS_HIP) && HAS_VBFE == 1 //__asm__ __volatile__ ("V_BFE_U32 %0, %1, 8, 8;" : "=v"(r) : "v"(v32)); #else r = (v32 >> 8) & 0xff; #endif return r; } DECLSPEC u32 unpack_v8c_from_v32_S (const u32 v32) { u32 r = 0; #if defined IS_NV && HAS_BFE == 1 asm volatile ("bfe.u32 %0, %1, 16, 8;" : "=r"(r) : "r"(v32)); //#elif (defined IS_AMD || defined IS_HIP) && HAS_VBFE == 1 //__asm__ __volatile__ ("V_BFE_U32 %0, %1, 16, 8;" : "=v"(r) : "v"(v32)); #else r = (v32 >> 16) & 0xff; #endif return r; } DECLSPEC u32 unpack_v8d_from_v32_S (const u32 v32) { u32 r = 0; #if defined IS_NV && HAS_BFE == 1 asm volatile ("bfe.u32 %0, %1, 24, 8;" : "=r"(r) : "r"(v32)); //#elif (defined IS_AMD || defined IS_HIP) && HAS_VBFE == 1 //__asm__ __volatile__ ("V_BFE_U32 %0, %1, 24, 8;" : "=v"(r) : "v"(v32)); #else r = (v32 >> 24) & 0xff; #endif return r; } DECLSPEC u32 l32_from_64_S (u64 a) { return v32a_from_v64_S (a); } DECLSPEC u32 h32_from_64_S (u64 a) { return v32b_from_v64_S (a); } DECLSPEC u64 hl32_to_64_S (const u32 a, const u32 b) { return v64_from_v32ab_S (b, a); } DECLSPEC u32x l32_from_64 (u64x a) { u32x r = 0; #if VECT_SIZE == 1 r = l32_from_64_S (a); #endif #if VECT_SIZE >= 2 r.s0 = l32_from_64_S (a.s0); r.s1 = l32_from_64_S (a.s1); #endif #if VECT_SIZE >= 4 r.s2 = l32_from_64_S (a.s2); r.s3 = l32_from_64_S (a.s3); #endif #if VECT_SIZE >= 8 r.s4 = l32_from_64_S (a.s4); r.s5 = l32_from_64_S (a.s5); r.s6 = l32_from_64_S (a.s6); r.s7 = l32_from_64_S (a.s7); #endif #if VECT_SIZE >= 16 r.s8 = l32_from_64_S (a.s8); r.s9 = l32_from_64_S (a.s9); r.sa = l32_from_64_S (a.sa); r.sb = l32_from_64_S (a.sb); r.sc = l32_from_64_S (a.sc); r.sd = l32_from_64_S (a.sd); r.se = l32_from_64_S (a.se); r.sf = l32_from_64_S (a.sf); #endif return r; } DECLSPEC u32x h32_from_64 (u64x a) { u32x r = 0; #if VECT_SIZE == 1 r = h32_from_64_S (a); #endif #if VECT_SIZE >= 2 r.s0 = h32_from_64_S (a.s0); r.s1 = h32_from_64_S (a.s1); #endif #if VECT_SIZE >= 4 r.s2 = h32_from_64_S (a.s2); r.s3 = h32_from_64_S (a.s3); #endif #if VECT_SIZE >= 8 r.s4 = h32_from_64_S (a.s4); r.s5 = h32_from_64_S (a.s5); r.s6 = h32_from_64_S (a.s6); r.s7 = h32_from_64_S (a.s7); #endif #if VECT_SIZE >= 16 r.s8 = h32_from_64_S (a.s8); r.s9 = h32_from_64_S (a.s9); r.sa = h32_from_64_S (a.sa); r.sb = h32_from_64_S (a.sb); r.sc = h32_from_64_S (a.sc); r.sd = h32_from_64_S (a.sd); r.se = h32_from_64_S (a.se); r.sf = h32_from_64_S (a.sf); #endif return r; } DECLSPEC u64x hl32_to_64 (const u32x a, const u32x b) { u64x r; #if VECT_SIZE == 1 r = v64_from_v32ab_S (b , a); #endif #if VECT_SIZE >= 2 r.s0 = v64_from_v32ab_S (b.s0, a.s0); r.s1 = v64_from_v32ab_S (b.s1, a.s1); #endif #if VECT_SIZE >= 4 r.s2 = v64_from_v32ab_S (b.s2, a.s2); r.s3 = v64_from_v32ab_S (b.s3, a.s3); #endif #if VECT_SIZE >= 8 r.s4 = v64_from_v32ab_S (b.s4, a.s4); r.s5 = v64_from_v32ab_S (b.s5, a.s5); r.s6 = v64_from_v32ab_S (b.s6, a.s6); r.s7 = v64_from_v32ab_S (b.s7, a.s7); #endif #if VECT_SIZE >= 16 r.s8 = v64_from_v32ab_S (b.s8, a.s8); r.s9 = v64_from_v32ab_S (b.s9, a.s9); r.sa = v64_from_v32ab_S (b.sa, a.sa); r.sb = v64_from_v32ab_S (b.sb, a.sb); r.sc = v64_from_v32ab_S (b.sc, a.sc); r.sd = v64_from_v32ab_S (b.sd, a.sd); r.se = v64_from_v32ab_S (b.se, a.se); r.sf = v64_from_v32ab_S (b.sf, a.sf); #endif return r; } // bit rotates // // For HC_CPU_OPENCL_EMU_H we dont need to care about vector functions // The VECT_SIZE is guaranteed to be set to 1 from cpu_opencl_emu.h DECLSPEC u32x hc_rotl32 (const u32x a, const int n) { #if defined HC_CPU_OPENCL_EMU_H return rotl32 (a, n); #elif defined IS_CUDA || defined IS_HIP return rotl32 (a, n); #else #ifdef USE_ROTATE return rotate (a, make_u32x (n)); #else return ((a << n) | (a >> (32 - n))); #endif #endif } DECLSPEC u32x hc_rotr32 (const u32x a, const int n) { #if defined HC_CPU_OPENCL_EMU_H return rotr32 (a, n); #elif defined IS_CUDA || defined IS_HIP return rotr32 (a, n); #else #ifdef USE_ROTATE return rotate (a, make_u32x (32 - n)); #else return ((a >> n) | (a << (32 - n))); #endif #endif } DECLSPEC u32 hc_rotl32_S (const u32 a, const int n) { #if defined HC_CPU_OPENCL_EMU_H return rotl32 (a, n); #elif defined IS_CUDA || defined IS_HIP return rotl32_S (a, n); #else #ifdef USE_ROTATE return rotate (a, (u32) (n)); #else return ((a << n) | (a >> (32 - n))); #endif #endif } DECLSPEC u32 hc_rotr32_S (const u32 a, const int n) { #if defined HC_CPU_OPENCL_EMU_H return rotr32 (a, n); #elif defined IS_CUDA || defined IS_HIP return rotr32_S (a, n); #else #ifdef USE_ROTATE return rotate (a, (u32) (32 - n)); #else return ((a >> n) | (a << (32 - n))); #endif #endif } DECLSPEC u64x hc_rotl64 (const u64x a, const int n) { #if defined HC_CPU_OPENCL_EMU_H return rotl64 (a, n); #elif defined IS_CUDA return rotl64 (a, n); #elif (defined IS_AMD || defined IS_HIP) return rotl64 (a, n); #else #ifdef USE_ROTATE return rotate (a, make_u64x (n)); #else return ((a << n) | (a >> (64 - n))); #endif #endif } DECLSPEC u64x hc_rotr64 (const u64x a, const int n) { #if defined HC_CPU_OPENCL_EMU_H return rotr64 (a, n); #elif defined IS_CUDA return rotr64 (a, n); #elif (defined IS_AMD || defined IS_HIP) return rotr64 (a, n); #else #ifdef USE_ROTATE return rotate (a, make_u64x (64 - n)); #else return ((a >> n) | (a << (64 - n))); #endif #endif } DECLSPEC u64 hc_rotl64_S (const u64 a, const int n) { #if defined HC_CPU_OPENCL_EMU_H return rotl64 (a, n); #elif defined IS_CUDA return rotl64_S (a, n); #elif (defined IS_AMD || defined IS_HIP) return rotl64_S (a, n); #else #ifdef USE_ROTATE return rotate (a, (u64) (n)); #else return ((a << n) | (a >> (64 - n))); #endif #endif } DECLSPEC u64 hc_rotr64_S (const u64 a, const int n) { #if defined HC_CPU_OPENCL_EMU_H return rotr64 (a, n); #elif defined IS_CUDA return rotr64_S (a, n); #elif (defined IS_AMD || defined IS_HIP) return rotr64_S (a, n); #else #ifdef USE_ROTATE return rotate (a, (u64) (64 - n)); #else return ((a >> n) | (a << (64 - n))); #endif #endif } // bitwise swap DECLSPEC u32x hc_swap32 (const u32x v) { u32x r; #ifdef HC_CPU_OPENCL_EMU_H r = byte_swap_32 (v); #else #if (defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1 const u32 m = 0x00010203; #if VECT_SIZE == 1 __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r) : "v"(v), "v"(m)); #endif #if VECT_SIZE >= 2 __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r.s0) : "v"(v.s0), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r.s1) : "v"(v.s1), "v"(m)); #endif #if VECT_SIZE >= 4 __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r.s2) : "v"(v.s2), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r.s3) : "v"(v.s3), "v"(m)); #endif #if VECT_SIZE >= 8 __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r.s4) : "v"(v.s4), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r.s5) : "v"(v.s5), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r.s6) : "v"(v.s6), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r.s7) : "v"(v.s7), "v"(m)); #endif #if VECT_SIZE >= 16 __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r.s8) : "v"(v.s8), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r.s9) : "v"(v.s9), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r.sa) : "v"(v.sa), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r.sb) : "v"(v.sb), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r.sc) : "v"(v.sc), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r.sd) : "v"(v.sd), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r.se) : "v"(v.se), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r.sf) : "v"(v.sf), "v"(m)); #endif #elif defined IS_NV && HAS_PRMT == 1 #if VECT_SIZE == 1 asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r) : "r"(v)); #endif #if VECT_SIZE >= 2 asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r.s0) : "r"(v.s0)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r.s1) : "r"(v.s1)); #endif #if VECT_SIZE >= 4 asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r.s2) : "r"(v.s2)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r.s3) : "r"(v.s3)); #endif #if VECT_SIZE >= 8 asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r.s4) : "r"(v.s4)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r.s5) : "r"(v.s5)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r.s6) : "r"(v.s6)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r.s7) : "r"(v.s7)); #endif #if VECT_SIZE >= 16 asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r.s8) : "r"(v.s8)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r.s9) : "r"(v.s9)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r.sa) : "r"(v.sa)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r.sb) : "r"(v.sb)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r.sc) : "r"(v.sc)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r.sd) : "r"(v.sd)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r.se) : "r"(v.se)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r.sf) : "r"(v.sf)); #endif #else #if defined USE_BITSELECT && defined USE_ROTATE r = bitselect (rotate (v, make_u32x (24)), rotate (v, make_u32x ( 8)), make_u32x (0x00ff00ff)); #else r = ((v & make_u32x (0xff000000)) >> 24) | ((v & make_u32x (0x00ff0000)) >> 8) | ((v & make_u32x (0x0000ff00)) << 8) | ((v & make_u32x (0x000000ff)) << 24); #endif #endif #endif return r; } DECLSPEC u32 hc_swap32_S (const u32 v) { u32 r; #ifdef HC_CPU_OPENCL_EMU_H r = byte_swap_32 (v); #else #if (defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1 __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(r) : "v"(v), "v"(0x00010203)); #elif defined IS_NV && HAS_PRMT == 1 asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r) : "r"(v)); #else #ifdef USE_SWIZZLE r = as_uint (as_uchar4 (v).s3210); #else r = ((v & 0xff000000) >> 24) | ((v & 0x00ff0000) >> 8) | ((v & 0x0000ff00) << 8) | ((v & 0x000000ff) << 24); #endif #endif #endif return r; } DECLSPEC u64x hc_swap64 (const u64x v) { u64x r; #ifdef HC_CPU_OPENCL_EMU_H r = byte_swap_64 (v); #else #if (defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1 const u32 m = 0x00010203; const u32x a0 = h32_from_64 (v); const u32x a1 = l32_from_64 (v); u32x t0; u32x t1; #if VECT_SIZE == 1 __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t0) : "v"(0), "v"(a0), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t1) : "v"(0), "v"(a1), "v"(m)); #endif #if VECT_SIZE >= 2 __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t0.s0) : "v"(0), "v"(a0.s0), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t1.s0) : "v"(0), "v"(a1.s0), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t0.s1) : "v"(0), "v"(a0.s1), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t1.s1) : "v"(0), "v"(a1.s1), "v"(m)); #endif #if VECT_SIZE >= 4 __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t0.s2) : "v"(0), "v"(a0.s2), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t1.s2) : "v"(0), "v"(a1.s2), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t0.s3) : "v"(0), "v"(a0.s3), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t1.s3) : "v"(0), "v"(a1.s3), "v"(m)); #endif #if VECT_SIZE >= 8 __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t0.s4) : "v"(0), "v"(a0.s4), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t1.s4) : "v"(0), "v"(a1.s4), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t0.s5) : "v"(0), "v"(a0.s5), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t1.s5) : "v"(0), "v"(a1.s5), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t0.s6) : "v"(0), "v"(a0.s6), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t1.s6) : "v"(0), "v"(a1.s6), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t0.s7) : "v"(0), "v"(a0.s7), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t1.s7) : "v"(0), "v"(a1.s7), "v"(m)); #endif #if VECT_SIZE >= 16 __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t0.s8) : "v"(0), "v"(a0.s8), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t1.s8) : "v"(0), "v"(a1.s8), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t0.s9) : "v"(0), "v"(a0.s9), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t1.s9) : "v"(0), "v"(a1.s9), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t0.sa) : "v"(0), "v"(a0.sa), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t1.sa) : "v"(0), "v"(a1.sa), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t0.sb) : "v"(0), "v"(a0.sb), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t1.sb) : "v"(0), "v"(a1.sb), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t0.sc) : "v"(0), "v"(a0.sc), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t1.sc) : "v"(0), "v"(a1.sc), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t0.sd) : "v"(0), "v"(a0.sd), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t1.sd) : "v"(0), "v"(a1.sd), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t0.se) : "v"(0), "v"(a0.se), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t1.se) : "v"(0), "v"(a1.se), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t0.sf) : "v"(0), "v"(a0.sf), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(t1.sf) : "v"(0), "v"(a1.sf), "v"(m)); #endif r = hl32_to_64 (t1, t0); #elif defined IS_NV && HAS_MOV64 == 1 && HAS_PRMT == 1 u32x il; u32x ir; #if VECT_SIZE == 1 asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il), "=r"(ir) : "l"(v)); #endif #if VECT_SIZE >= 2 asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il.s0), "=r"(ir.s0) : "l"(v.s0)); asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il.s1), "=r"(ir.s1) : "l"(v.s1)); #endif #if VECT_SIZE >= 4 asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il.s2), "=r"(ir.s2) : "l"(v.s2)); asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il.s3), "=r"(ir.s3) : "l"(v.s3)); #endif #if VECT_SIZE >= 8 asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il.s4), "=r"(ir.s4) : "l"(v.s4)); asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il.s5), "=r"(ir.s5) : "l"(v.s5)); asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il.s6), "=r"(ir.s6) : "l"(v.s6)); asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il.s7), "=r"(ir.s7) : "l"(v.s7)); #endif #if VECT_SIZE >= 16 asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il.s8), "=r"(ir.s8) : "l"(v.s8)); asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il.s9), "=r"(ir.s9) : "l"(v.s9)); asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il.sa), "=r"(ir.sa) : "l"(v.sa)); asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il.sb), "=r"(ir.sb) : "l"(v.sb)); asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il.sc), "=r"(ir.sc) : "l"(v.sc)); asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il.sd), "=r"(ir.sd) : "l"(v.sd)); asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il.se), "=r"(ir.se) : "l"(v.se)); asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il.sf), "=r"(ir.sf) : "l"(v.sf)); #endif u32x tl; u32x tr; #if VECT_SIZE == 1 asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl) : "r"(il)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr) : "r"(ir)); #endif #if VECT_SIZE >= 2 asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl.s0) : "r"(il.s0)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr.s0) : "r"(ir.s0)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl.s1) : "r"(il.s1)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr.s1) : "r"(ir.s1)); #endif #if VECT_SIZE >= 4 asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl.s2) : "r"(il.s2)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr.s2) : "r"(ir.s2)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl.s3) : "r"(il.s3)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr.s3) : "r"(ir.s3)); #endif #if VECT_SIZE >= 8 asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl.s4) : "r"(il.s4)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr.s4) : "r"(ir.s4)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl.s5) : "r"(il.s5)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr.s5) : "r"(ir.s5)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl.s6) : "r"(il.s6)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr.s6) : "r"(ir.s6)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl.s7) : "r"(il.s7)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr.s7) : "r"(ir.s7)); #endif #if VECT_SIZE >= 16 asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl.s8) : "r"(il.s8)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr.s8) : "r"(ir.s8)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl.s9) : "r"(il.s9)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr.s9) : "r"(ir.s9)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl.sa) : "r"(il.sa)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr.sa) : "r"(ir.sa)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl.sb) : "r"(il.sb)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr.sb) : "r"(ir.sb)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl.sc) : "r"(il.sc)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr.sc) : "r"(ir.sc)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl.sd) : "r"(il.sd)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr.sd) : "r"(ir.sd)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl.se) : "r"(il.se)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr.se) : "r"(ir.se)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl.sf) : "r"(il.sf)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr.sf) : "r"(ir.sf)); #endif #if VECT_SIZE == 1 asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r) : "r"(tr), "r"(tl)); #endif #if VECT_SIZE >= 2 asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r.s0) : "r"(tr.s0), "r"(tl.s0)); asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r.s1) : "r"(tr.s1), "r"(tl.s1)); #endif #if VECT_SIZE >= 4 asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r.s2) : "r"(tr.s2), "r"(tl.s2)); asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r.s3) : "r"(tr.s3), "r"(tl.s3)); #endif #if VECT_SIZE >= 8 asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r.s4) : "r"(tr.s4), "r"(tl.s4)); asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r.s5) : "r"(tr.s5), "r"(tl.s5)); asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r.s6) : "r"(tr.s6), "r"(tl.s6)); asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r.s7) : "r"(tr.s7), "r"(tl.s7)); #endif #if VECT_SIZE >= 16 asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r.s8) : "r"(tr.s8), "r"(tl.s8)); asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r.s9) : "r"(tr.s9), "r"(tl.s9)); asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r.sa) : "r"(tr.sa), "r"(tl.sa)); asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r.sb) : "r"(tr.sb), "r"(tl.sb)); asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r.sc) : "r"(tr.sc), "r"(tl.sc)); asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r.sd) : "r"(tr.sd), "r"(tl.sd)); asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r.se) : "r"(tr.se), "r"(tl.se)); asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r.sf) : "r"(tr.sf), "r"(tl.sf)); #endif #elif defined IS_METAL const u32x a0 = h32_from_64 (v); const u32x a1 = l32_from_64 (v); u32x t0 = hc_swap32 (a0); u32x t1 = hc_swap32 (a1); r = hl32_to_64 (t1, t0); #else #if defined USE_BITSELECT && defined USE_ROTATE r = bitselect (bitselect (rotate (v, make_u64x (24)), rotate (v, make_u64x ( 8)), make_u64x (0x000000ff000000ffUL)), bitselect (rotate (v, make_u64x (56)), rotate (v, make_u64x (40)), make_u64x (0x00ff000000ff0000UL)), make_u64x (0xffff0000ffff0000UL)); #else r = ((v & make_u64x (0xff00000000000000UL)) >> 56) | ((v & make_u64x (0x00ff000000000000UL)) >> 40) | ((v & make_u64x (0x0000ff0000000000UL)) >> 24) | ((v & make_u64x (0x000000ff00000000UL)) >> 8) | ((v & make_u64x (0x00000000ff000000UL)) << 8) | ((v & make_u64x (0x0000000000ff0000UL)) << 24) | ((v & make_u64x (0x000000000000ff00UL)) << 40) | ((v & make_u64x (0x00000000000000ffUL)) << 56); #endif #endif #endif return r; } DECLSPEC u64 hc_swap64_S (const u64 v) { u64 r; #ifdef HC_CPU_OPENCL_EMU_H r = byte_swap_64 (v); #else #if (defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1 const u32 m = 0x00010203; const u32 v0 = h32_from_64_S (v); const u32 v1 = l32_from_64_S (v); u32 t0; u32 t1; __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(t0) : "v"(v0), "v"(m)); __asm__ __volatile__ ("V_PERM_B32 %0, 0, %1, %2;" : "=v"(t1) : "v"(v1), "v"(m)); r = hl32_to_64_S (t1, t0); #elif defined IS_NV && HAS_PRMT == 1 u32 il; u32 ir; asm volatile ("mov.b64 {%0, %1}, %2;" : "=r"(il), "=r"(ir) : "l"(v)); u32 tl; u32 tr; asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl) : "r"(il)); asm volatile ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr) : "r"(ir)); asm volatile ("mov.b64 %0, {%1, %2};" : "=l"(r) : "r"(tr), "r"(tl)); #elif defined IS_METAL const u32 v0 = h32_from_64_S (v); const u32 v1 = l32_from_64_S (v); u32 t0 = hc_swap32_S (v0); u32 t1 = hc_swap32_S (v1); r = hl32_to_64_S (t1, t0); #else #ifdef USE_SWIZZLE r = as_ulong (as_uchar8 (v).s76543210); #else r = ((v & (u64) 0xff00000000000000UL) >> 56) | ((v & (u64) 0x00ff000000000000UL) >> 40) | ((v & (u64) 0x0000ff0000000000UL) >> 24) | ((v & (u64) 0x000000ff00000000UL) >> 8) | ((v & (u64) 0x00000000ff000000UL) << 8) | ((v & (u64) 0x0000000000ff0000UL) << 24) | ((v & (u64) 0x000000000000ff00UL) << 40) | ((v & (u64) 0x00000000000000ffUL) << 56); #endif #endif #endif return r; } #if (defined IS_AMD || defined IS_HIP) DECLSPEC u32x hc_bfe (const u32x a, const u32x b, const u32x c) { #define BIT(x) (make_u32x (1u) << (x)) #define BIT_MASK(x) (BIT (x) - 1) #define BFE(x,y,z) (((x) >> (y)) & BIT_MASK (z)) return BFE (a, b, c); #undef BIT #undef BIT_MASK #undef BFE } DECLSPEC u32 hc_bfe_S (const u32 a, const u32 b, const u32 c) { #define BIT(x) (1u << (x)) #define BIT_MASK(x) (BIT (x) - 1) #define BFE(x,y,z) (((x) >> (y)) & BIT_MASK (z)) return BFE (a, b, c); #undef BIT #undef BIT_MASK #undef BFE } DECLSPEC u32x hc_bytealign_be (const u32x a, const u32x b, const int c) { u32x r = 0; const int cm = c & 3; if (cm == 0) { r = b; } else if (cm == 1) { r = (a << 24) | (b >> 8); } else if (cm == 2) { r = (a << 16) | (b >> 16); } else if (cm == 3) { r = (a << 8) | (b >> 24); } return r; } DECLSPEC u32 hc_bytealign_be_S (const u32 a, const u32 b, const int c) { u32 r = 0; const int cm = c & 3; if (cm == 0) { r = b; } else if (cm == 1) { r = (a << 24) | (b >> 8); } else if (cm == 2) { r = (a << 16) | (b >> 16); } else if (cm == 3) { r = (a << 8) | (b >> 24); } return r; } DECLSPEC u32x hc_bytealign (const u32x a, const u32x b, const int c) { u32x r = 0; const int cm = c & 3; if (cm == 0) { r = b; } else if (cm == 1) { r = (a >> 24) | (b << 8); } else if (cm == 2) { r = (a >> 16) | (b << 16); } else if (cm == 3) { r = (a >> 8) | (b << 24); } return r; } DECLSPEC u32 hc_bytealign_S (const u32 a, const u32 b, const int c) { u32 r = 0; const int cm = c & 3; if (cm == 0) { r = b; } else if (cm == 1) { r = (a >> 24) | (b << 8); } else if (cm == 2) { r = (a >> 16) | (b << 16); } else if (cm == 3) { r = (a >> 8) | (b << 24); } return r; } #if HAS_VPERM == 1 DECLSPEC u32x hc_byte_perm (const u32x a, const u32x b, const int c) { u32x r = 0; #if VECT_SIZE == 1 __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r) : "v"(b), "v"(a), "v"(c)); #endif #if VECT_SIZE >= 2 __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r.s0) : "v"(b.s0), "v"(a.s0), "v"(c)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r.s1) : "v"(b.s1), "v"(a.s1), "v"(c)); #endif #if VECT_SIZE >= 4 __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r.s2) : "v"(b.s2), "v"(a.s2), "v"(c)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r.s3) : "v"(b.s3), "v"(a.s3), "v"(c)); #endif #if VECT_SIZE >= 8 __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r.s4) : "v"(b.s4), "v"(a.s4), "v"(c)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r.s5) : "v"(b.s5), "v"(a.s5), "v"(c)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r.s6) : "v"(b.s6), "v"(a.s6), "v"(c)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r.s7) : "v"(b.s7), "v"(a.s7), "v"(c)); #endif #if VECT_SIZE >= 16 __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r.s8) : "v"(b.s8), "v"(a.s8), "v"(c)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r.s9) : "v"(b.s9), "v"(a.s9), "v"(c)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r.sa) : "v"(b.sa), "v"(a.sa), "v"(c)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r.sb) : "v"(b.sb), "v"(a.sb), "v"(c)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r.sc) : "v"(b.sc), "v"(a.sc), "v"(c)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r.sd) : "v"(b.sd), "v"(a.sd), "v"(c)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r.se) : "v"(b.se), "v"(a.se), "v"(c)); __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r.sf) : "v"(b.sf), "v"(a.sf), "v"(c)); #endif return r; } DECLSPEC u32 hc_byte_perm_S (const u32 a, const u32 b, const int c) { u32 r = 0; __asm__ __volatile__ ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r) : "v"(b), "v"(a), "v"(c)); return r; } #endif #if HAS_VADD3 == 1 DECLSPEC u32x hc_add3 (const u32x a, const u32x b, const u32x c) { /* u32x r = 0; #if VECT_SIZE == 1 __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r) : "v"(b), "v"(a), "v"(c)); #endif #if VECT_SIZE >= 2 __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r.s0) : "v"(b.s0), "v"(a.s0), "v"(c.s0)); __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r.s1) : "v"(b.s1), "v"(a.s1), "v"(c.s1)); #endif #if VECT_SIZE >= 4 __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r.s2) : "v"(b.s2), "v"(a.s2), "v"(c.s2)); __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r.s3) : "v"(b.s3), "v"(a.s3), "v"(c.s3)); #endif #if VECT_SIZE >= 8 __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r.s4) : "v"(b.s4), "v"(a.s4), "v"(c.s4)); __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r.s5) : "v"(b.s5), "v"(a.s5), "v"(c.s5)); __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r.s6) : "v"(b.s6), "v"(a.s6), "v"(c.s6)); __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r.s7) : "v"(b.s7), "v"(a.s7), "v"(c.s7)); #endif #if VECT_SIZE >= 16 __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r.s8) : "v"(b.s8), "v"(a.s8), "v"(c.s8)); __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r.s9) : "v"(b.s9), "v"(a.s9), "v"(c.s9)); __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r.sa) : "v"(b.sa), "v"(a.sa), "v"(c.sa)); __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r.sb) : "v"(b.sb), "v"(a.sb), "v"(c.sb)); __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r.sc) : "v"(b.sc), "v"(a.sc), "v"(c.sc)); __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r.sd) : "v"(b.sd), "v"(a.sd), "v"(c.sd)); __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r.se) : "v"(b.se), "v"(a.se), "v"(c.se)); __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r.sf) : "v"(b.sf), "v"(a.sf), "v"(c.sf)); #endif return r; */ return a + b + c; } DECLSPEC u32 hc_add3_S (const u32 a, const u32 b, const u32 c) { /* u32 r = 0; __asm__ __volatile__ ("V_ADD3_U32 %0, %1, %2, %3;" : "=v"(r) : "v"(b), "v"(a), "v"(c)); return r; */ return a + b + c; } #else DECLSPEC u32x hc_add3 (const u32x a, const u32x b, const u32x c) { return a + b + c; } DECLSPEC u32 hc_add3_S (const u32 a, const u32 b, const u32 c) { return a + b + c; } #endif DECLSPEC u32x hc_lop_0x96 (const u32x a, const u32x b, const u32x c) { return a ^ b ^ c; } DECLSPEC u32 hc_lop_0x96_S (const u32 a, const u32 b, const u32 c) { return a ^ b ^ c; } #endif #ifdef IS_NV DECLSPEC u32x hc_byte_perm (const u32x a, const u32x b, const int c) { u32x r = 0; #if VECT_SIZE == 1 asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r) : "r"(a), "r"(b), "r"(c)); #endif #if VECT_SIZE >= 2 asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r.s0) : "r"(a.s0), "r"(b.s0), "r"(c)); asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r.s1) : "r"(a.s1), "r"(b.s1), "r"(c)); #endif #if VECT_SIZE >= 4 asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r.s2) : "r"(a.s2), "r"(b.s2), "r"(c)); asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r.s3) : "r"(a.s3), "r"(b.s3), "r"(c)); #endif #if VECT_SIZE >= 8 asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r.s4) : "r"(a.s4), "r"(b.s4), "r"(c)); asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r.s5) : "r"(a.s5), "r"(b.s5), "r"(c)); asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r.s6) : "r"(a.s6), "r"(b.s6), "r"(c)); asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r.s7) : "r"(a.s7), "r"(b.s7), "r"(c)); #endif #if VECT_SIZE >= 16 asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r.s8) : "r"(a.s8), "r"(b.s8), "r"(c)); asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r.s9) : "r"(a.s9), "r"(b.s9), "r"(c)); asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r.sa) : "r"(a.sa), "r"(b.sa), "r"(c)); asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r.sb) : "r"(a.sb), "r"(b.sb), "r"(c)); asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r.sc) : "r"(a.sc), "r"(b.sc), "r"(c)); asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r.sd) : "r"(a.sd), "r"(b.sd), "r"(c)); asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r.se) : "r"(a.se), "r"(b.se), "r"(c)); asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r.sf) : "r"(a.sf), "r"(b.sf), "r"(c)); #endif return r; } DECLSPEC u32 hc_byte_perm_S (const u32 a, const u32 b, const int c) { u32 r = 0; asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r) : "r"(a), "r"(b), "r"(c)); return r; } DECLSPEC u32x hc_bfe (const u32x a, const u32x b, const u32x c) { u32x r = 0; #if VECT_SIZE == 1 asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r) : "r"(a), "r"(b), "r"(c)); #endif #if VECT_SIZE >= 2 asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r.s0) : "r"(a.s0), "r"(b.s0), "r"(c.s0)); asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r.s1) : "r"(a.s1), "r"(b.s1), "r"(c.s1)); #endif #if VECT_SIZE >= 4 asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r.s2) : "r"(a.s2), "r"(b.s2), "r"(c.s2)); asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r.s3) : "r"(a.s3), "r"(b.s3), "r"(c.s3)); #endif #if VECT_SIZE >= 8 asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r.s4) : "r"(a.s4), "r"(b.s4), "r"(c.s4)); asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r.s5) : "r"(a.s5), "r"(b.s5), "r"(c.s5)); asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r.s6) : "r"(a.s6), "r"(b.s6), "r"(c.s6)); asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r.s7) : "r"(a.s7), "r"(b.s7), "r"(c.s7)); #endif #if VECT_SIZE >= 16 asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r.s8) : "r"(a.s8), "r"(b.s8), "r"(c.s8)); asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r.s9) : "r"(a.s9), "r"(b.s9), "r"(c.s9)); asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r.sa) : "r"(a.sa), "r"(b.sa), "r"(c.sa)); asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r.sb) : "r"(a.sb), "r"(b.sb), "r"(c.sb)); asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r.sc) : "r"(a.sc), "r"(b.sc), "r"(c.sc)); asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r.sd) : "r"(a.sd), "r"(b.sd), "r"(c.sd)); asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r.se) : "r"(a.se), "r"(b.se), "r"(c.se)); asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r.sf) : "r"(a.sf), "r"(b.sf), "r"(c.sf)); #endif return r; } DECLSPEC u32 hc_bfe_S (const u32 a, const u32 b, const u32 c) { u32 r = 0; asm volatile ("bfe.u32 %0, %1, %2, %3;" : "=r"(r) : "r"(a), "r"(b), "r"(c)); return r; } DECLSPEC u32 hc_bytealign_be_S (const u32 a, const u32 b, const int c) { const int c_mod_4 = c & 3; const u32 r = hc_byte_perm_S (b, a, (0x76543210 >> (c_mod_4 * 4)) & 0xffff); return r; } DECLSPEC u32x hc_bytealign (const u32x a, const u32x b, const int c) { const int c_mod_4 = c & 3; const int c_minus_4 = 4 - c_mod_4; const u32x r = hc_byte_perm (a, b, (0x76543210 >> (c_minus_4 * 4)) & 0xffff); return r; } DECLSPEC u32 hc_bytealign_S (const u32 a, const u32 b, const int c) { const int c_mod_4 = c & 3; const int c_minus_4 = 4 - c_mod_4; const u32 r = hc_byte_perm_S (a, b, (0x76543210 >> (c_minus_4 * 4)) & 0xffff); return r; } DECLSPEC u32x hc_add3 (const u32x a, const u32x b, const u32x c) { return a + b + c; } DECLSPEC u32 hc_add3_S (const u32 a, const u32 b, const u32 c) { return a + b + c; } DECLSPEC u32x hc_lop_0x96 (const u32x a, const u32x b, const u32x c) { u32x r = 0; #if CUDA_ARCH >= 500 #if VECT_SIZE == 1 asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r): "r"(a), "r"(b), "r"(c)); #endif #if VECT_SIZE >= 2 asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r.s0): "r"(a.s0), "r"(b.s0), "r"(c.s0)); asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r.s1): "r"(a.s1), "r"(b.s1), "r"(c.s1)); #endif #if VECT_SIZE >= 4 asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r.s2): "r"(a.s2), "r"(b.s2), "r"(c.s2)); asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r.s3): "r"(a.s3), "r"(b.s3), "r"(c.s3)); #endif #if VECT_SIZE >= 8 asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r.s4): "r"(a.s4), "r"(b.s4), "r"(c.s4)); asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r.s5): "r"(a.s5), "r"(b.s5), "r"(c.s5)); asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r.s6): "r"(a.s6), "r"(b.s6), "r"(c.s6)); asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r.s7): "r"(a.s7), "r"(b.s7), "r"(c.s7)); #endif #if VECT_SIZE >= 16 asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r.s8): "r"(a.s8), "r"(b.s8), "r"(c.s8)); asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r.s9): "r"(a.s9), "r"(b.s9), "r"(c.s9)); asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r.sa): "r"(a.sa), "r"(b.sa), "r"(c.sa)); asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r.sb): "r"(a.sb), "r"(b.sb), "r"(c.sb)); asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r.sc): "r"(a.sc), "r"(b.sc), "r"(c.sc)); asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r.sd): "r"(a.sd), "r"(b.sd), "r"(c.sd)); asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r.se): "r"(a.se), "r"(b.se), "r"(c.se)); asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r.sf): "r"(a.sf), "r"(b.sf), "r"(c.sf)); #endif #else r = a ^ b ^ c; #endif return r; } DECLSPEC u32 hc_lop_0x96_S (const u32 a, const u32 b, const u32 c) { u32 r = 0; #if CUDA_ARCH >= 500 asm volatile ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r"(r): "r"(a), "r"(b), "r"(c)); #else r = a ^ b ^ c; #endif return r; } #endif #ifdef IS_GENERIC DECLSPEC u32x hc_bfe (const u32x a, const u32x b, const u32x c) { #define BIT(x) (make_u32x (1u) << (x)) #define BIT_MASK(x) (BIT (x) - 1) #define BFE(x,y,z) (((x) >> (y)) & BIT_MASK (z)) return BFE (a, b, c); #undef BIT #undef BIT_MASK #undef BFE } DECLSPEC u32 hc_bfe_S (const u32 a, const u32 b, const u32 c) { #define BIT(x) (1u << (x)) #define BIT_MASK(x) (BIT (x) - 1) #define BFE(x,y,z) (((x) >> (y)) & BIT_MASK (z)) return BFE (a, b, c); #undef BIT #undef BIT_MASK #undef BFE } DECLSPEC u32x hc_bytealign_be (const u32x a, const u32x b, const int c) { u32x r = 0; const int cm = c & 3; if (cm == 0) { r = b; } else if (cm == 1) { r = (a << 24) | (b >> 8); } else if (cm == 2) { r = (a << 16) | (b >> 16); } else if (cm == 3) { r = (a << 8) | (b >> 24); } return r; } DECLSPEC u32 hc_bytealign_be_S (const u32 a, const u32 b, const int c) { u32 r = 0; const int cm = c & 3; if (cm == 0) { r = b; } else if (cm == 1) { r = (a << 24) | (b >> 8); } else if (cm == 2) { r = (a << 16) | (b >> 16); } else if (cm == 3) { r = (a << 8) | (b >> 24); } return r; } DECLSPEC u32x hc_bytealign (const u32x a, const u32x b, const int c) { u32x r = 0; const int cm = c & 3; if (cm == 0) { r = b; } else if (cm == 1) { r = (a >> 24) | (b << 8); } else if (cm == 2) { r = (a >> 16) | (b << 16); } else if (cm == 3) { r = (a >> 8) | (b << 24); } return r; } DECLSPEC u32 hc_bytealign_S (const u32 a, const u32 b, const int c) { u32 r = 0; const int cm = c & 3; if (cm == 0) { r = b; } else if (cm == 1) { r = (a >> 24) | (b << 8); } else if (cm == 2) { r = (a >> 16) | (b << 16); } else if (cm == 3) { r = (a >> 8) | (b << 24); } return r; } DECLSPEC u32x hc_add3 (const u32x a, const u32x b, const u32x c) { return a + b + c; } DECLSPEC u32 hc_add3_S (const u32 a, const u32 b, const u32 c) { return a + b + c; } DECLSPEC u32x hc_lop_0x96 (const u32x a, const u32x b, const u32x c) { return a ^ b ^ c; } DECLSPEC u32 hc_lop_0x96_S (const u32 a, const u32 b, const u32 c) { return a ^ b ^ c; } #endif /** * pure scalar functions */ DECLSPEC int ffz (const u32 v) { #ifdef _unroll #pragma unroll #endif for (int i = 0; i < 32; i++) { if ((v >> i) & 1) continue; return i; } return -1; } #ifdef KERNEL_STATIC DECLSPEC int hash_comp (PRIVATE_AS const u32 *d1, GLOBAL_AS const u32 *d2) { if (d1[3] > d2[DGST_R3]) return ( 1); if (d1[3] < d2[DGST_R3]) return (-1); if (d1[2] > d2[DGST_R2]) return ( 1); if (d1[2] < d2[DGST_R2]) return (-1); if (d1[1] > d2[DGST_R1]) return ( 1); if (d1[1] < d2[DGST_R1]) return (-1); if (d1[0] > d2[DGST_R0]) return ( 1); if (d1[0] < d2[DGST_R0]) return (-1); return (0); } DECLSPEC int find_hash (PRIVATE_AS const u32 *digest, const u32 digests_cnt, GLOBAL_AS const digest_t *digests_buf) { for (u32 l = 0, r = digests_cnt; r; r >>= 1) { const u32 m = r >> 1; const u32 c = l + m; const int cmp = hash_comp (digest, digests_buf[c].digest_buf); if (cmp > 0) { l += m + 1; r--; } if (cmp == 0) return (c); } return (-1); } #endif // Input has to be zero padded and buffer size has to be multiple of 4 and at least of length 24 // We simply ignore buffer length for the first 24 bytes for some extra speed boost :) // Number of unrolls found by simply testing what gave best results DECLSPEC int hc_enc_scan (PRIVATE_AS const u32 *buf, const int len) { if (buf[0] & 0x80808080) return 1; if (buf[1] & 0x80808080) return 1; if (buf[2] & 0x80808080) return 1; if (buf[3] & 0x80808080) return 1; if (buf[4] & 0x80808080) return 1; if (buf[5] & 0x80808080) return 1; for (int i = 24, j = 6; i < len; i += 4, j += 1) { if (buf[j] & 0x80808080) return 1; } return 0; } DECLSPEC int hc_enc_scan_global (GLOBAL_AS const u32 *buf, const int len) { if (buf[0] & 0x80808080) return 1; if (buf[1] & 0x80808080) return 1; if (buf[2] & 0x80808080) return 1; if (buf[3] & 0x80808080) return 1; if (buf[4] & 0x80808080) return 1; if (buf[5] & 0x80808080) return 1; for (int i = 24, j = 6; i < len; i += 4, j += 1) { if (buf[j] & 0x80808080) return 1; } return 0; } // Constants and some code snippets from unicode.org's ConvertUTF.c // Compiler can perfectly translate some of the branches and switch cases this into MOVC // which is faster than lookup tables #define halfShift 10 #define halfBase 0x0010000 #define halfMask 0x3FF #define UNI_MAX_BMP 0xFFFF #define UNI_SUR_HIGH_START 0xD800 #define UNI_SUR_HIGH_END 0xDBFF #define UNI_SUR_LOW_START 0xDC00 #define UNI_SUR_LOW_END 0xDFFF /* * Magic values subtracted from a buffer value during UTF8 conversion. * This table contains as many values as there might be trailing bytes * in a UTF-8 sequence. */ #define offsetsFromUTF8_0 0x00000000UL #define offsetsFromUTF8_1 0x00003080UL #define offsetsFromUTF8_2 0x000E2080UL #define offsetsFromUTF8_3 0x03C82080UL #define offsetsFromUTF8_4 0xFA082080UL #define offsetsFromUTF8_5 0x82082080UL DECLSPEC void hc_enc_init (PRIVATE_AS hc_enc_t *hc_enc) { hc_enc->pos = 0; hc_enc->cbuf = 0; hc_enc->clen = 0; } DECLSPEC int hc_enc_has_next (PRIVATE_AS hc_enc_t *hc_enc, const int sz) { if (hc_enc->pos < sz) return 1; if (hc_enc->clen) return 1; return 0; } DECLSPEC int hc_enc_validate_utf8 (PRIVATE_AS const u32 *src_buf, const int src_pos, const int extraBytesToRead) { PRIVATE_AS const u8 *src_ptr = (PRIVATE_AS const u8 *) src_buf; if (extraBytesToRead == 0) { const u8 c0 = src_ptr[src_pos + 0]; if (c0 >= 0x80) return 0; } else if (extraBytesToRead == 1) { const u8 c0 = src_ptr[src_pos + 0]; if ((c0 < 0xc2) || (c0 > 0xdf)) return 0; const u8 c1 = src_ptr[src_pos + 1]; if ((c1 < 0x80) || (c1 > 0xbf)) return 0; } else if (extraBytesToRead == 2) { const u8 c0 = src_ptr[src_pos + 0]; if ((c0 >= 0xe0) && (c0 <= 0xe0)) { const u8 c1 = src_ptr[src_pos + 1]; if ((c1 < 0xa0) || (c1 > 0xbf)) return 0; const u8 c2 = src_ptr[src_pos + 2]; if ((c2 < 0x80) || (c2 > 0xbf)) return 0; } else if ((c0 >= 0xe1) && (c0 <= 0xec)) { const u8 c1 = src_ptr[src_pos + 1]; if ((c1 < 0x80) || (c1 > 0xbf)) return 0; const u8 c2 = src_ptr[src_pos + 2]; if ((c2 < 0x80) || (c2 > 0xbf)) return 0; } else if ((c0 >= 0xed) && (c0 <= 0xed)) { const u8 c1 = src_ptr[src_pos + 1]; if ((c1 < 0x80) || (c1 > 0x9f)) return 0; const u8 c2 = src_ptr[src_pos + 2]; if ((c2 < 0x80) || (c2 > 0xbf)) return 0; } else if ((c0 >= 0xee) && (c0 <= 0xef)) { const u8 c1 = src_ptr[src_pos + 1]; if ((c1 < 0x80) || (c1 > 0xbf)) return 0; const u8 c2 = src_ptr[src_pos + 2]; if ((c2 < 0x80) || (c2 > 0xbf)) return 0; } else { return 0; } } else if (extraBytesToRead == 3) { const u8 c0 = src_ptr[src_pos + 0]; if ((c0 >= 0xf0) && (c0 <= 0xf0)) { const u8 c1 = src_ptr[src_pos + 1]; if ((c1 < 0x90) || (c1 > 0xbf)) return 0; const u8 c2 = src_ptr[src_pos + 2]; if ((c2 < 0x80) || (c2 > 0xbf)) return 0; const u8 c3 = src_ptr[src_pos + 3]; if ((c3 < 0x80) || (c3 > 0xbf)) return 0; } else if ((c0 >= 0xf1) && (c0 <= 0xf3)) { const u8 c1 = src_ptr[src_pos + 1]; if ((c1 < 0x80) || (c1 > 0xbf)) return 0; const u8 c2 = src_ptr[src_pos + 2]; if ((c2 < 0x80) || (c2 > 0xbf)) return 0; const u8 c3 = src_ptr[src_pos + 3]; if ((c3 < 0x80) || (c3 > 0xbf)) return 0; } else if ((c0 >= 0xf4) && (c0 <= 0xf4)) { const u8 c1 = src_ptr[src_pos + 1]; if ((c1 < 0x80) || (c1 > 0xbf)) return 0; const u8 c2 = src_ptr[src_pos + 2]; if ((c2 < 0x80) || (c2 > 0xbf)) return 0; const u8 c3 = src_ptr[src_pos + 3]; if ((c3 < 0x80) || (c3 > 0xbf)) return 0; } else { return 0; } } return 1; } DECLSPEC int hc_enc_validate_utf8_global (GLOBAL_AS const u32 *src_buf, const int src_pos, const int extraBytesToRead) { GLOBAL_AS const u8 *src_ptr = (GLOBAL_AS const u8 *) src_buf; if (extraBytesToRead == 0) { const u8 c0 = src_ptr[src_pos + 0]; if (c0 >= 0x80) return 0; } else if (extraBytesToRead == 1) { const u8 c0 = src_ptr[src_pos + 0]; if ((c0 < 0xc2) || (c0 > 0xdf)) return 0; const u8 c1 = src_ptr[src_pos + 1]; if ((c1 < 0x80) || (c1 > 0xbf)) return 0; } else if (extraBytesToRead == 2) { const u8 c0 = src_ptr[src_pos + 0]; if ((c0 >= 0xe0) && (c0 <= 0xe0)) { const u8 c1 = src_ptr[src_pos + 1]; if ((c1 < 0xa0) || (c1 > 0xbf)) return 0; const u8 c2 = src_ptr[src_pos + 2]; if ((c2 < 0x80) || (c2 > 0xbf)) return 0; } else if ((c0 >= 0xe1) && (c0 <= 0xec)) { const u8 c1 = src_ptr[src_pos + 1]; if ((c1 < 0x80) || (c1 > 0xbf)) return 0; const u8 c2 = src_ptr[src_pos + 2]; if ((c2 < 0x80) || (c2 > 0xbf)) return 0; } else if ((c0 >= 0xed) && (c0 <= 0xed)) { const u8 c1 = src_ptr[src_pos + 1]; if ((c1 < 0x80) || (c1 > 0x9f)) return 0; const u8 c2 = src_ptr[src_pos + 2]; if ((c2 < 0x80) || (c2 > 0xbf)) return 0; } else if ((c0 >= 0xee) && (c0 <= 0xef)) { const u8 c1 = src_ptr[src_pos + 1]; if ((c1 < 0x80) || (c1 > 0xbf)) return 0; const u8 c2 = src_ptr[src_pos + 2]; if ((c2 < 0x80) || (c2 > 0xbf)) return 0; } else { return 0; } } else if (extraBytesToRead == 3) { const u8 c0 = src_ptr[src_pos + 0]; if ((c0 >= 0xf0) && (c0 <= 0xf0)) { const u8 c1 = src_ptr[src_pos + 1]; if ((c1 < 0x90) || (c1 > 0xbf)) return 0; const u8 c2 = src_ptr[src_pos + 2]; if ((c2 < 0x80) || (c2 > 0xbf)) return 0; const u8 c3 = src_ptr[src_pos + 3]; if ((c3 < 0x80) || (c3 > 0xbf)) return 0; } else if ((c0 >= 0xf1) && (c0 <= 0xf3)) { const u8 c1 = src_ptr[src_pos + 1]; if ((c1 < 0x80) || (c1 > 0xbf)) return 0; const u8 c2 = src_ptr[src_pos + 2]; if ((c2 < 0x80) || (c2 > 0xbf)) return 0; const u8 c3 = src_ptr[src_pos + 3]; if ((c3 < 0x80) || (c3 > 0xbf)) return 0; } else if ((c0 >= 0xf4) && (c0 <= 0xf4)) { const u8 c1 = src_ptr[src_pos + 1]; if ((c1 < 0x80) || (c1 > 0xbf)) return 0; const u8 c2 = src_ptr[src_pos + 2]; if ((c2 < 0x80) || (c2 > 0xbf)) return 0; const u8 c3 = src_ptr[src_pos + 3]; if ((c3 < 0x80) || (c3 > 0xbf)) return 0; } else { return 0; } } return 1; } // Input buffer and Output buffer size has to be multiple of 4 and at least of size 4. // The output buffer is not zero padded, so entire buffer has to be set all zero before entering this function or truncated afterwards. DECLSPEC int hc_enc_next (PRIVATE_AS hc_enc_t *hc_enc, PRIVATE_AS const u32 *src_buf, const int src_len, const int src_sz, PRIVATE_AS u32 *dst_buf, const int dst_sz) { PRIVATE_AS const u8 *src_ptr = (PRIVATE_AS const u8 *) src_buf; PRIVATE_AS u8 *dst_ptr = (PRIVATE_AS u8 *) dst_buf; int src_pos = hc_enc->pos; #if VENDOR_ID == 8 // Work around segmentation fault in Intel JiT // Tested with 2021.12.6.0.19_160000 volatile #endif int dst_pos = hc_enc->clen; dst_buf[0] = hc_enc->cbuf; hc_enc->clen = 0; hc_enc->cbuf = 0; while ((src_pos < src_len) && (dst_pos < dst_sz)) { const u8 c = src_ptr[src_pos]; int extraBytesToRead = 0; if (c >= 0xfc) { // old version, doesnt work with https://github.com/hashcat/hashcat/issues/3592 //extraBytesToRead = 5; } else if (c >= 0xf8) { // old version, doesnt work with https://github.com/hashcat/hashcat/issues/3592 //extraBytesToRead = 4; } else if (c >= 0xf0) { extraBytesToRead = 3; } else if (c >= 0xe0) { extraBytesToRead = 2; } else if (c >= 0xc0) { extraBytesToRead = 1; } if ((src_pos + extraBytesToRead) >= src_sz) { // broken input hc_enc->pos = src_len; return -1; } if (hc_enc_validate_utf8 (src_buf, src_pos, extraBytesToRead) == 0) { // broken input hc_enc->pos = src_len; return -1; } u32 ch = 0; switch (extraBytesToRead) { // old version, doesnt work with https://github.com/hashcat/hashcat/issues/3592 /* case 5: ch += src_ptr[src_pos++]; ch <<= 6; // remember, illegal UTF-8 ch += src_ptr[src_pos++]; ch <<= 6; // remember, illegal UTF-8 ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch -= offsetsFromUTF8_5; break; case 4: ch += src_ptr[src_pos++]; ch <<= 6; // remember, illegal UTF-8 ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch -= offsetsFromUTF8_4; break; */ case 3: ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch -= offsetsFromUTF8_3; break; case 2: ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch -= offsetsFromUTF8_2; break; case 1: ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch -= offsetsFromUTF8_1; break; case 0: ch += src_ptr[src_pos++]; ch -= offsetsFromUTF8_0; break; } /* Target is a character <= 0xFFFF */ if (ch <= UNI_MAX_BMP) { dst_ptr[dst_pos++] = (ch >> 0) & 0xff; dst_ptr[dst_pos++] = (ch >> 8) & 0xff; } else { ch -= halfBase; const u32 a = ((ch >> halfShift) + UNI_SUR_HIGH_START); const u32 b = ((ch & halfMask) + UNI_SUR_LOW_START); if ((dst_pos + 2) == dst_sz) { dst_ptr[dst_pos++] = (a >> 0) & 0xff; dst_ptr[dst_pos++] = (a >> 8) & 0xff; hc_enc->cbuf = b & 0xffff; hc_enc->clen = 2; } else { dst_ptr[dst_pos++] = (a >> 0) & 0xff; dst_ptr[dst_pos++] = (a >> 8) & 0xff; dst_ptr[dst_pos++] = (b >> 0) & 0xff; dst_ptr[dst_pos++] = (b >> 8) & 0xff; } } } hc_enc->pos = src_pos; return dst_pos; } DECLSPEC int hc_enc_next_global (PRIVATE_AS hc_enc_t *hc_enc, GLOBAL_AS const u32 *src_buf, const int src_len, const int src_sz, PRIVATE_AS u32 *dst_buf, const int dst_sz) { GLOBAL_AS const u8 *src_ptr = (GLOBAL_AS const u8 *) src_buf; PRIVATE_AS u8 *dst_ptr = (PRIVATE_AS u8 *) dst_buf; int src_pos = hc_enc->pos; #if VENDOR_ID == 8 // Work around segmentation fault in Intel JiT // Tested with 2021.12.6.0.19_160000 volatile #endif int dst_pos = hc_enc->clen; dst_buf[0] = hc_enc->cbuf; hc_enc->clen = 0; hc_enc->cbuf = 0; while ((src_pos < src_len) && (dst_pos < dst_sz)) { const u8 c = src_ptr[src_pos]; int extraBytesToRead = 0; if (c >= 0xfc) { // old version, doesnt work with https://github.com/hashcat/hashcat/issues/3592 //extraBytesToRead = 5; } else if (c >= 0xf8) { // old version, doesnt work with https://github.com/hashcat/hashcat/issues/3592 //extraBytesToRead = 4; } else if (c >= 0xf0) { extraBytesToRead = 3; } else if (c >= 0xe0) { extraBytesToRead = 2; } else if (c >= 0xc0) { extraBytesToRead = 1; } if ((src_pos + extraBytesToRead) >= src_sz) { // broken input hc_enc->pos = src_len; return -1; } if (hc_enc_validate_utf8_global (src_buf, src_pos, extraBytesToRead) == 0) { // broken input hc_enc->pos = src_len; return -1; } u32 ch = 0; switch (extraBytesToRead) { // old version, doesnt work with https://github.com/hashcat/hashcat/issues/3592 /* case 5: ch += src_ptr[src_pos++]; ch <<= 6; // remember, illegal UTF-8 ch += src_ptr[src_pos++]; ch <<= 6; // remember, illegal UTF-8 ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch -= offsetsFromUTF8_5; break; case 4: ch += src_ptr[src_pos++]; ch <<= 6; // remember, illegal UTF-8 ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch -= offsetsFromUTF8_4; break; */ case 3: ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch -= offsetsFromUTF8_3; break; case 2: ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch -= offsetsFromUTF8_2; break; case 1: ch += src_ptr[src_pos++]; ch <<= 6; ch += src_ptr[src_pos++]; ch -= offsetsFromUTF8_1; break; case 0: ch += src_ptr[src_pos++]; ch -= offsetsFromUTF8_0; break; } /* Target is a character <= 0xFFFF */ if (ch <= UNI_MAX_BMP) { dst_ptr[dst_pos++] = (ch >> 0) & 0xff; dst_ptr[dst_pos++] = (ch >> 8) & 0xff; } else { ch -= halfBase; const u32 a = ((ch >> halfShift) + UNI_SUR_HIGH_START); const u32 b = ((ch & halfMask) + UNI_SUR_LOW_START); if ((dst_pos + 2) == dst_sz) { // this section seems to break intel opencl runtime but is unknown why dst_ptr[dst_pos++] = (a >> 0) & 0xff; dst_ptr[dst_pos++] = (a >> 8) & 0xff; hc_enc->cbuf = b & 0xffff; hc_enc->clen = 2; } else { dst_ptr[dst_pos++] = (a >> 0) & 0xff; dst_ptr[dst_pos++] = (a >> 8) & 0xff; dst_ptr[dst_pos++] = (b >> 0) & 0xff; dst_ptr[dst_pos++] = (b >> 8) & 0xff; } } } hc_enc->pos = src_pos; return dst_pos; } #undef halfShift #undef halfBase #undef halfMask #undef UNI_MAX_BMP #undef UNI_SUR_HIGH_START #undef UNI_SUR_HIGH_END #undef UNI_SUR_LOW_START #undef UNI_SUR_LOW_END #undef offsetsFromUTF8_0 #undef offsetsFromUTF8_1 #undef offsetsFromUTF8_2 #undef offsetsFromUTF8_3 #undef offsetsFromUTF8_4 #undef offsetsFromUTF8_5 DECLSPEC int pkcs_padding_bs8 (PRIVATE_AS const u32 *data_buf, const int data_len) { if (data_len == 0) return -1; // cannot have zero length, is important to avoid out of boundary reads if (data_len % 8) return -1; // has to be a multiple of block size const int last_pad_pos = data_len - 1; const int last_pad_elem = last_pad_pos / 4; const u32 pad = data_buf[last_pad_elem] >> 24; // guaranteed by pkcs structure if ((pad < 1) || (pad > 8)) return -1; // pkcs pads are not zero based const u32 padm = (pad << 0) | (pad << 8) | (pad << 16) | (pad << 24); u32 mask0 = 0; u32 mask1 = 0; switch (pad) { case 1: mask0 = 0x00000000; mask1 = 0xff000000; break; case 2: mask0 = 0x00000000; mask1 = 0xffff0000; break; case 3: mask0 = 0x00000000; mask1 = 0xffffff00; break; case 4: mask0 = 0x00000000; mask1 = 0xffffffff; break; case 5: mask0 = 0xff000000; mask1 = 0xffffffff; break; case 6: mask0 = 0xffff0000; mask1 = 0xffffffff; break; case 7: mask0 = 0xffffff00; mask1 = 0xffffffff; break; case 8: mask0 = 0xffffffff; mask1 = 0xffffffff; break; } const u32 data0 = data_buf[last_pad_elem - 1]; const u32 data1 = data_buf[last_pad_elem - 0]; if ((data0 & mask0) != (padm & mask0)) return -1; if ((data1 & mask1) != (padm & mask1)) return -1; const int real_len = data_len - pad; return real_len; } DECLSPEC int pkcs_padding_bs16 (PRIVATE_AS const u32 *data_buf, const int data_len) { if (data_len == 0) return -1; // cannot have zero length, is important to avoid out of boundary reads if (data_len % 16) return -1; // has to be a multiple of block size const int last_pad_pos = data_len - 1; const int last_pad_elem = last_pad_pos / 4; const u32 pad = data_buf[last_pad_elem] >> 24; // guaranteed by pkcs structure if ((pad < 1) || (pad > 16)) return -1; // pkcs pads are not zero based const u32 padm = (pad << 0) | (pad << 8) | (pad << 16) | (pad << 24); u32 mask0 = 0; u32 mask1 = 0; u32 mask2 = 0; u32 mask3 = 0; switch (pad) { case 1: mask0 = 0x00000000; mask1 = 0x00000000; mask2 = 0x00000000; mask3 = 0xff000000; break; case 2: mask0 = 0x00000000; mask1 = 0x00000000; mask2 = 0x00000000; mask3 = 0xffff0000; break; case 3: mask0 = 0x00000000; mask1 = 0x00000000; mask2 = 0x00000000; mask3 = 0xffffff00; break; case 4: mask0 = 0x00000000; mask1 = 0x00000000; mask2 = 0x00000000; mask3 = 0xffffffff; break; case 5: mask0 = 0x00000000; mask1 = 0x00000000; mask2 = 0xff000000; mask3 = 0xffffffff; break; case 6: mask0 = 0x00000000; mask1 = 0x00000000; mask2 = 0xffff0000; mask3 = 0xffffffff; break; case 7: mask0 = 0x00000000; mask1 = 0x00000000; mask2 = 0xffffff00; mask3 = 0xffffffff; break; case 8: mask0 = 0x00000000; mask1 = 0x00000000; mask2 = 0xffffffff; mask3 = 0xffffffff; break; case 9: mask0 = 0x00000000; mask1 = 0xff000000; mask2 = 0xffffffff; mask3 = 0xffffffff; break; case 10: mask0 = 0x00000000; mask1 = 0xffff0000; mask2 = 0xffffffff; mask3 = 0xffffffff; break; case 11: mask0 = 0x00000000; mask1 = 0xffffff00; mask2 = 0xffffffff; mask3 = 0xffffffff; break; case 12: mask0 = 0x00000000; mask1 = 0xffffffff; mask2 = 0xffffffff; mask3 = 0xffffffff; break; case 13: mask0 = 0xff000000; mask1 = 0xffffffff; mask2 = 0xffffffff; mask3 = 0xffffffff; break; case 14: mask0 = 0xffff0000; mask1 = 0xffffffff; mask2 = 0xffffffff; mask3 = 0xffffffff; break; case 15: mask0 = 0xffffff00; mask1 = 0xffffffff; mask2 = 0xffffffff; mask3 = 0xffffffff; break; case 16: mask0 = 0xffffffff; mask1 = 0xffffffff; mask2 = 0xffffffff; mask3 = 0xffffffff; break; } const u32 data0 = data_buf[last_pad_elem - 3]; const u32 data1 = data_buf[last_pad_elem - 2]; const u32 data2 = data_buf[last_pad_elem - 1]; const u32 data3 = data_buf[last_pad_elem - 0]; if ((data0 & mask0) != (padm & mask0)) return -1; if ((data1 & mask1) != (padm & mask1)) return -1; if ((data2 & mask2) != (padm & mask2)) return -1; if ((data3 & mask3) != (padm & mask3)) return -1; const int real_len = data_len - pad; return real_len; } DECLSPEC int asn1_detect (PRIVATE_AS const u32 *buf, const int len) { if (len < 128) { if ((buf[0] & 0x00ff80ff) != 0x00020030) return 0; } else if (len < 256) { if ((buf[0] & 0xff00ffff) != 0x02008130) return 0; } else if (len < 65536) { if ((buf[0] & 0x0000ffff) != 0x00008230) return 0; if ((buf[1] & 0x000000ff) != 0x00000002) return 0; } if (len < 128) { const int lenb = ((buf[0] & 0x00007f00) >> 8); if ((lenb + 2) != len) return 0; } else if (len < 256) { const int lenb = ((buf[0] & 0x00ff0000) >> 16); if ((lenb + 3) != len) return 0; } else if (len < 65536) { const int lenb = ((buf[0] & 0xff000000) >> 24) | ((buf[0] & 0x00ff0000) >> 8); if ((lenb + 4) != len) return 0; } return 1; } DECLSPEC u32 check_bitmap (GLOBAL_AS const u32 *bitmap, const u32 bitmap_mask, const u32 bitmap_shift, const u32 digest) { return (bitmap[(digest >> bitmap_shift) & bitmap_mask] & (1 << (digest & 0x1f))); } DECLSPEC u32 check (PRIVATE_AS const u32 *digest, GLOBAL_AS const u32 *bitmap_s1_a, GLOBAL_AS const u32 *bitmap_s1_b, GLOBAL_AS const u32 *bitmap_s1_c, GLOBAL_AS const u32 *bitmap_s1_d, GLOBAL_AS const u32 *bitmap_s2_a, GLOBAL_AS const u32 *bitmap_s2_b, GLOBAL_AS const u32 *bitmap_s2_c, GLOBAL_AS const u32 *bitmap_s2_d, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2) { if (check_bitmap (bitmap_s1_a, bitmap_mask, bitmap_shift1, digest[0]) == 0) return (0); if (check_bitmap (bitmap_s1_b, bitmap_mask, bitmap_shift1, digest[1]) == 0) return (0); if (check_bitmap (bitmap_s1_c, bitmap_mask, bitmap_shift1, digest[2]) == 0) return (0); if (check_bitmap (bitmap_s1_d, bitmap_mask, bitmap_shift1, digest[3]) == 0) return (0); if (check_bitmap (bitmap_s2_a, bitmap_mask, bitmap_shift2, digest[0]) == 0) return (0); if (check_bitmap (bitmap_s2_b, bitmap_mask, bitmap_shift2, digest[1]) == 0) return (0); if (check_bitmap (bitmap_s2_c, bitmap_mask, bitmap_shift2, digest[2]) == 0) return (0); if (check_bitmap (bitmap_s2_d, bitmap_mask, bitmap_shift2, digest[3]) == 0) return (0); return (1); } DECLSPEC void mark_hash (GLOBAL_AS plain_t *plains_buf, GLOBAL_AS u32 *d_result, const u32 salt_pos, const u32 digests_cnt, const u32 digest_pos, const u32 hash_pos, const u64 gid, const u32 il_pos, const u32 extra1, const u32 extra2) { const u32 idx = hc_atomic_inc (d_result); #if ATTACK_MODE == 9 #else if (idx >= digests_cnt) { // this is kind of tricky: we *must* call hc_atomic_inc() to know about the current value from a multi-thread perspective // this action creates a buffer overflow, so we need to fix it here hc_atomic_dec (d_result); return; } #endif plains_buf[idx].salt_pos = salt_pos; plains_buf[idx].digest_pos = digest_pos; // relative plains_buf[idx].hash_pos = hash_pos; // absolute plains_buf[idx].gidvid = gid; plains_buf[idx].il_pos = il_pos; plains_buf[idx].extra1 = extra1; // unused so far plains_buf[idx].extra2 = extra2; // unused so far } DECLSPEC int hc_count_char (PRIVATE_AS const u32 *buf, const int elems, const u32 c) { int r = 0; for (int i = 0; i < elems; i++) { const u32 v = buf[i]; if (((v >> 0) & 0xff) == c) r++; if (((v >> 8) & 0xff) == c) r++; if (((v >> 16) & 0xff) == c) r++; if (((v >> 24) & 0xff) == c) r++; } return r; } DECLSPEC float hc_get_entropy (PRIVATE_AS const u32 *buf, const int elems) { const int length = elems * 4; float entropy = 0.0f; #ifdef _unroll #pragma unroll #endif for (u32 c = 0; c < 256; c++) { const int r = hc_count_char (buf, elems, c); if (r == 0) continue; float w = (float) r / length; entropy += -w * log2 (w); } return entropy; } DECLSPEC int is_valid_hex_8 (const u8 v) { // direct lookup table is slower thanks to CMOV if ((v >= (u8) '0') && (v <= (u8) '9')) return 1; if ((v >= (u8) 'a') && (v <= (u8) 'f')) return 1; return 0; } DECLSPEC int is_valid_hex_32 (const u32 v) { if (is_valid_hex_8 ((u8) (v >> 0)) == 0) return 0; if (is_valid_hex_8 ((u8) (v >> 8)) == 0) return 0; if (is_valid_hex_8 ((u8) (v >> 16)) == 0) return 0; if (is_valid_hex_8 ((u8) (v >> 24)) == 0) return 0; return 1; } DECLSPEC int is_valid_base58_8 (const u8 v) { if (v > (u8) 'z') return 0; if (v < (u8) '1') return 0; if ((v > (u8) '9') && (v < (u8) 'A')) return 0; if ((v > (u8) 'Z') && (v < (u8) 'a')) return 0; // https://github.com/hashcat/hashcat/issues/3878 if (v == 'O') return 0; if (v == 'I') return 0; if (v == 'l') return 0; return 1; } DECLSPEC int is_valid_base58_32 (const u32 v) { if (is_valid_base58_8 ((u8) (v >> 0)) == 0) return 0; if (is_valid_base58_8 ((u8) (v >> 8)) == 0) return 0; if (is_valid_base58_8 ((u8) (v >> 16)) == 0) return 0; if (is_valid_base58_8 ((u8) (v >> 24)) == 0) return 0; return 1; } DECLSPEC int is_valid_printable_8 (const u8 v) { if (v > (u8) 0x7e) return 0; if (v < (u8) 0x20) return 0; return 1; } DECLSPEC int is_valid_printable_32 (const u32 v) { if (is_valid_printable_8 ((u8) (v >> 0)) == 0) return 0; if (is_valid_printable_8 ((u8) (v >> 8)) == 0) return 0; if (is_valid_printable_8 ((u8) (v >> 16)) == 0) return 0; if (is_valid_printable_8 ((u8) (v >> 24)) == 0) return 0; return 1; } DECLSPEC int hc_find_keyboard_layout_map (const u32 search, const int search_len, LOCAL_AS keyboard_layout_mapping_t *s_keyboard_layout_mapping_buf, const int keyboard_layout_mapping_cnt) { for (int idx = 0; idx < keyboard_layout_mapping_cnt; idx++) { const u32 src_char = s_keyboard_layout_mapping_buf[idx].src_char; const int src_len = s_keyboard_layout_mapping_buf[idx].src_len; if (src_len == search_len) { const u32 mask = 0xffffffff >> ((4 - search_len) * 8); if ((src_char & mask) == (search & mask)) return idx; } } return -1; } DECLSPEC int hc_execute_keyboard_layout_mapping (PRIVATE_AS u32 *w, const int pw_len, LOCAL_AS keyboard_layout_mapping_t *s_keyboard_layout_mapping_buf, const int keyboard_layout_mapping_cnt) { u32 out_buf[32] = { 0 }; PRIVATE_AS u8 *out_ptr = (PRIVATE_AS u8 *) out_buf; int out_len = 0; // TC/VC passwords are limited to 128 PRIVATE_AS u8 *w_ptr = (PRIVATE_AS u8 *) w; int pw_pos = 0; while (pw_pos < pw_len) { u32 src0 = 0; u32 src1 = 0; u32 src2 = 0; u32 src3 = 0; #define MIN(a,b) (((a) < (b)) ? (a) : (b)) const int rem = MIN (pw_len - pw_pos, 4); #undef MIN if (rem > 0) src0 = w_ptr[pw_pos + 0]; if (rem > 1) src1 = w_ptr[pw_pos + 1]; if (rem > 2) src2 = w_ptr[pw_pos + 2]; if (rem > 3) src3 = w_ptr[pw_pos + 3]; const u32 src = (src0 << 0) | (src1 << 8) | (src2 << 16) | (src3 << 24); int src_len; for (src_len = rem; src_len > 0; src_len--) { const int idx = hc_find_keyboard_layout_map (src, src_len, s_keyboard_layout_mapping_buf, keyboard_layout_mapping_cnt); if (idx == -1) continue; u32 dst_char = s_keyboard_layout_mapping_buf[idx].dst_char; int dst_len = s_keyboard_layout_mapping_buf[idx].dst_len; switch (dst_len) { case 1: out_ptr[out_len++] = (dst_char >> 0) & 0xff; break; case 2: out_ptr[out_len++] = (dst_char >> 0) & 0xff; out_ptr[out_len++] = (dst_char >> 8) & 0xff; break; case 3: out_ptr[out_len++] = (dst_char >> 0) & 0xff; out_ptr[out_len++] = (dst_char >> 8) & 0xff; out_ptr[out_len++] = (dst_char >> 16) & 0xff; break; case 4: out_ptr[out_len++] = (dst_char >> 0) & 0xff; out_ptr[out_len++] = (dst_char >> 8) & 0xff; out_ptr[out_len++] = (dst_char >> 16) & 0xff; out_ptr[out_len++] = (dst_char >> 24) & 0xff; break; } pw_pos += src_len; break; } // not matched, keep original if (src_len == 0) { out_ptr[out_len] = w_ptr[pw_pos]; out_len++; pw_pos++; } } w[ 0] = out_buf[ 0]; w[ 1] = out_buf[ 1]; w[ 2] = out_buf[ 2]; w[ 3] = out_buf[ 3]; w[ 4] = out_buf[ 4]; w[ 5] = out_buf[ 5]; w[ 6] = out_buf[ 6]; w[ 7] = out_buf[ 7]; w[ 8] = out_buf[ 8]; w[ 9] = out_buf[ 9]; w[10] = out_buf[10]; w[11] = out_buf[11]; w[12] = out_buf[12]; w[13] = out_buf[13]; w[14] = out_buf[14]; w[15] = out_buf[15]; w[16] = out_buf[16]; w[17] = out_buf[17]; w[18] = out_buf[18]; w[19] = out_buf[19]; w[20] = out_buf[20]; w[21] = out_buf[21]; w[22] = out_buf[22]; w[23] = out_buf[23]; w[24] = out_buf[24]; w[25] = out_buf[25]; w[26] = out_buf[26]; w[27] = out_buf[27]; w[28] = out_buf[28]; w[29] = out_buf[29]; w[30] = out_buf[30]; w[31] = out_buf[31]; return out_len; } DECLSPEC int count_bits_32 (const u32 v0, const u32 v1) { u32 r = v0 ^ v1; if (r == 0) return 0; // from https://stackoverflow.com/questions/109023/count-the-number-of-set-bits-in-a-32-bit-integer r = r - ((r >> 1) & 0x55555555); // add pairs of bits r = (r & 0x33333333) + ((r >> 2) & 0x33333333); // quads r = (r + (r >> 4)) & 0x0F0F0F0F; // groups of 8 r *= 0x01010101; // horizontal sum of bytes // return just that top byte (after truncating to 32-bit even when int is wider than uint32_t) return r >> 24; } /** * vector functions */ DECLSPEC void make_utf16be (PRIVATE_AS const u32x *in, PRIVATE_AS u32x *out1, PRIVATE_AS u32x *out2) { #if defined IS_NV out2[3] = hc_byte_perm (in[3], 0, 0x3727); out2[2] = hc_byte_perm (in[3], 0, 0x1707); out2[1] = hc_byte_perm (in[2], 0, 0x3727); out2[0] = hc_byte_perm (in[2], 0, 0x1707); out1[3] = hc_byte_perm (in[1], 0, 0x3727); out1[2] = hc_byte_perm (in[1], 0, 0x1707); out1[1] = hc_byte_perm (in[0], 0, 0x3727); out1[0] = hc_byte_perm (in[0], 0, 0x1707); #elif (defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1 out2[3] = hc_byte_perm (in[3], 0, 0x03070207); out2[2] = hc_byte_perm (in[3], 0, 0x01070007); out2[1] = hc_byte_perm (in[2], 0, 0x03070207); out2[0] = hc_byte_perm (in[2], 0, 0x01070007); out1[3] = hc_byte_perm (in[1], 0, 0x03070207); out1[2] = hc_byte_perm (in[1], 0, 0x01070007); out1[1] = hc_byte_perm (in[0], 0, 0x03070207); out1[0] = hc_byte_perm (in[0], 0, 0x01070007); #else out2[3] = ((in[3] >> 0) & 0xFF000000) | ((in[3] >> 8) & 0x0000FF00); out2[2] = ((in[3] << 16) & 0xFF000000) | ((in[3] << 8) & 0x0000FF00); out2[1] = ((in[2] >> 0) & 0xFF000000) | ((in[2] >> 8) & 0x0000FF00); out2[0] = ((in[2] << 16) & 0xFF000000) | ((in[2] << 8) & 0x0000FF00); out1[3] = ((in[1] >> 0) & 0xFF000000) | ((in[1] >> 8) & 0x0000FF00); out1[2] = ((in[1] << 16) & 0xFF000000) | ((in[1] << 8) & 0x0000FF00); out1[1] = ((in[0] >> 0) & 0xFF000000) | ((in[0] >> 8) & 0x0000FF00); out1[0] = ((in[0] << 16) & 0xFF000000) | ((in[0] << 8) & 0x0000FF00); #endif } DECLSPEC void make_utf16beN (PRIVATE_AS const u32x *in, PRIVATE_AS u32x *out1, PRIVATE_AS u32x *out2) { #if defined IS_NV out2[3] = hc_byte_perm (in[3], 0, 0x1707); out2[2] = hc_byte_perm (in[3], 0, 0x3727); out2[1] = hc_byte_perm (in[2], 0, 0x1707); out2[0] = hc_byte_perm (in[2], 0, 0x3727); out1[3] = hc_byte_perm (in[1], 0, 0x1707); out1[2] = hc_byte_perm (in[1], 0, 0x3727); out1[1] = hc_byte_perm (in[0], 0, 0x1707); out1[0] = hc_byte_perm (in[0], 0, 0x3727); #elif (defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1 out2[3] = hc_byte_perm (in[3], 0, 0x01070007); out2[2] = hc_byte_perm (in[3], 0, 0x03070207); out2[1] = hc_byte_perm (in[2], 0, 0x01070007); out2[0] = hc_byte_perm (in[2], 0, 0x03070207); out1[3] = hc_byte_perm (in[1], 0, 0x01070007); out1[2] = hc_byte_perm (in[1], 0, 0x03070207); out1[1] = hc_byte_perm (in[0], 0, 0x01070007); out1[0] = hc_byte_perm (in[0], 0, 0x03070207); #else out2[3] = ((in[3] << 16) & 0xFF000000) | ((in[3] << 8) & 0x0000FF00); out2[2] = ((in[3] >> 0) & 0xFF000000) | ((in[3] >> 8) & 0x0000FF00); out2[1] = ((in[2] << 16) & 0xFF000000) | ((in[2] << 8) & 0x0000FF00); out2[0] = ((in[2] >> 0) & 0xFF000000) | ((in[2] >> 8) & 0x0000FF00); out1[3] = ((in[1] << 16) & 0xFF000000) | ((in[1] << 8) & 0x0000FF00); out1[2] = ((in[1] >> 0) & 0xFF000000) | ((in[1] >> 8) & 0x0000FF00); out1[1] = ((in[0] << 16) & 0xFF000000) | ((in[0] << 8) & 0x0000FF00); out1[0] = ((in[0] >> 0) & 0xFF000000) | ((in[0] >> 8) & 0x0000FF00); #endif } DECLSPEC void make_utf16le (PRIVATE_AS const u32x *in, PRIVATE_AS u32x *out1, PRIVATE_AS u32x *out2) { #if defined IS_NV out2[3] = hc_byte_perm (in[3], 0, 0x7372); out2[2] = hc_byte_perm (in[3], 0, 0x7170); out2[1] = hc_byte_perm (in[2], 0, 0x7372); out2[0] = hc_byte_perm (in[2], 0, 0x7170); out1[3] = hc_byte_perm (in[1], 0, 0x7372); out1[2] = hc_byte_perm (in[1], 0, 0x7170); out1[1] = hc_byte_perm (in[0], 0, 0x7372); out1[0] = hc_byte_perm (in[0], 0, 0x7170); #elif (defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1 out2[3] = hc_byte_perm (in[3], 0, 0x07030702); out2[2] = hc_byte_perm (in[3], 0, 0x07010700); out2[1] = hc_byte_perm (in[2], 0, 0x07030702); out2[0] = hc_byte_perm (in[2], 0, 0x07010700); out1[3] = hc_byte_perm (in[1], 0, 0x07030702); out1[2] = hc_byte_perm (in[1], 0, 0x07010700); out1[1] = hc_byte_perm (in[0], 0, 0x07030702); out1[0] = hc_byte_perm (in[0], 0, 0x07010700); #else out2[3] = ((in[3] >> 8) & 0x00FF0000) | ((in[3] >> 16) & 0x000000FF); out2[2] = ((in[3] << 8) & 0x00FF0000) | ((in[3] >> 0) & 0x000000FF); out2[1] = ((in[2] >> 8) & 0x00FF0000) | ((in[2] >> 16) & 0x000000FF); out2[0] = ((in[2] << 8) & 0x00FF0000) | ((in[2] >> 0) & 0x000000FF); out1[3] = ((in[1] >> 8) & 0x00FF0000) | ((in[1] >> 16) & 0x000000FF); out1[2] = ((in[1] << 8) & 0x00FF0000) | ((in[1] >> 0) & 0x000000FF); out1[1] = ((in[0] >> 8) & 0x00FF0000) | ((in[0] >> 16) & 0x000000FF); out1[0] = ((in[0] << 8) & 0x00FF0000) | ((in[0] >> 0) & 0x000000FF); #endif } DECLSPEC void make_utf16leN (PRIVATE_AS const u32x *in, PRIVATE_AS u32x *out1, PRIVATE_AS u32x *out2) { #if defined IS_NV out2[3] = hc_byte_perm (in[3], 0, 0x7170); out2[2] = hc_byte_perm (in[3], 0, 0x7372); out2[1] = hc_byte_perm (in[2], 0, 0x7170); out2[0] = hc_byte_perm (in[2], 0, 0x7372); out1[3] = hc_byte_perm (in[1], 0, 0x7170); out1[2] = hc_byte_perm (in[1], 0, 0x7372); out1[1] = hc_byte_perm (in[0], 0, 0x7170); out1[0] = hc_byte_perm (in[0], 0, 0x7372); #elif (defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1 out2[3] = hc_byte_perm (in[3], 0, 0x07010700); out2[2] = hc_byte_perm (in[3], 0, 0x07030702); out2[1] = hc_byte_perm (in[2], 0, 0x07010700); out2[0] = hc_byte_perm (in[2], 0, 0x07030702); out1[3] = hc_byte_perm (in[1], 0, 0x07010700); out1[2] = hc_byte_perm (in[1], 0, 0x07030702); out1[1] = hc_byte_perm (in[0], 0, 0x07010700); out1[0] = hc_byte_perm (in[0], 0, 0x07030702); #else out2[3] = ((in[3] << 8) & 0x00FF0000) | ((in[3] >> 0) & 0x000000FF); out2[2] = ((in[3] >> 8) & 0x00FF0000) | ((in[3] >> 16) & 0x000000FF); out2[1] = ((in[2] << 8) & 0x00FF0000) | ((in[2] >> 0) & 0x000000FF); out2[0] = ((in[2] >> 8) & 0x00FF0000) | ((in[2] >> 16) & 0x000000FF); out1[3] = ((in[1] << 8) & 0x00FF0000) | ((in[1] >> 0) & 0x000000FF); out1[2] = ((in[1] >> 8) & 0x00FF0000) | ((in[1] >> 16) & 0x000000FF); out1[1] = ((in[0] << 8) & 0x00FF0000) | ((in[0] >> 0) & 0x000000FF); out1[0] = ((in[0] >> 8) & 0x00FF0000) | ((in[0] >> 16) & 0x000000FF); #endif } DECLSPEC void undo_utf16be (PRIVATE_AS const u32x *in1, PRIVATE_AS const u32x *in2, PRIVATE_AS u32x *out) { #if defined IS_NV out[0] = hc_byte_perm (in1[0], in1[1], 0x4602); out[1] = hc_byte_perm (in1[2], in1[3], 0x4602); out[2] = hc_byte_perm (in2[0], in2[1], 0x4602); out[3] = hc_byte_perm (in2[2], in2[3], 0x4602); #elif (defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1 out[0] = hc_byte_perm (in1[0], in1[1], 0x04060002); out[1] = hc_byte_perm (in1[2], in1[3], 0x04060002); out[2] = hc_byte_perm (in2[0], in2[1], 0x04060002); out[3] = hc_byte_perm (in2[2], in2[3], 0x04060002); #else out[0] = ((in1[0] & 0x0000ff00) >> 8) | ((in1[0] & 0xff000000) >> 16) | ((in1[1] & 0x0000ff00) << 8) | ((in1[1] & 0xff000000) << 0); out[1] = ((in1[2] & 0x0000ff00) >> 8) | ((in1[2] & 0xff000000) >> 16) | ((in1[3] & 0x0000ff00) << 8) | ((in1[3] & 0xff000000) << 0); out[2] = ((in2[0] & 0x0000ff00) >> 8) | ((in2[0] & 0xff000000) >> 16) | ((in2[1] & 0x0000ff00) << 8) | ((in2[1] & 0xff000000) << 0); out[3] = ((in2[2] & 0x0000ff00) >> 8) | ((in2[2] & 0xff000000) >> 16) | ((in2[3] & 0x0000ff00) << 8) | ((in2[3] & 0xff000000) << 0); #endif } DECLSPEC void undo_utf16le (PRIVATE_AS const u32x *in1, PRIVATE_AS const u32x *in2, PRIVATE_AS u32x *out) { #if defined IS_NV out[0] = hc_byte_perm (in1[0], in1[1], 0x6420); out[1] = hc_byte_perm (in1[2], in1[3], 0x6420); out[2] = hc_byte_perm (in2[0], in2[1], 0x6420); out[3] = hc_byte_perm (in2[2], in2[3], 0x6420); #elif (defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1 out[0] = hc_byte_perm (in1[0], in1[1], 0x06040200); out[1] = hc_byte_perm (in1[2], in1[3], 0x06040200); out[2] = hc_byte_perm (in2[0], in2[1], 0x06040200); out[3] = hc_byte_perm (in2[2], in2[3], 0x06040200); #else out[0] = ((in1[0] & 0x000000ff) >> 0) | ((in1[0] & 0x00ff0000) >> 8) | ((in1[1] & 0x000000ff) << 16) | ((in1[1] & 0x00ff0000) << 8); out[1] = ((in1[2] & 0x000000ff) >> 0) | ((in1[2] & 0x00ff0000) >> 8) | ((in1[3] & 0x000000ff) << 16) | ((in1[3] & 0x00ff0000) << 8); out[2] = ((in2[0] & 0x000000ff) >> 0) | ((in2[0] & 0x00ff0000) >> 8) | ((in2[1] & 0x000000ff) << 16) | ((in2[1] & 0x00ff0000) << 8); out[3] = ((in2[2] & 0x000000ff) >> 0) | ((in2[2] & 0x00ff0000) >> 8) | ((in2[3] & 0x000000ff) << 16) | ((in2[3] & 0x00ff0000) << 8); #endif } DECLSPEC void set_mark_1x4 (PRIVATE_AS u32 *v, const u32 offset) { const u32 c = (offset & 15) / 4; const u32 r = 0xff << ((offset & 3) * 8); v[0] = (c == 0) ? r : 0; v[1] = (c == 1) ? r : 0; v[2] = (c == 2) ? r : 0; v[3] = (c == 3) ? r : 0; } DECLSPEC void append_helper_1x4 (PRIVATE_AS u32x *r, const u32 v, PRIVATE_AS const u32 *m) { r[0] |= v & m[0]; r[1] |= v & m[1]; r[2] |= v & m[2]; r[3] |= v & m[3]; } DECLSPEC void append_0x80_1x4 (PRIVATE_AS u32x *w0, const u32 offset) { u32 v[4]; set_mark_1x4 (v, offset); append_helper_1x4 (w0, 0x80808080, v); } DECLSPEC void append_0x80_2x4 (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, const u32 offset) { u32 v[4]; set_mark_1x4 (v, offset); const u32 offset16 = offset / 16; append_helper_1x4 (w0, ((offset16 == 0) ? 0x80808080 : 0), v); append_helper_1x4 (w1, ((offset16 == 1) ? 0x80808080 : 0), v); } DECLSPEC void append_0x80_3x4 (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, const u32 offset) { u32 v[4]; set_mark_1x4 (v, offset); const u32 offset16 = offset / 16; append_helper_1x4 (w0, ((offset16 == 0) ? 0x80808080 : 0), v); append_helper_1x4 (w1, ((offset16 == 1) ? 0x80808080 : 0), v); append_helper_1x4 (w2, ((offset16 == 2) ? 0x80808080 : 0), v); } DECLSPEC void append_0x80_4x4 (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const u32 offset) { u32 v[4]; set_mark_1x4 (v, offset); const u32 offset16 = offset / 16; append_helper_1x4 (w0, ((offset16 == 0) ? 0x80808080 : 0), v); append_helper_1x4 (w1, ((offset16 == 1) ? 0x80808080 : 0), v); append_helper_1x4 (w2, ((offset16 == 2) ? 0x80808080 : 0), v); append_helper_1x4 (w3, ((offset16 == 3) ? 0x80808080 : 0), v); } DECLSPEC void append_0x80_8x4 (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *w4, PRIVATE_AS u32x *w5, PRIVATE_AS u32x *w6, PRIVATE_AS u32x *w7, const u32 offset) { u32 v[4]; set_mark_1x4 (v, offset); const u32 offset16 = offset / 16; append_helper_1x4 (w0, ((offset16 == 0) ? 0x80808080 : 0), v); append_helper_1x4 (w1, ((offset16 == 1) ? 0x80808080 : 0), v); append_helper_1x4 (w2, ((offset16 == 2) ? 0x80808080 : 0), v); append_helper_1x4 (w3, ((offset16 == 3) ? 0x80808080 : 0), v); append_helper_1x4 (w4, ((offset16 == 4) ? 0x80808080 : 0), v); append_helper_1x4 (w5, ((offset16 == 5) ? 0x80808080 : 0), v); append_helper_1x4 (w6, ((offset16 == 6) ? 0x80808080 : 0), v); append_helper_1x4 (w7, ((offset16 == 7) ? 0x80808080 : 0), v); } DECLSPEC void append_0x80_1x16 (PRIVATE_AS u32x *w, const u32 offset) { u32 v[4]; set_mark_1x4 (v, offset); const u32 offset16 = offset / 16; append_helper_1x4 (w + 0, ((offset16 == 0) ? 0x80808080 : 0), v); append_helper_1x4 (w + 4, ((offset16 == 1) ? 0x80808080 : 0), v); append_helper_1x4 (w + 8, ((offset16 == 2) ? 0x80808080 : 0), v); append_helper_1x4 (w + 12, ((offset16 == 3) ? 0x80808080 : 0), v); } DECLSPEC void switch_buffer_by_offset_le (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: w3[3] = hc_bytealign (w3[2], w3[3], offset); w3[2] = hc_bytealign (w3[1], w3[2], offset); w3[1] = hc_bytealign (w3[0], w3[1], offset); w3[0] = hc_bytealign (w2[3], w3[0], offset); w2[3] = hc_bytealign (w2[2], w2[3], offset); w2[2] = hc_bytealign (w2[1], w2[2], offset); w2[1] = hc_bytealign (w2[0], w2[1], offset); w2[0] = hc_bytealign (w1[3], w2[0], offset); w1[3] = hc_bytealign (w1[2], w1[3], offset); w1[2] = hc_bytealign (w1[1], w1[2], offset); w1[1] = hc_bytealign (w1[0], w1[1], offset); w1[0] = hc_bytealign (w0[3], w1[0], offset); w0[3] = hc_bytealign (w0[2], w0[3], offset); w0[2] = hc_bytealign (w0[1], w0[2], offset); w0[1] = hc_bytealign (w0[0], w0[1], offset); w0[0] = hc_bytealign ( 0, w0[0], offset); break; case 1: w3[3] = hc_bytealign (w3[1], w3[2], offset); w3[2] = hc_bytealign (w3[0], w3[1], offset); w3[1] = hc_bytealign (w2[3], w3[0], offset); w3[0] = hc_bytealign (w2[2], w2[3], offset); w2[3] = hc_bytealign (w2[1], w2[2], offset); w2[2] = hc_bytealign (w2[0], w2[1], offset); w2[1] = hc_bytealign (w1[3], w2[0], offset); w2[0] = hc_bytealign (w1[2], w1[3], offset); w1[3] = hc_bytealign (w1[1], w1[2], offset); w1[2] = hc_bytealign (w1[0], w1[1], offset); w1[1] = hc_bytealign (w0[3], w1[0], offset); w1[0] = hc_bytealign (w0[2], w0[3], offset); w0[3] = hc_bytealign (w0[1], w0[2], offset); w0[2] = hc_bytealign (w0[0], w0[1], offset); w0[1] = hc_bytealign ( 0, w0[0], offset); w0[0] = 0; break; case 2: w3[3] = hc_bytealign (w3[0], w3[1], offset); w3[2] = hc_bytealign (w2[3], w3[0], offset); w3[1] = hc_bytealign (w2[2], w2[3], offset); w3[0] = hc_bytealign (w2[1], w2[2], offset); w2[3] = hc_bytealign (w2[0], w2[1], offset); w2[2] = hc_bytealign (w1[3], w2[0], offset); w2[1] = hc_bytealign (w1[2], w1[3], offset); w2[0] = hc_bytealign (w1[1], w1[2], offset); w1[3] = hc_bytealign (w1[0], w1[1], offset); w1[2] = hc_bytealign (w0[3], w1[0], offset); w1[1] = hc_bytealign (w0[2], w0[3], offset); w1[0] = hc_bytealign (w0[1], w0[2], offset); w0[3] = hc_bytealign (w0[0], w0[1], offset); w0[2] = hc_bytealign ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: w3[3] = hc_bytealign (w2[3], w3[0], offset); w3[2] = hc_bytealign (w2[2], w2[3], offset); w3[1] = hc_bytealign (w2[1], w2[2], offset); w3[0] = hc_bytealign (w2[0], w2[1], offset); w2[3] = hc_bytealign (w1[3], w2[0], offset); w2[2] = hc_bytealign (w1[2], w1[3], offset); w2[1] = hc_bytealign (w1[1], w1[2], offset); w2[0] = hc_bytealign (w1[0], w1[1], offset); w1[3] = hc_bytealign (w0[3], w1[0], offset); w1[2] = hc_bytealign (w0[2], w0[3], offset); w1[1] = hc_bytealign (w0[1], w0[2], offset); w1[0] = hc_bytealign (w0[0], w0[1], offset); w0[3] = hc_bytealign ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: w3[3] = hc_bytealign (w2[2], w2[3], offset); w3[2] = hc_bytealign (w2[1], w2[2], offset); w3[1] = hc_bytealign (w2[0], w2[1], offset); w3[0] = hc_bytealign (w1[3], w2[0], offset); w2[3] = hc_bytealign (w1[2], w1[3], offset); w2[2] = hc_bytealign (w1[1], w1[2], offset); w2[1] = hc_bytealign (w1[0], w1[1], offset); w2[0] = hc_bytealign (w0[3], w1[0], offset); w1[3] = hc_bytealign (w0[2], w0[3], offset); w1[2] = hc_bytealign (w0[1], w0[2], offset); w1[1] = hc_bytealign (w0[0], w0[1], offset); w1[0] = hc_bytealign ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: w3[3] = hc_bytealign (w2[1], w2[2], offset); w3[2] = hc_bytealign (w2[0], w2[1], offset); w3[1] = hc_bytealign (w1[3], w2[0], offset); w3[0] = hc_bytealign (w1[2], w1[3], offset); w2[3] = hc_bytealign (w1[1], w1[2], offset); w2[2] = hc_bytealign (w1[0], w1[1], offset); w2[1] = hc_bytealign (w0[3], w1[0], offset); w2[0] = hc_bytealign (w0[2], w0[3], offset); w1[3] = hc_bytealign (w0[1], w0[2], offset); w1[2] = hc_bytealign (w0[0], w0[1], offset); w1[1] = hc_bytealign ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: w3[3] = hc_bytealign (w2[0], w2[1], offset); w3[2] = hc_bytealign (w1[3], w2[0], offset); w3[1] = hc_bytealign (w1[2], w1[3], offset); w3[0] = hc_bytealign (w1[1], w1[2], offset); w2[3] = hc_bytealign (w1[0], w1[1], offset); w2[2] = hc_bytealign (w0[3], w1[0], offset); w2[1] = hc_bytealign (w0[2], w0[3], offset); w2[0] = hc_bytealign (w0[1], w0[2], offset); w1[3] = hc_bytealign (w0[0], w0[1], offset); w1[2] = hc_bytealign ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: w3[3] = hc_bytealign (w1[3], w2[0], offset); w3[2] = hc_bytealign (w1[2], w1[3], offset); w3[1] = hc_bytealign (w1[1], w1[2], offset); w3[0] = hc_bytealign (w1[0], w1[1], offset); w2[3] = hc_bytealign (w0[3], w1[0], offset); w2[2] = hc_bytealign (w0[2], w0[3], offset); w2[1] = hc_bytealign (w0[1], w0[2], offset); w2[0] = hc_bytealign (w0[0], w0[1], offset); w1[3] = hc_bytealign ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: w3[3] = hc_bytealign (w1[2], w1[3], offset); w3[2] = hc_bytealign (w1[1], w1[2], offset); w3[1] = hc_bytealign (w1[0], w1[1], offset); w3[0] = hc_bytealign (w0[3], w1[0], offset); w2[3] = hc_bytealign (w0[2], w0[3], offset); w2[2] = hc_bytealign (w0[1], w0[2], offset); w2[1] = hc_bytealign (w0[0], w0[1], offset); w2[0] = hc_bytealign ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: w3[3] = hc_bytealign (w1[1], w1[2], offset); w3[2] = hc_bytealign (w1[0], w1[1], offset); w3[1] = hc_bytealign (w0[3], w1[0], offset); w3[0] = hc_bytealign (w0[2], w0[3], offset); w2[3] = hc_bytealign (w0[1], w0[2], offset); w2[2] = hc_bytealign (w0[0], w0[1], offset); w2[1] = hc_bytealign ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: w3[3] = hc_bytealign (w1[0], w1[1], offset); w3[2] = hc_bytealign (w0[3], w1[0], offset); w3[1] = hc_bytealign (w0[2], w0[3], offset); w3[0] = hc_bytealign (w0[1], w0[2], offset); w2[3] = hc_bytealign (w0[0], w0[1], offset); w2[2] = hc_bytealign ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: w3[3] = hc_bytealign (w0[3], w1[0], offset); w3[2] = hc_bytealign (w0[2], w0[3], offset); w3[1] = hc_bytealign (w0[1], w0[2], offset); w3[0] = hc_bytealign (w0[0], w0[1], offset); w2[3] = hc_bytealign ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: w3[3] = hc_bytealign (w0[2], w0[3], offset); w3[2] = hc_bytealign (w0[1], w0[2], offset); w3[1] = hc_bytealign (w0[0], w0[1], offset); w3[0] = hc_bytealign ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: w3[3] = hc_bytealign (w0[1], w0[2], offset); w3[2] = hc_bytealign (w0[0], w0[1], offset); w3[1] = hc_bytealign ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: w3[3] = hc_bytealign (w0[0], w0[1], offset); w3[2] = hc_bytealign ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: w3[3] = hc_bytealign ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV const int offset_mod_4 = offset & 3; const int offset_minus_4 = 4 - offset_mod_4; #if defined IS_NV const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> (offset_minus_4 * 8)); #endif switch (offset_switch) { case 0: w3[3] = hc_byte_perm (w3[2], w3[3], selector); w3[2] = hc_byte_perm (w3[1], w3[2], selector); w3[1] = hc_byte_perm (w3[0], w3[1], selector); w3[0] = hc_byte_perm (w2[3], w3[0], selector); w2[3] = hc_byte_perm (w2[2], w2[3], selector); w2[2] = hc_byte_perm (w2[1], w2[2], selector); w2[1] = hc_byte_perm (w2[0], w2[1], selector); w2[0] = hc_byte_perm (w1[3], w2[0], selector); w1[3] = hc_byte_perm (w1[2], w1[3], selector); w1[2] = hc_byte_perm (w1[1], w1[2], selector); w1[1] = hc_byte_perm (w1[0], w1[1], selector); w1[0] = hc_byte_perm (w0[3], w1[0], selector); w0[3] = hc_byte_perm (w0[2], w0[3], selector); w0[2] = hc_byte_perm (w0[1], w0[2], selector); w0[1] = hc_byte_perm (w0[0], w0[1], selector); w0[0] = hc_byte_perm ( 0, w0[0], selector); break; case 1: w3[3] = hc_byte_perm (w3[1], w3[2], selector); w3[2] = hc_byte_perm (w3[0], w3[1], selector); w3[1] = hc_byte_perm (w2[3], w3[0], selector); w3[0] = hc_byte_perm (w2[2], w2[3], selector); w2[3] = hc_byte_perm (w2[1], w2[2], selector); w2[2] = hc_byte_perm (w2[0], w2[1], selector); w2[1] = hc_byte_perm (w1[3], w2[0], selector); w2[0] = hc_byte_perm (w1[2], w1[3], selector); w1[3] = hc_byte_perm (w1[1], w1[2], selector); w1[2] = hc_byte_perm (w1[0], w1[1], selector); w1[1] = hc_byte_perm (w0[3], w1[0], selector); w1[0] = hc_byte_perm (w0[2], w0[3], selector); w0[3] = hc_byte_perm (w0[1], w0[2], selector); w0[2] = hc_byte_perm (w0[0], w0[1], selector); w0[1] = hc_byte_perm ( 0, w0[0], selector); w0[0] = 0; break; case 2: w3[3] = hc_byte_perm (w3[0], w3[1], selector); w3[2] = hc_byte_perm (w2[3], w3[0], selector); w3[1] = hc_byte_perm (w2[2], w2[3], selector); w3[0] = hc_byte_perm (w2[1], w2[2], selector); w2[3] = hc_byte_perm (w2[0], w2[1], selector); w2[2] = hc_byte_perm (w1[3], w2[0], selector); w2[1] = hc_byte_perm (w1[2], w1[3], selector); w2[0] = hc_byte_perm (w1[1], w1[2], selector); w1[3] = hc_byte_perm (w1[0], w1[1], selector); w1[2] = hc_byte_perm (w0[3], w1[0], selector); w1[1] = hc_byte_perm (w0[2], w0[3], selector); w1[0] = hc_byte_perm (w0[1], w0[2], selector); w0[3] = hc_byte_perm (w0[0], w0[1], selector); w0[2] = hc_byte_perm ( 0, w0[0], selector); w0[1] = 0; w0[0] = 0; break; case 3: w3[3] = hc_byte_perm (w2[3], w3[0], selector); w3[2] = hc_byte_perm (w2[2], w2[3], selector); w3[1] = hc_byte_perm (w2[1], w2[2], selector); w3[0] = hc_byte_perm (w2[0], w2[1], selector); w2[3] = hc_byte_perm (w1[3], w2[0], selector); w2[2] = hc_byte_perm (w1[2], w1[3], selector); w2[1] = hc_byte_perm (w1[1], w1[2], selector); w2[0] = hc_byte_perm (w1[0], w1[1], selector); w1[3] = hc_byte_perm (w0[3], w1[0], selector); w1[2] = hc_byte_perm (w0[2], w0[3], selector); w1[1] = hc_byte_perm (w0[1], w0[2], selector); w1[0] = hc_byte_perm (w0[0], w0[1], selector); w0[3] = hc_byte_perm ( 0, w0[0], selector); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: w3[3] = hc_byte_perm (w2[2], w2[3], selector); w3[2] = hc_byte_perm (w2[1], w2[2], selector); w3[1] = hc_byte_perm (w2[0], w2[1], selector); w3[0] = hc_byte_perm (w1[3], w2[0], selector); w2[3] = hc_byte_perm (w1[2], w1[3], selector); w2[2] = hc_byte_perm (w1[1], w1[2], selector); w2[1] = hc_byte_perm (w1[0], w1[1], selector); w2[0] = hc_byte_perm (w0[3], w1[0], selector); w1[3] = hc_byte_perm (w0[2], w0[3], selector); w1[2] = hc_byte_perm (w0[1], w0[2], selector); w1[1] = hc_byte_perm (w0[0], w0[1], selector); w1[0] = hc_byte_perm ( 0, w0[0], selector); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: w3[3] = hc_byte_perm (w2[1], w2[2], selector); w3[2] = hc_byte_perm (w2[0], w2[1], selector); w3[1] = hc_byte_perm (w1[3], w2[0], selector); w3[0] = hc_byte_perm (w1[2], w1[3], selector); w2[3] = hc_byte_perm (w1[1], w1[2], selector); w2[2] = hc_byte_perm (w1[0], w1[1], selector); w2[1] = hc_byte_perm (w0[3], w1[0], selector); w2[0] = hc_byte_perm (w0[2], w0[3], selector); w1[3] = hc_byte_perm (w0[1], w0[2], selector); w1[2] = hc_byte_perm (w0[0], w0[1], selector); w1[1] = hc_byte_perm ( 0, w0[0], selector); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: w3[3] = hc_byte_perm (w2[0], w2[1], selector); w3[2] = hc_byte_perm (w1[3], w2[0], selector); w3[1] = hc_byte_perm (w1[2], w1[3], selector); w3[0] = hc_byte_perm (w1[1], w1[2], selector); w2[3] = hc_byte_perm (w1[0], w1[1], selector); w2[2] = hc_byte_perm (w0[3], w1[0], selector); w2[1] = hc_byte_perm (w0[2], w0[3], selector); w2[0] = hc_byte_perm (w0[1], w0[2], selector); w1[3] = hc_byte_perm (w0[0], w0[1], selector); w1[2] = hc_byte_perm ( 0, w0[0], selector); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: w3[3] = hc_byte_perm (w1[3], w2[0], selector); w3[2] = hc_byte_perm (w1[2], w1[3], selector); w3[1] = hc_byte_perm (w1[1], w1[2], selector); w3[0] = hc_byte_perm (w1[0], w1[1], selector); w2[3] = hc_byte_perm (w0[3], w1[0], selector); w2[2] = hc_byte_perm (w0[2], w0[3], selector); w2[1] = hc_byte_perm (w0[1], w0[2], selector); w2[0] = hc_byte_perm (w0[0], w0[1], selector); w1[3] = hc_byte_perm ( 0, w0[0], selector); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: w3[3] = hc_byte_perm (w1[2], w1[3], selector); w3[2] = hc_byte_perm (w1[1], w1[2], selector); w3[1] = hc_byte_perm (w1[0], w1[1], selector); w3[0] = hc_byte_perm (w0[3], w1[0], selector); w2[3] = hc_byte_perm (w0[2], w0[3], selector); w2[2] = hc_byte_perm (w0[1], w0[2], selector); w2[1] = hc_byte_perm (w0[0], w0[1], selector); w2[0] = hc_byte_perm ( 0, w0[0], selector); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: w3[3] = hc_byte_perm (w1[1], w1[2], selector); w3[2] = hc_byte_perm (w1[0], w1[1], selector); w3[1] = hc_byte_perm (w0[3], w1[0], selector); w3[0] = hc_byte_perm (w0[2], w0[3], selector); w2[3] = hc_byte_perm (w0[1], w0[2], selector); w2[2] = hc_byte_perm (w0[0], w0[1], selector); w2[1] = hc_byte_perm ( 0, w0[0], selector); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: w3[3] = hc_byte_perm (w1[0], w1[1], selector); w3[2] = hc_byte_perm (w0[3], w1[0], selector); w3[1] = hc_byte_perm (w0[2], w0[3], selector); w3[0] = hc_byte_perm (w0[1], w0[2], selector); w2[3] = hc_byte_perm (w0[0], w0[1], selector); w2[2] = hc_byte_perm ( 0, w0[0], selector); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: w3[3] = hc_byte_perm (w0[3], w1[0], selector); w3[2] = hc_byte_perm (w0[2], w0[3], selector); w3[1] = hc_byte_perm (w0[1], w0[2], selector); w3[0] = hc_byte_perm (w0[0], w0[1], selector); w2[3] = hc_byte_perm ( 0, w0[0], selector); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: w3[3] = hc_byte_perm (w0[2], w0[3], selector); w3[2] = hc_byte_perm (w0[1], w0[2], selector); w3[1] = hc_byte_perm (w0[0], w0[1], selector); w3[0] = hc_byte_perm ( 0, w0[0], selector); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: w3[3] = hc_byte_perm (w0[1], w0[2], selector); w3[2] = hc_byte_perm (w0[0], w0[1], selector); w3[1] = hc_byte_perm ( 0, w0[0], selector); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: w3[3] = hc_byte_perm (w0[0], w0[1], selector); w3[2] = hc_byte_perm ( 0, w0[0], selector); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: w3[3] = hc_byte_perm ( 0, w0[0], selector); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_carry_le (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *c0, PRIVATE_AS u32x *c1, PRIVATE_AS u32x *c2, PRIVATE_AS u32x *c3, const u32 offset) { const int offset_switch = offset / 4; #if (defined IS_AMD || defined IS_HIP) || defined IS_GENERIC switch (offset_switch) { case 0: c0[0] = hc_bytealign (w3[3], 0, offset); w3[3] = hc_bytealign (w3[2], w3[3], offset); w3[2] = hc_bytealign (w3[1], w3[2], offset); w3[1] = hc_bytealign (w3[0], w3[1], offset); w3[0] = hc_bytealign (w2[3], w3[0], offset); w2[3] = hc_bytealign (w2[2], w2[3], offset); w2[2] = hc_bytealign (w2[1], w2[2], offset); w2[1] = hc_bytealign (w2[0], w2[1], offset); w2[0] = hc_bytealign (w1[3], w2[0], offset); w1[3] = hc_bytealign (w1[2], w1[3], offset); w1[2] = hc_bytealign (w1[1], w1[2], offset); w1[1] = hc_bytealign (w1[0], w1[1], offset); w1[0] = hc_bytealign (w0[3], w1[0], offset); w0[3] = hc_bytealign (w0[2], w0[3], offset); w0[2] = hc_bytealign (w0[1], w0[2], offset); w0[1] = hc_bytealign (w0[0], w0[1], offset); w0[0] = hc_bytealign ( 0, w0[0], offset); break; case 1: c0[1] = hc_bytealign (w3[3], 0, offset); c0[0] = hc_bytealign (w3[2], w3[3], offset); w3[3] = hc_bytealign (w3[1], w3[2], offset); w3[2] = hc_bytealign (w3[0], w3[1], offset); w3[1] = hc_bytealign (w2[3], w3[0], offset); w3[0] = hc_bytealign (w2[2], w2[3], offset); w2[3] = hc_bytealign (w2[1], w2[2], offset); w2[2] = hc_bytealign (w2[0], w2[1], offset); w2[1] = hc_bytealign (w1[3], w2[0], offset); w2[0] = hc_bytealign (w1[2], w1[3], offset); w1[3] = hc_bytealign (w1[1], w1[2], offset); w1[2] = hc_bytealign (w1[0], w1[1], offset); w1[1] = hc_bytealign (w0[3], w1[0], offset); w1[0] = hc_bytealign (w0[2], w0[3], offset); w0[3] = hc_bytealign (w0[1], w0[2], offset); w0[2] = hc_bytealign (w0[0], w0[1], offset); w0[1] = hc_bytealign ( 0, w0[0], offset); w0[0] = 0; break; case 2: c0[2] = hc_bytealign (w3[3], 0, offset); c0[1] = hc_bytealign (w3[2], w3[3], offset); c0[0] = hc_bytealign (w3[1], w3[2], offset); w3[3] = hc_bytealign (w3[0], w3[1], offset); w3[2] = hc_bytealign (w2[3], w3[0], offset); w3[1] = hc_bytealign (w2[2], w2[3], offset); w3[0] = hc_bytealign (w2[1], w2[2], offset); w2[3] = hc_bytealign (w2[0], w2[1], offset); w2[2] = hc_bytealign (w1[3], w2[0], offset); w2[1] = hc_bytealign (w1[2], w1[3], offset); w2[0] = hc_bytealign (w1[1], w1[2], offset); w1[3] = hc_bytealign (w1[0], w1[1], offset); w1[2] = hc_bytealign (w0[3], w1[0], offset); w1[1] = hc_bytealign (w0[2], w0[3], offset); w1[0] = hc_bytealign (w0[1], w0[2], offset); w0[3] = hc_bytealign (w0[0], w0[1], offset); w0[2] = hc_bytealign ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: c0[3] = hc_bytealign (w3[3], 0, offset); c0[2] = hc_bytealign (w3[2], w3[3], offset); c0[1] = hc_bytealign (w3[1], w3[2], offset); c0[0] = hc_bytealign (w3[0], w3[1], offset); w3[3] = hc_bytealign (w2[3], w3[0], offset); w3[2] = hc_bytealign (w2[2], w2[3], offset); w3[1] = hc_bytealign (w2[1], w2[2], offset); w3[0] = hc_bytealign (w2[0], w2[1], offset); w2[3] = hc_bytealign (w1[3], w2[0], offset); w2[2] = hc_bytealign (w1[2], w1[3], offset); w2[1] = hc_bytealign (w1[1], w1[2], offset); w2[0] = hc_bytealign (w1[0], w1[1], offset); w1[3] = hc_bytealign (w0[3], w1[0], offset); w1[2] = hc_bytealign (w0[2], w0[3], offset); w1[1] = hc_bytealign (w0[1], w0[2], offset); w1[0] = hc_bytealign (w0[0], w0[1], offset); w0[3] = hc_bytealign ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: c1[0] = hc_bytealign (w3[3], 0, offset); c0[3] = hc_bytealign (w3[2], w3[3], offset); c0[2] = hc_bytealign (w3[1], w3[2], offset); c0[1] = hc_bytealign (w3[0], w3[1], offset); c0[0] = hc_bytealign (w2[3], w3[0], offset); w3[3] = hc_bytealign (w2[2], w2[3], offset); w3[2] = hc_bytealign (w2[1], w2[2], offset); w3[1] = hc_bytealign (w2[0], w2[1], offset); w3[0] = hc_bytealign (w1[3], w2[0], offset); w2[3] = hc_bytealign (w1[2], w1[3], offset); w2[2] = hc_bytealign (w1[1], w1[2], offset); w2[1] = hc_bytealign (w1[0], w1[1], offset); w2[0] = hc_bytealign (w0[3], w1[0], offset); w1[3] = hc_bytealign (w0[2], w0[3], offset); w1[2] = hc_bytealign (w0[1], w0[2], offset); w1[1] = hc_bytealign (w0[0], w0[1], offset); w1[0] = hc_bytealign ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: c1[1] = hc_bytealign (w3[3], 0, offset); c1[0] = hc_bytealign (w3[2], w3[3], offset); c0[3] = hc_bytealign (w3[1], w3[2], offset); c0[2] = hc_bytealign (w3[0], w3[1], offset); c0[1] = hc_bytealign (w2[3], w3[0], offset); c0[0] = hc_bytealign (w2[2], w2[3], offset); w3[3] = hc_bytealign (w2[1], w2[2], offset); w3[2] = hc_bytealign (w2[0], w2[1], offset); w3[1] = hc_bytealign (w1[3], w2[0], offset); w3[0] = hc_bytealign (w1[2], w1[3], offset); w2[3] = hc_bytealign (w1[1], w1[2], offset); w2[2] = hc_bytealign (w1[0], w1[1], offset); w2[1] = hc_bytealign (w0[3], w1[0], offset); w2[0] = hc_bytealign (w0[2], w0[3], offset); w1[3] = hc_bytealign (w0[1], w0[2], offset); w1[2] = hc_bytealign (w0[0], w0[1], offset); w1[1] = hc_bytealign ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: c1[2] = hc_bytealign (w3[3], 0, offset); c1[1] = hc_bytealign (w3[2], w3[3], offset); c1[0] = hc_bytealign (w3[1], w3[2], offset); c0[3] = hc_bytealign (w3[0], w3[1], offset); c0[2] = hc_bytealign (w2[3], w3[0], offset); c0[1] = hc_bytealign (w2[2], w2[3], offset); c0[0] = hc_bytealign (w2[1], w2[2], offset); w3[3] = hc_bytealign (w2[0], w2[1], offset); w3[2] = hc_bytealign (w1[3], w2[0], offset); w3[1] = hc_bytealign (w1[2], w1[3], offset); w3[0] = hc_bytealign (w1[1], w1[2], offset); w2[3] = hc_bytealign (w1[0], w1[1], offset); w2[2] = hc_bytealign (w0[3], w1[0], offset); w2[1] = hc_bytealign (w0[2], w0[3], offset); w2[0] = hc_bytealign (w0[1], w0[2], offset); w1[3] = hc_bytealign (w0[0], w0[1], offset); w1[2] = hc_bytealign ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: c1[3] = hc_bytealign (w3[3], 0, offset); c1[2] = hc_bytealign (w3[2], w3[3], offset); c1[1] = hc_bytealign (w3[1], w3[2], offset); c1[0] = hc_bytealign (w3[0], w3[1], offset); c0[3] = hc_bytealign (w2[3], w3[0], offset); c0[2] = hc_bytealign (w2[2], w2[3], offset); c0[1] = hc_bytealign (w2[1], w2[2], offset); c0[0] = hc_bytealign (w2[0], w2[1], offset); w3[3] = hc_bytealign (w1[3], w2[0], offset); w3[2] = hc_bytealign (w1[2], w1[3], offset); w3[1] = hc_bytealign (w1[1], w1[2], offset); w3[0] = hc_bytealign (w1[0], w1[1], offset); w2[3] = hc_bytealign (w0[3], w1[0], offset); w2[2] = hc_bytealign (w0[2], w0[3], offset); w2[1] = hc_bytealign (w0[1], w0[2], offset); w2[0] = hc_bytealign (w0[0], w0[1], offset); w1[3] = hc_bytealign ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: c2[0] = hc_bytealign (w3[3], 0, offset); c1[3] = hc_bytealign (w3[2], w3[3], offset); c1[2] = hc_bytealign (w3[1], w3[2], offset); c1[1] = hc_bytealign (w3[0], w3[1], offset); c1[0] = hc_bytealign (w2[3], w3[0], offset); c0[3] = hc_bytealign (w2[2], w2[3], offset); c0[2] = hc_bytealign (w2[1], w2[2], offset); c0[1] = hc_bytealign (w2[0], w2[1], offset); c0[0] = hc_bytealign (w1[3], w2[0], offset); w3[3] = hc_bytealign (w1[2], w1[3], offset); w3[2] = hc_bytealign (w1[1], w1[2], offset); w3[1] = hc_bytealign (w1[0], w1[1], offset); w3[0] = hc_bytealign (w0[3], w1[0], offset); w2[3] = hc_bytealign (w0[2], w0[3], offset); w2[2] = hc_bytealign (w0[1], w0[2], offset); w2[1] = hc_bytealign (w0[0], w0[1], offset); w2[0] = hc_bytealign ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: c2[1] = hc_bytealign (w3[3], 0, offset); c2[0] = hc_bytealign (w3[2], w3[3], offset); c1[3] = hc_bytealign (w3[1], w3[2], offset); c1[2] = hc_bytealign (w3[0], w3[1], offset); c1[1] = hc_bytealign (w2[3], w3[0], offset); c1[0] = hc_bytealign (w2[2], w2[3], offset); c0[3] = hc_bytealign (w2[1], w2[2], offset); c0[2] = hc_bytealign (w2[0], w2[1], offset); c0[1] = hc_bytealign (w1[3], w2[0], offset); c0[0] = hc_bytealign (w1[2], w1[3], offset); w3[3] = hc_bytealign (w1[1], w1[2], offset); w3[2] = hc_bytealign (w1[0], w1[1], offset); w3[1] = hc_bytealign (w0[3], w1[0], offset); w3[0] = hc_bytealign (w0[2], w0[3], offset); w2[3] = hc_bytealign (w0[1], w0[2], offset); w2[2] = hc_bytealign (w0[0], w0[1], offset); w2[1] = hc_bytealign ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: c2[2] = hc_bytealign (w3[3], 0, offset); c2[1] = hc_bytealign (w3[2], w3[3], offset); c2[0] = hc_bytealign (w3[1], w3[2], offset); c1[3] = hc_bytealign (w3[0], w3[1], offset); c1[2] = hc_bytealign (w2[3], w3[0], offset); c1[1] = hc_bytealign (w2[2], w2[3], offset); c1[0] = hc_bytealign (w2[1], w2[2], offset); c0[3] = hc_bytealign (w2[0], w2[1], offset); c0[2] = hc_bytealign (w1[3], w2[0], offset); c0[1] = hc_bytealign (w1[2], w1[3], offset); c0[0] = hc_bytealign (w1[1], w1[2], offset); w3[3] = hc_bytealign (w1[0], w1[1], offset); w3[2] = hc_bytealign (w0[3], w1[0], offset); w3[1] = hc_bytealign (w0[2], w0[3], offset); w3[0] = hc_bytealign (w0[1], w0[2], offset); w2[3] = hc_bytealign (w0[0], w0[1], offset); w2[2] = hc_bytealign ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: c2[3] = hc_bytealign (w3[3], 0, offset); c2[2] = hc_bytealign (w3[2], w3[3], offset); c2[1] = hc_bytealign (w3[1], w3[2], offset); c2[0] = hc_bytealign (w3[0], w3[1], offset); c1[3] = hc_bytealign (w2[3], w3[0], offset); c1[2] = hc_bytealign (w2[2], w2[3], offset); c1[1] = hc_bytealign (w2[1], w2[2], offset); c1[0] = hc_bytealign (w2[0], w2[1], offset); c0[3] = hc_bytealign (w1[3], w2[0], offset); c0[2] = hc_bytealign (w1[2], w1[3], offset); c0[1] = hc_bytealign (w1[1], w1[2], offset); c0[0] = hc_bytealign (w1[0], w1[1], offset); w3[3] = hc_bytealign (w0[3], w1[0], offset); w3[2] = hc_bytealign (w0[2], w0[3], offset); w3[1] = hc_bytealign (w0[1], w0[2], offset); w3[0] = hc_bytealign (w0[0], w0[1], offset); w2[3] = hc_bytealign ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: c3[0] = hc_bytealign (w3[3], 0, offset); c2[3] = hc_bytealign (w3[2], w3[3], offset); c2[2] = hc_bytealign (w3[1], w3[2], offset); c2[1] = hc_bytealign (w3[0], w3[1], offset); c2[0] = hc_bytealign (w2[3], w3[0], offset); c1[3] = hc_bytealign (w2[2], w2[3], offset); c1[2] = hc_bytealign (w2[1], w2[2], offset); c1[1] = hc_bytealign (w2[0], w2[1], offset); c1[0] = hc_bytealign (w1[3], w2[0], offset); c0[3] = hc_bytealign (w1[2], w1[3], offset); c0[2] = hc_bytealign (w1[1], w1[2], offset); c0[1] = hc_bytealign (w1[0], w1[1], offset); c0[0] = hc_bytealign (w0[3], w1[0], offset); w3[3] = hc_bytealign (w0[2], w0[3], offset); w3[2] = hc_bytealign (w0[1], w0[2], offset); w3[1] = hc_bytealign (w0[0], w0[1], offset); w3[0] = hc_bytealign ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: c3[1] = hc_bytealign (w3[3], 0, offset); c3[0] = hc_bytealign (w3[2], w3[3], offset); c2[3] = hc_bytealign (w3[1], w3[2], offset); c2[2] = hc_bytealign (w3[0], w3[1], offset); c2[1] = hc_bytealign (w2[3], w3[0], offset); c2[0] = hc_bytealign (w2[2], w2[3], offset); c1[3] = hc_bytealign (w2[1], w2[2], offset); c1[2] = hc_bytealign (w2[0], w2[1], offset); c1[1] = hc_bytealign (w1[3], w2[0], offset); c1[0] = hc_bytealign (w1[2], w1[3], offset); c0[3] = hc_bytealign (w1[1], w1[2], offset); c0[2] = hc_bytealign (w1[0], w1[1], offset); c0[1] = hc_bytealign (w0[3], w1[0], offset); c0[0] = hc_bytealign (w0[2], w0[3], offset); w3[3] = hc_bytealign (w0[1], w0[2], offset); w3[2] = hc_bytealign (w0[0], w0[1], offset); w3[1] = hc_bytealign ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: c3[2] = hc_bytealign (w3[3], 0, offset); c3[1] = hc_bytealign (w3[2], w3[3], offset); c3[0] = hc_bytealign (w3[1], w3[2], offset); c2[3] = hc_bytealign (w3[0], w3[1], offset); c2[2] = hc_bytealign (w2[3], w3[0], offset); c2[1] = hc_bytealign (w2[2], w2[3], offset); c2[0] = hc_bytealign (w2[1], w2[2], offset); c1[3] = hc_bytealign (w2[0], w2[1], offset); c1[2] = hc_bytealign (w1[3], w2[0], offset); c1[1] = hc_bytealign (w1[2], w1[3], offset); c1[0] = hc_bytealign (w1[1], w1[2], offset); c0[3] = hc_bytealign (w1[0], w1[1], offset); c0[2] = hc_bytealign (w0[3], w1[0], offset); c0[1] = hc_bytealign (w0[2], w0[3], offset); c0[0] = hc_bytealign (w0[1], w0[2], offset); w3[3] = hc_bytealign (w0[0], w0[1], offset); w3[2] = hc_bytealign ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: c3[3] = hc_bytealign (w3[3], 0, offset); c3[2] = hc_bytealign (w3[2], w3[3], offset); c3[1] = hc_bytealign (w3[1], w3[2], offset); c3[0] = hc_bytealign (w3[0], w3[1], offset); c2[3] = hc_bytealign (w2[3], w3[0], offset); c2[2] = hc_bytealign (w2[2], w2[3], offset); c2[1] = hc_bytealign (w2[1], w2[2], offset); c2[0] = hc_bytealign (w2[0], w2[1], offset); c1[3] = hc_bytealign (w1[3], w2[0], offset); c1[2] = hc_bytealign (w1[2], w1[3], offset); c1[1] = hc_bytealign (w1[1], w1[2], offset); c1[0] = hc_bytealign (w1[0], w1[1], offset); c0[3] = hc_bytealign (w0[3], w1[0], offset); c0[2] = hc_bytealign (w0[2], w0[3], offset); c0[1] = hc_bytealign (w0[1], w0[2], offset); c0[0] = hc_bytealign (w0[0], w0[1], offset); w3[3] = hc_bytealign ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif #ifdef IS_NV // atm only same code as for AMD, but could be improved switch (offset_switch) { case 0: c0[0] = hc_bytealign (w3[3], 0, offset); w3[3] = hc_bytealign (w3[2], w3[3], offset); w3[2] = hc_bytealign (w3[1], w3[2], offset); w3[1] = hc_bytealign (w3[0], w3[1], offset); w3[0] = hc_bytealign (w2[3], w3[0], offset); w2[3] = hc_bytealign (w2[2], w2[3], offset); w2[2] = hc_bytealign (w2[1], w2[2], offset); w2[1] = hc_bytealign (w2[0], w2[1], offset); w2[0] = hc_bytealign (w1[3], w2[0], offset); w1[3] = hc_bytealign (w1[2], w1[3], offset); w1[2] = hc_bytealign (w1[1], w1[2], offset); w1[1] = hc_bytealign (w1[0], w1[1], offset); w1[0] = hc_bytealign (w0[3], w1[0], offset); w0[3] = hc_bytealign (w0[2], w0[3], offset); w0[2] = hc_bytealign (w0[1], w0[2], offset); w0[1] = hc_bytealign (w0[0], w0[1], offset); w0[0] = hc_bytealign ( 0, w0[0], offset); break; case 1: c0[1] = hc_bytealign (w3[3], 0, offset); c0[0] = hc_bytealign (w3[2], w3[3], offset); w3[3] = hc_bytealign (w3[1], w3[2], offset); w3[2] = hc_bytealign (w3[0], w3[1], offset); w3[1] = hc_bytealign (w2[3], w3[0], offset); w3[0] = hc_bytealign (w2[2], w2[3], offset); w2[3] = hc_bytealign (w2[1], w2[2], offset); w2[2] = hc_bytealign (w2[0], w2[1], offset); w2[1] = hc_bytealign (w1[3], w2[0], offset); w2[0] = hc_bytealign (w1[2], w1[3], offset); w1[3] = hc_bytealign (w1[1], w1[2], offset); w1[2] = hc_bytealign (w1[0], w1[1], offset); w1[1] = hc_bytealign (w0[3], w1[0], offset); w1[0] = hc_bytealign (w0[2], w0[3], offset); w0[3] = hc_bytealign (w0[1], w0[2], offset); w0[2] = hc_bytealign (w0[0], w0[1], offset); w0[1] = hc_bytealign ( 0, w0[0], offset); w0[0] = 0; break; case 2: c0[2] = hc_bytealign (w3[3], 0, offset); c0[1] = hc_bytealign (w3[2], w3[3], offset); c0[0] = hc_bytealign (w3[1], w3[2], offset); w3[3] = hc_bytealign (w3[0], w3[1], offset); w3[2] = hc_bytealign (w2[3], w3[0], offset); w3[1] = hc_bytealign (w2[2], w2[3], offset); w3[0] = hc_bytealign (w2[1], w2[2], offset); w2[3] = hc_bytealign (w2[0], w2[1], offset); w2[2] = hc_bytealign (w1[3], w2[0], offset); w2[1] = hc_bytealign (w1[2], w1[3], offset); w2[0] = hc_bytealign (w1[1], w1[2], offset); w1[3] = hc_bytealign (w1[0], w1[1], offset); w1[2] = hc_bytealign (w0[3], w1[0], offset); w1[1] = hc_bytealign (w0[2], w0[3], offset); w1[0] = hc_bytealign (w0[1], w0[2], offset); w0[3] = hc_bytealign (w0[0], w0[1], offset); w0[2] = hc_bytealign ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: c0[3] = hc_bytealign (w3[3], 0, offset); c0[2] = hc_bytealign (w3[2], w3[3], offset); c0[1] = hc_bytealign (w3[1], w3[2], offset); c0[0] = hc_bytealign (w3[0], w3[1], offset); w3[3] = hc_bytealign (w2[3], w3[0], offset); w3[2] = hc_bytealign (w2[2], w2[3], offset); w3[1] = hc_bytealign (w2[1], w2[2], offset); w3[0] = hc_bytealign (w2[0], w2[1], offset); w2[3] = hc_bytealign (w1[3], w2[0], offset); w2[2] = hc_bytealign (w1[2], w1[3], offset); w2[1] = hc_bytealign (w1[1], w1[2], offset); w2[0] = hc_bytealign (w1[0], w1[1], offset); w1[3] = hc_bytealign (w0[3], w1[0], offset); w1[2] = hc_bytealign (w0[2], w0[3], offset); w1[1] = hc_bytealign (w0[1], w0[2], offset); w1[0] = hc_bytealign (w0[0], w0[1], offset); w0[3] = hc_bytealign ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: c1[0] = hc_bytealign (w3[3], 0, offset); c0[3] = hc_bytealign (w3[2], w3[3], offset); c0[2] = hc_bytealign (w3[1], w3[2], offset); c0[1] = hc_bytealign (w3[0], w3[1], offset); c0[0] = hc_bytealign (w2[3], w3[0], offset); w3[3] = hc_bytealign (w2[2], w2[3], offset); w3[2] = hc_bytealign (w2[1], w2[2], offset); w3[1] = hc_bytealign (w2[0], w2[1], offset); w3[0] = hc_bytealign (w1[3], w2[0], offset); w2[3] = hc_bytealign (w1[2], w1[3], offset); w2[2] = hc_bytealign (w1[1], w1[2], offset); w2[1] = hc_bytealign (w1[0], w1[1], offset); w2[0] = hc_bytealign (w0[3], w1[0], offset); w1[3] = hc_bytealign (w0[2], w0[3], offset); w1[2] = hc_bytealign (w0[1], w0[2], offset); w1[1] = hc_bytealign (w0[0], w0[1], offset); w1[0] = hc_bytealign ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: c1[1] = hc_bytealign (w3[3], 0, offset); c1[0] = hc_bytealign (w3[2], w3[3], offset); c0[3] = hc_bytealign (w3[1], w3[2], offset); c0[2] = hc_bytealign (w3[0], w3[1], offset); c0[1] = hc_bytealign (w2[3], w3[0], offset); c0[0] = hc_bytealign (w2[2], w2[3], offset); w3[3] = hc_bytealign (w2[1], w2[2], offset); w3[2] = hc_bytealign (w2[0], w2[1], offset); w3[1] = hc_bytealign (w1[3], w2[0], offset); w3[0] = hc_bytealign (w1[2], w1[3], offset); w2[3] = hc_bytealign (w1[1], w1[2], offset); w2[2] = hc_bytealign (w1[0], w1[1], offset); w2[1] = hc_bytealign (w0[3], w1[0], offset); w2[0] = hc_bytealign (w0[2], w0[3], offset); w1[3] = hc_bytealign (w0[1], w0[2], offset); w1[2] = hc_bytealign (w0[0], w0[1], offset); w1[1] = hc_bytealign ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: c1[2] = hc_bytealign (w3[3], 0, offset); c1[1] = hc_bytealign (w3[2], w3[3], offset); c1[0] = hc_bytealign (w3[1], w3[2], offset); c0[3] = hc_bytealign (w3[0], w3[1], offset); c0[2] = hc_bytealign (w2[3], w3[0], offset); c0[1] = hc_bytealign (w2[2], w2[3], offset); c0[0] = hc_bytealign (w2[1], w2[2], offset); w3[3] = hc_bytealign (w2[0], w2[1], offset); w3[2] = hc_bytealign (w1[3], w2[0], offset); w3[1] = hc_bytealign (w1[2], w1[3], offset); w3[0] = hc_bytealign (w1[1], w1[2], offset); w2[3] = hc_bytealign (w1[0], w1[1], offset); w2[2] = hc_bytealign (w0[3], w1[0], offset); w2[1] = hc_bytealign (w0[2], w0[3], offset); w2[0] = hc_bytealign (w0[1], w0[2], offset); w1[3] = hc_bytealign (w0[0], w0[1], offset); w1[2] = hc_bytealign ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: c1[3] = hc_bytealign (w3[3], 0, offset); c1[2] = hc_bytealign (w3[2], w3[3], offset); c1[1] = hc_bytealign (w3[1], w3[2], offset); c1[0] = hc_bytealign (w3[0], w3[1], offset); c0[3] = hc_bytealign (w2[3], w3[0], offset); c0[2] = hc_bytealign (w2[2], w2[3], offset); c0[1] = hc_bytealign (w2[1], w2[2], offset); c0[0] = hc_bytealign (w2[0], w2[1], offset); w3[3] = hc_bytealign (w1[3], w2[0], offset); w3[2] = hc_bytealign (w1[2], w1[3], offset); w3[1] = hc_bytealign (w1[1], w1[2], offset); w3[0] = hc_bytealign (w1[0], w1[1], offset); w2[3] = hc_bytealign (w0[3], w1[0], offset); w2[2] = hc_bytealign (w0[2], w0[3], offset); w2[1] = hc_bytealign (w0[1], w0[2], offset); w2[0] = hc_bytealign (w0[0], w0[1], offset); w1[3] = hc_bytealign ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: c2[0] = hc_bytealign (w3[3], 0, offset); c1[3] = hc_bytealign (w3[2], w3[3], offset); c1[2] = hc_bytealign (w3[1], w3[2], offset); c1[1] = hc_bytealign (w3[0], w3[1], offset); c1[0] = hc_bytealign (w2[3], w3[0], offset); c0[3] = hc_bytealign (w2[2], w2[3], offset); c0[2] = hc_bytealign (w2[1], w2[2], offset); c0[1] = hc_bytealign (w2[0], w2[1], offset); c0[0] = hc_bytealign (w1[3], w2[0], offset); w3[3] = hc_bytealign (w1[2], w1[3], offset); w3[2] = hc_bytealign (w1[1], w1[2], offset); w3[1] = hc_bytealign (w1[0], w1[1], offset); w3[0] = hc_bytealign (w0[3], w1[0], offset); w2[3] = hc_bytealign (w0[2], w0[3], offset); w2[2] = hc_bytealign (w0[1], w0[2], offset); w2[1] = hc_bytealign (w0[0], w0[1], offset); w2[0] = hc_bytealign ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: c2[1] = hc_bytealign (w3[3], 0, offset); c2[0] = hc_bytealign (w3[2], w3[3], offset); c1[3] = hc_bytealign (w3[1], w3[2], offset); c1[2] = hc_bytealign (w3[0], w3[1], offset); c1[1] = hc_bytealign (w2[3], w3[0], offset); c1[0] = hc_bytealign (w2[2], w2[3], offset); c0[3] = hc_bytealign (w2[1], w2[2], offset); c0[2] = hc_bytealign (w2[0], w2[1], offset); c0[1] = hc_bytealign (w1[3], w2[0], offset); c0[0] = hc_bytealign (w1[2], w1[3], offset); w3[3] = hc_bytealign (w1[1], w1[2], offset); w3[2] = hc_bytealign (w1[0], w1[1], offset); w3[1] = hc_bytealign (w0[3], w1[0], offset); w3[0] = hc_bytealign (w0[2], w0[3], offset); w2[3] = hc_bytealign (w0[1], w0[2], offset); w2[2] = hc_bytealign (w0[0], w0[1], offset); w2[1] = hc_bytealign ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: c2[2] = hc_bytealign (w3[3], 0, offset); c2[1] = hc_bytealign (w3[2], w3[3], offset); c2[0] = hc_bytealign (w3[1], w3[2], offset); c1[3] = hc_bytealign (w3[0], w3[1], offset); c1[2] = hc_bytealign (w2[3], w3[0], offset); c1[1] = hc_bytealign (w2[2], w2[3], offset); c1[0] = hc_bytealign (w2[1], w2[2], offset); c0[3] = hc_bytealign (w2[0], w2[1], offset); c0[2] = hc_bytealign (w1[3], w2[0], offset); c0[1] = hc_bytealign (w1[2], w1[3], offset); c0[0] = hc_bytealign (w1[1], w1[2], offset); w3[3] = hc_bytealign (w1[0], w1[1], offset); w3[2] = hc_bytealign (w0[3], w1[0], offset); w3[1] = hc_bytealign (w0[2], w0[3], offset); w3[0] = hc_bytealign (w0[1], w0[2], offset); w2[3] = hc_bytealign (w0[0], w0[1], offset); w2[2] = hc_bytealign ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: c2[3] = hc_bytealign (w3[3], 0, offset); c2[2] = hc_bytealign (w3[2], w3[3], offset); c2[1] = hc_bytealign (w3[1], w3[2], offset); c2[0] = hc_bytealign (w3[0], w3[1], offset); c1[3] = hc_bytealign (w2[3], w3[0], offset); c1[2] = hc_bytealign (w2[2], w2[3], offset); c1[1] = hc_bytealign (w2[1], w2[2], offset); c1[0] = hc_bytealign (w2[0], w2[1], offset); c0[3] = hc_bytealign (w1[3], w2[0], offset); c0[2] = hc_bytealign (w1[2], w1[3], offset); c0[1] = hc_bytealign (w1[1], w1[2], offset); c0[0] = hc_bytealign (w1[0], w1[1], offset); w3[3] = hc_bytealign (w0[3], w1[0], offset); w3[2] = hc_bytealign (w0[2], w0[3], offset); w3[1] = hc_bytealign (w0[1], w0[2], offset); w3[0] = hc_bytealign (w0[0], w0[1], offset); w2[3] = hc_bytealign ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: c3[0] = hc_bytealign (w3[3], 0, offset); c2[3] = hc_bytealign (w3[2], w3[3], offset); c2[2] = hc_bytealign (w3[1], w3[2], offset); c2[1] = hc_bytealign (w3[0], w3[1], offset); c2[0] = hc_bytealign (w2[3], w3[0], offset); c1[3] = hc_bytealign (w2[2], w2[3], offset); c1[2] = hc_bytealign (w2[1], w2[2], offset); c1[1] = hc_bytealign (w2[0], w2[1], offset); c1[0] = hc_bytealign (w1[3], w2[0], offset); c0[3] = hc_bytealign (w1[2], w1[3], offset); c0[2] = hc_bytealign (w1[1], w1[2], offset); c0[1] = hc_bytealign (w1[0], w1[1], offset); c0[0] = hc_bytealign (w0[3], w1[0], offset); w3[3] = hc_bytealign (w0[2], w0[3], offset); w3[2] = hc_bytealign (w0[1], w0[2], offset); w3[1] = hc_bytealign (w0[0], w0[1], offset); w3[0] = hc_bytealign ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: c3[1] = hc_bytealign (w3[3], 0, offset); c3[0] = hc_bytealign (w3[2], w3[3], offset); c2[3] = hc_bytealign (w3[1], w3[2], offset); c2[2] = hc_bytealign (w3[0], w3[1], offset); c2[1] = hc_bytealign (w2[3], w3[0], offset); c2[0] = hc_bytealign (w2[2], w2[3], offset); c1[3] = hc_bytealign (w2[1], w2[2], offset); c1[2] = hc_bytealign (w2[0], w2[1], offset); c1[1] = hc_bytealign (w1[3], w2[0], offset); c1[0] = hc_bytealign (w1[2], w1[3], offset); c0[3] = hc_bytealign (w1[1], w1[2], offset); c0[2] = hc_bytealign (w1[0], w1[1], offset); c0[1] = hc_bytealign (w0[3], w1[0], offset); c0[0] = hc_bytealign (w0[2], w0[3], offset); w3[3] = hc_bytealign (w0[1], w0[2], offset); w3[2] = hc_bytealign (w0[0], w0[1], offset); w3[1] = hc_bytealign ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: c3[2] = hc_bytealign (w3[3], 0, offset); c3[1] = hc_bytealign (w3[2], w3[3], offset); c3[0] = hc_bytealign (w3[1], w3[2], offset); c2[3] = hc_bytealign (w3[0], w3[1], offset); c2[2] = hc_bytealign (w2[3], w3[0], offset); c2[1] = hc_bytealign (w2[2], w2[3], offset); c2[0] = hc_bytealign (w2[1], w2[2], offset); c1[3] = hc_bytealign (w2[0], w2[1], offset); c1[2] = hc_bytealign (w1[3], w2[0], offset); c1[1] = hc_bytealign (w1[2], w1[3], offset); c1[0] = hc_bytealign (w1[1], w1[2], offset); c0[3] = hc_bytealign (w1[0], w1[1], offset); c0[2] = hc_bytealign (w0[3], w1[0], offset); c0[1] = hc_bytealign (w0[2], w0[3], offset); c0[0] = hc_bytealign (w0[1], w0[2], offset); w3[3] = hc_bytealign (w0[0], w0[1], offset); w3[2] = hc_bytealign ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: c3[3] = hc_bytealign (w3[3], 0, offset); c3[2] = hc_bytealign (w3[2], w3[3], offset); c3[1] = hc_bytealign (w3[1], w3[2], offset); c3[0] = hc_bytealign (w3[0], w3[1], offset); c2[3] = hc_bytealign (w2[3], w3[0], offset); c2[2] = hc_bytealign (w2[2], w2[3], offset); c2[1] = hc_bytealign (w2[1], w2[2], offset); c2[0] = hc_bytealign (w2[0], w2[1], offset); c1[3] = hc_bytealign (w1[3], w2[0], offset); c1[2] = hc_bytealign (w1[2], w1[3], offset); c1[1] = hc_bytealign (w1[1], w1[2], offset); c1[0] = hc_bytealign (w1[0], w1[1], offset); c0[3] = hc_bytealign (w0[3], w1[0], offset); c0[2] = hc_bytealign (w0[2], w0[3], offset); c0[1] = hc_bytealign (w0[1], w0[2], offset); c0[0] = hc_bytealign (w0[0], w0[1], offset); w3[3] = hc_bytealign ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_be (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: w3[3] = hc_bytealign_be (w3[2], w3[3], offset); w3[2] = hc_bytealign_be (w3[1], w3[2], offset); w3[1] = hc_bytealign_be (w3[0], w3[1], offset); w3[0] = hc_bytealign_be (w2[3], w3[0], offset); w2[3] = hc_bytealign_be (w2[2], w2[3], offset); w2[2] = hc_bytealign_be (w2[1], w2[2], offset); w2[1] = hc_bytealign_be (w2[0], w2[1], offset); w2[0] = hc_bytealign_be (w1[3], w2[0], offset); w1[3] = hc_bytealign_be (w1[2], w1[3], offset); w1[2] = hc_bytealign_be (w1[1], w1[2], offset); w1[1] = hc_bytealign_be (w1[0], w1[1], offset); w1[0] = hc_bytealign_be (w0[3], w1[0], offset); w0[3] = hc_bytealign_be (w0[2], w0[3], offset); w0[2] = hc_bytealign_be (w0[1], w0[2], offset); w0[1] = hc_bytealign_be (w0[0], w0[1], offset); w0[0] = hc_bytealign_be ( 0, w0[0], offset); break; case 1: w3[3] = hc_bytealign_be (w3[1], w3[2], offset); w3[2] = hc_bytealign_be (w3[0], w3[1], offset); w3[1] = hc_bytealign_be (w2[3], w3[0], offset); w3[0] = hc_bytealign_be (w2[2], w2[3], offset); w2[3] = hc_bytealign_be (w2[1], w2[2], offset); w2[2] = hc_bytealign_be (w2[0], w2[1], offset); w2[1] = hc_bytealign_be (w1[3], w2[0], offset); w2[0] = hc_bytealign_be (w1[2], w1[3], offset); w1[3] = hc_bytealign_be (w1[1], w1[2], offset); w1[2] = hc_bytealign_be (w1[0], w1[1], offset); w1[1] = hc_bytealign_be (w0[3], w1[0], offset); w1[0] = hc_bytealign_be (w0[2], w0[3], offset); w0[3] = hc_bytealign_be (w0[1], w0[2], offset); w0[2] = hc_bytealign_be (w0[0], w0[1], offset); w0[1] = hc_bytealign_be ( 0, w0[0], offset); w0[0] = 0; break; case 2: w3[3] = hc_bytealign_be (w3[0], w3[1], offset); w3[2] = hc_bytealign_be (w2[3], w3[0], offset); w3[1] = hc_bytealign_be (w2[2], w2[3], offset); w3[0] = hc_bytealign_be (w2[1], w2[2], offset); w2[3] = hc_bytealign_be (w2[0], w2[1], offset); w2[2] = hc_bytealign_be (w1[3], w2[0], offset); w2[1] = hc_bytealign_be (w1[2], w1[3], offset); w2[0] = hc_bytealign_be (w1[1], w1[2], offset); w1[3] = hc_bytealign_be (w1[0], w1[1], offset); w1[2] = hc_bytealign_be (w0[3], w1[0], offset); w1[1] = hc_bytealign_be (w0[2], w0[3], offset); w1[0] = hc_bytealign_be (w0[1], w0[2], offset); w0[3] = hc_bytealign_be (w0[0], w0[1], offset); w0[2] = hc_bytealign_be ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: w3[3] = hc_bytealign_be (w2[3], w3[0], offset); w3[2] = hc_bytealign_be (w2[2], w2[3], offset); w3[1] = hc_bytealign_be (w2[1], w2[2], offset); w3[0] = hc_bytealign_be (w2[0], w2[1], offset); w2[3] = hc_bytealign_be (w1[3], w2[0], offset); w2[2] = hc_bytealign_be (w1[2], w1[3], offset); w2[1] = hc_bytealign_be (w1[1], w1[2], offset); w2[0] = hc_bytealign_be (w1[0], w1[1], offset); w1[3] = hc_bytealign_be (w0[3], w1[0], offset); w1[2] = hc_bytealign_be (w0[2], w0[3], offset); w1[1] = hc_bytealign_be (w0[1], w0[2], offset); w1[0] = hc_bytealign_be (w0[0], w0[1], offset); w0[3] = hc_bytealign_be ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: w3[3] = hc_bytealign_be (w2[2], w2[3], offset); w3[2] = hc_bytealign_be (w2[1], w2[2], offset); w3[1] = hc_bytealign_be (w2[0], w2[1], offset); w3[0] = hc_bytealign_be (w1[3], w2[0], offset); w2[3] = hc_bytealign_be (w1[2], w1[3], offset); w2[2] = hc_bytealign_be (w1[1], w1[2], offset); w2[1] = hc_bytealign_be (w1[0], w1[1], offset); w2[0] = hc_bytealign_be (w0[3], w1[0], offset); w1[3] = hc_bytealign_be (w0[2], w0[3], offset); w1[2] = hc_bytealign_be (w0[1], w0[2], offset); w1[1] = hc_bytealign_be (w0[0], w0[1], offset); w1[0] = hc_bytealign_be ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: w3[3] = hc_bytealign_be (w2[1], w2[2], offset); w3[2] = hc_bytealign_be (w2[0], w2[1], offset); w3[1] = hc_bytealign_be (w1[3], w2[0], offset); w3[0] = hc_bytealign_be (w1[2], w1[3], offset); w2[3] = hc_bytealign_be (w1[1], w1[2], offset); w2[2] = hc_bytealign_be (w1[0], w1[1], offset); w2[1] = hc_bytealign_be (w0[3], w1[0], offset); w2[0] = hc_bytealign_be (w0[2], w0[3], offset); w1[3] = hc_bytealign_be (w0[1], w0[2], offset); w1[2] = hc_bytealign_be (w0[0], w0[1], offset); w1[1] = hc_bytealign_be ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: w3[3] = hc_bytealign_be (w2[0], w2[1], offset); w3[2] = hc_bytealign_be (w1[3], w2[0], offset); w3[1] = hc_bytealign_be (w1[2], w1[3], offset); w3[0] = hc_bytealign_be (w1[1], w1[2], offset); w2[3] = hc_bytealign_be (w1[0], w1[1], offset); w2[2] = hc_bytealign_be (w0[3], w1[0], offset); w2[1] = hc_bytealign_be (w0[2], w0[3], offset); w2[0] = hc_bytealign_be (w0[1], w0[2], offset); w1[3] = hc_bytealign_be (w0[0], w0[1], offset); w1[2] = hc_bytealign_be ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: w3[3] = hc_bytealign_be (w1[3], w2[0], offset); w3[2] = hc_bytealign_be (w1[2], w1[3], offset); w3[1] = hc_bytealign_be (w1[1], w1[2], offset); w3[0] = hc_bytealign_be (w1[0], w1[1], offset); w2[3] = hc_bytealign_be (w0[3], w1[0], offset); w2[2] = hc_bytealign_be (w0[2], w0[3], offset); w2[1] = hc_bytealign_be (w0[1], w0[2], offset); w2[0] = hc_bytealign_be (w0[0], w0[1], offset); w1[3] = hc_bytealign_be ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: w3[3] = hc_bytealign_be (w1[2], w1[3], offset); w3[2] = hc_bytealign_be (w1[1], w1[2], offset); w3[1] = hc_bytealign_be (w1[0], w1[1], offset); w3[0] = hc_bytealign_be (w0[3], w1[0], offset); w2[3] = hc_bytealign_be (w0[2], w0[3], offset); w2[2] = hc_bytealign_be (w0[1], w0[2], offset); w2[1] = hc_bytealign_be (w0[0], w0[1], offset); w2[0] = hc_bytealign_be ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: w3[3] = hc_bytealign_be (w1[1], w1[2], offset); w3[2] = hc_bytealign_be (w1[0], w1[1], offset); w3[1] = hc_bytealign_be (w0[3], w1[0], offset); w3[0] = hc_bytealign_be (w0[2], w0[3], offset); w2[3] = hc_bytealign_be (w0[1], w0[2], offset); w2[2] = hc_bytealign_be (w0[0], w0[1], offset); w2[1] = hc_bytealign_be ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: w3[3] = hc_bytealign_be (w1[0], w1[1], offset); w3[2] = hc_bytealign_be (w0[3], w1[0], offset); w3[1] = hc_bytealign_be (w0[2], w0[3], offset); w3[0] = hc_bytealign_be (w0[1], w0[2], offset); w2[3] = hc_bytealign_be (w0[0], w0[1], offset); w2[2] = hc_bytealign_be ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: w3[3] = hc_bytealign_be (w0[3], w1[0], offset); w3[2] = hc_bytealign_be (w0[2], w0[3], offset); w3[1] = hc_bytealign_be (w0[1], w0[2], offset); w3[0] = hc_bytealign_be (w0[0], w0[1], offset); w2[3] = hc_bytealign_be ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: w3[3] = hc_bytealign_be (w0[2], w0[3], offset); w3[2] = hc_bytealign_be (w0[1], w0[2], offset); w3[1] = hc_bytealign_be (w0[0], w0[1], offset); w3[0] = hc_bytealign_be ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: w3[3] = hc_bytealign_be (w0[1], w0[2], offset); w3[2] = hc_bytealign_be (w0[0], w0[1], offset); w3[1] = hc_bytealign_be ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: w3[3] = hc_bytealign_be (w0[0], w0[1], offset); w3[2] = hc_bytealign_be ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: w3[3] = hc_bytealign_be ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV #if defined IS_NV const int selector = (0x76543210 >> ((offset & 3) * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> ((offset & 3) * 8)); #endif switch (offset_switch) { case 0: w3[3] = hc_byte_perm (w3[3], w3[2], selector); w3[2] = hc_byte_perm (w3[2], w3[1], selector); w3[1] = hc_byte_perm (w3[1], w3[0], selector); w3[0] = hc_byte_perm (w3[0], w2[3], selector); w2[3] = hc_byte_perm (w2[3], w2[2], selector); w2[2] = hc_byte_perm (w2[2], w2[1], selector); w2[1] = hc_byte_perm (w2[1], w2[0], selector); w2[0] = hc_byte_perm (w2[0], w1[3], selector); w1[3] = hc_byte_perm (w1[3], w1[2], selector); w1[2] = hc_byte_perm (w1[2], w1[1], selector); w1[1] = hc_byte_perm (w1[1], w1[0], selector); w1[0] = hc_byte_perm (w1[0], w0[3], selector); w0[3] = hc_byte_perm (w0[3], w0[2], selector); w0[2] = hc_byte_perm (w0[2], w0[1], selector); w0[1] = hc_byte_perm (w0[1], w0[0], selector); w0[0] = hc_byte_perm (w0[0], 0, selector); break; case 1: w3[3] = hc_byte_perm (w3[2], w3[1], selector); w3[2] = hc_byte_perm (w3[1], w3[0], selector); w3[1] = hc_byte_perm (w3[0], w2[3], selector); w3[0] = hc_byte_perm (w2[3], w2[2], selector); w2[3] = hc_byte_perm (w2[2], w2[1], selector); w2[2] = hc_byte_perm (w2[1], w2[0], selector); w2[1] = hc_byte_perm (w2[0], w1[3], selector); w2[0] = hc_byte_perm (w1[3], w1[2], selector); w1[3] = hc_byte_perm (w1[2], w1[1], selector); w1[2] = hc_byte_perm (w1[1], w1[0], selector); w1[1] = hc_byte_perm (w1[0], w0[3], selector); w1[0] = hc_byte_perm (w0[3], w0[2], selector); w0[3] = hc_byte_perm (w0[2], w0[1], selector); w0[2] = hc_byte_perm (w0[1], w0[0], selector); w0[1] = hc_byte_perm (w0[0], 0, selector); w0[0] = 0; break; case 2: w3[3] = hc_byte_perm (w3[1], w3[0], selector); w3[2] = hc_byte_perm (w3[0], w2[3], selector); w3[1] = hc_byte_perm (w2[3], w2[2], selector); w3[0] = hc_byte_perm (w2[2], w2[1], selector); w2[3] = hc_byte_perm (w2[1], w2[0], selector); w2[2] = hc_byte_perm (w2[0], w1[3], selector); w2[1] = hc_byte_perm (w1[3], w1[2], selector); w2[0] = hc_byte_perm (w1[2], w1[1], selector); w1[3] = hc_byte_perm (w1[1], w1[0], selector); w1[2] = hc_byte_perm (w1[0], w0[3], selector); w1[1] = hc_byte_perm (w0[3], w0[2], selector); w1[0] = hc_byte_perm (w0[2], w0[1], selector); w0[3] = hc_byte_perm (w0[1], w0[0], selector); w0[2] = hc_byte_perm (w0[0], 0, selector); w0[1] = 0; w0[0] = 0; break; case 3: w3[3] = hc_byte_perm (w3[0], w2[3], selector); w3[2] = hc_byte_perm (w2[3], w2[2], selector); w3[1] = hc_byte_perm (w2[2], w2[1], selector); w3[0] = hc_byte_perm (w2[1], w2[0], selector); w2[3] = hc_byte_perm (w2[0], w1[3], selector); w2[2] = hc_byte_perm (w1[3], w1[2], selector); w2[1] = hc_byte_perm (w1[2], w1[1], selector); w2[0] = hc_byte_perm (w1[1], w1[0], selector); w1[3] = hc_byte_perm (w1[0], w0[3], selector); w1[2] = hc_byte_perm (w0[3], w0[2], selector); w1[1] = hc_byte_perm (w0[2], w0[1], selector); w1[0] = hc_byte_perm (w0[1], w0[0], selector); w0[3] = hc_byte_perm (w0[0], 0, selector); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: w3[3] = hc_byte_perm (w2[3], w2[2], selector); w3[2] = hc_byte_perm (w2[2], w2[1], selector); w3[1] = hc_byte_perm (w2[1], w2[0], selector); w3[0] = hc_byte_perm (w2[0], w1[3], selector); w2[3] = hc_byte_perm (w1[3], w1[2], selector); w2[2] = hc_byte_perm (w1[2], w1[1], selector); w2[1] = hc_byte_perm (w1[1], w1[0], selector); w2[0] = hc_byte_perm (w1[0], w0[3], selector); w1[3] = hc_byte_perm (w0[3], w0[2], selector); w1[2] = hc_byte_perm (w0[2], w0[1], selector); w1[1] = hc_byte_perm (w0[1], w0[0], selector); w1[0] = hc_byte_perm (w0[0], 0, selector); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: w3[3] = hc_byte_perm (w2[2], w2[1], selector); w3[2] = hc_byte_perm (w2[1], w2[0], selector); w3[1] = hc_byte_perm (w2[0], w1[3], selector); w3[0] = hc_byte_perm (w1[3], w1[2], selector); w2[3] = hc_byte_perm (w1[2], w1[1], selector); w2[2] = hc_byte_perm (w1[1], w1[0], selector); w2[1] = hc_byte_perm (w1[0], w0[3], selector); w2[0] = hc_byte_perm (w0[3], w0[2], selector); w1[3] = hc_byte_perm (w0[2], w0[1], selector); w1[2] = hc_byte_perm (w0[1], w0[0], selector); w1[1] = hc_byte_perm (w0[0], 0, selector); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: w3[3] = hc_byte_perm (w2[1], w2[0], selector); w3[2] = hc_byte_perm (w2[0], w1[3], selector); w3[1] = hc_byte_perm (w1[3], w1[2], selector); w3[0] = hc_byte_perm (w1[2], w1[1], selector); w2[3] = hc_byte_perm (w1[1], w1[0], selector); w2[2] = hc_byte_perm (w1[0], w0[3], selector); w2[1] = hc_byte_perm (w0[3], w0[2], selector); w2[0] = hc_byte_perm (w0[2], w0[1], selector); w1[3] = hc_byte_perm (w0[1], w0[0], selector); w1[2] = hc_byte_perm (w0[0], 0, selector); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: w3[3] = hc_byte_perm (w2[0], w1[3], selector); w3[2] = hc_byte_perm (w1[3], w1[2], selector); w3[1] = hc_byte_perm (w1[2], w1[1], selector); w3[0] = hc_byte_perm (w1[1], w1[0], selector); w2[3] = hc_byte_perm (w1[0], w0[3], selector); w2[2] = hc_byte_perm (w0[3], w0[2], selector); w2[1] = hc_byte_perm (w0[2], w0[1], selector); w2[0] = hc_byte_perm (w0[1], w0[0], selector); w1[3] = hc_byte_perm (w0[0], 0, selector); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: w3[3] = hc_byte_perm (w1[3], w1[2], selector); w3[2] = hc_byte_perm (w1[2], w1[1], selector); w3[1] = hc_byte_perm (w1[1], w1[0], selector); w3[0] = hc_byte_perm (w1[0], w0[3], selector); w2[3] = hc_byte_perm (w0[3], w0[2], selector); w2[2] = hc_byte_perm (w0[2], w0[1], selector); w2[1] = hc_byte_perm (w0[1], w0[0], selector); w2[0] = hc_byte_perm (w0[0], 0, selector); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: w3[3] = hc_byte_perm (w1[2], w1[1], selector); w3[2] = hc_byte_perm (w1[1], w1[0], selector); w3[1] = hc_byte_perm (w1[0], w0[3], selector); w3[0] = hc_byte_perm (w0[3], w0[2], selector); w2[3] = hc_byte_perm (w0[2], w0[1], selector); w2[2] = hc_byte_perm (w0[1], w0[0], selector); w2[1] = hc_byte_perm (w0[0], 0, selector); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: w3[3] = hc_byte_perm (w1[1], w1[0], selector); w3[2] = hc_byte_perm (w1[0], w0[3], selector); w3[1] = hc_byte_perm (w0[3], w0[2], selector); w3[0] = hc_byte_perm (w0[2], w0[1], selector); w2[3] = hc_byte_perm (w0[1], w0[0], selector); w2[2] = hc_byte_perm (w0[0], 0, selector); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: w3[3] = hc_byte_perm (w1[0], w0[3], selector); w3[2] = hc_byte_perm (w0[3], w0[2], selector); w3[1] = hc_byte_perm (w0[2], w0[1], selector); w3[0] = hc_byte_perm (w0[1], w0[0], selector); w2[3] = hc_byte_perm (w0[0], 0, selector); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: w3[3] = hc_byte_perm (w0[3], w0[2], selector); w3[2] = hc_byte_perm (w0[2], w0[1], selector); w3[1] = hc_byte_perm (w0[1], w0[0], selector); w3[0] = hc_byte_perm (w0[0], 0, selector); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: w3[3] = hc_byte_perm (w0[2], w0[1], selector); w3[2] = hc_byte_perm (w0[1], w0[0], selector); w3[1] = hc_byte_perm (w0[0], 0, selector); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: w3[3] = hc_byte_perm (w0[1], w0[0], selector); w3[2] = hc_byte_perm (w0[0], 0, selector); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: w3[3] = hc_byte_perm (w0[0], 0, selector); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_carry_be (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *c0, PRIVATE_AS u32x *c1, PRIVATE_AS u32x *c2, PRIVATE_AS u32x *c3, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: c0[0] = hc_bytealign_be (w3[3], 0, offset); w3[3] = hc_bytealign_be (w3[2], w3[3], offset); w3[2] = hc_bytealign_be (w3[1], w3[2], offset); w3[1] = hc_bytealign_be (w3[0], w3[1], offset); w3[0] = hc_bytealign_be (w2[3], w3[0], offset); w2[3] = hc_bytealign_be (w2[2], w2[3], offset); w2[2] = hc_bytealign_be (w2[1], w2[2], offset); w2[1] = hc_bytealign_be (w2[0], w2[1], offset); w2[0] = hc_bytealign_be (w1[3], w2[0], offset); w1[3] = hc_bytealign_be (w1[2], w1[3], offset); w1[2] = hc_bytealign_be (w1[1], w1[2], offset); w1[1] = hc_bytealign_be (w1[0], w1[1], offset); w1[0] = hc_bytealign_be (w0[3], w1[0], offset); w0[3] = hc_bytealign_be (w0[2], w0[3], offset); w0[2] = hc_bytealign_be (w0[1], w0[2], offset); w0[1] = hc_bytealign_be (w0[0], w0[1], offset); w0[0] = hc_bytealign_be ( 0, w0[0], offset); break; case 1: c0[1] = hc_bytealign_be (w3[3], 0, offset); c0[0] = hc_bytealign_be (w3[2], w3[3], offset); w3[3] = hc_bytealign_be (w3[1], w3[2], offset); w3[2] = hc_bytealign_be (w3[0], w3[1], offset); w3[1] = hc_bytealign_be (w2[3], w3[0], offset); w3[0] = hc_bytealign_be (w2[2], w2[3], offset); w2[3] = hc_bytealign_be (w2[1], w2[2], offset); w2[2] = hc_bytealign_be (w2[0], w2[1], offset); w2[1] = hc_bytealign_be (w1[3], w2[0], offset); w2[0] = hc_bytealign_be (w1[2], w1[3], offset); w1[3] = hc_bytealign_be (w1[1], w1[2], offset); w1[2] = hc_bytealign_be (w1[0], w1[1], offset); w1[1] = hc_bytealign_be (w0[3], w1[0], offset); w1[0] = hc_bytealign_be (w0[2], w0[3], offset); w0[3] = hc_bytealign_be (w0[1], w0[2], offset); w0[2] = hc_bytealign_be (w0[0], w0[1], offset); w0[1] = hc_bytealign_be ( 0, w0[0], offset); w0[0] = 0; break; case 2: c0[2] = hc_bytealign_be (w3[3], 0, offset); c0[1] = hc_bytealign_be (w3[2], w3[3], offset); c0[0] = hc_bytealign_be (w3[1], w3[2], offset); w3[3] = hc_bytealign_be (w3[0], w3[1], offset); w3[2] = hc_bytealign_be (w2[3], w3[0], offset); w3[1] = hc_bytealign_be (w2[2], w2[3], offset); w3[0] = hc_bytealign_be (w2[1], w2[2], offset); w2[3] = hc_bytealign_be (w2[0], w2[1], offset); w2[2] = hc_bytealign_be (w1[3], w2[0], offset); w2[1] = hc_bytealign_be (w1[2], w1[3], offset); w2[0] = hc_bytealign_be (w1[1], w1[2], offset); w1[3] = hc_bytealign_be (w1[0], w1[1], offset); w1[2] = hc_bytealign_be (w0[3], w1[0], offset); w1[1] = hc_bytealign_be (w0[2], w0[3], offset); w1[0] = hc_bytealign_be (w0[1], w0[2], offset); w0[3] = hc_bytealign_be (w0[0], w0[1], offset); w0[2] = hc_bytealign_be ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: c0[3] = hc_bytealign_be (w3[3], 0, offset); c0[2] = hc_bytealign_be (w3[2], w3[3], offset); c0[1] = hc_bytealign_be (w3[1], w3[2], offset); c0[0] = hc_bytealign_be (w3[0], w3[1], offset); w3[3] = hc_bytealign_be (w2[3], w3[0], offset); w3[2] = hc_bytealign_be (w2[2], w2[3], offset); w3[1] = hc_bytealign_be (w2[1], w2[2], offset); w3[0] = hc_bytealign_be (w2[0], w2[1], offset); w2[3] = hc_bytealign_be (w1[3], w2[0], offset); w2[2] = hc_bytealign_be (w1[2], w1[3], offset); w2[1] = hc_bytealign_be (w1[1], w1[2], offset); w2[0] = hc_bytealign_be (w1[0], w1[1], offset); w1[3] = hc_bytealign_be (w0[3], w1[0], offset); w1[2] = hc_bytealign_be (w0[2], w0[3], offset); w1[1] = hc_bytealign_be (w0[1], w0[2], offset); w1[0] = hc_bytealign_be (w0[0], w0[1], offset); w0[3] = hc_bytealign_be ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: c1[0] = hc_bytealign_be (w3[3], 0, offset); c0[3] = hc_bytealign_be (w3[2], w3[3], offset); c0[2] = hc_bytealign_be (w3[1], w3[2], offset); c0[1] = hc_bytealign_be (w3[0], w3[1], offset); c0[0] = hc_bytealign_be (w2[3], w3[0], offset); w3[3] = hc_bytealign_be (w2[2], w2[3], offset); w3[2] = hc_bytealign_be (w2[1], w2[2], offset); w3[1] = hc_bytealign_be (w2[0], w2[1], offset); w3[0] = hc_bytealign_be (w1[3], w2[0], offset); w2[3] = hc_bytealign_be (w1[2], w1[3], offset); w2[2] = hc_bytealign_be (w1[1], w1[2], offset); w2[1] = hc_bytealign_be (w1[0], w1[1], offset); w2[0] = hc_bytealign_be (w0[3], w1[0], offset); w1[3] = hc_bytealign_be (w0[2], w0[3], offset); w1[2] = hc_bytealign_be (w0[1], w0[2], offset); w1[1] = hc_bytealign_be (w0[0], w0[1], offset); w1[0] = hc_bytealign_be ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: c1[1] = hc_bytealign_be (w3[3], 0, offset); c1[0] = hc_bytealign_be (w3[2], w3[3], offset); c0[3] = hc_bytealign_be (w3[1], w3[2], offset); c0[2] = hc_bytealign_be (w3[0], w3[1], offset); c0[1] = hc_bytealign_be (w2[3], w3[0], offset); c0[0] = hc_bytealign_be (w2[2], w2[3], offset); w3[3] = hc_bytealign_be (w2[1], w2[2], offset); w3[2] = hc_bytealign_be (w2[0], w2[1], offset); w3[1] = hc_bytealign_be (w1[3], w2[0], offset); w3[0] = hc_bytealign_be (w1[2], w1[3], offset); w2[3] = hc_bytealign_be (w1[1], w1[2], offset); w2[2] = hc_bytealign_be (w1[0], w1[1], offset); w2[1] = hc_bytealign_be (w0[3], w1[0], offset); w2[0] = hc_bytealign_be (w0[2], w0[3], offset); w1[3] = hc_bytealign_be (w0[1], w0[2], offset); w1[2] = hc_bytealign_be (w0[0], w0[1], offset); w1[1] = hc_bytealign_be ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: c1[2] = hc_bytealign_be (w3[3], 0, offset); c1[1] = hc_bytealign_be (w3[2], w3[3], offset); c1[0] = hc_bytealign_be (w3[1], w3[2], offset); c0[3] = hc_bytealign_be (w3[0], w3[1], offset); c0[2] = hc_bytealign_be (w2[3], w3[0], offset); c0[1] = hc_bytealign_be (w2[2], w2[3], offset); c0[0] = hc_bytealign_be (w2[1], w2[2], offset); w3[3] = hc_bytealign_be (w2[0], w2[1], offset); w3[2] = hc_bytealign_be (w1[3], w2[0], offset); w3[1] = hc_bytealign_be (w1[2], w1[3], offset); w3[0] = hc_bytealign_be (w1[1], w1[2], offset); w2[3] = hc_bytealign_be (w1[0], w1[1], offset); w2[2] = hc_bytealign_be (w0[3], w1[0], offset); w2[1] = hc_bytealign_be (w0[2], w0[3], offset); w2[0] = hc_bytealign_be (w0[1], w0[2], offset); w1[3] = hc_bytealign_be (w0[0], w0[1], offset); w1[2] = hc_bytealign_be ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: c1[3] = hc_bytealign_be (w3[3], 0, offset); c1[2] = hc_bytealign_be (w3[2], w3[3], offset); c1[1] = hc_bytealign_be (w3[1], w3[2], offset); c1[0] = hc_bytealign_be (w3[0], w3[1], offset); c0[3] = hc_bytealign_be (w2[3], w3[0], offset); c0[2] = hc_bytealign_be (w2[2], w2[3], offset); c0[1] = hc_bytealign_be (w2[1], w2[2], offset); c0[0] = hc_bytealign_be (w2[0], w2[1], offset); w3[3] = hc_bytealign_be (w1[3], w2[0], offset); w3[2] = hc_bytealign_be (w1[2], w1[3], offset); w3[1] = hc_bytealign_be (w1[1], w1[2], offset); w3[0] = hc_bytealign_be (w1[0], w1[1], offset); w2[3] = hc_bytealign_be (w0[3], w1[0], offset); w2[2] = hc_bytealign_be (w0[2], w0[3], offset); w2[1] = hc_bytealign_be (w0[1], w0[2], offset); w2[0] = hc_bytealign_be (w0[0], w0[1], offset); w1[3] = hc_bytealign_be ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: c2[0] = hc_bytealign_be (w3[3], 0, offset); c1[3] = hc_bytealign_be (w3[2], w3[3], offset); c1[2] = hc_bytealign_be (w3[1], w3[2], offset); c1[1] = hc_bytealign_be (w3[0], w3[1], offset); c1[0] = hc_bytealign_be (w2[3], w3[0], offset); c0[3] = hc_bytealign_be (w2[2], w2[3], offset); c0[2] = hc_bytealign_be (w2[1], w2[2], offset); c0[1] = hc_bytealign_be (w2[0], w2[1], offset); c0[0] = hc_bytealign_be (w1[3], w2[0], offset); w3[3] = hc_bytealign_be (w1[2], w1[3], offset); w3[2] = hc_bytealign_be (w1[1], w1[2], offset); w3[1] = hc_bytealign_be (w1[0], w1[1], offset); w3[0] = hc_bytealign_be (w0[3], w1[0], offset); w2[3] = hc_bytealign_be (w0[2], w0[3], offset); w2[2] = hc_bytealign_be (w0[1], w0[2], offset); w2[1] = hc_bytealign_be (w0[0], w0[1], offset); w2[0] = hc_bytealign_be ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: c2[1] = hc_bytealign_be (w3[3], 0, offset); c2[0] = hc_bytealign_be (w3[2], w3[3], offset); c1[3] = hc_bytealign_be (w3[1], w3[2], offset); c1[2] = hc_bytealign_be (w3[0], w3[1], offset); c1[1] = hc_bytealign_be (w2[3], w3[0], offset); c1[0] = hc_bytealign_be (w2[2], w2[3], offset); c0[3] = hc_bytealign_be (w2[1], w2[2], offset); c0[2] = hc_bytealign_be (w2[0], w2[1], offset); c0[1] = hc_bytealign_be (w1[3], w2[0], offset); c0[0] = hc_bytealign_be (w1[2], w1[3], offset); w3[3] = hc_bytealign_be (w1[1], w1[2], offset); w3[2] = hc_bytealign_be (w1[0], w1[1], offset); w3[1] = hc_bytealign_be (w0[3], w1[0], offset); w3[0] = hc_bytealign_be (w0[2], w0[3], offset); w2[3] = hc_bytealign_be (w0[1], w0[2], offset); w2[2] = hc_bytealign_be (w0[0], w0[1], offset); w2[1] = hc_bytealign_be ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: c2[2] = hc_bytealign_be (w3[3], 0, offset); c2[1] = hc_bytealign_be (w3[2], w3[3], offset); c2[0] = hc_bytealign_be (w3[1], w3[2], offset); c1[3] = hc_bytealign_be (w3[0], w3[1], offset); c1[2] = hc_bytealign_be (w2[3], w3[0], offset); c1[1] = hc_bytealign_be (w2[2], w2[3], offset); c1[0] = hc_bytealign_be (w2[1], w2[2], offset); c0[3] = hc_bytealign_be (w2[0], w2[1], offset); c0[2] = hc_bytealign_be (w1[3], w2[0], offset); c0[1] = hc_bytealign_be (w1[2], w1[3], offset); c0[0] = hc_bytealign_be (w1[1], w1[2], offset); w3[3] = hc_bytealign_be (w1[0], w1[1], offset); w3[2] = hc_bytealign_be (w0[3], w1[0], offset); w3[1] = hc_bytealign_be (w0[2], w0[3], offset); w3[0] = hc_bytealign_be (w0[1], w0[2], offset); w2[3] = hc_bytealign_be (w0[0], w0[1], offset); w2[2] = hc_bytealign_be ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: c2[3] = hc_bytealign_be (w3[3], 0, offset); c2[2] = hc_bytealign_be (w3[2], w3[3], offset); c2[1] = hc_bytealign_be (w3[1], w3[2], offset); c2[0] = hc_bytealign_be (w3[0], w3[1], offset); c1[3] = hc_bytealign_be (w2[3], w3[0], offset); c1[2] = hc_bytealign_be (w2[2], w2[3], offset); c1[1] = hc_bytealign_be (w2[1], w2[2], offset); c1[0] = hc_bytealign_be (w2[0], w2[1], offset); c0[3] = hc_bytealign_be (w1[3], w2[0], offset); c0[2] = hc_bytealign_be (w1[2], w1[3], offset); c0[1] = hc_bytealign_be (w1[1], w1[2], offset); c0[0] = hc_bytealign_be (w1[0], w1[1], offset); w3[3] = hc_bytealign_be (w0[3], w1[0], offset); w3[2] = hc_bytealign_be (w0[2], w0[3], offset); w3[1] = hc_bytealign_be (w0[1], w0[2], offset); w3[0] = hc_bytealign_be (w0[0], w0[1], offset); w2[3] = hc_bytealign_be ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: c3[0] = hc_bytealign_be (w3[3], 0, offset); c2[3] = hc_bytealign_be (w3[2], w3[3], offset); c2[2] = hc_bytealign_be (w3[1], w3[2], offset); c2[1] = hc_bytealign_be (w3[0], w3[1], offset); c2[0] = hc_bytealign_be (w2[3], w3[0], offset); c1[3] = hc_bytealign_be (w2[2], w2[3], offset); c1[2] = hc_bytealign_be (w2[1], w2[2], offset); c1[1] = hc_bytealign_be (w2[0], w2[1], offset); c1[0] = hc_bytealign_be (w1[3], w2[0], offset); c0[3] = hc_bytealign_be (w1[2], w1[3], offset); c0[2] = hc_bytealign_be (w1[1], w1[2], offset); c0[1] = hc_bytealign_be (w1[0], w1[1], offset); c0[0] = hc_bytealign_be (w0[3], w1[0], offset); w3[3] = hc_bytealign_be (w0[2], w0[3], offset); w3[2] = hc_bytealign_be (w0[1], w0[2], offset); w3[1] = hc_bytealign_be (w0[0], w0[1], offset); w3[0] = hc_bytealign_be ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: c3[1] = hc_bytealign_be (w3[3], 0, offset); c3[0] = hc_bytealign_be (w3[2], w3[3], offset); c2[3] = hc_bytealign_be (w3[1], w3[2], offset); c2[2] = hc_bytealign_be (w3[0], w3[1], offset); c2[1] = hc_bytealign_be (w2[3], w3[0], offset); c2[0] = hc_bytealign_be (w2[2], w2[3], offset); c1[3] = hc_bytealign_be (w2[1], w2[2], offset); c1[2] = hc_bytealign_be (w2[0], w2[1], offset); c1[1] = hc_bytealign_be (w1[3], w2[0], offset); c1[0] = hc_bytealign_be (w1[2], w1[3], offset); c0[3] = hc_bytealign_be (w1[1], w1[2], offset); c0[2] = hc_bytealign_be (w1[0], w1[1], offset); c0[1] = hc_bytealign_be (w0[3], w1[0], offset); c0[0] = hc_bytealign_be (w0[2], w0[3], offset); w3[3] = hc_bytealign_be (w0[1], w0[2], offset); w3[2] = hc_bytealign_be (w0[0], w0[1], offset); w3[1] = hc_bytealign_be ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: c3[2] = hc_bytealign_be (w3[3], 0, offset); c3[1] = hc_bytealign_be (w3[2], w3[3], offset); c3[0] = hc_bytealign_be (w3[1], w3[2], offset); c2[3] = hc_bytealign_be (w3[0], w3[1], offset); c2[2] = hc_bytealign_be (w2[3], w3[0], offset); c2[1] = hc_bytealign_be (w2[2], w2[3], offset); c2[0] = hc_bytealign_be (w2[1], w2[2], offset); c1[3] = hc_bytealign_be (w2[0], w2[1], offset); c1[2] = hc_bytealign_be (w1[3], w2[0], offset); c1[1] = hc_bytealign_be (w1[2], w1[3], offset); c1[0] = hc_bytealign_be (w1[1], w1[2], offset); c0[3] = hc_bytealign_be (w1[0], w1[1], offset); c0[2] = hc_bytealign_be (w0[3], w1[0], offset); c0[1] = hc_bytealign_be (w0[2], w0[3], offset); c0[0] = hc_bytealign_be (w0[1], w0[2], offset); w3[3] = hc_bytealign_be (w0[0], w0[1], offset); w3[2] = hc_bytealign_be ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: c3[3] = hc_bytealign_be (w3[3], 0, offset); c3[2] = hc_bytealign_be (w3[2], w3[3], offset); c3[1] = hc_bytealign_be (w3[1], w3[2], offset); c3[0] = hc_bytealign_be (w3[0], w3[1], offset); c2[3] = hc_bytealign_be (w2[3], w3[0], offset); c2[2] = hc_bytealign_be (w2[2], w2[3], offset); c2[1] = hc_bytealign_be (w2[1], w2[2], offset); c2[0] = hc_bytealign_be (w2[0], w2[1], offset); c1[3] = hc_bytealign_be (w1[3], w2[0], offset); c1[2] = hc_bytealign_be (w1[2], w1[3], offset); c1[1] = hc_bytealign_be (w1[1], w1[2], offset); c1[0] = hc_bytealign_be (w1[0], w1[1], offset); c0[3] = hc_bytealign_be (w0[3], w1[0], offset); c0[2] = hc_bytealign_be (w0[2], w0[3], offset); c0[1] = hc_bytealign_be (w0[1], w0[2], offset); c0[0] = hc_bytealign_be (w0[0], w0[1], offset); w3[3] = hc_bytealign_be ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV #if defined IS_NV const int selector = (0x76543210 >> ((offset & 3) * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> ((offset & 3) * 8)); #endif switch (offset_switch) { case 0: c0[0] = hc_byte_perm ( 0, w3[3], selector); w3[3] = hc_byte_perm (w3[3], w3[2], selector); w3[2] = hc_byte_perm (w3[2], w3[1], selector); w3[1] = hc_byte_perm (w3[1], w3[0], selector); w3[0] = hc_byte_perm (w3[0], w2[3], selector); w2[3] = hc_byte_perm (w2[3], w2[2], selector); w2[2] = hc_byte_perm (w2[2], w2[1], selector); w2[1] = hc_byte_perm (w2[1], w2[0], selector); w2[0] = hc_byte_perm (w2[0], w1[3], selector); w1[3] = hc_byte_perm (w1[3], w1[2], selector); w1[2] = hc_byte_perm (w1[2], w1[1], selector); w1[1] = hc_byte_perm (w1[1], w1[0], selector); w1[0] = hc_byte_perm (w1[0], w0[3], selector); w0[3] = hc_byte_perm (w0[3], w0[2], selector); w0[2] = hc_byte_perm (w0[2], w0[1], selector); w0[1] = hc_byte_perm (w0[1], w0[0], selector); w0[0] = hc_byte_perm (w0[0], 0, selector); break; case 1: c0[1] = hc_byte_perm ( 0, w3[3], selector); c0[0] = hc_byte_perm (w3[3], w3[2], selector); w3[3] = hc_byte_perm (w3[2], w3[1], selector); w3[2] = hc_byte_perm (w3[1], w3[0], selector); w3[1] = hc_byte_perm (w3[0], w2[3], selector); w3[0] = hc_byte_perm (w2[3], w2[2], selector); w2[3] = hc_byte_perm (w2[2], w2[1], selector); w2[2] = hc_byte_perm (w2[1], w2[0], selector); w2[1] = hc_byte_perm (w2[0], w1[3], selector); w2[0] = hc_byte_perm (w1[3], w1[2], selector); w1[3] = hc_byte_perm (w1[2], w1[1], selector); w1[2] = hc_byte_perm (w1[1], w1[0], selector); w1[1] = hc_byte_perm (w1[0], w0[3], selector); w1[0] = hc_byte_perm (w0[3], w0[2], selector); w0[3] = hc_byte_perm (w0[2], w0[1], selector); w0[2] = hc_byte_perm (w0[1], w0[0], selector); w0[1] = hc_byte_perm (w0[0], 0, selector); w0[0] = 0; break; case 2: c0[2] = hc_byte_perm ( 0, w3[3], selector); c0[1] = hc_byte_perm (w3[3], w3[2], selector); c0[0] = hc_byte_perm (w3[2], w3[1], selector); w3[3] = hc_byte_perm (w3[1], w3[0], selector); w3[2] = hc_byte_perm (w3[0], w2[3], selector); w3[1] = hc_byte_perm (w2[3], w2[2], selector); w3[0] = hc_byte_perm (w2[2], w2[1], selector); w2[3] = hc_byte_perm (w2[1], w2[0], selector); w2[2] = hc_byte_perm (w2[0], w1[3], selector); w2[1] = hc_byte_perm (w1[3], w1[2], selector); w2[0] = hc_byte_perm (w1[2], w1[1], selector); w1[3] = hc_byte_perm (w1[1], w1[0], selector); w1[2] = hc_byte_perm (w1[0], w0[3], selector); w1[1] = hc_byte_perm (w0[3], w0[2], selector); w1[0] = hc_byte_perm (w0[2], w0[1], selector); w0[3] = hc_byte_perm (w0[1], w0[0], selector); w0[2] = hc_byte_perm (w0[0], 0, selector); w0[1] = 0; w0[0] = 0; break; case 3: c0[3] = hc_byte_perm ( 0, w3[3], selector); c0[2] = hc_byte_perm (w3[3], w3[2], selector); c0[1] = hc_byte_perm (w3[2], w3[1], selector); c0[0] = hc_byte_perm (w3[1], w3[0], selector); w3[3] = hc_byte_perm (w3[0], w2[3], selector); w3[2] = hc_byte_perm (w2[3], w2[2], selector); w3[1] = hc_byte_perm (w2[2], w2[1], selector); w3[0] = hc_byte_perm (w2[1], w2[0], selector); w2[3] = hc_byte_perm (w2[0], w1[3], selector); w2[2] = hc_byte_perm (w1[3], w1[2], selector); w2[1] = hc_byte_perm (w1[2], w1[1], selector); w2[0] = hc_byte_perm (w1[1], w1[0], selector); w1[3] = hc_byte_perm (w1[0], w0[3], selector); w1[2] = hc_byte_perm (w0[3], w0[2], selector); w1[1] = hc_byte_perm (w0[2], w0[1], selector); w1[0] = hc_byte_perm (w0[1], w0[0], selector); w0[3] = hc_byte_perm (w0[0], 0, selector); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: c1[0] = hc_byte_perm ( 0, w3[3], selector); c0[3] = hc_byte_perm (w3[3], w3[2], selector); c0[2] = hc_byte_perm (w3[2], w3[1], selector); c0[1] = hc_byte_perm (w3[1], w3[0], selector); c0[0] = hc_byte_perm (w3[0], w2[3], selector); w3[3] = hc_byte_perm (w2[3], w2[2], selector); w3[2] = hc_byte_perm (w2[2], w2[1], selector); w3[1] = hc_byte_perm (w2[1], w2[0], selector); w3[0] = hc_byte_perm (w2[0], w1[3], selector); w2[3] = hc_byte_perm (w1[3], w1[2], selector); w2[2] = hc_byte_perm (w1[2], w1[1], selector); w2[1] = hc_byte_perm (w1[1], w1[0], selector); w2[0] = hc_byte_perm (w1[0], w0[3], selector); w1[3] = hc_byte_perm (w0[3], w0[2], selector); w1[2] = hc_byte_perm (w0[2], w0[1], selector); w1[1] = hc_byte_perm (w0[1], w0[0], selector); w1[0] = hc_byte_perm (w0[0], 0, selector); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: c1[1] = hc_byte_perm ( 0, w3[3], selector); c1[0] = hc_byte_perm (w3[3], w3[2], selector); c0[3] = hc_byte_perm (w3[2], w3[1], selector); c0[2] = hc_byte_perm (w3[1], w3[0], selector); c0[1] = hc_byte_perm (w3[0], w2[3], selector); c0[0] = hc_byte_perm (w2[3], w2[2], selector); w3[3] = hc_byte_perm (w2[2], w2[1], selector); w3[2] = hc_byte_perm (w2[1], w2[0], selector); w3[1] = hc_byte_perm (w2[0], w1[3], selector); w3[0] = hc_byte_perm (w1[3], w1[2], selector); w2[3] = hc_byte_perm (w1[2], w1[1], selector); w2[2] = hc_byte_perm (w1[1], w1[0], selector); w2[1] = hc_byte_perm (w1[0], w0[3], selector); w2[0] = hc_byte_perm (w0[3], w0[2], selector); w1[3] = hc_byte_perm (w0[2], w0[1], selector); w1[2] = hc_byte_perm (w0[1], w0[0], selector); w1[1] = hc_byte_perm (w0[0], 0, selector); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: c1[2] = hc_byte_perm ( 0, w3[3], selector); c1[1] = hc_byte_perm (w3[3], w3[2], selector); c1[0] = hc_byte_perm (w3[2], w3[1], selector); c0[3] = hc_byte_perm (w3[1], w3[0], selector); c0[2] = hc_byte_perm (w3[0], w2[3], selector); c0[1] = hc_byte_perm (w2[3], w2[2], selector); c0[0] = hc_byte_perm (w2[2], w2[1], selector); w3[3] = hc_byte_perm (w2[1], w2[0], selector); w3[2] = hc_byte_perm (w2[0], w1[3], selector); w3[1] = hc_byte_perm (w1[3], w1[2], selector); w3[0] = hc_byte_perm (w1[2], w1[1], selector); w2[3] = hc_byte_perm (w1[1], w1[0], selector); w2[2] = hc_byte_perm (w1[0], w0[3], selector); w2[1] = hc_byte_perm (w0[3], w0[2], selector); w2[0] = hc_byte_perm (w0[2], w0[1], selector); w1[3] = hc_byte_perm (w0[1], w0[0], selector); w1[2] = hc_byte_perm (w0[0], 0, selector); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: c1[3] = hc_byte_perm ( 0, w3[3], selector); c1[2] = hc_byte_perm (w3[3], w3[2], selector); c1[1] = hc_byte_perm (w3[2], w3[1], selector); c1[0] = hc_byte_perm (w3[1], w3[0], selector); c0[3] = hc_byte_perm (w3[0], w2[3], selector); c0[2] = hc_byte_perm (w2[3], w2[2], selector); c0[1] = hc_byte_perm (w2[2], w2[1], selector); c0[0] = hc_byte_perm (w2[1], w2[0], selector); w3[3] = hc_byte_perm (w2[0], w1[3], selector); w3[2] = hc_byte_perm (w1[3], w1[2], selector); w3[1] = hc_byte_perm (w1[2], w1[1], selector); w3[0] = hc_byte_perm (w1[1], w1[0], selector); w2[3] = hc_byte_perm (w1[0], w0[3], selector); w2[2] = hc_byte_perm (w0[3], w0[2], selector); w2[1] = hc_byte_perm (w0[2], w0[1], selector); w2[0] = hc_byte_perm (w0[1], w0[0], selector); w1[3] = hc_byte_perm (w0[0], 0, selector); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: c2[0] = hc_byte_perm ( 0, w3[3], selector); c1[3] = hc_byte_perm (w3[3], w3[2], selector); c1[2] = hc_byte_perm (w3[2], w3[1], selector); c1[1] = hc_byte_perm (w3[1], w3[0], selector); c1[0] = hc_byte_perm (w3[0], w2[3], selector); c0[3] = hc_byte_perm (w2[3], w2[2], selector); c0[2] = hc_byte_perm (w2[2], w2[1], selector); c0[1] = hc_byte_perm (w2[1], w2[0], selector); c0[0] = hc_byte_perm (w2[0], w1[3], selector); w3[3] = hc_byte_perm (w1[3], w1[2], selector); w3[2] = hc_byte_perm (w1[2], w1[1], selector); w3[1] = hc_byte_perm (w1[1], w1[0], selector); w3[0] = hc_byte_perm (w1[0], w0[3], selector); w2[3] = hc_byte_perm (w0[3], w0[2], selector); w2[2] = hc_byte_perm (w0[2], w0[1], selector); w2[1] = hc_byte_perm (w0[1], w0[0], selector); w2[0] = hc_byte_perm (w0[0], 0, selector); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: c2[1] = hc_byte_perm ( 0, w3[3], selector); c2[0] = hc_byte_perm (w3[3], w3[2], selector); c1[3] = hc_byte_perm (w3[2], w3[1], selector); c1[2] = hc_byte_perm (w3[1], w3[0], selector); c1[1] = hc_byte_perm (w3[0], w2[3], selector); c1[0] = hc_byte_perm (w2[3], w2[2], selector); c0[3] = hc_byte_perm (w2[2], w2[1], selector); c0[2] = hc_byte_perm (w2[1], w2[0], selector); c0[1] = hc_byte_perm (w2[0], w1[3], selector); c0[0] = hc_byte_perm (w1[3], w1[2], selector); w3[3] = hc_byte_perm (w1[2], w1[1], selector); w3[2] = hc_byte_perm (w1[1], w1[0], selector); w3[1] = hc_byte_perm (w1[0], w0[3], selector); w3[0] = hc_byte_perm (w0[3], w0[2], selector); w2[3] = hc_byte_perm (w0[2], w0[1], selector); w2[2] = hc_byte_perm (w0[1], w0[0], selector); w2[1] = hc_byte_perm (w0[0], 0, selector); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: c2[2] = hc_byte_perm ( 0, w3[3], selector); c2[1] = hc_byte_perm (w3[3], w3[2], selector); c2[0] = hc_byte_perm (w3[2], w3[1], selector); c1[3] = hc_byte_perm (w3[1], w3[0], selector); c1[2] = hc_byte_perm (w3[0], w2[3], selector); c1[1] = hc_byte_perm (w2[3], w2[2], selector); c1[0] = hc_byte_perm (w2[2], w2[1], selector); c0[3] = hc_byte_perm (w2[1], w2[0], selector); c0[2] = hc_byte_perm (w2[0], w1[3], selector); c0[1] = hc_byte_perm (w1[3], w1[2], selector); c0[0] = hc_byte_perm (w1[2], w1[1], selector); w3[3] = hc_byte_perm (w1[1], w1[0], selector); w3[2] = hc_byte_perm (w1[0], w0[3], selector); w3[1] = hc_byte_perm (w0[3], w0[2], selector); w3[0] = hc_byte_perm (w0[2], w0[1], selector); w2[3] = hc_byte_perm (w0[1], w0[0], selector); w2[2] = hc_byte_perm (w0[0], 0, selector); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: c2[3] = hc_byte_perm ( 0, w3[3], selector); c2[2] = hc_byte_perm (w3[3], w3[2], selector); c2[1] = hc_byte_perm (w3[2], w3[1], selector); c2[0] = hc_byte_perm (w3[1], w3[0], selector); c1[3] = hc_byte_perm (w3[0], w2[3], selector); c1[2] = hc_byte_perm (w2[3], w2[2], selector); c1[1] = hc_byte_perm (w2[2], w2[1], selector); c1[0] = hc_byte_perm (w2[1], w2[0], selector); c0[3] = hc_byte_perm (w2[0], w1[3], selector); c0[2] = hc_byte_perm (w1[3], w1[2], selector); c0[1] = hc_byte_perm (w1[2], w1[1], selector); c0[0] = hc_byte_perm (w1[1], w1[0], selector); w3[3] = hc_byte_perm (w1[0], w0[3], selector); w3[2] = hc_byte_perm (w0[3], w0[2], selector); w3[1] = hc_byte_perm (w0[2], w0[1], selector); w3[0] = hc_byte_perm (w0[1], w0[0], selector); w2[3] = hc_byte_perm (w0[0], 0, selector); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: c3[0] = hc_byte_perm ( 0, w3[3], selector); c2[3] = hc_byte_perm (w3[3], w3[2], selector); c2[2] = hc_byte_perm (w3[2], w3[1], selector); c2[1] = hc_byte_perm (w3[1], w3[0], selector); c2[0] = hc_byte_perm (w3[0], w2[3], selector); c1[3] = hc_byte_perm (w2[3], w2[2], selector); c1[2] = hc_byte_perm (w2[2], w2[1], selector); c1[1] = hc_byte_perm (w2[1], w2[0], selector); c1[0] = hc_byte_perm (w2[0], w1[3], selector); c0[3] = hc_byte_perm (w1[3], w1[2], selector); c0[2] = hc_byte_perm (w1[2], w1[1], selector); c0[1] = hc_byte_perm (w1[1], w1[0], selector); c0[0] = hc_byte_perm (w1[0], w0[3], selector); w3[3] = hc_byte_perm (w0[3], w0[2], selector); w3[2] = hc_byte_perm (w0[2], w0[1], selector); w3[1] = hc_byte_perm (w0[1], w0[0], selector); w3[0] = hc_byte_perm (w0[0], 0, selector); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: c3[1] = hc_byte_perm ( 0, w3[3], selector); c3[0] = hc_byte_perm (w3[3], w3[2], selector); c2[3] = hc_byte_perm (w3[2], w3[1], selector); c2[2] = hc_byte_perm (w3[1], w3[0], selector); c2[1] = hc_byte_perm (w3[0], w2[3], selector); c2[0] = hc_byte_perm (w2[3], w2[2], selector); c1[3] = hc_byte_perm (w2[2], w2[1], selector); c1[2] = hc_byte_perm (w2[1], w2[0], selector); c1[1] = hc_byte_perm (w2[0], w1[3], selector); c1[0] = hc_byte_perm (w1[3], w1[2], selector); c0[3] = hc_byte_perm (w1[2], w1[1], selector); c0[2] = hc_byte_perm (w1[1], w1[0], selector); c0[1] = hc_byte_perm (w1[0], w0[3], selector); c0[0] = hc_byte_perm (w0[3], w0[2], selector); w3[3] = hc_byte_perm (w0[2], w0[1], selector); w3[2] = hc_byte_perm (w0[1], w0[0], selector); w3[1] = hc_byte_perm (w0[0], 0, selector); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: c3[2] = hc_byte_perm ( 0, w3[3], selector); c3[1] = hc_byte_perm (w3[3], w3[2], selector); c3[0] = hc_byte_perm (w3[2], w3[1], selector); c2[3] = hc_byte_perm (w3[1], w3[0], selector); c2[2] = hc_byte_perm (w3[0], w2[3], selector); c2[1] = hc_byte_perm (w2[3], w2[2], selector); c2[0] = hc_byte_perm (w2[2], w2[1], selector); c1[3] = hc_byte_perm (w2[1], w2[0], selector); c1[2] = hc_byte_perm (w2[0], w1[3], selector); c1[1] = hc_byte_perm (w1[3], w1[2], selector); c1[0] = hc_byte_perm (w1[2], w1[1], selector); c0[3] = hc_byte_perm (w1[1], w1[0], selector); c0[2] = hc_byte_perm (w1[0], w0[3], selector); c0[1] = hc_byte_perm (w0[3], w0[2], selector); c0[0] = hc_byte_perm (w0[2], w0[1], selector); w3[3] = hc_byte_perm (w0[1], w0[0], selector); w3[2] = hc_byte_perm (w0[0], 0, selector); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: c3[3] = hc_byte_perm ( 0, w3[3], selector); c3[2] = hc_byte_perm (w3[3], w3[2], selector); c3[1] = hc_byte_perm (w3[2], w3[1], selector); c3[0] = hc_byte_perm (w3[1], w3[0], selector); c2[3] = hc_byte_perm (w3[0], w2[3], selector); c2[2] = hc_byte_perm (w2[3], w2[2], selector); c2[1] = hc_byte_perm (w2[2], w2[1], selector); c2[0] = hc_byte_perm (w2[1], w2[0], selector); c1[3] = hc_byte_perm (w2[0], w1[3], selector); c1[2] = hc_byte_perm (w1[3], w1[2], selector); c1[1] = hc_byte_perm (w1[2], w1[1], selector); c1[0] = hc_byte_perm (w1[1], w1[0], selector); c0[3] = hc_byte_perm (w1[0], w0[3], selector); c0[2] = hc_byte_perm (w0[3], w0[2], selector); c0[1] = hc_byte_perm (w0[2], w0[1], selector); c0[0] = hc_byte_perm (w0[1], w0[0], selector); w3[3] = hc_byte_perm (w0[0], 0, selector); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_8x4_le (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *w4, PRIVATE_AS u32x *w5, PRIVATE_AS u32x *w6, PRIVATE_AS u32x *w7, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: w7[3] = hc_bytealign (w7[2], w7[3], offset); w7[2] = hc_bytealign (w7[1], w7[2], offset); w7[1] = hc_bytealign (w7[0], w7[1], offset); w7[0] = hc_bytealign (w6[3], w7[0], offset); w6[3] = hc_bytealign (w6[2], w6[3], offset); w6[2] = hc_bytealign (w6[1], w6[2], offset); w6[1] = hc_bytealign (w6[0], w6[1], offset); w6[0] = hc_bytealign (w5[3], w6[0], offset); w5[3] = hc_bytealign (w5[2], w5[3], offset); w5[2] = hc_bytealign (w5[1], w5[2], offset); w5[1] = hc_bytealign (w5[0], w5[1], offset); w5[0] = hc_bytealign (w4[3], w5[0], offset); w4[3] = hc_bytealign (w4[2], w4[3], offset); w4[2] = hc_bytealign (w4[1], w4[2], offset); w4[1] = hc_bytealign (w4[0], w4[1], offset); w4[0] = hc_bytealign (w3[3], w4[0], offset); w3[3] = hc_bytealign (w3[2], w3[3], offset); w3[2] = hc_bytealign (w3[1], w3[2], offset); w3[1] = hc_bytealign (w3[0], w3[1], offset); w3[0] = hc_bytealign (w2[3], w3[0], offset); w2[3] = hc_bytealign (w2[2], w2[3], offset); w2[2] = hc_bytealign (w2[1], w2[2], offset); w2[1] = hc_bytealign (w2[0], w2[1], offset); w2[0] = hc_bytealign (w1[3], w2[0], offset); w1[3] = hc_bytealign (w1[2], w1[3], offset); w1[2] = hc_bytealign (w1[1], w1[2], offset); w1[1] = hc_bytealign (w1[0], w1[1], offset); w1[0] = hc_bytealign (w0[3], w1[0], offset); w0[3] = hc_bytealign (w0[2], w0[3], offset); w0[2] = hc_bytealign (w0[1], w0[2], offset); w0[1] = hc_bytealign (w0[0], w0[1], offset); w0[0] = hc_bytealign ( 0, w0[0], offset); break; case 1: w7[3] = hc_bytealign (w7[1], w7[2], offset); w7[2] = hc_bytealign (w7[0], w7[1], offset); w7[1] = hc_bytealign (w6[3], w7[0], offset); w7[0] = hc_bytealign (w6[2], w6[3], offset); w6[3] = hc_bytealign (w6[1], w6[2], offset); w6[2] = hc_bytealign (w6[0], w6[1], offset); w6[1] = hc_bytealign (w5[3], w6[0], offset); w6[0] = hc_bytealign (w5[2], w5[3], offset); w5[3] = hc_bytealign (w5[1], w5[2], offset); w5[2] = hc_bytealign (w5[0], w5[1], offset); w5[1] = hc_bytealign (w4[3], w5[0], offset); w5[0] = hc_bytealign (w4[2], w4[3], offset); w4[3] = hc_bytealign (w4[1], w4[2], offset); w4[2] = hc_bytealign (w4[0], w4[1], offset); w4[1] = hc_bytealign (w3[3], w4[0], offset); w4[0] = hc_bytealign (w3[2], w3[3], offset); w3[3] = hc_bytealign (w3[1], w3[2], offset); w3[2] = hc_bytealign (w3[0], w3[1], offset); w3[1] = hc_bytealign (w2[3], w3[0], offset); w3[0] = hc_bytealign (w2[2], w2[3], offset); w2[3] = hc_bytealign (w2[1], w2[2], offset); w2[2] = hc_bytealign (w2[0], w2[1], offset); w2[1] = hc_bytealign (w1[3], w2[0], offset); w2[0] = hc_bytealign (w1[2], w1[3], offset); w1[3] = hc_bytealign (w1[1], w1[2], offset); w1[2] = hc_bytealign (w1[0], w1[1], offset); w1[1] = hc_bytealign (w0[3], w1[0], offset); w1[0] = hc_bytealign (w0[2], w0[3], offset); w0[3] = hc_bytealign (w0[1], w0[2], offset); w0[2] = hc_bytealign (w0[0], w0[1], offset); w0[1] = hc_bytealign ( 0, w0[0], offset); w0[0] = 0; break; case 2: w7[3] = hc_bytealign (w7[0], w7[1], offset); w7[2] = hc_bytealign (w6[3], w7[0], offset); w7[1] = hc_bytealign (w6[2], w6[3], offset); w7[0] = hc_bytealign (w6[1], w6[2], offset); w6[3] = hc_bytealign (w6[0], w6[1], offset); w6[2] = hc_bytealign (w5[3], w6[0], offset); w6[1] = hc_bytealign (w5[2], w5[3], offset); w6[0] = hc_bytealign (w5[1], w5[2], offset); w5[3] = hc_bytealign (w5[0], w5[1], offset); w5[2] = hc_bytealign (w4[3], w5[0], offset); w5[1] = hc_bytealign (w4[2], w4[3], offset); w5[0] = hc_bytealign (w4[1], w4[2], offset); w4[3] = hc_bytealign (w4[0], w4[1], offset); w4[2] = hc_bytealign (w3[3], w4[0], offset); w4[1] = hc_bytealign (w3[2], w3[3], offset); w4[0] = hc_bytealign (w3[1], w3[2], offset); w3[3] = hc_bytealign (w3[0], w3[1], offset); w3[2] = hc_bytealign (w2[3], w3[0], offset); w3[1] = hc_bytealign (w2[2], w2[3], offset); w3[0] = hc_bytealign (w2[1], w2[2], offset); w2[3] = hc_bytealign (w2[0], w2[1], offset); w2[2] = hc_bytealign (w1[3], w2[0], offset); w2[1] = hc_bytealign (w1[2], w1[3], offset); w2[0] = hc_bytealign (w1[1], w1[2], offset); w1[3] = hc_bytealign (w1[0], w1[1], offset); w1[2] = hc_bytealign (w0[3], w1[0], offset); w1[1] = hc_bytealign (w0[2], w0[3], offset); w1[0] = hc_bytealign (w0[1], w0[2], offset); w0[3] = hc_bytealign (w0[0], w0[1], offset); w0[2] = hc_bytealign ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: w7[3] = hc_bytealign (w6[3], w7[0], offset); w7[2] = hc_bytealign (w6[2], w6[3], offset); w7[1] = hc_bytealign (w6[1], w6[2], offset); w7[0] = hc_bytealign (w6[0], w6[1], offset); w6[3] = hc_bytealign (w5[3], w6[0], offset); w6[2] = hc_bytealign (w5[2], w5[3], offset); w6[1] = hc_bytealign (w5[1], w5[2], offset); w6[0] = hc_bytealign (w5[0], w5[1], offset); w5[3] = hc_bytealign (w4[3], w5[0], offset); w5[2] = hc_bytealign (w4[2], w4[3], offset); w5[1] = hc_bytealign (w4[1], w4[2], offset); w5[0] = hc_bytealign (w4[0], w4[1], offset); w4[3] = hc_bytealign (w3[3], w4[0], offset); w4[2] = hc_bytealign (w3[2], w3[3], offset); w4[1] = hc_bytealign (w3[1], w3[2], offset); w4[0] = hc_bytealign (w3[0], w3[1], offset); w3[3] = hc_bytealign (w2[3], w3[0], offset); w3[2] = hc_bytealign (w2[2], w2[3], offset); w3[1] = hc_bytealign (w2[1], w2[2], offset); w3[0] = hc_bytealign (w2[0], w2[1], offset); w2[3] = hc_bytealign (w1[3], w2[0], offset); w2[2] = hc_bytealign (w1[2], w1[3], offset); w2[1] = hc_bytealign (w1[1], w1[2], offset); w2[0] = hc_bytealign (w1[0], w1[1], offset); w1[3] = hc_bytealign (w0[3], w1[0], offset); w1[2] = hc_bytealign (w0[2], w0[3], offset); w1[1] = hc_bytealign (w0[1], w0[2], offset); w1[0] = hc_bytealign (w0[0], w0[1], offset); w0[3] = hc_bytealign ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: w7[3] = hc_bytealign (w6[2], w6[3], offset); w7[2] = hc_bytealign (w6[1], w6[2], offset); w7[1] = hc_bytealign (w6[0], w6[1], offset); w7[0] = hc_bytealign (w5[3], w6[0], offset); w6[3] = hc_bytealign (w5[2], w5[3], offset); w6[2] = hc_bytealign (w5[1], w5[2], offset); w6[1] = hc_bytealign (w5[0], w5[1], offset); w6[0] = hc_bytealign (w4[3], w5[0], offset); w5[3] = hc_bytealign (w4[2], w4[3], offset); w5[2] = hc_bytealign (w4[1], w4[2], offset); w5[1] = hc_bytealign (w4[0], w4[1], offset); w5[0] = hc_bytealign (w3[3], w4[0], offset); w4[3] = hc_bytealign (w3[2], w3[3], offset); w4[2] = hc_bytealign (w3[1], w3[2], offset); w4[1] = hc_bytealign (w3[0], w3[1], offset); w4[0] = hc_bytealign (w2[3], w3[0], offset); w3[3] = hc_bytealign (w2[2], w2[3], offset); w3[2] = hc_bytealign (w2[1], w2[2], offset); w3[1] = hc_bytealign (w2[0], w2[1], offset); w3[0] = hc_bytealign (w1[3], w2[0], offset); w2[3] = hc_bytealign (w1[2], w1[3], offset); w2[2] = hc_bytealign (w1[1], w1[2], offset); w2[1] = hc_bytealign (w1[0], w1[1], offset); w2[0] = hc_bytealign (w0[3], w1[0], offset); w1[3] = hc_bytealign (w0[2], w0[3], offset); w1[2] = hc_bytealign (w0[1], w0[2], offset); w1[1] = hc_bytealign (w0[0], w0[1], offset); w1[0] = hc_bytealign ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: w7[3] = hc_bytealign (w6[1], w6[2], offset); w7[2] = hc_bytealign (w6[0], w6[1], offset); w7[1] = hc_bytealign (w5[3], w6[0], offset); w7[0] = hc_bytealign (w5[2], w5[3], offset); w6[3] = hc_bytealign (w5[1], w5[2], offset); w6[2] = hc_bytealign (w5[0], w5[1], offset); w6[1] = hc_bytealign (w4[3], w5[0], offset); w6[0] = hc_bytealign (w4[2], w4[3], offset); w5[3] = hc_bytealign (w4[1], w4[2], offset); w5[2] = hc_bytealign (w4[0], w4[1], offset); w5[1] = hc_bytealign (w3[3], w4[0], offset); w5[0] = hc_bytealign (w3[2], w3[3], offset); w4[3] = hc_bytealign (w3[1], w3[2], offset); w4[2] = hc_bytealign (w3[0], w3[1], offset); w4[1] = hc_bytealign (w2[3], w3[0], offset); w4[0] = hc_bytealign (w2[2], w2[3], offset); w3[3] = hc_bytealign (w2[1], w2[2], offset); w3[2] = hc_bytealign (w2[0], w2[1], offset); w3[1] = hc_bytealign (w1[3], w2[0], offset); w3[0] = hc_bytealign (w1[2], w1[3], offset); w2[3] = hc_bytealign (w1[1], w1[2], offset); w2[2] = hc_bytealign (w1[0], w1[1], offset); w2[1] = hc_bytealign (w0[3], w1[0], offset); w2[0] = hc_bytealign (w0[2], w0[3], offset); w1[3] = hc_bytealign (w0[1], w0[2], offset); w1[2] = hc_bytealign (w0[0], w0[1], offset); w1[1] = hc_bytealign ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: w7[3] = hc_bytealign (w6[0], w6[1], offset); w7[2] = hc_bytealign (w5[3], w6[0], offset); w7[1] = hc_bytealign (w5[2], w5[3], offset); w7[0] = hc_bytealign (w5[1], w5[2], offset); w6[3] = hc_bytealign (w5[0], w5[1], offset); w6[2] = hc_bytealign (w4[3], w5[0], offset); w6[1] = hc_bytealign (w4[2], w4[3], offset); w6[0] = hc_bytealign (w4[1], w4[2], offset); w5[3] = hc_bytealign (w4[0], w4[1], offset); w5[2] = hc_bytealign (w3[3], w4[0], offset); w5[1] = hc_bytealign (w3[2], w3[3], offset); w5[0] = hc_bytealign (w3[1], w3[2], offset); w4[3] = hc_bytealign (w3[0], w3[1], offset); w4[2] = hc_bytealign (w2[3], w3[0], offset); w4[1] = hc_bytealign (w2[2], w2[3], offset); w4[0] = hc_bytealign (w2[1], w2[2], offset); w3[3] = hc_bytealign (w2[0], w2[1], offset); w3[2] = hc_bytealign (w1[3], w2[0], offset); w3[1] = hc_bytealign (w1[2], w1[3], offset); w3[0] = hc_bytealign (w1[1], w1[2], offset); w2[3] = hc_bytealign (w1[0], w1[1], offset); w2[2] = hc_bytealign (w0[3], w1[0], offset); w2[1] = hc_bytealign (w0[2], w0[3], offset); w2[0] = hc_bytealign (w0[1], w0[2], offset); w1[3] = hc_bytealign (w0[0], w0[1], offset); w1[2] = hc_bytealign ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: w7[3] = hc_bytealign (w5[3], w6[0], offset); w7[2] = hc_bytealign (w5[2], w5[3], offset); w7[1] = hc_bytealign (w5[1], w5[2], offset); w7[0] = hc_bytealign (w5[0], w5[1], offset); w6[3] = hc_bytealign (w4[3], w5[0], offset); w6[2] = hc_bytealign (w4[2], w4[3], offset); w6[1] = hc_bytealign (w4[1], w4[2], offset); w6[0] = hc_bytealign (w4[0], w4[1], offset); w5[3] = hc_bytealign (w3[3], w4[0], offset); w5[2] = hc_bytealign (w3[2], w3[3], offset); w5[1] = hc_bytealign (w3[1], w3[2], offset); w5[0] = hc_bytealign (w3[0], w3[1], offset); w4[3] = hc_bytealign (w2[3], w3[0], offset); w4[2] = hc_bytealign (w2[2], w2[3], offset); w4[1] = hc_bytealign (w2[1], w2[2], offset); w4[0] = hc_bytealign (w2[0], w2[1], offset); w3[3] = hc_bytealign (w1[3], w2[0], offset); w3[2] = hc_bytealign (w1[2], w1[3], offset); w3[1] = hc_bytealign (w1[1], w1[2], offset); w3[0] = hc_bytealign (w1[0], w1[1], offset); w2[3] = hc_bytealign (w0[3], w1[0], offset); w2[2] = hc_bytealign (w0[2], w0[3], offset); w2[1] = hc_bytealign (w0[1], w0[2], offset); w2[0] = hc_bytealign (w0[0], w0[1], offset); w1[3] = hc_bytealign ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: w7[3] = hc_bytealign (w5[2], w5[3], offset); w7[2] = hc_bytealign (w5[1], w5[2], offset); w7[1] = hc_bytealign (w5[0], w5[1], offset); w7[0] = hc_bytealign (w4[3], w5[0], offset); w6[3] = hc_bytealign (w4[2], w4[3], offset); w6[2] = hc_bytealign (w4[1], w4[2], offset); w6[1] = hc_bytealign (w4[0], w4[1], offset); w6[0] = hc_bytealign (w3[3], w4[0], offset); w5[3] = hc_bytealign (w3[2], w3[3], offset); w5[2] = hc_bytealign (w3[1], w3[2], offset); w5[1] = hc_bytealign (w3[0], w3[1], offset); w5[0] = hc_bytealign (w2[3], w3[0], offset); w4[3] = hc_bytealign (w2[2], w2[3], offset); w4[2] = hc_bytealign (w2[1], w2[2], offset); w4[1] = hc_bytealign (w2[0], w2[1], offset); w4[0] = hc_bytealign (w1[3], w2[0], offset); w3[3] = hc_bytealign (w1[2], w1[3], offset); w3[2] = hc_bytealign (w1[1], w1[2], offset); w3[1] = hc_bytealign (w1[0], w1[1], offset); w3[0] = hc_bytealign (w0[3], w1[0], offset); w2[3] = hc_bytealign (w0[2], w0[3], offset); w2[2] = hc_bytealign (w0[1], w0[2], offset); w2[1] = hc_bytealign (w0[0], w0[1], offset); w2[0] = hc_bytealign ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: w7[3] = hc_bytealign (w5[1], w5[2], offset); w7[2] = hc_bytealign (w5[0], w5[1], offset); w7[1] = hc_bytealign (w4[3], w5[0], offset); w7[0] = hc_bytealign (w4[2], w4[3], offset); w6[3] = hc_bytealign (w4[1], w4[2], offset); w6[2] = hc_bytealign (w4[0], w4[1], offset); w6[1] = hc_bytealign (w3[3], w4[0], offset); w6[0] = hc_bytealign (w3[2], w3[3], offset); w5[3] = hc_bytealign (w3[1], w3[2], offset); w5[2] = hc_bytealign (w3[0], w3[1], offset); w5[1] = hc_bytealign (w2[3], w3[0], offset); w5[0] = hc_bytealign (w2[2], w2[3], offset); w4[3] = hc_bytealign (w2[1], w2[2], offset); w4[2] = hc_bytealign (w2[0], w2[1], offset); w4[1] = hc_bytealign (w1[3], w2[0], offset); w4[0] = hc_bytealign (w1[2], w1[3], offset); w3[3] = hc_bytealign (w1[1], w1[2], offset); w3[2] = hc_bytealign (w1[0], w1[1], offset); w3[1] = hc_bytealign (w0[3], w1[0], offset); w3[0] = hc_bytealign (w0[2], w0[3], offset); w2[3] = hc_bytealign (w0[1], w0[2], offset); w2[2] = hc_bytealign (w0[0], w0[1], offset); w2[1] = hc_bytealign ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: w7[3] = hc_bytealign (w5[0], w5[1], offset); w7[2] = hc_bytealign (w4[3], w5[0], offset); w7[1] = hc_bytealign (w4[2], w4[3], offset); w7[0] = hc_bytealign (w4[1], w4[2], offset); w6[3] = hc_bytealign (w4[0], w4[1], offset); w6[2] = hc_bytealign (w3[3], w4[0], offset); w6[1] = hc_bytealign (w3[2], w3[3], offset); w6[0] = hc_bytealign (w3[1], w3[2], offset); w5[3] = hc_bytealign (w3[0], w3[1], offset); w5[2] = hc_bytealign (w2[3], w3[0], offset); w5[1] = hc_bytealign (w2[2], w2[3], offset); w5[0] = hc_bytealign (w2[1], w2[2], offset); w4[3] = hc_bytealign (w2[0], w2[1], offset); w4[2] = hc_bytealign (w1[3], w2[0], offset); w4[1] = hc_bytealign (w1[2], w1[3], offset); w4[0] = hc_bytealign (w1[1], w1[2], offset); w3[3] = hc_bytealign (w1[0], w1[1], offset); w3[2] = hc_bytealign (w0[3], w1[0], offset); w3[1] = hc_bytealign (w0[2], w0[3], offset); w3[0] = hc_bytealign (w0[1], w0[2], offset); w2[3] = hc_bytealign (w0[0], w0[1], offset); w2[2] = hc_bytealign ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: w7[3] = hc_bytealign (w4[3], w5[0], offset); w7[2] = hc_bytealign (w4[2], w4[3], offset); w7[1] = hc_bytealign (w4[1], w4[2], offset); w7[0] = hc_bytealign (w4[0], w4[1], offset); w6[3] = hc_bytealign (w3[3], w4[0], offset); w6[2] = hc_bytealign (w3[2], w3[3], offset); w6[1] = hc_bytealign (w3[1], w3[2], offset); w6[0] = hc_bytealign (w3[0], w3[1], offset); w5[3] = hc_bytealign (w2[3], w3[0], offset); w5[2] = hc_bytealign (w2[2], w2[3], offset); w5[1] = hc_bytealign (w2[1], w2[2], offset); w5[0] = hc_bytealign (w2[0], w2[1], offset); w4[3] = hc_bytealign (w1[3], w2[0], offset); w4[2] = hc_bytealign (w1[2], w1[3], offset); w4[1] = hc_bytealign (w1[1], w1[2], offset); w4[0] = hc_bytealign (w1[0], w1[1], offset); w3[3] = hc_bytealign (w0[3], w1[0], offset); w3[2] = hc_bytealign (w0[2], w0[3], offset); w3[1] = hc_bytealign (w0[1], w0[2], offset); w3[0] = hc_bytealign (w0[0], w0[1], offset); w2[3] = hc_bytealign ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: w7[3] = hc_bytealign (w4[2], w4[3], offset); w7[2] = hc_bytealign (w4[1], w4[2], offset); w7[1] = hc_bytealign (w4[0], w4[1], offset); w7[0] = hc_bytealign (w3[3], w4[0], offset); w6[3] = hc_bytealign (w3[2], w3[3], offset); w6[2] = hc_bytealign (w3[1], w3[2], offset); w6[1] = hc_bytealign (w3[0], w3[1], offset); w6[0] = hc_bytealign (w2[3], w3[0], offset); w5[3] = hc_bytealign (w2[2], w2[3], offset); w5[2] = hc_bytealign (w2[1], w2[2], offset); w5[1] = hc_bytealign (w2[0], w2[1], offset); w5[0] = hc_bytealign (w1[3], w2[0], offset); w4[3] = hc_bytealign (w1[2], w1[3], offset); w4[2] = hc_bytealign (w1[1], w1[2], offset); w4[1] = hc_bytealign (w1[0], w1[1], offset); w4[0] = hc_bytealign (w0[3], w1[0], offset); w3[3] = hc_bytealign (w0[2], w0[3], offset); w3[2] = hc_bytealign (w0[1], w0[2], offset); w3[1] = hc_bytealign (w0[0], w0[1], offset); w3[0] = hc_bytealign ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: w7[3] = hc_bytealign (w4[1], w4[2], offset); w7[2] = hc_bytealign (w4[0], w4[1], offset); w7[1] = hc_bytealign (w3[3], w4[0], offset); w7[0] = hc_bytealign (w3[2], w3[3], offset); w6[3] = hc_bytealign (w3[1], w3[2], offset); w6[2] = hc_bytealign (w3[0], w3[1], offset); w6[1] = hc_bytealign (w2[3], w3[0], offset); w6[0] = hc_bytealign (w2[2], w2[3], offset); w5[3] = hc_bytealign (w2[1], w2[2], offset); w5[2] = hc_bytealign (w2[0], w2[1], offset); w5[1] = hc_bytealign (w1[3], w2[0], offset); w5[0] = hc_bytealign (w1[2], w1[3], offset); w4[3] = hc_bytealign (w1[1], w1[2], offset); w4[2] = hc_bytealign (w1[0], w1[1], offset); w4[1] = hc_bytealign (w0[3], w1[0], offset); w4[0] = hc_bytealign (w0[2], w0[3], offset); w3[3] = hc_bytealign (w0[1], w0[2], offset); w3[2] = hc_bytealign (w0[0], w0[1], offset); w3[1] = hc_bytealign ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: w7[3] = hc_bytealign (w4[0], w4[1], offset); w7[2] = hc_bytealign (w3[3], w4[0], offset); w7[1] = hc_bytealign (w3[2], w3[3], offset); w7[0] = hc_bytealign (w3[1], w3[2], offset); w6[3] = hc_bytealign (w3[0], w3[1], offset); w6[2] = hc_bytealign (w2[3], w3[0], offset); w6[1] = hc_bytealign (w2[2], w2[3], offset); w6[0] = hc_bytealign (w2[1], w2[2], offset); w5[3] = hc_bytealign (w2[0], w2[1], offset); w5[2] = hc_bytealign (w1[3], w2[0], offset); w5[1] = hc_bytealign (w1[2], w1[3], offset); w5[0] = hc_bytealign (w1[1], w1[2], offset); w4[3] = hc_bytealign (w1[0], w1[1], offset); w4[2] = hc_bytealign (w0[3], w1[0], offset); w4[1] = hc_bytealign (w0[2], w0[3], offset); w4[0] = hc_bytealign (w0[1], w0[2], offset); w3[3] = hc_bytealign (w0[0], w0[1], offset); w3[2] = hc_bytealign ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: w7[3] = hc_bytealign (w3[3], w4[0], offset); w7[2] = hc_bytealign (w3[2], w3[3], offset); w7[1] = hc_bytealign (w3[1], w3[2], offset); w7[0] = hc_bytealign (w3[0], w3[1], offset); w6[3] = hc_bytealign (w2[3], w3[0], offset); w6[2] = hc_bytealign (w2[2], w2[3], offset); w6[1] = hc_bytealign (w2[1], w2[2], offset); w6[0] = hc_bytealign (w2[0], w2[1], offset); w5[3] = hc_bytealign (w1[3], w2[0], offset); w5[2] = hc_bytealign (w1[2], w1[3], offset); w5[1] = hc_bytealign (w1[1], w1[2], offset); w5[0] = hc_bytealign (w1[0], w1[1], offset); w4[3] = hc_bytealign (w0[3], w1[0], offset); w4[2] = hc_bytealign (w0[2], w0[3], offset); w4[1] = hc_bytealign (w0[1], w0[2], offset); w4[0] = hc_bytealign (w0[0], w0[1], offset); w3[3] = hc_bytealign ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 16: w7[3] = hc_bytealign (w3[2], w3[3], offset); w7[2] = hc_bytealign (w3[1], w3[2], offset); w7[1] = hc_bytealign (w3[0], w3[1], offset); w7[0] = hc_bytealign (w2[3], w3[0], offset); w6[3] = hc_bytealign (w2[2], w2[3], offset); w6[2] = hc_bytealign (w2[1], w2[2], offset); w6[1] = hc_bytealign (w2[0], w2[1], offset); w6[0] = hc_bytealign (w1[3], w2[0], offset); w5[3] = hc_bytealign (w1[2], w1[3], offset); w5[2] = hc_bytealign (w1[1], w1[2], offset); w5[1] = hc_bytealign (w1[0], w1[1], offset); w5[0] = hc_bytealign (w0[3], w1[0], offset); w4[3] = hc_bytealign (w0[2], w0[3], offset); w4[2] = hc_bytealign (w0[1], w0[2], offset); w4[1] = hc_bytealign (w0[0], w0[1], offset); w4[0] = hc_bytealign ( 0, w0[0], offset); w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 17: w7[3] = hc_bytealign (w3[1], w3[2], offset); w7[2] = hc_bytealign (w3[0], w3[1], offset); w7[1] = hc_bytealign (w2[3], w3[0], offset); w7[0] = hc_bytealign (w2[2], w2[3], offset); w6[3] = hc_bytealign (w2[1], w2[2], offset); w6[2] = hc_bytealign (w2[0], w2[1], offset); w6[1] = hc_bytealign (w1[3], w2[0], offset); w6[0] = hc_bytealign (w1[2], w1[3], offset); w5[3] = hc_bytealign (w1[1], w1[2], offset); w5[2] = hc_bytealign (w1[0], w1[1], offset); w5[1] = hc_bytealign (w0[3], w1[0], offset); w5[0] = hc_bytealign (w0[2], w0[3], offset); w4[3] = hc_bytealign (w0[1], w0[2], offset); w4[2] = hc_bytealign (w0[0], w0[1], offset); w4[1] = hc_bytealign ( 0, w0[0], offset); w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 18: w7[3] = hc_bytealign (w3[0], w3[1], offset); w7[2] = hc_bytealign (w2[3], w3[0], offset); w7[1] = hc_bytealign (w2[2], w2[3], offset); w7[0] = hc_bytealign (w2[1], w2[2], offset); w6[3] = hc_bytealign (w2[0], w2[1], offset); w6[2] = hc_bytealign (w1[3], w2[0], offset); w6[1] = hc_bytealign (w1[2], w1[3], offset); w6[0] = hc_bytealign (w1[1], w1[2], offset); w5[3] = hc_bytealign (w1[0], w1[1], offset); w5[2] = hc_bytealign (w0[3], w1[0], offset); w5[1] = hc_bytealign (w0[2], w0[3], offset); w5[0] = hc_bytealign (w0[1], w0[2], offset); w4[3] = hc_bytealign (w0[0], w0[1], offset); w4[2] = hc_bytealign ( 0, w0[0], offset); w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 19: w7[3] = hc_bytealign (w2[3], w3[0], offset); w7[2] = hc_bytealign (w2[2], w2[3], offset); w7[1] = hc_bytealign (w2[1], w2[2], offset); w7[0] = hc_bytealign (w2[0], w2[1], offset); w6[3] = hc_bytealign (w1[3], w2[0], offset); w6[2] = hc_bytealign (w1[2], w1[3], offset); w6[1] = hc_bytealign (w1[1], w1[2], offset); w6[0] = hc_bytealign (w1[0], w1[1], offset); w5[3] = hc_bytealign (w0[3], w1[0], offset); w5[2] = hc_bytealign (w0[2], w0[3], offset); w5[1] = hc_bytealign (w0[1], w0[2], offset); w5[0] = hc_bytealign (w0[0], w0[1], offset); w4[3] = hc_bytealign ( 0, w0[0], offset); w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 20: w7[3] = hc_bytealign (w2[2], w2[3], offset); w7[2] = hc_bytealign (w2[1], w2[2], offset); w7[1] = hc_bytealign (w2[0], w2[1], offset); w7[0] = hc_bytealign (w1[3], w2[0], offset); w6[3] = hc_bytealign (w1[2], w1[3], offset); w6[2] = hc_bytealign (w1[1], w1[2], offset); w6[1] = hc_bytealign (w1[0], w1[1], offset); w6[0] = hc_bytealign (w0[3], w1[0], offset); w5[3] = hc_bytealign (w0[2], w0[3], offset); w5[2] = hc_bytealign (w0[1], w0[2], offset); w5[1] = hc_bytealign (w0[0], w0[1], offset); w5[0] = hc_bytealign ( 0, w0[0], offset); w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 21: w7[3] = hc_bytealign (w2[1], w2[2], offset); w7[2] = hc_bytealign (w2[0], w2[1], offset); w7[1] = hc_bytealign (w1[3], w2[0], offset); w7[0] = hc_bytealign (w1[2], w1[3], offset); w6[3] = hc_bytealign (w1[1], w1[2], offset); w6[2] = hc_bytealign (w1[0], w1[1], offset); w6[1] = hc_bytealign (w0[3], w1[0], offset); w6[0] = hc_bytealign (w0[2], w0[3], offset); w5[3] = hc_bytealign (w0[1], w0[2], offset); w5[2] = hc_bytealign (w0[0], w0[1], offset); w5[1] = hc_bytealign ( 0, w0[0], offset); w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 22: w7[3] = hc_bytealign (w2[0], w2[1], offset); w7[2] = hc_bytealign (w1[3], w2[0], offset); w7[1] = hc_bytealign (w1[2], w1[3], offset); w7[0] = hc_bytealign (w1[1], w1[2], offset); w6[3] = hc_bytealign (w1[0], w1[1], offset); w6[2] = hc_bytealign (w0[3], w1[0], offset); w6[1] = hc_bytealign (w0[2], w0[3], offset); w6[0] = hc_bytealign (w0[1], w0[2], offset); w5[3] = hc_bytealign (w0[0], w0[1], offset); w5[2] = hc_bytealign ( 0, w0[0], offset); w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 23: w7[3] = hc_bytealign (w1[3], w2[0], offset); w7[2] = hc_bytealign (w1[2], w1[3], offset); w7[1] = hc_bytealign (w1[1], w1[2], offset); w7[0] = hc_bytealign (w1[0], w1[1], offset); w6[3] = hc_bytealign (w0[3], w1[0], offset); w6[2] = hc_bytealign (w0[2], w0[3], offset); w6[1] = hc_bytealign (w0[1], w0[2], offset); w6[0] = hc_bytealign (w0[0], w0[1], offset); w5[3] = hc_bytealign ( 0, w0[0], offset); w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 24: w7[3] = hc_bytealign (w1[2], w1[3], offset); w7[2] = hc_bytealign (w1[1], w1[2], offset); w7[1] = hc_bytealign (w1[0], w1[1], offset); w7[0] = hc_bytealign (w0[3], w1[0], offset); w6[3] = hc_bytealign (w0[2], w0[3], offset); w6[2] = hc_bytealign (w0[1], w0[2], offset); w6[1] = hc_bytealign (w0[0], w0[1], offset); w6[0] = hc_bytealign ( 0, w0[0], offset); w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 25: w7[3] = hc_bytealign (w1[1], w1[2], offset); w7[2] = hc_bytealign (w1[0], w1[1], offset); w7[1] = hc_bytealign (w0[3], w1[0], offset); w7[0] = hc_bytealign (w0[2], w0[3], offset); w6[3] = hc_bytealign (w0[1], w0[2], offset); w6[2] = hc_bytealign (w0[0], w0[1], offset); w6[1] = hc_bytealign ( 0, w0[0], offset); w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 26: w7[3] = hc_bytealign (w1[0], w1[1], offset); w7[2] = hc_bytealign (w0[3], w1[0], offset); w7[1] = hc_bytealign (w0[2], w0[3], offset); w7[0] = hc_bytealign (w0[1], w0[2], offset); w6[3] = hc_bytealign (w0[0], w0[1], offset); w6[2] = hc_bytealign ( 0, w0[0], offset); w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 27: w7[3] = hc_bytealign (w0[3], w1[0], offset); w7[2] = hc_bytealign (w0[2], w0[3], offset); w7[1] = hc_bytealign (w0[1], w0[2], offset); w7[0] = hc_bytealign (w0[0], w0[1], offset); w6[3] = hc_bytealign ( 0, w0[0], offset); w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 28: w7[3] = hc_bytealign (w0[2], w0[3], offset); w7[2] = hc_bytealign (w0[1], w0[2], offset); w7[1] = hc_bytealign (w0[0], w0[1], offset); w7[0] = hc_bytealign ( 0, w0[0], offset); w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 29: w7[3] = hc_bytealign (w0[1], w0[2], offset); w7[2] = hc_bytealign (w0[0], w0[1], offset); w7[1] = hc_bytealign ( 0, w0[0], offset); w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 30: w7[3] = hc_bytealign (w0[0], w0[1], offset); w7[2] = hc_bytealign ( 0, w0[0], offset); w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 31: w7[3] = hc_bytealign ( 0, w0[0], offset); w7[2] = 0; w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV const int offset_mod_4 = offset & 3; const int offset_minus_4 = 4 - offset_mod_4; #if defined IS_NV const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> (offset_minus_4 * 8)); #endif switch (offset_switch) { case 0: w7[3] = hc_byte_perm (w7[2], w7[3], selector); w7[2] = hc_byte_perm (w7[1], w7[2], selector); w7[1] = hc_byte_perm (w7[0], w7[1], selector); w7[0] = hc_byte_perm (w6[3], w7[0], selector); w6[3] = hc_byte_perm (w6[2], w6[3], selector); w6[2] = hc_byte_perm (w6[1], w6[2], selector); w6[1] = hc_byte_perm (w6[0], w6[1], selector); w6[0] = hc_byte_perm (w5[3], w6[0], selector); w5[3] = hc_byte_perm (w5[2], w5[3], selector); w5[2] = hc_byte_perm (w5[1], w5[2], selector); w5[1] = hc_byte_perm (w5[0], w5[1], selector); w5[0] = hc_byte_perm (w4[3], w5[0], selector); w4[3] = hc_byte_perm (w4[2], w4[3], selector); w4[2] = hc_byte_perm (w4[1], w4[2], selector); w4[1] = hc_byte_perm (w4[0], w4[1], selector); w4[0] = hc_byte_perm (w3[3], w4[0], selector); w3[3] = hc_byte_perm (w3[2], w3[3], selector); w3[2] = hc_byte_perm (w3[1], w3[2], selector); w3[1] = hc_byte_perm (w3[0], w3[1], selector); w3[0] = hc_byte_perm (w2[3], w3[0], selector); w2[3] = hc_byte_perm (w2[2], w2[3], selector); w2[2] = hc_byte_perm (w2[1], w2[2], selector); w2[1] = hc_byte_perm (w2[0], w2[1], selector); w2[0] = hc_byte_perm (w1[3], w2[0], selector); w1[3] = hc_byte_perm (w1[2], w1[3], selector); w1[2] = hc_byte_perm (w1[1], w1[2], selector); w1[1] = hc_byte_perm (w1[0], w1[1], selector); w1[0] = hc_byte_perm (w0[3], w1[0], selector); w0[3] = hc_byte_perm (w0[2], w0[3], selector); w0[2] = hc_byte_perm (w0[1], w0[2], selector); w0[1] = hc_byte_perm (w0[0], w0[1], selector); w0[0] = hc_byte_perm ( 0, w0[0], selector); break; case 1: w7[3] = hc_byte_perm (w7[1], w7[2], selector); w7[2] = hc_byte_perm (w7[0], w7[1], selector); w7[1] = hc_byte_perm (w6[3], w7[0], selector); w7[0] = hc_byte_perm (w6[2], w6[3], selector); w6[3] = hc_byte_perm (w6[1], w6[2], selector); w6[2] = hc_byte_perm (w6[0], w6[1], selector); w6[1] = hc_byte_perm (w5[3], w6[0], selector); w6[0] = hc_byte_perm (w5[2], w5[3], selector); w5[3] = hc_byte_perm (w5[1], w5[2], selector); w5[2] = hc_byte_perm (w5[0], w5[1], selector); w5[1] = hc_byte_perm (w4[3], w5[0], selector); w5[0] = hc_byte_perm (w4[2], w4[3], selector); w4[3] = hc_byte_perm (w4[1], w4[2], selector); w4[2] = hc_byte_perm (w4[0], w4[1], selector); w4[1] = hc_byte_perm (w3[3], w4[0], selector); w4[0] = hc_byte_perm (w3[2], w3[3], selector); w3[3] = hc_byte_perm (w3[1], w3[2], selector); w3[2] = hc_byte_perm (w3[0], w3[1], selector); w3[1] = hc_byte_perm (w2[3], w3[0], selector); w3[0] = hc_byte_perm (w2[2], w2[3], selector); w2[3] = hc_byte_perm (w2[1], w2[2], selector); w2[2] = hc_byte_perm (w2[0], w2[1], selector); w2[1] = hc_byte_perm (w1[3], w2[0], selector); w2[0] = hc_byte_perm (w1[2], w1[3], selector); w1[3] = hc_byte_perm (w1[1], w1[2], selector); w1[2] = hc_byte_perm (w1[0], w1[1], selector); w1[1] = hc_byte_perm (w0[3], w1[0], selector); w1[0] = hc_byte_perm (w0[2], w0[3], selector); w0[3] = hc_byte_perm (w0[1], w0[2], selector); w0[2] = hc_byte_perm (w0[0], w0[1], selector); w0[1] = hc_byte_perm ( 0, w0[0], selector); w0[0] = 0; break; case 2: w7[3] = hc_byte_perm (w7[0], w7[1], selector); w7[2] = hc_byte_perm (w6[3], w7[0], selector); w7[1] = hc_byte_perm (w6[2], w6[3], selector); w7[0] = hc_byte_perm (w6[1], w6[2], selector); w6[3] = hc_byte_perm (w6[0], w6[1], selector); w6[2] = hc_byte_perm (w5[3], w6[0], selector); w6[1] = hc_byte_perm (w5[2], w5[3], selector); w6[0] = hc_byte_perm (w5[1], w5[2], selector); w5[3] = hc_byte_perm (w5[0], w5[1], selector); w5[2] = hc_byte_perm (w4[3], w5[0], selector); w5[1] = hc_byte_perm (w4[2], w4[3], selector); w5[0] = hc_byte_perm (w4[1], w4[2], selector); w4[3] = hc_byte_perm (w4[0], w4[1], selector); w4[2] = hc_byte_perm (w3[3], w4[0], selector); w4[1] = hc_byte_perm (w3[2], w3[3], selector); w4[0] = hc_byte_perm (w3[1], w3[2], selector); w3[3] = hc_byte_perm (w3[0], w3[1], selector); w3[2] = hc_byte_perm (w2[3], w3[0], selector); w3[1] = hc_byte_perm (w2[2], w2[3], selector); w3[0] = hc_byte_perm (w2[1], w2[2], selector); w2[3] = hc_byte_perm (w2[0], w2[1], selector); w2[2] = hc_byte_perm (w1[3], w2[0], selector); w2[1] = hc_byte_perm (w1[2], w1[3], selector); w2[0] = hc_byte_perm (w1[1], w1[2], selector); w1[3] = hc_byte_perm (w1[0], w1[1], selector); w1[2] = hc_byte_perm (w0[3], w1[0], selector); w1[1] = hc_byte_perm (w0[2], w0[3], selector); w1[0] = hc_byte_perm (w0[1], w0[2], selector); w0[3] = hc_byte_perm (w0[0], w0[1], selector); w0[2] = hc_byte_perm ( 0, w0[0], selector); w0[1] = 0; w0[0] = 0; break; case 3: w7[3] = hc_byte_perm (w6[3], w7[0], selector); w7[2] = hc_byte_perm (w6[2], w6[3], selector); w7[1] = hc_byte_perm (w6[1], w6[2], selector); w7[0] = hc_byte_perm (w6[0], w6[1], selector); w6[3] = hc_byte_perm (w5[3], w6[0], selector); w6[2] = hc_byte_perm (w5[2], w5[3], selector); w6[1] = hc_byte_perm (w5[1], w5[2], selector); w6[0] = hc_byte_perm (w5[0], w5[1], selector); w5[3] = hc_byte_perm (w4[3], w5[0], selector); w5[2] = hc_byte_perm (w4[2], w4[3], selector); w5[1] = hc_byte_perm (w4[1], w4[2], selector); w5[0] = hc_byte_perm (w4[0], w4[1], selector); w4[3] = hc_byte_perm (w3[3], w4[0], selector); w4[2] = hc_byte_perm (w3[2], w3[3], selector); w4[1] = hc_byte_perm (w3[1], w3[2], selector); w4[0] = hc_byte_perm (w3[0], w3[1], selector); w3[3] = hc_byte_perm (w2[3], w3[0], selector); w3[2] = hc_byte_perm (w2[2], w2[3], selector); w3[1] = hc_byte_perm (w2[1], w2[2], selector); w3[0] = hc_byte_perm (w2[0], w2[1], selector); w2[3] = hc_byte_perm (w1[3], w2[0], selector); w2[2] = hc_byte_perm (w1[2], w1[3], selector); w2[1] = hc_byte_perm (w1[1], w1[2], selector); w2[0] = hc_byte_perm (w1[0], w1[1], selector); w1[3] = hc_byte_perm (w0[3], w1[0], selector); w1[2] = hc_byte_perm (w0[2], w0[3], selector); w1[1] = hc_byte_perm (w0[1], w0[2], selector); w1[0] = hc_byte_perm (w0[0], w0[1], selector); w0[3] = hc_byte_perm ( 0, w0[0], selector); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: w7[3] = hc_byte_perm (w6[2], w6[3], selector); w7[2] = hc_byte_perm (w6[1], w6[2], selector); w7[1] = hc_byte_perm (w6[0], w6[1], selector); w7[0] = hc_byte_perm (w5[3], w6[0], selector); w6[3] = hc_byte_perm (w5[2], w5[3], selector); w6[2] = hc_byte_perm (w5[1], w5[2], selector); w6[1] = hc_byte_perm (w5[0], w5[1], selector); w6[0] = hc_byte_perm (w4[3], w5[0], selector); w5[3] = hc_byte_perm (w4[2], w4[3], selector); w5[2] = hc_byte_perm (w4[1], w4[2], selector); w5[1] = hc_byte_perm (w4[0], w4[1], selector); w5[0] = hc_byte_perm (w3[3], w4[0], selector); w4[3] = hc_byte_perm (w3[2], w3[3], selector); w4[2] = hc_byte_perm (w3[1], w3[2], selector); w4[1] = hc_byte_perm (w3[0], w3[1], selector); w4[0] = hc_byte_perm (w2[3], w3[0], selector); w3[3] = hc_byte_perm (w2[2], w2[3], selector); w3[2] = hc_byte_perm (w2[1], w2[2], selector); w3[1] = hc_byte_perm (w2[0], w2[1], selector); w3[0] = hc_byte_perm (w1[3], w2[0], selector); w2[3] = hc_byte_perm (w1[2], w1[3], selector); w2[2] = hc_byte_perm (w1[1], w1[2], selector); w2[1] = hc_byte_perm (w1[0], w1[1], selector); w2[0] = hc_byte_perm (w0[3], w1[0], selector); w1[3] = hc_byte_perm (w0[2], w0[3], selector); w1[2] = hc_byte_perm (w0[1], w0[2], selector); w1[1] = hc_byte_perm (w0[0], w0[1], selector); w1[0] = hc_byte_perm ( 0, w0[0], selector); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: w7[3] = hc_byte_perm (w6[1], w6[2], selector); w7[2] = hc_byte_perm (w6[0], w6[1], selector); w7[1] = hc_byte_perm (w5[3], w6[0], selector); w7[0] = hc_byte_perm (w5[2], w5[3], selector); w6[3] = hc_byte_perm (w5[1], w5[2], selector); w6[2] = hc_byte_perm (w5[0], w5[1], selector); w6[1] = hc_byte_perm (w4[3], w5[0], selector); w6[0] = hc_byte_perm (w4[2], w4[3], selector); w5[3] = hc_byte_perm (w4[1], w4[2], selector); w5[2] = hc_byte_perm (w4[0], w4[1], selector); w5[1] = hc_byte_perm (w3[3], w4[0], selector); w5[0] = hc_byte_perm (w3[2], w3[3], selector); w4[3] = hc_byte_perm (w3[1], w3[2], selector); w4[2] = hc_byte_perm (w3[0], w3[1], selector); w4[1] = hc_byte_perm (w2[3], w3[0], selector); w4[0] = hc_byte_perm (w2[2], w2[3], selector); w3[3] = hc_byte_perm (w2[1], w2[2], selector); w3[2] = hc_byte_perm (w2[0], w2[1], selector); w3[1] = hc_byte_perm (w1[3], w2[0], selector); w3[0] = hc_byte_perm (w1[2], w1[3], selector); w2[3] = hc_byte_perm (w1[1], w1[2], selector); w2[2] = hc_byte_perm (w1[0], w1[1], selector); w2[1] = hc_byte_perm (w0[3], w1[0], selector); w2[0] = hc_byte_perm (w0[2], w0[3], selector); w1[3] = hc_byte_perm (w0[1], w0[2], selector); w1[2] = hc_byte_perm (w0[0], w0[1], selector); w1[1] = hc_byte_perm ( 0, w0[0], selector); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: w7[3] = hc_byte_perm (w6[0], w6[1], selector); w7[2] = hc_byte_perm (w5[3], w6[0], selector); w7[1] = hc_byte_perm (w5[2], w5[3], selector); w7[0] = hc_byte_perm (w5[1], w5[2], selector); w6[3] = hc_byte_perm (w5[0], w5[1], selector); w6[2] = hc_byte_perm (w4[3], w5[0], selector); w6[1] = hc_byte_perm (w4[2], w4[3], selector); w6[0] = hc_byte_perm (w4[1], w4[2], selector); w5[3] = hc_byte_perm (w4[0], w4[1], selector); w5[2] = hc_byte_perm (w3[3], w4[0], selector); w5[1] = hc_byte_perm (w3[2], w3[3], selector); w5[0] = hc_byte_perm (w3[1], w3[2], selector); w4[3] = hc_byte_perm (w3[0], w3[1], selector); w4[2] = hc_byte_perm (w2[3], w3[0], selector); w4[1] = hc_byte_perm (w2[2], w2[3], selector); w4[0] = hc_byte_perm (w2[1], w2[2], selector); w3[3] = hc_byte_perm (w2[0], w2[1], selector); w3[2] = hc_byte_perm (w1[3], w2[0], selector); w3[1] = hc_byte_perm (w1[2], w1[3], selector); w3[0] = hc_byte_perm (w1[1], w1[2], selector); w2[3] = hc_byte_perm (w1[0], w1[1], selector); w2[2] = hc_byte_perm (w0[3], w1[0], selector); w2[1] = hc_byte_perm (w0[2], w0[3], selector); w2[0] = hc_byte_perm (w0[1], w0[2], selector); w1[3] = hc_byte_perm (w0[0], w0[1], selector); w1[2] = hc_byte_perm ( 0, w0[0], selector); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: w7[3] = hc_byte_perm (w5[3], w6[0], selector); w7[2] = hc_byte_perm (w5[2], w5[3], selector); w7[1] = hc_byte_perm (w5[1], w5[2], selector); w7[0] = hc_byte_perm (w5[0], w5[1], selector); w6[3] = hc_byte_perm (w4[3], w5[0], selector); w6[2] = hc_byte_perm (w4[2], w4[3], selector); w6[1] = hc_byte_perm (w4[1], w4[2], selector); w6[0] = hc_byte_perm (w4[0], w4[1], selector); w5[3] = hc_byte_perm (w3[3], w4[0], selector); w5[2] = hc_byte_perm (w3[2], w3[3], selector); w5[1] = hc_byte_perm (w3[1], w3[2], selector); w5[0] = hc_byte_perm (w3[0], w3[1], selector); w4[3] = hc_byte_perm (w2[3], w3[0], selector); w4[2] = hc_byte_perm (w2[2], w2[3], selector); w4[1] = hc_byte_perm (w2[1], w2[2], selector); w4[0] = hc_byte_perm (w2[0], w2[1], selector); w3[3] = hc_byte_perm (w1[3], w2[0], selector); w3[2] = hc_byte_perm (w1[2], w1[3], selector); w3[1] = hc_byte_perm (w1[1], w1[2], selector); w3[0] = hc_byte_perm (w1[0], w1[1], selector); w2[3] = hc_byte_perm (w0[3], w1[0], selector); w2[2] = hc_byte_perm (w0[2], w0[3], selector); w2[1] = hc_byte_perm (w0[1], w0[2], selector); w2[0] = hc_byte_perm (w0[0], w0[1], selector); w1[3] = hc_byte_perm ( 0, w0[0], selector); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: w7[3] = hc_byte_perm (w5[2], w5[3], selector); w7[2] = hc_byte_perm (w5[1], w5[2], selector); w7[1] = hc_byte_perm (w5[0], w5[1], selector); w7[0] = hc_byte_perm (w4[3], w5[0], selector); w6[3] = hc_byte_perm (w4[2], w4[3], selector); w6[2] = hc_byte_perm (w4[1], w4[2], selector); w6[1] = hc_byte_perm (w4[0], w4[1], selector); w6[0] = hc_byte_perm (w3[3], w4[0], selector); w5[3] = hc_byte_perm (w3[2], w3[3], selector); w5[2] = hc_byte_perm (w3[1], w3[2], selector); w5[1] = hc_byte_perm (w3[0], w3[1], selector); w5[0] = hc_byte_perm (w2[3], w3[0], selector); w4[3] = hc_byte_perm (w2[2], w2[3], selector); w4[2] = hc_byte_perm (w2[1], w2[2], selector); w4[1] = hc_byte_perm (w2[0], w2[1], selector); w4[0] = hc_byte_perm (w1[3], w2[0], selector); w3[3] = hc_byte_perm (w1[2], w1[3], selector); w3[2] = hc_byte_perm (w1[1], w1[2], selector); w3[1] = hc_byte_perm (w1[0], w1[1], selector); w3[0] = hc_byte_perm (w0[3], w1[0], selector); w2[3] = hc_byte_perm (w0[2], w0[3], selector); w2[2] = hc_byte_perm (w0[1], w0[2], selector); w2[1] = hc_byte_perm (w0[0], w0[1], selector); w2[0] = hc_byte_perm ( 0, w0[0], selector); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: w7[3] = hc_byte_perm (w5[1], w5[2], selector); w7[2] = hc_byte_perm (w5[0], w5[1], selector); w7[1] = hc_byte_perm (w4[3], w5[0], selector); w7[0] = hc_byte_perm (w4[2], w4[3], selector); w6[3] = hc_byte_perm (w4[1], w4[2], selector); w6[2] = hc_byte_perm (w4[0], w4[1], selector); w6[1] = hc_byte_perm (w3[3], w4[0], selector); w6[0] = hc_byte_perm (w3[2], w3[3], selector); w5[3] = hc_byte_perm (w3[1], w3[2], selector); w5[2] = hc_byte_perm (w3[0], w3[1], selector); w5[1] = hc_byte_perm (w2[3], w3[0], selector); w5[0] = hc_byte_perm (w2[2], w2[3], selector); w4[3] = hc_byte_perm (w2[1], w2[2], selector); w4[2] = hc_byte_perm (w2[0], w2[1], selector); w4[1] = hc_byte_perm (w1[3], w2[0], selector); w4[0] = hc_byte_perm (w1[2], w1[3], selector); w3[3] = hc_byte_perm (w1[1], w1[2], selector); w3[2] = hc_byte_perm (w1[0], w1[1], selector); w3[1] = hc_byte_perm (w0[3], w1[0], selector); w3[0] = hc_byte_perm (w0[2], w0[3], selector); w2[3] = hc_byte_perm (w0[1], w0[2], selector); w2[2] = hc_byte_perm (w0[0], w0[1], selector); w2[1] = hc_byte_perm ( 0, w0[0], selector); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: w7[3] = hc_byte_perm (w5[0], w5[1], selector); w7[2] = hc_byte_perm (w4[3], w5[0], selector); w7[1] = hc_byte_perm (w4[2], w4[3], selector); w7[0] = hc_byte_perm (w4[1], w4[2], selector); w6[3] = hc_byte_perm (w4[0], w4[1], selector); w6[2] = hc_byte_perm (w3[3], w4[0], selector); w6[1] = hc_byte_perm (w3[2], w3[3], selector); w6[0] = hc_byte_perm (w3[1], w3[2], selector); w5[3] = hc_byte_perm (w3[0], w3[1], selector); w5[2] = hc_byte_perm (w2[3], w3[0], selector); w5[1] = hc_byte_perm (w2[2], w2[3], selector); w5[0] = hc_byte_perm (w2[1], w2[2], selector); w4[3] = hc_byte_perm (w2[0], w2[1], selector); w4[2] = hc_byte_perm (w1[3], w2[0], selector); w4[1] = hc_byte_perm (w1[2], w1[3], selector); w4[0] = hc_byte_perm (w1[1], w1[2], selector); w3[3] = hc_byte_perm (w1[0], w1[1], selector); w3[2] = hc_byte_perm (w0[3], w1[0], selector); w3[1] = hc_byte_perm (w0[2], w0[3], selector); w3[0] = hc_byte_perm (w0[1], w0[2], selector); w2[3] = hc_byte_perm (w0[0], w0[1], selector); w2[2] = hc_byte_perm ( 0, w0[0], selector); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: w7[3] = hc_byte_perm (w4[3], w5[0], selector); w7[2] = hc_byte_perm (w4[2], w4[3], selector); w7[1] = hc_byte_perm (w4[1], w4[2], selector); w7[0] = hc_byte_perm (w4[0], w4[1], selector); w6[3] = hc_byte_perm (w3[3], w4[0], selector); w6[2] = hc_byte_perm (w3[2], w3[3], selector); w6[1] = hc_byte_perm (w3[1], w3[2], selector); w6[0] = hc_byte_perm (w3[0], w3[1], selector); w5[3] = hc_byte_perm (w2[3], w3[0], selector); w5[2] = hc_byte_perm (w2[2], w2[3], selector); w5[1] = hc_byte_perm (w2[1], w2[2], selector); w5[0] = hc_byte_perm (w2[0], w2[1], selector); w4[3] = hc_byte_perm (w1[3], w2[0], selector); w4[2] = hc_byte_perm (w1[2], w1[3], selector); w4[1] = hc_byte_perm (w1[1], w1[2], selector); w4[0] = hc_byte_perm (w1[0], w1[1], selector); w3[3] = hc_byte_perm (w0[3], w1[0], selector); w3[2] = hc_byte_perm (w0[2], w0[3], selector); w3[1] = hc_byte_perm (w0[1], w0[2], selector); w3[0] = hc_byte_perm (w0[0], w0[1], selector); w2[3] = hc_byte_perm ( 0, w0[0], selector); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: w7[3] = hc_byte_perm (w4[2], w4[3], selector); w7[2] = hc_byte_perm (w4[1], w4[2], selector); w7[1] = hc_byte_perm (w4[0], w4[1], selector); w7[0] = hc_byte_perm (w3[3], w4[0], selector); w6[3] = hc_byte_perm (w3[2], w3[3], selector); w6[2] = hc_byte_perm (w3[1], w3[2], selector); w6[1] = hc_byte_perm (w3[0], w3[1], selector); w6[0] = hc_byte_perm (w2[3], w3[0], selector); w5[3] = hc_byte_perm (w2[2], w2[3], selector); w5[2] = hc_byte_perm (w2[1], w2[2], selector); w5[1] = hc_byte_perm (w2[0], w2[1], selector); w5[0] = hc_byte_perm (w1[3], w2[0], selector); w4[3] = hc_byte_perm (w1[2], w1[3], selector); w4[2] = hc_byte_perm (w1[1], w1[2], selector); w4[1] = hc_byte_perm (w1[0], w1[1], selector); w4[0] = hc_byte_perm (w0[3], w1[0], selector); w3[3] = hc_byte_perm (w0[2], w0[3], selector); w3[2] = hc_byte_perm (w0[1], w0[2], selector); w3[1] = hc_byte_perm (w0[0], w0[1], selector); w3[0] = hc_byte_perm ( 0, w0[0], selector); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: w7[3] = hc_byte_perm (w4[1], w4[2], selector); w7[2] = hc_byte_perm (w4[0], w4[1], selector); w7[1] = hc_byte_perm (w3[3], w4[0], selector); w7[0] = hc_byte_perm (w3[2], w3[3], selector); w6[3] = hc_byte_perm (w3[1], w3[2], selector); w6[2] = hc_byte_perm (w3[0], w3[1], selector); w6[1] = hc_byte_perm (w2[3], w3[0], selector); w6[0] = hc_byte_perm (w2[2], w2[3], selector); w5[3] = hc_byte_perm (w2[1], w2[2], selector); w5[2] = hc_byte_perm (w2[0], w2[1], selector); w5[1] = hc_byte_perm (w1[3], w2[0], selector); w5[0] = hc_byte_perm (w1[2], w1[3], selector); w4[3] = hc_byte_perm (w1[1], w1[2], selector); w4[2] = hc_byte_perm (w1[0], w1[1], selector); w4[1] = hc_byte_perm (w0[3], w1[0], selector); w4[0] = hc_byte_perm (w0[2], w0[3], selector); w3[3] = hc_byte_perm (w0[1], w0[2], selector); w3[2] = hc_byte_perm (w0[0], w0[1], selector); w3[1] = hc_byte_perm ( 0, w0[0], selector); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: w7[3] = hc_byte_perm (w4[0], w4[1], selector); w7[2] = hc_byte_perm (w3[3], w4[0], selector); w7[1] = hc_byte_perm (w3[2], w3[3], selector); w7[0] = hc_byte_perm (w3[1], w3[2], selector); w6[3] = hc_byte_perm (w3[0], w3[1], selector); w6[2] = hc_byte_perm (w2[3], w3[0], selector); w6[1] = hc_byte_perm (w2[2], w2[3], selector); w6[0] = hc_byte_perm (w2[1], w2[2], selector); w5[3] = hc_byte_perm (w2[0], w2[1], selector); w5[2] = hc_byte_perm (w1[3], w2[0], selector); w5[1] = hc_byte_perm (w1[2], w1[3], selector); w5[0] = hc_byte_perm (w1[1], w1[2], selector); w4[3] = hc_byte_perm (w1[0], w1[1], selector); w4[2] = hc_byte_perm (w0[3], w1[0], selector); w4[1] = hc_byte_perm (w0[2], w0[3], selector); w4[0] = hc_byte_perm (w0[1], w0[2], selector); w3[3] = hc_byte_perm (w0[0], w0[1], selector); w3[2] = hc_byte_perm ( 0, w0[0], selector); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: w7[3] = hc_byte_perm (w3[3], w4[0], selector); w7[2] = hc_byte_perm (w3[2], w3[3], selector); w7[1] = hc_byte_perm (w3[1], w3[2], selector); w7[0] = hc_byte_perm (w3[0], w3[1], selector); w6[3] = hc_byte_perm (w2[3], w3[0], selector); w6[2] = hc_byte_perm (w2[2], w2[3], selector); w6[1] = hc_byte_perm (w2[1], w2[2], selector); w6[0] = hc_byte_perm (w2[0], w2[1], selector); w5[3] = hc_byte_perm (w1[3], w2[0], selector); w5[2] = hc_byte_perm (w1[2], w1[3], selector); w5[1] = hc_byte_perm (w1[1], w1[2], selector); w5[0] = hc_byte_perm (w1[0], w1[1], selector); w4[3] = hc_byte_perm (w0[3], w1[0], selector); w4[2] = hc_byte_perm (w0[2], w0[3], selector); w4[1] = hc_byte_perm (w0[1], w0[2], selector); w4[0] = hc_byte_perm (w0[0], w0[1], selector); w3[3] = hc_byte_perm ( 0, w0[0], selector); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_8x4_carry_le (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *w4, PRIVATE_AS u32x *w5, PRIVATE_AS u32x *w6, PRIVATE_AS u32x *w7, PRIVATE_AS u32x *c0, PRIVATE_AS u32x *c1, PRIVATE_AS u32x *c2, PRIVATE_AS u32x *c3, PRIVATE_AS u32x *c4, PRIVATE_AS u32x *c5, PRIVATE_AS u32x *c6, PRIVATE_AS u32x *c7, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: c0[0] = hc_bytealign (w7[3], 0, offset); w7[3] = hc_bytealign (w7[2], w7[3], offset); w7[2] = hc_bytealign (w7[1], w7[2], offset); w7[1] = hc_bytealign (w7[0], w7[1], offset); w7[0] = hc_bytealign (w6[3], w7[0], offset); w6[3] = hc_bytealign (w6[2], w6[3], offset); w6[2] = hc_bytealign (w6[1], w6[2], offset); w6[1] = hc_bytealign (w6[0], w6[1], offset); w6[0] = hc_bytealign (w5[3], w6[0], offset); w5[3] = hc_bytealign (w5[2], w5[3], offset); w5[2] = hc_bytealign (w5[1], w5[2], offset); w5[1] = hc_bytealign (w5[0], w5[1], offset); w5[0] = hc_bytealign (w4[3], w5[0], offset); w4[3] = hc_bytealign (w4[2], w4[3], offset); w4[2] = hc_bytealign (w4[1], w4[2], offset); w4[1] = hc_bytealign (w4[0], w4[1], offset); w4[0] = hc_bytealign (w3[3], w4[0], offset); w3[3] = hc_bytealign (w3[2], w3[3], offset); w3[2] = hc_bytealign (w3[1], w3[2], offset); w3[1] = hc_bytealign (w3[0], w3[1], offset); w3[0] = hc_bytealign (w2[3], w3[0], offset); w2[3] = hc_bytealign (w2[2], w2[3], offset); w2[2] = hc_bytealign (w2[1], w2[2], offset); w2[1] = hc_bytealign (w2[0], w2[1], offset); w2[0] = hc_bytealign (w1[3], w2[0], offset); w1[3] = hc_bytealign (w1[2], w1[3], offset); w1[2] = hc_bytealign (w1[1], w1[2], offset); w1[1] = hc_bytealign (w1[0], w1[1], offset); w1[0] = hc_bytealign (w0[3], w1[0], offset); w0[3] = hc_bytealign (w0[2], w0[3], offset); w0[2] = hc_bytealign (w0[1], w0[2], offset); w0[1] = hc_bytealign (w0[0], w0[1], offset); w0[0] = hc_bytealign ( 0, w0[0], offset); break; case 1: c0[1] = hc_bytealign (w7[3], 0, offset); c0[0] = hc_bytealign (w7[2], w7[3], offset); w7[3] = hc_bytealign (w7[1], w7[2], offset); w7[2] = hc_bytealign (w7[0], w7[1], offset); w7[1] = hc_bytealign (w6[3], w7[0], offset); w7[0] = hc_bytealign (w6[2], w6[3], offset); w6[3] = hc_bytealign (w6[1], w6[2], offset); w6[2] = hc_bytealign (w6[0], w6[1], offset); w6[1] = hc_bytealign (w5[3], w6[0], offset); w6[0] = hc_bytealign (w5[2], w5[3], offset); w5[3] = hc_bytealign (w5[1], w5[2], offset); w5[2] = hc_bytealign (w5[0], w5[1], offset); w5[1] = hc_bytealign (w4[3], w5[0], offset); w5[0] = hc_bytealign (w4[2], w4[3], offset); w4[3] = hc_bytealign (w4[1], w4[2], offset); w4[2] = hc_bytealign (w4[0], w4[1], offset); w4[1] = hc_bytealign (w3[3], w4[0], offset); w4[0] = hc_bytealign (w3[2], w3[3], offset); w3[3] = hc_bytealign (w3[1], w3[2], offset); w3[2] = hc_bytealign (w3[0], w3[1], offset); w3[1] = hc_bytealign (w2[3], w3[0], offset); w3[0] = hc_bytealign (w2[2], w2[3], offset); w2[3] = hc_bytealign (w2[1], w2[2], offset); w2[2] = hc_bytealign (w2[0], w2[1], offset); w2[1] = hc_bytealign (w1[3], w2[0], offset); w2[0] = hc_bytealign (w1[2], w1[3], offset); w1[3] = hc_bytealign (w1[1], w1[2], offset); w1[2] = hc_bytealign (w1[0], w1[1], offset); w1[1] = hc_bytealign (w0[3], w1[0], offset); w1[0] = hc_bytealign (w0[2], w0[3], offset); w0[3] = hc_bytealign (w0[1], w0[2], offset); w0[2] = hc_bytealign (w0[0], w0[1], offset); w0[1] = hc_bytealign ( 0, w0[0], offset); w0[0] = 0; break; case 2: c0[2] = hc_bytealign (w7[3], 0, offset); c0[1] = hc_bytealign (w7[2], w7[3], offset); c0[0] = hc_bytealign (w7[1], w7[2], offset); w7[3] = hc_bytealign (w7[0], w7[1], offset); w7[2] = hc_bytealign (w6[3], w7[0], offset); w7[1] = hc_bytealign (w6[2], w6[3], offset); w7[0] = hc_bytealign (w6[1], w6[2], offset); w6[3] = hc_bytealign (w6[0], w6[1], offset); w6[2] = hc_bytealign (w5[3], w6[0], offset); w6[1] = hc_bytealign (w5[2], w5[3], offset); w6[0] = hc_bytealign (w5[1], w5[2], offset); w5[3] = hc_bytealign (w5[0], w5[1], offset); w5[2] = hc_bytealign (w4[3], w5[0], offset); w5[1] = hc_bytealign (w4[2], w4[3], offset); w5[0] = hc_bytealign (w4[1], w4[2], offset); w4[3] = hc_bytealign (w4[0], w4[1], offset); w4[2] = hc_bytealign (w3[3], w4[0], offset); w4[1] = hc_bytealign (w3[2], w3[3], offset); w4[0] = hc_bytealign (w3[1], w3[2], offset); w3[3] = hc_bytealign (w3[0], w3[1], offset); w3[2] = hc_bytealign (w2[3], w3[0], offset); w3[1] = hc_bytealign (w2[2], w2[3], offset); w3[0] = hc_bytealign (w2[1], w2[2], offset); w2[3] = hc_bytealign (w2[0], w2[1], offset); w2[2] = hc_bytealign (w1[3], w2[0], offset); w2[1] = hc_bytealign (w1[2], w1[3], offset); w2[0] = hc_bytealign (w1[1], w1[2], offset); w1[3] = hc_bytealign (w1[0], w1[1], offset); w1[2] = hc_bytealign (w0[3], w1[0], offset); w1[1] = hc_bytealign (w0[2], w0[3], offset); w1[0] = hc_bytealign (w0[1], w0[2], offset); w0[3] = hc_bytealign (w0[0], w0[1], offset); w0[2] = hc_bytealign ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: c0[3] = hc_bytealign (w7[3], 0, offset); c0[2] = hc_bytealign (w7[2], w7[3], offset); c0[1] = hc_bytealign (w7[1], w7[2], offset); c0[0] = hc_bytealign (w7[0], w7[1], offset); w7[3] = hc_bytealign (w6[3], w7[0], offset); w7[2] = hc_bytealign (w6[2], w6[3], offset); w7[1] = hc_bytealign (w6[1], w6[2], offset); w7[0] = hc_bytealign (w6[0], w6[1], offset); w6[3] = hc_bytealign (w5[3], w6[0], offset); w6[2] = hc_bytealign (w5[2], w5[3], offset); w6[1] = hc_bytealign (w5[1], w5[2], offset); w6[0] = hc_bytealign (w5[0], w5[1], offset); w5[3] = hc_bytealign (w4[3], w5[0], offset); w5[2] = hc_bytealign (w4[2], w4[3], offset); w5[1] = hc_bytealign (w4[1], w4[2], offset); w5[0] = hc_bytealign (w4[0], w4[1], offset); w4[3] = hc_bytealign (w3[3], w4[0], offset); w4[2] = hc_bytealign (w3[2], w3[3], offset); w4[1] = hc_bytealign (w3[1], w3[2], offset); w4[0] = hc_bytealign (w3[0], w3[1], offset); w3[3] = hc_bytealign (w2[3], w3[0], offset); w3[2] = hc_bytealign (w2[2], w2[3], offset); w3[1] = hc_bytealign (w2[1], w2[2], offset); w3[0] = hc_bytealign (w2[0], w2[1], offset); w2[3] = hc_bytealign (w1[3], w2[0], offset); w2[2] = hc_bytealign (w1[2], w1[3], offset); w2[1] = hc_bytealign (w1[1], w1[2], offset); w2[0] = hc_bytealign (w1[0], w1[1], offset); w1[3] = hc_bytealign (w0[3], w1[0], offset); w1[2] = hc_bytealign (w0[2], w0[3], offset); w1[1] = hc_bytealign (w0[1], w0[2], offset); w1[0] = hc_bytealign (w0[0], w0[1], offset); w0[3] = hc_bytealign ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: c1[0] = hc_bytealign (w7[3], 0, offset); c0[3] = hc_bytealign (w7[2], w7[3], offset); c0[2] = hc_bytealign (w7[1], w7[2], offset); c0[1] = hc_bytealign (w7[0], w7[1], offset); c0[0] = hc_bytealign (w6[3], w7[0], offset); w7[3] = hc_bytealign (w6[2], w6[3], offset); w7[2] = hc_bytealign (w6[1], w6[2], offset); w7[1] = hc_bytealign (w6[0], w6[1], offset); w7[0] = hc_bytealign (w5[3], w6[0], offset); w6[3] = hc_bytealign (w5[2], w5[3], offset); w6[2] = hc_bytealign (w5[1], w5[2], offset); w6[1] = hc_bytealign (w5[0], w5[1], offset); w6[0] = hc_bytealign (w4[3], w5[0], offset); w5[3] = hc_bytealign (w4[2], w4[3], offset); w5[2] = hc_bytealign (w4[1], w4[2], offset); w5[1] = hc_bytealign (w4[0], w4[1], offset); w5[0] = hc_bytealign (w3[3], w4[0], offset); w4[3] = hc_bytealign (w3[2], w3[3], offset); w4[2] = hc_bytealign (w3[1], w3[2], offset); w4[1] = hc_bytealign (w3[0], w3[1], offset); w4[0] = hc_bytealign (w2[3], w3[0], offset); w3[3] = hc_bytealign (w2[2], w2[3], offset); w3[2] = hc_bytealign (w2[1], w2[2], offset); w3[1] = hc_bytealign (w2[0], w2[1], offset); w3[0] = hc_bytealign (w1[3], w2[0], offset); w2[3] = hc_bytealign (w1[2], w1[3], offset); w2[2] = hc_bytealign (w1[1], w1[2], offset); w2[1] = hc_bytealign (w1[0], w1[1], offset); w2[0] = hc_bytealign (w0[3], w1[0], offset); w1[3] = hc_bytealign (w0[2], w0[3], offset); w1[2] = hc_bytealign (w0[1], w0[2], offset); w1[1] = hc_bytealign (w0[0], w0[1], offset); w1[0] = hc_bytealign ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: c1[1] = hc_bytealign (w7[3], 0, offset); c1[0] = hc_bytealign (w7[2], w7[3], offset); c0[3] = hc_bytealign (w7[1], w7[2], offset); c0[2] = hc_bytealign (w7[0], w7[1], offset); c0[1] = hc_bytealign (w6[3], w7[0], offset); c0[0] = hc_bytealign (w6[2], w6[3], offset); w7[3] = hc_bytealign (w6[1], w6[2], offset); w7[2] = hc_bytealign (w6[0], w6[1], offset); w7[1] = hc_bytealign (w5[3], w6[0], offset); w7[0] = hc_bytealign (w5[2], w5[3], offset); w6[3] = hc_bytealign (w5[1], w5[2], offset); w6[2] = hc_bytealign (w5[0], w5[1], offset); w6[1] = hc_bytealign (w4[3], w5[0], offset); w6[0] = hc_bytealign (w4[2], w4[3], offset); w5[3] = hc_bytealign (w4[1], w4[2], offset); w5[2] = hc_bytealign (w4[0], w4[1], offset); w5[1] = hc_bytealign (w3[3], w4[0], offset); w5[0] = hc_bytealign (w3[2], w3[3], offset); w4[3] = hc_bytealign (w3[1], w3[2], offset); w4[2] = hc_bytealign (w3[0], w3[1], offset); w4[1] = hc_bytealign (w2[3], w3[0], offset); w4[0] = hc_bytealign (w2[2], w2[3], offset); w3[3] = hc_bytealign (w2[1], w2[2], offset); w3[2] = hc_bytealign (w2[0], w2[1], offset); w3[1] = hc_bytealign (w1[3], w2[0], offset); w3[0] = hc_bytealign (w1[2], w1[3], offset); w2[3] = hc_bytealign (w1[1], w1[2], offset); w2[2] = hc_bytealign (w1[0], w1[1], offset); w2[1] = hc_bytealign (w0[3], w1[0], offset); w2[0] = hc_bytealign (w0[2], w0[3], offset); w1[3] = hc_bytealign (w0[1], w0[2], offset); w1[2] = hc_bytealign (w0[0], w0[1], offset); w1[1] = hc_bytealign ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: c1[2] = hc_bytealign (w7[3], 0, offset); c1[1] = hc_bytealign (w7[2], w7[3], offset); c1[0] = hc_bytealign (w7[1], w7[2], offset); c0[3] = hc_bytealign (w7[0], w7[1], offset); c0[2] = hc_bytealign (w6[3], w7[0], offset); c0[1] = hc_bytealign (w6[2], w6[3], offset); c0[0] = hc_bytealign (w6[1], w6[2], offset); w7[3] = hc_bytealign (w6[0], w6[1], offset); w7[2] = hc_bytealign (w5[3], w6[0], offset); w7[1] = hc_bytealign (w5[2], w5[3], offset); w7[0] = hc_bytealign (w5[1], w5[2], offset); w6[3] = hc_bytealign (w5[0], w5[1], offset); w6[2] = hc_bytealign (w4[3], w5[0], offset); w6[1] = hc_bytealign (w4[2], w4[3], offset); w6[0] = hc_bytealign (w4[1], w4[2], offset); w5[3] = hc_bytealign (w4[0], w4[1], offset); w5[2] = hc_bytealign (w3[3], w4[0], offset); w5[1] = hc_bytealign (w3[2], w3[3], offset); w5[0] = hc_bytealign (w3[1], w3[2], offset); w4[3] = hc_bytealign (w3[0], w3[1], offset); w4[2] = hc_bytealign (w2[3], w3[0], offset); w4[1] = hc_bytealign (w2[2], w2[3], offset); w4[0] = hc_bytealign (w2[1], w2[2], offset); w3[3] = hc_bytealign (w2[0], w2[1], offset); w3[2] = hc_bytealign (w1[3], w2[0], offset); w3[1] = hc_bytealign (w1[2], w1[3], offset); w3[0] = hc_bytealign (w1[1], w1[2], offset); w2[3] = hc_bytealign (w1[0], w1[1], offset); w2[2] = hc_bytealign (w0[3], w1[0], offset); w2[1] = hc_bytealign (w0[2], w0[3], offset); w2[0] = hc_bytealign (w0[1], w0[2], offset); w1[3] = hc_bytealign (w0[0], w0[1], offset); w1[2] = hc_bytealign ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: c1[3] = hc_bytealign (w7[3], 0, offset); c1[2] = hc_bytealign (w7[2], w7[3], offset); c1[1] = hc_bytealign (w7[1], w7[2], offset); c1[0] = hc_bytealign (w7[0], w7[1], offset); c0[3] = hc_bytealign (w6[3], w7[0], offset); c0[2] = hc_bytealign (w6[2], w6[3], offset); c0[1] = hc_bytealign (w6[1], w6[2], offset); c0[0] = hc_bytealign (w6[0], w6[1], offset); w7[3] = hc_bytealign (w5[3], w6[0], offset); w7[2] = hc_bytealign (w5[2], w5[3], offset); w7[1] = hc_bytealign (w5[1], w5[2], offset); w7[0] = hc_bytealign (w5[0], w5[1], offset); w6[3] = hc_bytealign (w4[3], w5[0], offset); w6[2] = hc_bytealign (w4[2], w4[3], offset); w6[1] = hc_bytealign (w4[1], w4[2], offset); w6[0] = hc_bytealign (w4[0], w4[1], offset); w5[3] = hc_bytealign (w3[3], w4[0], offset); w5[2] = hc_bytealign (w3[2], w3[3], offset); w5[1] = hc_bytealign (w3[1], w3[2], offset); w5[0] = hc_bytealign (w3[0], w3[1], offset); w4[3] = hc_bytealign (w2[3], w3[0], offset); w4[2] = hc_bytealign (w2[2], w2[3], offset); w4[1] = hc_bytealign (w2[1], w2[2], offset); w4[0] = hc_bytealign (w2[0], w2[1], offset); w3[3] = hc_bytealign (w1[3], w2[0], offset); w3[2] = hc_bytealign (w1[2], w1[3], offset); w3[1] = hc_bytealign (w1[1], w1[2], offset); w3[0] = hc_bytealign (w1[0], w1[1], offset); w2[3] = hc_bytealign (w0[3], w1[0], offset); w2[2] = hc_bytealign (w0[2], w0[3], offset); w2[1] = hc_bytealign (w0[1], w0[2], offset); w2[0] = hc_bytealign (w0[0], w0[1], offset); w1[3] = hc_bytealign ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: c2[0] = hc_bytealign (w7[3], 0, offset); c1[3] = hc_bytealign (w7[2], w7[3], offset); c1[2] = hc_bytealign (w7[1], w7[2], offset); c1[1] = hc_bytealign (w7[0], w7[1], offset); c1[0] = hc_bytealign (w6[3], w7[0], offset); c0[3] = hc_bytealign (w6[2], w6[3], offset); c0[2] = hc_bytealign (w6[1], w6[2], offset); c0[1] = hc_bytealign (w6[0], w6[1], offset); c0[0] = hc_bytealign (w5[3], w6[0], offset); w7[3] = hc_bytealign (w5[2], w5[3], offset); w7[2] = hc_bytealign (w5[1], w5[2], offset); w7[1] = hc_bytealign (w5[0], w5[1], offset); w7[0] = hc_bytealign (w4[3], w5[0], offset); w6[3] = hc_bytealign (w4[2], w4[3], offset); w6[2] = hc_bytealign (w4[1], w4[2], offset); w6[1] = hc_bytealign (w4[0], w4[1], offset); w6[0] = hc_bytealign (w3[3], w4[0], offset); w5[3] = hc_bytealign (w3[2], w3[3], offset); w5[2] = hc_bytealign (w3[1], w3[2], offset); w5[1] = hc_bytealign (w3[0], w3[1], offset); w5[0] = hc_bytealign (w2[3], w3[0], offset); w4[3] = hc_bytealign (w2[2], w2[3], offset); w4[2] = hc_bytealign (w2[1], w2[2], offset); w4[1] = hc_bytealign (w2[0], w2[1], offset); w4[0] = hc_bytealign (w1[3], w2[0], offset); w3[3] = hc_bytealign (w1[2], w1[3], offset); w3[2] = hc_bytealign (w1[1], w1[2], offset); w3[1] = hc_bytealign (w1[0], w1[1], offset); w3[0] = hc_bytealign (w0[3], w1[0], offset); w2[3] = hc_bytealign (w0[2], w0[3], offset); w2[2] = hc_bytealign (w0[1], w0[2], offset); w2[1] = hc_bytealign (w0[0], w0[1], offset); w2[0] = hc_bytealign ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: c2[1] = hc_bytealign (w7[3], 0, offset); c2[0] = hc_bytealign (w7[2], w7[3], offset); c1[3] = hc_bytealign (w7[1], w7[2], offset); c1[2] = hc_bytealign (w7[0], w7[1], offset); c1[1] = hc_bytealign (w6[3], w7[0], offset); c1[0] = hc_bytealign (w6[2], w6[3], offset); c0[3] = hc_bytealign (w6[1], w6[2], offset); c0[2] = hc_bytealign (w6[0], w6[1], offset); c0[1] = hc_bytealign (w5[3], w6[0], offset); c0[0] = hc_bytealign (w5[2], w5[3], offset); w7[3] = hc_bytealign (w5[1], w5[2], offset); w7[2] = hc_bytealign (w5[0], w5[1], offset); w7[1] = hc_bytealign (w4[3], w5[0], offset); w7[0] = hc_bytealign (w4[2], w4[3], offset); w6[3] = hc_bytealign (w4[1], w4[2], offset); w6[2] = hc_bytealign (w4[0], w4[1], offset); w6[1] = hc_bytealign (w3[3], w4[0], offset); w6[0] = hc_bytealign (w3[2], w3[3], offset); w5[3] = hc_bytealign (w3[1], w3[2], offset); w5[2] = hc_bytealign (w3[0], w3[1], offset); w5[1] = hc_bytealign (w2[3], w3[0], offset); w5[0] = hc_bytealign (w2[2], w2[3], offset); w4[3] = hc_bytealign (w2[1], w2[2], offset); w4[2] = hc_bytealign (w2[0], w2[1], offset); w4[1] = hc_bytealign (w1[3], w2[0], offset); w4[0] = hc_bytealign (w1[2], w1[3], offset); w3[3] = hc_bytealign (w1[1], w1[2], offset); w3[2] = hc_bytealign (w1[0], w1[1], offset); w3[1] = hc_bytealign (w0[3], w1[0], offset); w3[0] = hc_bytealign (w0[2], w0[3], offset); w2[3] = hc_bytealign (w0[1], w0[2], offset); w2[2] = hc_bytealign (w0[0], w0[1], offset); w2[1] = hc_bytealign ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: c2[2] = hc_bytealign (w7[3], 0, offset); c2[1] = hc_bytealign (w7[2], w7[3], offset); c2[0] = hc_bytealign (w7[1], w7[2], offset); c1[3] = hc_bytealign (w7[0], w7[1], offset); c1[2] = hc_bytealign (w6[3], w7[0], offset); c1[1] = hc_bytealign (w6[2], w6[3], offset); c1[0] = hc_bytealign (w6[1], w6[2], offset); c0[3] = hc_bytealign (w6[0], w6[1], offset); c0[2] = hc_bytealign (w5[3], w6[0], offset); c0[1] = hc_bytealign (w5[2], w5[3], offset); c0[0] = hc_bytealign (w5[1], w5[2], offset); w7[3] = hc_bytealign (w5[0], w5[1], offset); w7[2] = hc_bytealign (w4[3], w5[0], offset); w7[1] = hc_bytealign (w4[2], w4[3], offset); w7[0] = hc_bytealign (w4[1], w4[2], offset); w6[3] = hc_bytealign (w4[0], w4[1], offset); w6[2] = hc_bytealign (w3[3], w4[0], offset); w6[1] = hc_bytealign (w3[2], w3[3], offset); w6[0] = hc_bytealign (w3[1], w3[2], offset); w5[3] = hc_bytealign (w3[0], w3[1], offset); w5[2] = hc_bytealign (w2[3], w3[0], offset); w5[1] = hc_bytealign (w2[2], w2[3], offset); w5[0] = hc_bytealign (w2[1], w2[2], offset); w4[3] = hc_bytealign (w2[0], w2[1], offset); w4[2] = hc_bytealign (w1[3], w2[0], offset); w4[1] = hc_bytealign (w1[2], w1[3], offset); w4[0] = hc_bytealign (w1[1], w1[2], offset); w3[3] = hc_bytealign (w1[0], w1[1], offset); w3[2] = hc_bytealign (w0[3], w1[0], offset); w3[1] = hc_bytealign (w0[2], w0[3], offset); w3[0] = hc_bytealign (w0[1], w0[2], offset); w2[3] = hc_bytealign (w0[0], w0[1], offset); w2[2] = hc_bytealign ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: c2[3] = hc_bytealign (w7[3], 0, offset); c2[2] = hc_bytealign (w7[2], w7[3], offset); c2[1] = hc_bytealign (w7[1], w7[2], offset); c2[0] = hc_bytealign (w7[0], w7[1], offset); c1[3] = hc_bytealign (w6[3], w7[0], offset); c1[2] = hc_bytealign (w6[2], w6[3], offset); c1[1] = hc_bytealign (w6[1], w6[2], offset); c1[0] = hc_bytealign (w6[0], w6[1], offset); c0[3] = hc_bytealign (w5[3], w6[0], offset); c0[2] = hc_bytealign (w5[2], w5[3], offset); c0[1] = hc_bytealign (w5[1], w5[2], offset); c0[0] = hc_bytealign (w5[0], w5[1], offset); w7[3] = hc_bytealign (w4[3], w5[0], offset); w7[2] = hc_bytealign (w4[2], w4[3], offset); w7[1] = hc_bytealign (w4[1], w4[2], offset); w7[0] = hc_bytealign (w4[0], w4[1], offset); w6[3] = hc_bytealign (w3[3], w4[0], offset); w6[2] = hc_bytealign (w3[2], w3[3], offset); w6[1] = hc_bytealign (w3[1], w3[2], offset); w6[0] = hc_bytealign (w3[0], w3[1], offset); w5[3] = hc_bytealign (w2[3], w3[0], offset); w5[2] = hc_bytealign (w2[2], w2[3], offset); w5[1] = hc_bytealign (w2[1], w2[2], offset); w5[0] = hc_bytealign (w2[0], w2[1], offset); w4[3] = hc_bytealign (w1[3], w2[0], offset); w4[2] = hc_bytealign (w1[2], w1[3], offset); w4[1] = hc_bytealign (w1[1], w1[2], offset); w4[0] = hc_bytealign (w1[0], w1[1], offset); w3[3] = hc_bytealign (w0[3], w1[0], offset); w3[2] = hc_bytealign (w0[2], w0[3], offset); w3[1] = hc_bytealign (w0[1], w0[2], offset); w3[0] = hc_bytealign (w0[0], w0[1], offset); w2[3] = hc_bytealign ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: c3[0] = hc_bytealign (w7[3], 0, offset); c2[3] = hc_bytealign (w7[2], w7[3], offset); c2[2] = hc_bytealign (w7[1], w7[2], offset); c2[1] = hc_bytealign (w7[0], w7[1], offset); c2[0] = hc_bytealign (w6[3], w7[0], offset); c1[3] = hc_bytealign (w6[2], w6[3], offset); c1[2] = hc_bytealign (w6[1], w6[2], offset); c1[1] = hc_bytealign (w6[0], w6[1], offset); c1[0] = hc_bytealign (w5[3], w6[0], offset); c0[3] = hc_bytealign (w5[2], w5[3], offset); c0[2] = hc_bytealign (w5[1], w5[2], offset); c0[1] = hc_bytealign (w5[0], w5[1], offset); c0[0] = hc_bytealign (w4[3], w5[0], offset); w7[3] = hc_bytealign (w4[2], w4[3], offset); w7[2] = hc_bytealign (w4[1], w4[2], offset); w7[1] = hc_bytealign (w4[0], w4[1], offset); w7[0] = hc_bytealign (w3[3], w4[0], offset); w6[3] = hc_bytealign (w3[2], w3[3], offset); w6[2] = hc_bytealign (w3[1], w3[2], offset); w6[1] = hc_bytealign (w3[0], w3[1], offset); w6[0] = hc_bytealign (w2[3], w3[0], offset); w5[3] = hc_bytealign (w2[2], w2[3], offset); w5[2] = hc_bytealign (w2[1], w2[2], offset); w5[1] = hc_bytealign (w2[0], w2[1], offset); w5[0] = hc_bytealign (w1[3], w2[0], offset); w4[3] = hc_bytealign (w1[2], w1[3], offset); w4[2] = hc_bytealign (w1[1], w1[2], offset); w4[1] = hc_bytealign (w1[0], w1[1], offset); w4[0] = hc_bytealign (w0[3], w1[0], offset); w3[3] = hc_bytealign (w0[2], w0[3], offset); w3[2] = hc_bytealign (w0[1], w0[2], offset); w3[1] = hc_bytealign (w0[0], w0[1], offset); w3[0] = hc_bytealign ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: c3[1] = hc_bytealign (w7[3], 0, offset); c3[0] = hc_bytealign (w7[2], w7[3], offset); c2[3] = hc_bytealign (w7[1], w7[2], offset); c2[2] = hc_bytealign (w7[0], w7[1], offset); c2[1] = hc_bytealign (w6[3], w7[0], offset); c2[0] = hc_bytealign (w6[2], w6[3], offset); c1[3] = hc_bytealign (w6[1], w6[2], offset); c1[2] = hc_bytealign (w6[0], w6[1], offset); c1[1] = hc_bytealign (w5[3], w6[0], offset); c1[0] = hc_bytealign (w5[2], w5[3], offset); c0[3] = hc_bytealign (w5[1], w5[2], offset); c0[2] = hc_bytealign (w5[0], w5[1], offset); c0[1] = hc_bytealign (w4[3], w5[0], offset); c0[0] = hc_bytealign (w4[2], w4[3], offset); w7[3] = hc_bytealign (w4[1], w4[2], offset); w7[2] = hc_bytealign (w4[0], w4[1], offset); w7[1] = hc_bytealign (w3[3], w4[0], offset); w7[0] = hc_bytealign (w3[2], w3[3], offset); w6[3] = hc_bytealign (w3[1], w3[2], offset); w6[2] = hc_bytealign (w3[0], w3[1], offset); w6[1] = hc_bytealign (w2[3], w3[0], offset); w6[0] = hc_bytealign (w2[2], w2[3], offset); w5[3] = hc_bytealign (w2[1], w2[2], offset); w5[2] = hc_bytealign (w2[0], w2[1], offset); w5[1] = hc_bytealign (w1[3], w2[0], offset); w5[0] = hc_bytealign (w1[2], w1[3], offset); w4[3] = hc_bytealign (w1[1], w1[2], offset); w4[2] = hc_bytealign (w1[0], w1[1], offset); w4[1] = hc_bytealign (w0[3], w1[0], offset); w4[0] = hc_bytealign (w0[2], w0[3], offset); w3[3] = hc_bytealign (w0[1], w0[2], offset); w3[2] = hc_bytealign (w0[0], w0[1], offset); w3[1] = hc_bytealign ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: c3[2] = hc_bytealign (w7[3], 0, offset); c3[1] = hc_bytealign (w7[2], w7[3], offset); c3[0] = hc_bytealign (w7[1], w7[2], offset); c2[3] = hc_bytealign (w7[0], w7[1], offset); c2[2] = hc_bytealign (w6[3], w7[0], offset); c2[1] = hc_bytealign (w6[2], w6[3], offset); c2[0] = hc_bytealign (w6[1], w6[2], offset); c1[3] = hc_bytealign (w6[0], w6[1], offset); c1[2] = hc_bytealign (w5[3], w6[0], offset); c1[1] = hc_bytealign (w5[2], w5[3], offset); c1[0] = hc_bytealign (w5[1], w5[2], offset); c0[3] = hc_bytealign (w5[0], w5[1], offset); c0[2] = hc_bytealign (w4[3], w5[0], offset); c0[1] = hc_bytealign (w4[2], w4[3], offset); c0[0] = hc_bytealign (w4[1], w4[2], offset); w7[3] = hc_bytealign (w4[0], w4[1], offset); w7[2] = hc_bytealign (w3[3], w4[0], offset); w7[1] = hc_bytealign (w3[2], w3[3], offset); w7[0] = hc_bytealign (w3[1], w3[2], offset); w6[3] = hc_bytealign (w3[0], w3[1], offset); w6[2] = hc_bytealign (w2[3], w3[0], offset); w6[1] = hc_bytealign (w2[2], w2[3], offset); w6[0] = hc_bytealign (w2[1], w2[2], offset); w5[3] = hc_bytealign (w2[0], w2[1], offset); w5[2] = hc_bytealign (w1[3], w2[0], offset); w5[1] = hc_bytealign (w1[2], w1[3], offset); w5[0] = hc_bytealign (w1[1], w1[2], offset); w4[3] = hc_bytealign (w1[0], w1[1], offset); w4[2] = hc_bytealign (w0[3], w1[0], offset); w4[1] = hc_bytealign (w0[2], w0[3], offset); w4[0] = hc_bytealign (w0[1], w0[2], offset); w3[3] = hc_bytealign (w0[0], w0[1], offset); w3[2] = hc_bytealign ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: c3[3] = hc_bytealign (w7[3], 0, offset); c3[2] = hc_bytealign (w7[2], w7[3], offset); c3[1] = hc_bytealign (w7[1], w7[2], offset); c3[0] = hc_bytealign (w7[0], w7[1], offset); c2[3] = hc_bytealign (w6[3], w7[0], offset); c2[2] = hc_bytealign (w6[2], w6[3], offset); c2[1] = hc_bytealign (w6[1], w6[2], offset); c2[0] = hc_bytealign (w6[0], w6[1], offset); c1[3] = hc_bytealign (w5[3], w6[0], offset); c1[2] = hc_bytealign (w5[2], w5[3], offset); c1[1] = hc_bytealign (w5[1], w5[2], offset); c1[0] = hc_bytealign (w5[0], w5[1], offset); c0[3] = hc_bytealign (w4[3], w5[0], offset); c0[2] = hc_bytealign (w4[2], w4[3], offset); c0[1] = hc_bytealign (w4[1], w4[2], offset); c0[0] = hc_bytealign (w4[0], w4[1], offset); w7[3] = hc_bytealign (w3[3], w4[0], offset); w7[2] = hc_bytealign (w3[2], w3[3], offset); w7[1] = hc_bytealign (w3[1], w3[2], offset); w7[0] = hc_bytealign (w3[0], w3[1], offset); w6[3] = hc_bytealign (w2[3], w3[0], offset); w6[2] = hc_bytealign (w2[2], w2[3], offset); w6[1] = hc_bytealign (w2[1], w2[2], offset); w6[0] = hc_bytealign (w2[0], w2[1], offset); w5[3] = hc_bytealign (w1[3], w2[0], offset); w5[2] = hc_bytealign (w1[2], w1[3], offset); w5[1] = hc_bytealign (w1[1], w1[2], offset); w5[0] = hc_bytealign (w1[0], w1[1], offset); w4[3] = hc_bytealign (w0[3], w1[0], offset); w4[2] = hc_bytealign (w0[2], w0[3], offset); w4[1] = hc_bytealign (w0[1], w0[2], offset); w4[0] = hc_bytealign (w0[0], w0[1], offset); w3[3] = hc_bytealign ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 16: c4[0] = hc_bytealign (w7[3], 0, offset); c3[3] = hc_bytealign (w7[2], w7[3], offset); c3[2] = hc_bytealign (w7[1], w7[2], offset); c3[1] = hc_bytealign (w7[0], w7[1], offset); c3[0] = hc_bytealign (w6[3], w7[0], offset); c2[3] = hc_bytealign (w6[2], w6[3], offset); c2[2] = hc_bytealign (w6[1], w6[2], offset); c2[1] = hc_bytealign (w6[0], w6[1], offset); c2[0] = hc_bytealign (w5[3], w6[0], offset); c1[3] = hc_bytealign (w5[2], w5[3], offset); c1[2] = hc_bytealign (w5[1], w5[2], offset); c1[1] = hc_bytealign (w5[0], w5[1], offset); c1[0] = hc_bytealign (w4[3], w5[0], offset); c0[3] = hc_bytealign (w4[2], w4[3], offset); c0[2] = hc_bytealign (w4[1], w4[2], offset); c0[1] = hc_bytealign (w4[0], w4[1], offset); c0[0] = hc_bytealign (w3[3], w4[0], offset); w7[3] = hc_bytealign (w3[2], w3[3], offset); w7[2] = hc_bytealign (w3[1], w3[2], offset); w7[1] = hc_bytealign (w3[0], w3[1], offset); w7[0] = hc_bytealign (w2[3], w3[0], offset); w6[3] = hc_bytealign (w2[2], w2[3], offset); w6[2] = hc_bytealign (w2[1], w2[2], offset); w6[1] = hc_bytealign (w2[0], w2[1], offset); w6[0] = hc_bytealign (w1[3], w2[0], offset); w5[3] = hc_bytealign (w1[2], w1[3], offset); w5[2] = hc_bytealign (w1[1], w1[2], offset); w5[1] = hc_bytealign (w1[0], w1[1], offset); w5[0] = hc_bytealign (w0[3], w1[0], offset); w4[3] = hc_bytealign (w0[2], w0[3], offset); w4[2] = hc_bytealign (w0[1], w0[2], offset); w4[1] = hc_bytealign (w0[0], w0[1], offset); w4[0] = hc_bytealign ( 0, w0[0], offset); w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 17: c4[1] = hc_bytealign (w7[3], 0, offset); c4[0] = hc_bytealign (w7[2], w7[3], offset); c3[3] = hc_bytealign (w7[1], w7[2], offset); c3[2] = hc_bytealign (w7[0], w7[1], offset); c3[1] = hc_bytealign (w6[3], w7[0], offset); c3[0] = hc_bytealign (w6[2], w6[3], offset); c2[3] = hc_bytealign (w6[1], w6[2], offset); c2[2] = hc_bytealign (w6[0], w6[1], offset); c2[1] = hc_bytealign (w5[3], w6[0], offset); c2[0] = hc_bytealign (w5[2], w5[3], offset); c1[3] = hc_bytealign (w5[1], w5[2], offset); c1[2] = hc_bytealign (w5[0], w5[1], offset); c1[1] = hc_bytealign (w4[3], w5[0], offset); c1[0] = hc_bytealign (w4[2], w4[3], offset); c0[3] = hc_bytealign (w4[1], w4[2], offset); c0[2] = hc_bytealign (w4[0], w4[1], offset); c0[1] = hc_bytealign (w3[3], w4[0], offset); c0[0] = hc_bytealign (w3[2], w3[3], offset); w7[3] = hc_bytealign (w3[1], w3[2], offset); w7[2] = hc_bytealign (w3[0], w3[1], offset); w7[1] = hc_bytealign (w2[3], w3[0], offset); w7[0] = hc_bytealign (w2[2], w2[3], offset); w6[3] = hc_bytealign (w2[1], w2[2], offset); w6[2] = hc_bytealign (w2[0], w2[1], offset); w6[1] = hc_bytealign (w1[3], w2[0], offset); w6[0] = hc_bytealign (w1[2], w1[3], offset); w5[3] = hc_bytealign (w1[1], w1[2], offset); w5[2] = hc_bytealign (w1[0], w1[1], offset); w5[1] = hc_bytealign (w0[3], w1[0], offset); w5[0] = hc_bytealign (w0[2], w0[3], offset); w4[3] = hc_bytealign (w0[1], w0[2], offset); w4[2] = hc_bytealign (w0[0], w0[1], offset); w4[1] = hc_bytealign ( 0, w0[0], offset); w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 18: c4[2] = hc_bytealign (w7[3], 0, offset); c4[1] = hc_bytealign (w7[2], w7[3], offset); c4[0] = hc_bytealign (w7[1], w7[2], offset); c3[3] = hc_bytealign (w7[0], w7[1], offset); c3[2] = hc_bytealign (w6[3], w7[0], offset); c3[1] = hc_bytealign (w6[2], w6[3], offset); c3[0] = hc_bytealign (w6[1], w6[2], offset); c2[3] = hc_bytealign (w6[0], w6[1], offset); c2[2] = hc_bytealign (w5[3], w6[0], offset); c2[1] = hc_bytealign (w5[2], w5[3], offset); c2[0] = hc_bytealign (w5[1], w5[2], offset); c1[3] = hc_bytealign (w5[0], w5[1], offset); c1[2] = hc_bytealign (w4[3], w5[0], offset); c1[1] = hc_bytealign (w4[2], w4[3], offset); c1[0] = hc_bytealign (w4[1], w4[2], offset); c0[3] = hc_bytealign (w4[0], w4[1], offset); c0[2] = hc_bytealign (w3[3], w4[0], offset); c0[1] = hc_bytealign (w3[2], w3[3], offset); c0[0] = hc_bytealign (w3[1], w3[2], offset); w7[3] = hc_bytealign (w3[0], w3[1], offset); w7[2] = hc_bytealign (w2[3], w3[0], offset); w7[1] = hc_bytealign (w2[2], w2[3], offset); w7[0] = hc_bytealign (w2[1], w2[2], offset); w6[3] = hc_bytealign (w2[0], w2[1], offset); w6[2] = hc_bytealign (w1[3], w2[0], offset); w6[1] = hc_bytealign (w1[2], w1[3], offset); w6[0] = hc_bytealign (w1[1], w1[2], offset); w5[3] = hc_bytealign (w1[0], w1[1], offset); w5[2] = hc_bytealign (w0[3], w1[0], offset); w5[1] = hc_bytealign (w0[2], w0[3], offset); w5[0] = hc_bytealign (w0[1], w0[2], offset); w4[3] = hc_bytealign (w0[0], w0[1], offset); w4[2] = hc_bytealign ( 0, w0[0], offset); w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 19: c4[3] = hc_bytealign (w7[3], 0, offset); c4[2] = hc_bytealign (w7[2], w7[3], offset); c4[1] = hc_bytealign (w7[1], w7[2], offset); c4[0] = hc_bytealign (w7[0], w7[1], offset); c3[3] = hc_bytealign (w6[3], w7[0], offset); c3[2] = hc_bytealign (w6[2], w6[3], offset); c3[1] = hc_bytealign (w6[1], w6[2], offset); c3[0] = hc_bytealign (w6[0], w6[1], offset); c2[3] = hc_bytealign (w5[3], w6[0], offset); c2[2] = hc_bytealign (w5[2], w5[3], offset); c2[1] = hc_bytealign (w5[1], w5[2], offset); c2[0] = hc_bytealign (w5[0], w5[1], offset); c1[3] = hc_bytealign (w4[3], w5[0], offset); c1[2] = hc_bytealign (w4[2], w4[3], offset); c1[1] = hc_bytealign (w4[1], w4[2], offset); c1[0] = hc_bytealign (w4[0], w4[1], offset); c0[3] = hc_bytealign (w3[3], w4[0], offset); c0[2] = hc_bytealign (w3[2], w3[3], offset); c0[1] = hc_bytealign (w3[1], w3[2], offset); c0[0] = hc_bytealign (w3[0], w3[1], offset); w7[3] = hc_bytealign (w2[3], w3[0], offset); w7[2] = hc_bytealign (w2[2], w2[3], offset); w7[1] = hc_bytealign (w2[1], w2[2], offset); w7[0] = hc_bytealign (w2[0], w2[1], offset); w6[3] = hc_bytealign (w1[3], w2[0], offset); w6[2] = hc_bytealign (w1[2], w1[3], offset); w6[1] = hc_bytealign (w1[1], w1[2], offset); w6[0] = hc_bytealign (w1[0], w1[1], offset); w5[3] = hc_bytealign (w0[3], w1[0], offset); w5[2] = hc_bytealign (w0[2], w0[3], offset); w5[1] = hc_bytealign (w0[1], w0[2], offset); w5[0] = hc_bytealign (w0[0], w0[1], offset); w4[3] = hc_bytealign ( 0, w0[0], offset); w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 20: c5[0] = hc_bytealign (w7[3], 0, offset); c4[3] = hc_bytealign (w7[2], w7[3], offset); c4[2] = hc_bytealign (w7[1], w7[2], offset); c4[1] = hc_bytealign (w7[0], w7[1], offset); c4[0] = hc_bytealign (w6[3], w7[0], offset); c3[3] = hc_bytealign (w6[2], w6[3], offset); c3[2] = hc_bytealign (w6[1], w6[2], offset); c3[1] = hc_bytealign (w6[0], w6[1], offset); c3[0] = hc_bytealign (w5[3], w6[0], offset); c2[3] = hc_bytealign (w5[2], w5[3], offset); c2[2] = hc_bytealign (w5[1], w5[2], offset); c2[1] = hc_bytealign (w5[0], w5[1], offset); c2[0] = hc_bytealign (w4[3], w5[0], offset); c1[3] = hc_bytealign (w4[2], w4[3], offset); c1[2] = hc_bytealign (w4[1], w4[2], offset); c1[1] = hc_bytealign (w4[0], w4[1], offset); c1[0] = hc_bytealign (w3[3], w4[0], offset); c0[3] = hc_bytealign (w3[2], w3[3], offset); c0[2] = hc_bytealign (w3[1], w3[2], offset); c0[1] = hc_bytealign (w3[0], w3[1], offset); c0[0] = hc_bytealign (w2[3], w3[0], offset); w7[3] = hc_bytealign (w2[2], w2[3], offset); w7[2] = hc_bytealign (w2[1], w2[2], offset); w7[1] = hc_bytealign (w2[0], w2[1], offset); w7[0] = hc_bytealign (w1[3], w2[0], offset); w6[3] = hc_bytealign (w1[2], w1[3], offset); w6[2] = hc_bytealign (w1[1], w1[2], offset); w6[1] = hc_bytealign (w1[0], w1[1], offset); w6[0] = hc_bytealign (w0[3], w1[0], offset); w5[3] = hc_bytealign (w0[2], w0[3], offset); w5[2] = hc_bytealign (w0[1], w0[2], offset); w5[1] = hc_bytealign (w0[0], w0[1], offset); w5[0] = hc_bytealign ( 0, w0[0], offset); w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 21: c5[1] = hc_bytealign (w7[3], 0, offset); c5[0] = hc_bytealign (w7[2], w7[3], offset); c4[3] = hc_bytealign (w7[1], w7[2], offset); c4[2] = hc_bytealign (w7[0], w7[1], offset); c4[1] = hc_bytealign (w6[3], w7[0], offset); c4[0] = hc_bytealign (w6[2], w6[3], offset); c3[3] = hc_bytealign (w6[1], w6[2], offset); c3[2] = hc_bytealign (w6[0], w6[1], offset); c3[1] = hc_bytealign (w5[3], w6[0], offset); c3[0] = hc_bytealign (w5[2], w5[3], offset); c2[3] = hc_bytealign (w5[1], w5[2], offset); c2[2] = hc_bytealign (w5[0], w5[1], offset); c2[1] = hc_bytealign (w4[3], w5[0], offset); c2[0] = hc_bytealign (w4[2], w4[3], offset); c1[3] = hc_bytealign (w4[1], w4[2], offset); c1[2] = hc_bytealign (w4[0], w4[1], offset); c1[1] = hc_bytealign (w3[3], w4[0], offset); c1[0] = hc_bytealign (w3[2], w3[3], offset); c0[3] = hc_bytealign (w3[1], w3[2], offset); c0[2] = hc_bytealign (w3[0], w3[1], offset); c0[1] = hc_bytealign (w2[3], w3[0], offset); c0[0] = hc_bytealign (w2[2], w2[3], offset); w7[3] = hc_bytealign (w2[1], w2[2], offset); w7[2] = hc_bytealign (w2[0], w2[1], offset); w7[1] = hc_bytealign (w1[3], w2[0], offset); w7[0] = hc_bytealign (w1[2], w1[3], offset); w6[3] = hc_bytealign (w1[1], w1[2], offset); w6[2] = hc_bytealign (w1[0], w1[1], offset); w6[1] = hc_bytealign (w0[3], w1[0], offset); w6[0] = hc_bytealign (w0[2], w0[3], offset); w5[3] = hc_bytealign (w0[1], w0[2], offset); w5[2] = hc_bytealign (w0[0], w0[1], offset); w5[1] = hc_bytealign ( 0, w0[0], offset); w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 22: c5[2] = hc_bytealign (w7[3], 0, offset); c5[1] = hc_bytealign (w7[2], w7[3], offset); c5[0] = hc_bytealign (w7[1], w7[2], offset); c4[3] = hc_bytealign (w7[0], w7[1], offset); c4[2] = hc_bytealign (w6[3], w7[0], offset); c4[1] = hc_bytealign (w6[2], w6[3], offset); c4[0] = hc_bytealign (w6[1], w6[2], offset); c3[3] = hc_bytealign (w6[0], w6[1], offset); c3[2] = hc_bytealign (w5[3], w6[0], offset); c3[1] = hc_bytealign (w5[2], w5[3], offset); c3[0] = hc_bytealign (w5[1], w5[2], offset); c2[3] = hc_bytealign (w5[0], w5[1], offset); c2[2] = hc_bytealign (w4[3], w5[0], offset); c2[1] = hc_bytealign (w4[2], w4[3], offset); c2[0] = hc_bytealign (w4[1], w4[2], offset); c1[3] = hc_bytealign (w4[0], w4[1], offset); c1[2] = hc_bytealign (w3[3], w4[0], offset); c1[1] = hc_bytealign (w3[2], w3[3], offset); c1[0] = hc_bytealign (w3[1], w3[2], offset); c0[3] = hc_bytealign (w3[0], w3[1], offset); c0[2] = hc_bytealign (w2[3], w3[0], offset); c0[1] = hc_bytealign (w2[2], w2[3], offset); c0[0] = hc_bytealign (w2[1], w2[2], offset); w7[3] = hc_bytealign (w2[0], w2[1], offset); w7[2] = hc_bytealign (w1[3], w2[0], offset); w7[1] = hc_bytealign (w1[2], w1[3], offset); w7[0] = hc_bytealign (w1[1], w1[2], offset); w6[3] = hc_bytealign (w1[0], w1[1], offset); w6[2] = hc_bytealign (w0[3], w1[0], offset); w6[1] = hc_bytealign (w0[2], w0[3], offset); w6[0] = hc_bytealign (w0[1], w0[2], offset); w5[3] = hc_bytealign (w0[0], w0[1], offset); w5[2] = hc_bytealign ( 0, w0[0], offset); w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 23: c5[3] = hc_bytealign (w7[3], 0, offset); c5[2] = hc_bytealign (w7[2], w7[3], offset); c5[1] = hc_bytealign (w7[1], w7[2], offset); c5[0] = hc_bytealign (w7[0], w7[1], offset); c4[3] = hc_bytealign (w6[3], w7[0], offset); c4[2] = hc_bytealign (w6[2], w6[3], offset); c4[1] = hc_bytealign (w6[1], w6[2], offset); c4[0] = hc_bytealign (w6[0], w6[1], offset); c3[3] = hc_bytealign (w5[3], w6[0], offset); c3[2] = hc_bytealign (w5[2], w5[3], offset); c3[1] = hc_bytealign (w5[1], w5[2], offset); c3[0] = hc_bytealign (w5[0], w5[1], offset); c2[3] = hc_bytealign (w4[3], w5[0], offset); c2[2] = hc_bytealign (w4[2], w4[3], offset); c2[1] = hc_bytealign (w4[1], w4[2], offset); c2[0] = hc_bytealign (w4[0], w4[1], offset); c1[3] = hc_bytealign (w3[3], w4[0], offset); c1[2] = hc_bytealign (w3[2], w3[3], offset); c1[1] = hc_bytealign (w3[1], w3[2], offset); c1[0] = hc_bytealign (w3[0], w3[1], offset); c0[3] = hc_bytealign (w2[3], w3[0], offset); c0[2] = hc_bytealign (w2[2], w2[3], offset); c0[1] = hc_bytealign (w2[1], w2[2], offset); c0[0] = hc_bytealign (w2[0], w2[1], offset); w7[3] = hc_bytealign (w1[3], w2[0], offset); w7[2] = hc_bytealign (w1[2], w1[3], offset); w7[1] = hc_bytealign (w1[1], w1[2], offset); w7[0] = hc_bytealign (w1[0], w1[1], offset); w6[3] = hc_bytealign (w0[3], w1[0], offset); w6[2] = hc_bytealign (w0[2], w0[3], offset); w6[1] = hc_bytealign (w0[1], w0[2], offset); w6[0] = hc_bytealign (w0[0], w0[1], offset); w5[3] = hc_bytealign ( 0, w0[0], offset); w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 24: c6[0] = hc_bytealign (w7[3], 0, offset); c5[3] = hc_bytealign (w7[2], w7[3], offset); c5[2] = hc_bytealign (w7[1], w7[2], offset); c5[1] = hc_bytealign (w7[0], w7[1], offset); c5[0] = hc_bytealign (w6[3], w7[0], offset); c4[3] = hc_bytealign (w6[2], w6[3], offset); c4[2] = hc_bytealign (w6[1], w6[2], offset); c4[1] = hc_bytealign (w6[0], w6[1], offset); c4[0] = hc_bytealign (w5[3], w6[0], offset); c3[3] = hc_bytealign (w5[2], w5[3], offset); c3[2] = hc_bytealign (w5[1], w5[2], offset); c3[1] = hc_bytealign (w5[0], w5[1], offset); c3[0] = hc_bytealign (w4[3], w5[0], offset); c2[3] = hc_bytealign (w4[2], w4[3], offset); c2[2] = hc_bytealign (w4[1], w4[2], offset); c2[1] = hc_bytealign (w4[0], w4[1], offset); c2[0] = hc_bytealign (w3[3], w4[0], offset); c1[3] = hc_bytealign (w3[2], w3[3], offset); c1[2] = hc_bytealign (w3[1], w3[2], offset); c1[1] = hc_bytealign (w3[0], w3[1], offset); c1[0] = hc_bytealign (w2[3], w3[0], offset); c0[3] = hc_bytealign (w2[2], w2[3], offset); c0[2] = hc_bytealign (w2[1], w2[2], offset); c0[1] = hc_bytealign (w2[0], w2[1], offset); c0[0] = hc_bytealign (w1[3], w2[0], offset); w7[3] = hc_bytealign (w1[2], w1[3], offset); w7[2] = hc_bytealign (w1[1], w1[2], offset); w7[1] = hc_bytealign (w1[0], w1[1], offset); w7[0] = hc_bytealign (w0[3], w1[0], offset); w6[3] = hc_bytealign (w0[2], w0[3], offset); w6[2] = hc_bytealign (w0[1], w0[2], offset); w6[1] = hc_bytealign (w0[0], w0[1], offset); w6[0] = hc_bytealign ( 0, w0[0], offset); w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 25: c6[1] = hc_bytealign (w7[3], 0, offset); c6[0] = hc_bytealign (w7[2], w7[3], offset); c5[3] = hc_bytealign (w7[1], w7[2], offset); c5[2] = hc_bytealign (w7[0], w7[1], offset); c5[1] = hc_bytealign (w6[3], w7[0], offset); c5[0] = hc_bytealign (w6[2], w6[3], offset); c4[3] = hc_bytealign (w6[1], w6[2], offset); c4[2] = hc_bytealign (w6[0], w6[1], offset); c4[1] = hc_bytealign (w5[3], w6[0], offset); c4[0] = hc_bytealign (w5[2], w5[3], offset); c3[3] = hc_bytealign (w5[1], w5[2], offset); c3[2] = hc_bytealign (w5[0], w5[1], offset); c3[1] = hc_bytealign (w4[3], w5[0], offset); c3[0] = hc_bytealign (w4[2], w4[3], offset); c2[3] = hc_bytealign (w4[1], w4[2], offset); c2[2] = hc_bytealign (w4[0], w4[1], offset); c2[1] = hc_bytealign (w3[3], w4[0], offset); c2[0] = hc_bytealign (w3[2], w3[3], offset); c1[3] = hc_bytealign (w3[1], w3[2], offset); c1[2] = hc_bytealign (w3[0], w3[1], offset); c1[1] = hc_bytealign (w2[3], w3[0], offset); c1[0] = hc_bytealign (w2[2], w2[3], offset); c0[3] = hc_bytealign (w2[1], w2[2], offset); c0[2] = hc_bytealign (w2[0], w2[1], offset); c0[1] = hc_bytealign (w1[3], w2[0], offset); c0[0] = hc_bytealign (w1[2], w1[3], offset); w7[3] = hc_bytealign (w1[1], w1[2], offset); w7[2] = hc_bytealign (w1[0], w1[1], offset); w7[1] = hc_bytealign (w0[3], w1[0], offset); w7[0] = hc_bytealign (w0[2], w0[3], offset); w6[3] = hc_bytealign (w0[1], w0[2], offset); w6[2] = hc_bytealign (w0[0], w0[1], offset); w6[1] = hc_bytealign ( 0, w0[0], offset); w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 26: c6[2] = hc_bytealign (w7[3], 0, offset); c6[1] = hc_bytealign (w7[2], w7[3], offset); c6[0] = hc_bytealign (w7[1], w7[2], offset); c5[3] = hc_bytealign (w7[0], w7[1], offset); c5[2] = hc_bytealign (w6[3], w7[0], offset); c5[1] = hc_bytealign (w6[2], w6[3], offset); c5[0] = hc_bytealign (w6[1], w6[2], offset); c4[3] = hc_bytealign (w6[0], w6[1], offset); c4[2] = hc_bytealign (w5[3], w6[0], offset); c4[1] = hc_bytealign (w5[2], w5[3], offset); c4[0] = hc_bytealign (w5[1], w5[2], offset); c3[3] = hc_bytealign (w5[0], w5[1], offset); c3[2] = hc_bytealign (w4[3], w5[0], offset); c3[1] = hc_bytealign (w4[2], w4[3], offset); c3[0] = hc_bytealign (w4[1], w4[2], offset); c2[3] = hc_bytealign (w4[0], w4[1], offset); c2[2] = hc_bytealign (w3[3], w4[0], offset); c2[1] = hc_bytealign (w3[2], w3[3], offset); c2[0] = hc_bytealign (w3[1], w3[2], offset); c1[3] = hc_bytealign (w3[0], w3[1], offset); c1[2] = hc_bytealign (w2[3], w3[0], offset); c1[1] = hc_bytealign (w2[2], w2[3], offset); c1[0] = hc_bytealign (w2[1], w2[2], offset); c0[3] = hc_bytealign (w2[0], w2[1], offset); c0[2] = hc_bytealign (w1[3], w2[0], offset); c0[1] = hc_bytealign (w1[2], w1[3], offset); c0[0] = hc_bytealign (w1[1], w1[2], offset); w7[3] = hc_bytealign (w1[0], w1[1], offset); w7[2] = hc_bytealign (w0[3], w1[0], offset); w7[1] = hc_bytealign (w0[2], w0[3], offset); w7[0] = hc_bytealign (w0[1], w0[2], offset); w6[3] = hc_bytealign (w0[0], w0[1], offset); w6[2] = hc_bytealign ( 0, w0[0], offset); w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 27: c6[3] = hc_bytealign (w7[3], 0, offset); c6[2] = hc_bytealign (w7[2], w7[3], offset); c6[1] = hc_bytealign (w7[1], w7[2], offset); c6[0] = hc_bytealign (w7[0], w7[1], offset); c5[3] = hc_bytealign (w6[3], w7[0], offset); c5[2] = hc_bytealign (w6[2], w6[3], offset); c5[1] = hc_bytealign (w6[1], w6[2], offset); c5[0] = hc_bytealign (w6[0], w6[1], offset); c4[3] = hc_bytealign (w5[3], w6[0], offset); c4[2] = hc_bytealign (w5[2], w5[3], offset); c4[1] = hc_bytealign (w5[1], w5[2], offset); c4[0] = hc_bytealign (w5[0], w5[1], offset); c3[3] = hc_bytealign (w4[3], w5[0], offset); c3[2] = hc_bytealign (w4[2], w4[3], offset); c3[1] = hc_bytealign (w4[1], w4[2], offset); c3[0] = hc_bytealign (w4[0], w4[1], offset); c2[3] = hc_bytealign (w3[3], w4[0], offset); c2[2] = hc_bytealign (w3[2], w3[3], offset); c2[1] = hc_bytealign (w3[1], w3[2], offset); c2[0] = hc_bytealign (w3[0], w3[1], offset); c1[3] = hc_bytealign (w2[3], w3[0], offset); c1[2] = hc_bytealign (w2[2], w2[3], offset); c1[1] = hc_bytealign (w2[1], w2[2], offset); c1[0] = hc_bytealign (w2[0], w2[1], offset); c0[3] = hc_bytealign (w1[3], w2[0], offset); c0[2] = hc_bytealign (w1[2], w1[3], offset); c0[1] = hc_bytealign (w1[1], w1[2], offset); c0[0] = hc_bytealign (w1[0], w1[1], offset); w7[3] = hc_bytealign (w0[3], w1[0], offset); w7[2] = hc_bytealign (w0[2], w0[3], offset); w7[1] = hc_bytealign (w0[1], w0[2], offset); w7[0] = hc_bytealign (w0[0], w0[1], offset); w6[3] = hc_bytealign ( 0, w0[0], offset); w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 28: c7[0] = hc_bytealign (w7[3], 0, offset); c6[3] = hc_bytealign (w7[2], w7[3], offset); c6[2] = hc_bytealign (w7[1], w7[2], offset); c6[1] = hc_bytealign (w7[0], w7[1], offset); c6[0] = hc_bytealign (w6[3], w7[0], offset); c5[3] = hc_bytealign (w6[2], w6[3], offset); c5[2] = hc_bytealign (w6[1], w6[2], offset); c5[1] = hc_bytealign (w6[0], w6[1], offset); c5[0] = hc_bytealign (w5[3], w6[0], offset); c4[3] = hc_bytealign (w5[2], w5[3], offset); c4[2] = hc_bytealign (w5[1], w5[2], offset); c4[1] = hc_bytealign (w5[0], w5[1], offset); c4[0] = hc_bytealign (w4[3], w5[0], offset); c3[3] = hc_bytealign (w4[2], w4[3], offset); c3[2] = hc_bytealign (w4[1], w4[2], offset); c3[1] = hc_bytealign (w4[0], w4[1], offset); c3[0] = hc_bytealign (w3[3], w4[0], offset); c2[3] = hc_bytealign (w3[2], w3[3], offset); c2[2] = hc_bytealign (w3[1], w3[2], offset); c2[1] = hc_bytealign (w3[0], w3[1], offset); c2[0] = hc_bytealign (w2[3], w3[0], offset); c1[3] = hc_bytealign (w2[2], w2[3], offset); c1[2] = hc_bytealign (w2[1], w2[2], offset); c1[1] = hc_bytealign (w2[0], w2[1], offset); c1[0] = hc_bytealign (w1[3], w2[0], offset); c0[3] = hc_bytealign (w1[2], w1[3], offset); c0[2] = hc_bytealign (w1[1], w1[2], offset); c0[1] = hc_bytealign (w1[0], w1[1], offset); c0[0] = hc_bytealign (w0[3], w1[0], offset); w7[3] = hc_bytealign (w0[2], w0[3], offset); w7[2] = hc_bytealign (w0[1], w0[2], offset); w7[1] = hc_bytealign (w0[0], w0[1], offset); w7[0] = hc_bytealign ( 0, w0[0], offset); w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 29: c7[1] = hc_bytealign (w7[3], 0, offset); c7[0] = hc_bytealign (w7[2], w7[3], offset); c6[3] = hc_bytealign (w7[1], w7[2], offset); c6[2] = hc_bytealign (w7[0], w7[1], offset); c6[1] = hc_bytealign (w6[3], w7[0], offset); c6[0] = hc_bytealign (w6[2], w6[3], offset); c5[3] = hc_bytealign (w6[1], w6[2], offset); c5[2] = hc_bytealign (w6[0], w6[1], offset); c5[1] = hc_bytealign (w5[3], w6[0], offset); c5[0] = hc_bytealign (w5[2], w5[3], offset); c4[3] = hc_bytealign (w5[1], w5[2], offset); c4[2] = hc_bytealign (w5[0], w5[1], offset); c4[1] = hc_bytealign (w4[3], w5[0], offset); c4[0] = hc_bytealign (w4[2], w4[3], offset); c3[3] = hc_bytealign (w4[1], w4[2], offset); c3[2] = hc_bytealign (w4[0], w4[1], offset); c3[1] = hc_bytealign (w3[3], w4[0], offset); c3[0] = hc_bytealign (w3[2], w3[3], offset); c2[3] = hc_bytealign (w3[1], w3[2], offset); c2[2] = hc_bytealign (w3[0], w3[1], offset); c2[1] = hc_bytealign (w2[3], w3[0], offset); c2[0] = hc_bytealign (w2[2], w2[3], offset); c1[3] = hc_bytealign (w2[1], w2[2], offset); c1[2] = hc_bytealign (w2[0], w2[1], offset); c1[1] = hc_bytealign (w1[3], w2[0], offset); c1[0] = hc_bytealign (w1[2], w1[3], offset); c0[3] = hc_bytealign (w1[1], w1[2], offset); c0[2] = hc_bytealign (w1[0], w1[1], offset); c0[1] = hc_bytealign (w0[3], w1[0], offset); c0[0] = hc_bytealign (w0[2], w0[3], offset); w7[3] = hc_bytealign (w0[1], w0[2], offset); w7[2] = hc_bytealign (w0[0], w0[1], offset); w7[1] = hc_bytealign ( 0, w0[0], offset); w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 30: c7[2] = hc_bytealign (w7[3], 0, offset); c7[1] = hc_bytealign (w7[2], w7[3], offset); c7[0] = hc_bytealign (w7[1], w7[2], offset); c6[3] = hc_bytealign (w7[0], w7[1], offset); c6[2] = hc_bytealign (w6[3], w7[0], offset); c6[1] = hc_bytealign (w6[2], w6[3], offset); c6[0] = hc_bytealign (w6[1], w6[2], offset); c5[3] = hc_bytealign (w6[0], w6[1], offset); c5[2] = hc_bytealign (w5[3], w6[0], offset); c5[1] = hc_bytealign (w5[2], w5[3], offset); c5[0] = hc_bytealign (w5[1], w5[2], offset); c4[3] = hc_bytealign (w5[0], w5[1], offset); c4[2] = hc_bytealign (w4[3], w5[0], offset); c4[1] = hc_bytealign (w4[2], w4[3], offset); c4[0] = hc_bytealign (w4[1], w4[2], offset); c3[3] = hc_bytealign (w4[0], w4[1], offset); c3[2] = hc_bytealign (w3[3], w4[0], offset); c3[1] = hc_bytealign (w3[2], w3[3], offset); c3[0] = hc_bytealign (w3[1], w3[2], offset); c2[3] = hc_bytealign (w3[0], w3[1], offset); c2[2] = hc_bytealign (w2[3], w3[0], offset); c2[1] = hc_bytealign (w2[2], w2[3], offset); c2[0] = hc_bytealign (w2[1], w2[2], offset); c1[3] = hc_bytealign (w2[0], w2[1], offset); c1[2] = hc_bytealign (w1[3], w2[0], offset); c1[1] = hc_bytealign (w1[2], w1[3], offset); c1[0] = hc_bytealign (w1[1], w1[2], offset); c0[3] = hc_bytealign (w1[0], w1[1], offset); c0[2] = hc_bytealign (w0[3], w1[0], offset); c0[1] = hc_bytealign (w0[2], w0[3], offset); c0[0] = hc_bytealign (w0[1], w0[2], offset); w7[3] = hc_bytealign (w0[0], w0[1], offset); w7[2] = hc_bytealign ( 0, w0[0], offset); w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 31: c7[3] = hc_bytealign (w7[3], 0, offset); c7[2] = hc_bytealign (w7[2], w7[3], offset); c7[1] = hc_bytealign (w7[1], w7[2], offset); c7[0] = hc_bytealign (w7[0], w7[1], offset); c6[3] = hc_bytealign (w6[3], w7[0], offset); c6[2] = hc_bytealign (w6[2], w6[3], offset); c6[1] = hc_bytealign (w6[1], w6[2], offset); c6[0] = hc_bytealign (w6[0], w6[1], offset); c5[3] = hc_bytealign (w5[3], w6[0], offset); c5[2] = hc_bytealign (w5[2], w5[3], offset); c5[1] = hc_bytealign (w5[1], w5[2], offset); c5[0] = hc_bytealign (w5[0], w5[1], offset); c4[3] = hc_bytealign (w4[3], w5[0], offset); c4[2] = hc_bytealign (w4[2], w4[3], offset); c4[1] = hc_bytealign (w4[1], w4[2], offset); c4[0] = hc_bytealign (w4[0], w4[1], offset); c3[3] = hc_bytealign (w3[3], w4[0], offset); c3[2] = hc_bytealign (w3[2], w3[3], offset); c3[1] = hc_bytealign (w3[1], w3[2], offset); c3[0] = hc_bytealign (w3[0], w3[1], offset); c2[3] = hc_bytealign (w2[3], w3[0], offset); c2[2] = hc_bytealign (w2[2], w2[3], offset); c2[1] = hc_bytealign (w2[1], w2[2], offset); c2[0] = hc_bytealign (w2[0], w2[1], offset); c1[3] = hc_bytealign (w1[3], w2[0], offset); c1[2] = hc_bytealign (w1[2], w1[3], offset); c1[1] = hc_bytealign (w1[1], w1[2], offset); c1[0] = hc_bytealign (w1[0], w1[1], offset); c0[3] = hc_bytealign (w0[3], w1[0], offset); c0[2] = hc_bytealign (w0[2], w0[3], offset); c0[1] = hc_bytealign (w0[1], w0[2], offset); c0[0] = hc_bytealign (w0[0], w0[1], offset); w7[3] = hc_bytealign ( 0, w0[0], offset); w7[2] = 0; w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV const int offset_mod_4 = offset & 3; const int offset_minus_4 = 4 - offset_mod_4; #if defined IS_NV const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> (offset_minus_4 * 8)); #endif switch (offset_switch) { case 0: c0[0] = hc_byte_perm (w7[3], 0, selector); w7[3] = hc_byte_perm (w7[2], w7[3], selector); w7[2] = hc_byte_perm (w7[1], w7[2], selector); w7[1] = hc_byte_perm (w7[0], w7[1], selector); w7[0] = hc_byte_perm (w6[3], w7[0], selector); w6[3] = hc_byte_perm (w6[2], w6[3], selector); w6[2] = hc_byte_perm (w6[1], w6[2], selector); w6[1] = hc_byte_perm (w6[0], w6[1], selector); w6[0] = hc_byte_perm (w5[3], w6[0], selector); w5[3] = hc_byte_perm (w5[2], w5[3], selector); w5[2] = hc_byte_perm (w5[1], w5[2], selector); w5[1] = hc_byte_perm (w5[0], w5[1], selector); w5[0] = hc_byte_perm (w4[3], w5[0], selector); w4[3] = hc_byte_perm (w4[2], w4[3], selector); w4[2] = hc_byte_perm (w4[1], w4[2], selector); w4[1] = hc_byte_perm (w4[0], w4[1], selector); w4[0] = hc_byte_perm (w3[3], w4[0], selector); w3[3] = hc_byte_perm (w3[2], w3[3], selector); w3[2] = hc_byte_perm (w3[1], w3[2], selector); w3[1] = hc_byte_perm (w3[0], w3[1], selector); w3[0] = hc_byte_perm (w2[3], w3[0], selector); w2[3] = hc_byte_perm (w2[2], w2[3], selector); w2[2] = hc_byte_perm (w2[1], w2[2], selector); w2[1] = hc_byte_perm (w2[0], w2[1], selector); w2[0] = hc_byte_perm (w1[3], w2[0], selector); w1[3] = hc_byte_perm (w1[2], w1[3], selector); w1[2] = hc_byte_perm (w1[1], w1[2], selector); w1[1] = hc_byte_perm (w1[0], w1[1], selector); w1[0] = hc_byte_perm (w0[3], w1[0], selector); w0[3] = hc_byte_perm (w0[2], w0[3], selector); w0[2] = hc_byte_perm (w0[1], w0[2], selector); w0[1] = hc_byte_perm (w0[0], w0[1], selector); w0[0] = hc_byte_perm ( 0, w0[0], selector); break; case 1: c0[1] = hc_byte_perm (w7[3], 0, selector); c0[0] = hc_byte_perm (w7[2], w7[3], selector); w7[3] = hc_byte_perm (w7[1], w7[2], selector); w7[2] = hc_byte_perm (w7[0], w7[1], selector); w7[1] = hc_byte_perm (w6[3], w7[0], selector); w7[0] = hc_byte_perm (w6[2], w6[3], selector); w6[3] = hc_byte_perm (w6[1], w6[2], selector); w6[2] = hc_byte_perm (w6[0], w6[1], selector); w6[1] = hc_byte_perm (w5[3], w6[0], selector); w6[0] = hc_byte_perm (w5[2], w5[3], selector); w5[3] = hc_byte_perm (w5[1], w5[2], selector); w5[2] = hc_byte_perm (w5[0], w5[1], selector); w5[1] = hc_byte_perm (w4[3], w5[0], selector); w5[0] = hc_byte_perm (w4[2], w4[3], selector); w4[3] = hc_byte_perm (w4[1], w4[2], selector); w4[2] = hc_byte_perm (w4[0], w4[1], selector); w4[1] = hc_byte_perm (w3[3], w4[0], selector); w4[0] = hc_byte_perm (w3[2], w3[3], selector); w3[3] = hc_byte_perm (w3[1], w3[2], selector); w3[2] = hc_byte_perm (w3[0], w3[1], selector); w3[1] = hc_byte_perm (w2[3], w3[0], selector); w3[0] = hc_byte_perm (w2[2], w2[3], selector); w2[3] = hc_byte_perm (w2[1], w2[2], selector); w2[2] = hc_byte_perm (w2[0], w2[1], selector); w2[1] = hc_byte_perm (w1[3], w2[0], selector); w2[0] = hc_byte_perm (w1[2], w1[3], selector); w1[3] = hc_byte_perm (w1[1], w1[2], selector); w1[2] = hc_byte_perm (w1[0], w1[1], selector); w1[1] = hc_byte_perm (w0[3], w1[0], selector); w1[0] = hc_byte_perm (w0[2], w0[3], selector); w0[3] = hc_byte_perm (w0[1], w0[2], selector); w0[2] = hc_byte_perm (w0[0], w0[1], selector); w0[1] = hc_byte_perm ( 0, w0[0], selector); w0[0] = 0; break; case 2: c0[2] = hc_byte_perm (w7[3], 0, selector); c0[1] = hc_byte_perm (w7[2], w7[3], selector); c0[0] = hc_byte_perm (w7[1], w7[2], selector); w7[3] = hc_byte_perm (w7[0], w7[1], selector); w7[2] = hc_byte_perm (w6[3], w7[0], selector); w7[1] = hc_byte_perm (w6[2], w6[3], selector); w7[0] = hc_byte_perm (w6[1], w6[2], selector); w6[3] = hc_byte_perm (w6[0], w6[1], selector); w6[2] = hc_byte_perm (w5[3], w6[0], selector); w6[1] = hc_byte_perm (w5[2], w5[3], selector); w6[0] = hc_byte_perm (w5[1], w5[2], selector); w5[3] = hc_byte_perm (w5[0], w5[1], selector); w5[2] = hc_byte_perm (w4[3], w5[0], selector); w5[1] = hc_byte_perm (w4[2], w4[3], selector); w5[0] = hc_byte_perm (w4[1], w4[2], selector); w4[3] = hc_byte_perm (w4[0], w4[1], selector); w4[2] = hc_byte_perm (w3[3], w4[0], selector); w4[1] = hc_byte_perm (w3[2], w3[3], selector); w4[0] = hc_byte_perm (w3[1], w3[2], selector); w3[3] = hc_byte_perm (w3[0], w3[1], selector); w3[2] = hc_byte_perm (w2[3], w3[0], selector); w3[1] = hc_byte_perm (w2[2], w2[3], selector); w3[0] = hc_byte_perm (w2[1], w2[2], selector); w2[3] = hc_byte_perm (w2[0], w2[1], selector); w2[2] = hc_byte_perm (w1[3], w2[0], selector); w2[1] = hc_byte_perm (w1[2], w1[3], selector); w2[0] = hc_byte_perm (w1[1], w1[2], selector); w1[3] = hc_byte_perm (w1[0], w1[1], selector); w1[2] = hc_byte_perm (w0[3], w1[0], selector); w1[1] = hc_byte_perm (w0[2], w0[3], selector); w1[0] = hc_byte_perm (w0[1], w0[2], selector); w0[3] = hc_byte_perm (w0[0], w0[1], selector); w0[2] = hc_byte_perm ( 0, w0[0], selector); w0[1] = 0; w0[0] = 0; break; case 3: c0[3] = hc_byte_perm (w7[3], 0, selector); c0[2] = hc_byte_perm (w7[2], w7[3], selector); c0[1] = hc_byte_perm (w7[1], w7[2], selector); c0[0] = hc_byte_perm (w7[0], w7[1], selector); w7[3] = hc_byte_perm (w6[3], w7[0], selector); w7[2] = hc_byte_perm (w6[2], w6[3], selector); w7[1] = hc_byte_perm (w6[1], w6[2], selector); w7[0] = hc_byte_perm (w6[0], w6[1], selector); w6[3] = hc_byte_perm (w5[3], w6[0], selector); w6[2] = hc_byte_perm (w5[2], w5[3], selector); w6[1] = hc_byte_perm (w5[1], w5[2], selector); w6[0] = hc_byte_perm (w5[0], w5[1], selector); w5[3] = hc_byte_perm (w4[3], w5[0], selector); w5[2] = hc_byte_perm (w4[2], w4[3], selector); w5[1] = hc_byte_perm (w4[1], w4[2], selector); w5[0] = hc_byte_perm (w4[0], w4[1], selector); w4[3] = hc_byte_perm (w3[3], w4[0], selector); w4[2] = hc_byte_perm (w3[2], w3[3], selector); w4[1] = hc_byte_perm (w3[1], w3[2], selector); w4[0] = hc_byte_perm (w3[0], w3[1], selector); w3[3] = hc_byte_perm (w2[3], w3[0], selector); w3[2] = hc_byte_perm (w2[2], w2[3], selector); w3[1] = hc_byte_perm (w2[1], w2[2], selector); w3[0] = hc_byte_perm (w2[0], w2[1], selector); w2[3] = hc_byte_perm (w1[3], w2[0], selector); w2[2] = hc_byte_perm (w1[2], w1[3], selector); w2[1] = hc_byte_perm (w1[1], w1[2], selector); w2[0] = hc_byte_perm (w1[0], w1[1], selector); w1[3] = hc_byte_perm (w0[3], w1[0], selector); w1[2] = hc_byte_perm (w0[2], w0[3], selector); w1[1] = hc_byte_perm (w0[1], w0[2], selector); w1[0] = hc_byte_perm (w0[0], w0[1], selector); w0[3] = hc_byte_perm ( 0, w0[0], selector); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: c1[0] = hc_byte_perm (w7[3], 0, selector); c0[3] = hc_byte_perm (w7[2], w7[3], selector); c0[2] = hc_byte_perm (w7[1], w7[2], selector); c0[1] = hc_byte_perm (w7[0], w7[1], selector); c0[0] = hc_byte_perm (w6[3], w7[0], selector); w7[3] = hc_byte_perm (w6[2], w6[3], selector); w7[2] = hc_byte_perm (w6[1], w6[2], selector); w7[1] = hc_byte_perm (w6[0], w6[1], selector); w7[0] = hc_byte_perm (w5[3], w6[0], selector); w6[3] = hc_byte_perm (w5[2], w5[3], selector); w6[2] = hc_byte_perm (w5[1], w5[2], selector); w6[1] = hc_byte_perm (w5[0], w5[1], selector); w6[0] = hc_byte_perm (w4[3], w5[0], selector); w5[3] = hc_byte_perm (w4[2], w4[3], selector); w5[2] = hc_byte_perm (w4[1], w4[2], selector); w5[1] = hc_byte_perm (w4[0], w4[1], selector); w5[0] = hc_byte_perm (w3[3], w4[0], selector); w4[3] = hc_byte_perm (w3[2], w3[3], selector); w4[2] = hc_byte_perm (w3[1], w3[2], selector); w4[1] = hc_byte_perm (w3[0], w3[1], selector); w4[0] = hc_byte_perm (w2[3], w3[0], selector); w3[3] = hc_byte_perm (w2[2], w2[3], selector); w3[2] = hc_byte_perm (w2[1], w2[2], selector); w3[1] = hc_byte_perm (w2[0], w2[1], selector); w3[0] = hc_byte_perm (w1[3], w2[0], selector); w2[3] = hc_byte_perm (w1[2], w1[3], selector); w2[2] = hc_byte_perm (w1[1], w1[2], selector); w2[1] = hc_byte_perm (w1[0], w1[1], selector); w2[0] = hc_byte_perm (w0[3], w1[0], selector); w1[3] = hc_byte_perm (w0[2], w0[3], selector); w1[2] = hc_byte_perm (w0[1], w0[2], selector); w1[1] = hc_byte_perm (w0[0], w0[1], selector); w1[0] = hc_byte_perm ( 0, w0[0], selector); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: c1[1] = hc_byte_perm (w7[3], 0, selector); c1[0] = hc_byte_perm (w7[2], w7[3], selector); c0[3] = hc_byte_perm (w7[1], w7[2], selector); c0[2] = hc_byte_perm (w7[0], w7[1], selector); c0[1] = hc_byte_perm (w6[3], w7[0], selector); c0[0] = hc_byte_perm (w6[2], w6[3], selector); w7[3] = hc_byte_perm (w6[1], w6[2], selector); w7[2] = hc_byte_perm (w6[0], w6[1], selector); w7[1] = hc_byte_perm (w5[3], w6[0], selector); w7[0] = hc_byte_perm (w5[2], w5[3], selector); w6[3] = hc_byte_perm (w5[1], w5[2], selector); w6[2] = hc_byte_perm (w5[0], w5[1], selector); w6[1] = hc_byte_perm (w4[3], w5[0], selector); w6[0] = hc_byte_perm (w4[2], w4[3], selector); w5[3] = hc_byte_perm (w4[1], w4[2], selector); w5[2] = hc_byte_perm (w4[0], w4[1], selector); w5[1] = hc_byte_perm (w3[3], w4[0], selector); w5[0] = hc_byte_perm (w3[2], w3[3], selector); w4[3] = hc_byte_perm (w3[1], w3[2], selector); w4[2] = hc_byte_perm (w3[0], w3[1], selector); w4[1] = hc_byte_perm (w2[3], w3[0], selector); w4[0] = hc_byte_perm (w2[2], w2[3], selector); w3[3] = hc_byte_perm (w2[1], w2[2], selector); w3[2] = hc_byte_perm (w2[0], w2[1], selector); w3[1] = hc_byte_perm (w1[3], w2[0], selector); w3[0] = hc_byte_perm (w1[2], w1[3], selector); w2[3] = hc_byte_perm (w1[1], w1[2], selector); w2[2] = hc_byte_perm (w1[0], w1[1], selector); w2[1] = hc_byte_perm (w0[3], w1[0], selector); w2[0] = hc_byte_perm (w0[2], w0[3], selector); w1[3] = hc_byte_perm (w0[1], w0[2], selector); w1[2] = hc_byte_perm (w0[0], w0[1], selector); w1[1] = hc_byte_perm ( 0, w0[0], selector); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: c1[2] = hc_byte_perm (w7[3], 0, selector); c1[1] = hc_byte_perm (w7[2], w7[3], selector); c1[0] = hc_byte_perm (w7[1], w7[2], selector); c0[3] = hc_byte_perm (w7[0], w7[1], selector); c0[2] = hc_byte_perm (w6[3], w7[0], selector); c0[1] = hc_byte_perm (w6[2], w6[3], selector); c0[0] = hc_byte_perm (w6[1], w6[2], selector); w7[3] = hc_byte_perm (w6[0], w6[1], selector); w7[2] = hc_byte_perm (w5[3], w6[0], selector); w7[1] = hc_byte_perm (w5[2], w5[3], selector); w7[0] = hc_byte_perm (w5[1], w5[2], selector); w6[3] = hc_byte_perm (w5[0], w5[1], selector); w6[2] = hc_byte_perm (w4[3], w5[0], selector); w6[1] = hc_byte_perm (w4[2], w4[3], selector); w6[0] = hc_byte_perm (w4[1], w4[2], selector); w5[3] = hc_byte_perm (w4[0], w4[1], selector); w5[2] = hc_byte_perm (w3[3], w4[0], selector); w5[1] = hc_byte_perm (w3[2], w3[3], selector); w5[0] = hc_byte_perm (w3[1], w3[2], selector); w4[3] = hc_byte_perm (w3[0], w3[1], selector); w4[2] = hc_byte_perm (w2[3], w3[0], selector); w4[1] = hc_byte_perm (w2[2], w2[3], selector); w4[0] = hc_byte_perm (w2[1], w2[2], selector); w3[3] = hc_byte_perm (w2[0], w2[1], selector); w3[2] = hc_byte_perm (w1[3], w2[0], selector); w3[1] = hc_byte_perm (w1[2], w1[3], selector); w3[0] = hc_byte_perm (w1[1], w1[2], selector); w2[3] = hc_byte_perm (w1[0], w1[1], selector); w2[2] = hc_byte_perm (w0[3], w1[0], selector); w2[1] = hc_byte_perm (w0[2], w0[3], selector); w2[0] = hc_byte_perm (w0[1], w0[2], selector); w1[3] = hc_byte_perm (w0[0], w0[1], selector); w1[2] = hc_byte_perm ( 0, w0[0], selector); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: c1[3] = hc_byte_perm (w7[3], 0, selector); c1[2] = hc_byte_perm (w7[2], w7[3], selector); c1[1] = hc_byte_perm (w7[1], w7[2], selector); c1[0] = hc_byte_perm (w7[0], w7[1], selector); c0[3] = hc_byte_perm (w6[3], w7[0], selector); c0[2] = hc_byte_perm (w6[2], w6[3], selector); c0[1] = hc_byte_perm (w6[1], w6[2], selector); c0[0] = hc_byte_perm (w6[0], w6[1], selector); w7[3] = hc_byte_perm (w5[3], w6[0], selector); w7[2] = hc_byte_perm (w5[2], w5[3], selector); w7[1] = hc_byte_perm (w5[1], w5[2], selector); w7[0] = hc_byte_perm (w5[0], w5[1], selector); w6[3] = hc_byte_perm (w4[3], w5[0], selector); w6[2] = hc_byte_perm (w4[2], w4[3], selector); w6[1] = hc_byte_perm (w4[1], w4[2], selector); w6[0] = hc_byte_perm (w4[0], w4[1], selector); w5[3] = hc_byte_perm (w3[3], w4[0], selector); w5[2] = hc_byte_perm (w3[2], w3[3], selector); w5[1] = hc_byte_perm (w3[1], w3[2], selector); w5[0] = hc_byte_perm (w3[0], w3[1], selector); w4[3] = hc_byte_perm (w2[3], w3[0], selector); w4[2] = hc_byte_perm (w2[2], w2[3], selector); w4[1] = hc_byte_perm (w2[1], w2[2], selector); w4[0] = hc_byte_perm (w2[0], w2[1], selector); w3[3] = hc_byte_perm (w1[3], w2[0], selector); w3[2] = hc_byte_perm (w1[2], w1[3], selector); w3[1] = hc_byte_perm (w1[1], w1[2], selector); w3[0] = hc_byte_perm (w1[0], w1[1], selector); w2[3] = hc_byte_perm (w0[3], w1[0], selector); w2[2] = hc_byte_perm (w0[2], w0[3], selector); w2[1] = hc_byte_perm (w0[1], w0[2], selector); w2[0] = hc_byte_perm (w0[0], w0[1], selector); w1[3] = hc_byte_perm ( 0, w0[0], selector); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: c2[0] = hc_byte_perm (w7[3], 0, selector); c1[3] = hc_byte_perm (w7[2], w7[3], selector); c1[2] = hc_byte_perm (w7[1], w7[2], selector); c1[1] = hc_byte_perm (w7[0], w7[1], selector); c1[0] = hc_byte_perm (w6[3], w7[0], selector); c0[3] = hc_byte_perm (w6[2], w6[3], selector); c0[2] = hc_byte_perm (w6[1], w6[2], selector); c0[1] = hc_byte_perm (w6[0], w6[1], selector); c0[0] = hc_byte_perm (w5[3], w6[0], selector); w7[3] = hc_byte_perm (w5[2], w5[3], selector); w7[2] = hc_byte_perm (w5[1], w5[2], selector); w7[1] = hc_byte_perm (w5[0], w5[1], selector); w7[0] = hc_byte_perm (w4[3], w5[0], selector); w6[3] = hc_byte_perm (w4[2], w4[3], selector); w6[2] = hc_byte_perm (w4[1], w4[2], selector); w6[1] = hc_byte_perm (w4[0], w4[1], selector); w6[0] = hc_byte_perm (w3[3], w4[0], selector); w5[3] = hc_byte_perm (w3[2], w3[3], selector); w5[2] = hc_byte_perm (w3[1], w3[2], selector); w5[1] = hc_byte_perm (w3[0], w3[1], selector); w5[0] = hc_byte_perm (w2[3], w3[0], selector); w4[3] = hc_byte_perm (w2[2], w2[3], selector); w4[2] = hc_byte_perm (w2[1], w2[2], selector); w4[1] = hc_byte_perm (w2[0], w2[1], selector); w4[0] = hc_byte_perm (w1[3], w2[0], selector); w3[3] = hc_byte_perm (w1[2], w1[3], selector); w3[2] = hc_byte_perm (w1[1], w1[2], selector); w3[1] = hc_byte_perm (w1[0], w1[1], selector); w3[0] = hc_byte_perm (w0[3], w1[0], selector); w2[3] = hc_byte_perm (w0[2], w0[3], selector); w2[2] = hc_byte_perm (w0[1], w0[2], selector); w2[1] = hc_byte_perm (w0[0], w0[1], selector); w2[0] = hc_byte_perm ( 0, w0[0], selector); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: c2[1] = hc_byte_perm (w7[3], 0, selector); c2[0] = hc_byte_perm (w7[2], w7[3], selector); c1[3] = hc_byte_perm (w7[1], w7[2], selector); c1[2] = hc_byte_perm (w7[0], w7[1], selector); c1[1] = hc_byte_perm (w6[3], w7[0], selector); c1[0] = hc_byte_perm (w6[2], w6[3], selector); c0[3] = hc_byte_perm (w6[1], w6[2], selector); c0[2] = hc_byte_perm (w6[0], w6[1], selector); c0[1] = hc_byte_perm (w5[3], w6[0], selector); c0[0] = hc_byte_perm (w5[2], w5[3], selector); w7[3] = hc_byte_perm (w5[1], w5[2], selector); w7[2] = hc_byte_perm (w5[0], w5[1], selector); w7[1] = hc_byte_perm (w4[3], w5[0], selector); w7[0] = hc_byte_perm (w4[2], w4[3], selector); w6[3] = hc_byte_perm (w4[1], w4[2], selector); w6[2] = hc_byte_perm (w4[0], w4[1], selector); w6[1] = hc_byte_perm (w3[3], w4[0], selector); w6[0] = hc_byte_perm (w3[2], w3[3], selector); w5[3] = hc_byte_perm (w3[1], w3[2], selector); w5[2] = hc_byte_perm (w3[0], w3[1], selector); w5[1] = hc_byte_perm (w2[3], w3[0], selector); w5[0] = hc_byte_perm (w2[2], w2[3], selector); w4[3] = hc_byte_perm (w2[1], w2[2], selector); w4[2] = hc_byte_perm (w2[0], w2[1], selector); w4[1] = hc_byte_perm (w1[3], w2[0], selector); w4[0] = hc_byte_perm (w1[2], w1[3], selector); w3[3] = hc_byte_perm (w1[1], w1[2], selector); w3[2] = hc_byte_perm (w1[0], w1[1], selector); w3[1] = hc_byte_perm (w0[3], w1[0], selector); w3[0] = hc_byte_perm (w0[2], w0[3], selector); w2[3] = hc_byte_perm (w0[1], w0[2], selector); w2[2] = hc_byte_perm (w0[0], w0[1], selector); w2[1] = hc_byte_perm ( 0, w0[0], selector); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: c2[2] = hc_byte_perm (w7[3], 0, selector); c2[1] = hc_byte_perm (w7[2], w7[3], selector); c2[0] = hc_byte_perm (w7[1], w7[2], selector); c1[3] = hc_byte_perm (w7[0], w7[1], selector); c1[2] = hc_byte_perm (w6[3], w7[0], selector); c1[1] = hc_byte_perm (w6[2], w6[3], selector); c1[0] = hc_byte_perm (w6[1], w6[2], selector); c0[3] = hc_byte_perm (w6[0], w6[1], selector); c0[2] = hc_byte_perm (w5[3], w6[0], selector); c0[1] = hc_byte_perm (w5[2], w5[3], selector); c0[0] = hc_byte_perm (w5[1], w5[2], selector); w7[3] = hc_byte_perm (w5[0], w5[1], selector); w7[2] = hc_byte_perm (w4[3], w5[0], selector); w7[1] = hc_byte_perm (w4[2], w4[3], selector); w7[0] = hc_byte_perm (w4[1], w4[2], selector); w6[3] = hc_byte_perm (w4[0], w4[1], selector); w6[2] = hc_byte_perm (w3[3], w4[0], selector); w6[1] = hc_byte_perm (w3[2], w3[3], selector); w6[0] = hc_byte_perm (w3[1], w3[2], selector); w5[3] = hc_byte_perm (w3[0], w3[1], selector); w5[2] = hc_byte_perm (w2[3], w3[0], selector); w5[1] = hc_byte_perm (w2[2], w2[3], selector); w5[0] = hc_byte_perm (w2[1], w2[2], selector); w4[3] = hc_byte_perm (w2[0], w2[1], selector); w4[2] = hc_byte_perm (w1[3], w2[0], selector); w4[1] = hc_byte_perm (w1[2], w1[3], selector); w4[0] = hc_byte_perm (w1[1], w1[2], selector); w3[3] = hc_byte_perm (w1[0], w1[1], selector); w3[2] = hc_byte_perm (w0[3], w1[0], selector); w3[1] = hc_byte_perm (w0[2], w0[3], selector); w3[0] = hc_byte_perm (w0[1], w0[2], selector); w2[3] = hc_byte_perm (w0[0], w0[1], selector); w2[2] = hc_byte_perm ( 0, w0[0], selector); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: c2[3] = hc_byte_perm (w7[3], 0, selector); c2[2] = hc_byte_perm (w7[2], w7[3], selector); c2[1] = hc_byte_perm (w7[1], w7[2], selector); c2[0] = hc_byte_perm (w7[0], w7[1], selector); c1[3] = hc_byte_perm (w6[3], w7[0], selector); c1[2] = hc_byte_perm (w6[2], w6[3], selector); c1[1] = hc_byte_perm (w6[1], w6[2], selector); c1[0] = hc_byte_perm (w6[0], w6[1], selector); c0[3] = hc_byte_perm (w5[3], w6[0], selector); c0[2] = hc_byte_perm (w5[2], w5[3], selector); c0[1] = hc_byte_perm (w5[1], w5[2], selector); c0[0] = hc_byte_perm (w5[0], w5[1], selector); w7[3] = hc_byte_perm (w4[3], w5[0], selector); w7[2] = hc_byte_perm (w4[2], w4[3], selector); w7[1] = hc_byte_perm (w4[1], w4[2], selector); w7[0] = hc_byte_perm (w4[0], w4[1], selector); w6[3] = hc_byte_perm (w3[3], w4[0], selector); w6[2] = hc_byte_perm (w3[2], w3[3], selector); w6[1] = hc_byte_perm (w3[1], w3[2], selector); w6[0] = hc_byte_perm (w3[0], w3[1], selector); w5[3] = hc_byte_perm (w2[3], w3[0], selector); w5[2] = hc_byte_perm (w2[2], w2[3], selector); w5[1] = hc_byte_perm (w2[1], w2[2], selector); w5[0] = hc_byte_perm (w2[0], w2[1], selector); w4[3] = hc_byte_perm (w1[3], w2[0], selector); w4[2] = hc_byte_perm (w1[2], w1[3], selector); w4[1] = hc_byte_perm (w1[1], w1[2], selector); w4[0] = hc_byte_perm (w1[0], w1[1], selector); w3[3] = hc_byte_perm (w0[3], w1[0], selector); w3[2] = hc_byte_perm (w0[2], w0[3], selector); w3[1] = hc_byte_perm (w0[1], w0[2], selector); w3[0] = hc_byte_perm (w0[0], w0[1], selector); w2[3] = hc_byte_perm ( 0, w0[0], selector); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: c3[0] = hc_byte_perm (w7[3], 0, selector); c2[3] = hc_byte_perm (w7[2], w7[3], selector); c2[2] = hc_byte_perm (w7[1], w7[2], selector); c2[1] = hc_byte_perm (w7[0], w7[1], selector); c2[0] = hc_byte_perm (w6[3], w7[0], selector); c1[3] = hc_byte_perm (w6[2], w6[3], selector); c1[2] = hc_byte_perm (w6[1], w6[2], selector); c1[1] = hc_byte_perm (w6[0], w6[1], selector); c1[0] = hc_byte_perm (w5[3], w6[0], selector); c0[3] = hc_byte_perm (w5[2], w5[3], selector); c0[2] = hc_byte_perm (w5[1], w5[2], selector); c0[1] = hc_byte_perm (w5[0], w5[1], selector); c0[0] = hc_byte_perm (w4[3], w5[0], selector); w7[3] = hc_byte_perm (w4[2], w4[3], selector); w7[2] = hc_byte_perm (w4[1], w4[2], selector); w7[1] = hc_byte_perm (w4[0], w4[1], selector); w7[0] = hc_byte_perm (w3[3], w4[0], selector); w6[3] = hc_byte_perm (w3[2], w3[3], selector); w6[2] = hc_byte_perm (w3[1], w3[2], selector); w6[1] = hc_byte_perm (w3[0], w3[1], selector); w6[0] = hc_byte_perm (w2[3], w3[0], selector); w5[3] = hc_byte_perm (w2[2], w2[3], selector); w5[2] = hc_byte_perm (w2[1], w2[2], selector); w5[1] = hc_byte_perm (w2[0], w2[1], selector); w5[0] = hc_byte_perm (w1[3], w2[0], selector); w4[3] = hc_byte_perm (w1[2], w1[3], selector); w4[2] = hc_byte_perm (w1[1], w1[2], selector); w4[1] = hc_byte_perm (w1[0], w1[1], selector); w4[0] = hc_byte_perm (w0[3], w1[0], selector); w3[3] = hc_byte_perm (w0[2], w0[3], selector); w3[2] = hc_byte_perm (w0[1], w0[2], selector); w3[1] = hc_byte_perm (w0[0], w0[1], selector); w3[0] = hc_byte_perm ( 0, w0[0], selector); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: c3[1] = hc_byte_perm (w7[3], 0, selector); c3[0] = hc_byte_perm (w7[2], w7[3], selector); c2[3] = hc_byte_perm (w7[1], w7[2], selector); c2[2] = hc_byte_perm (w7[0], w7[1], selector); c2[1] = hc_byte_perm (w6[3], w7[0], selector); c2[0] = hc_byte_perm (w6[2], w6[3], selector); c1[3] = hc_byte_perm (w6[1], w6[2], selector); c1[2] = hc_byte_perm (w6[0], w6[1], selector); c1[1] = hc_byte_perm (w5[3], w6[0], selector); c1[0] = hc_byte_perm (w5[2], w5[3], selector); c0[3] = hc_byte_perm (w5[1], w5[2], selector); c0[2] = hc_byte_perm (w5[0], w5[1], selector); c0[1] = hc_byte_perm (w4[3], w5[0], selector); c0[0] = hc_byte_perm (w4[2], w4[3], selector); w7[3] = hc_byte_perm (w4[1], w4[2], selector); w7[2] = hc_byte_perm (w4[0], w4[1], selector); w7[1] = hc_byte_perm (w3[3], w4[0], selector); w7[0] = hc_byte_perm (w3[2], w3[3], selector); w6[3] = hc_byte_perm (w3[1], w3[2], selector); w6[2] = hc_byte_perm (w3[0], w3[1], selector); w6[1] = hc_byte_perm (w2[3], w3[0], selector); w6[0] = hc_byte_perm (w2[2], w2[3], selector); w5[3] = hc_byte_perm (w2[1], w2[2], selector); w5[2] = hc_byte_perm (w2[0], w2[1], selector); w5[1] = hc_byte_perm (w1[3], w2[0], selector); w5[0] = hc_byte_perm (w1[2], w1[3], selector); w4[3] = hc_byte_perm (w1[1], w1[2], selector); w4[2] = hc_byte_perm (w1[0], w1[1], selector); w4[1] = hc_byte_perm (w0[3], w1[0], selector); w4[0] = hc_byte_perm (w0[2], w0[3], selector); w3[3] = hc_byte_perm (w0[1], w0[2], selector); w3[2] = hc_byte_perm (w0[0], w0[1], selector); w3[1] = hc_byte_perm ( 0, w0[0], selector); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: c3[2] = hc_byte_perm (w7[3], 0, selector); c3[1] = hc_byte_perm (w7[2], w7[3], selector); c3[0] = hc_byte_perm (w7[1], w7[2], selector); c2[3] = hc_byte_perm (w7[0], w7[1], selector); c2[2] = hc_byte_perm (w6[3], w7[0], selector); c2[1] = hc_byte_perm (w6[2], w6[3], selector); c2[0] = hc_byte_perm (w6[1], w6[2], selector); c1[3] = hc_byte_perm (w6[0], w6[1], selector); c1[2] = hc_byte_perm (w5[3], w6[0], selector); c1[1] = hc_byte_perm (w5[2], w5[3], selector); c1[0] = hc_byte_perm (w5[1], w5[2], selector); c0[3] = hc_byte_perm (w5[0], w5[1], selector); c0[2] = hc_byte_perm (w4[3], w5[0], selector); c0[1] = hc_byte_perm (w4[2], w4[3], selector); c0[0] = hc_byte_perm (w4[1], w4[2], selector); w7[3] = hc_byte_perm (w4[0], w4[1], selector); w7[2] = hc_byte_perm (w3[3], w4[0], selector); w7[1] = hc_byte_perm (w3[2], w3[3], selector); w7[0] = hc_byte_perm (w3[1], w3[2], selector); w6[3] = hc_byte_perm (w3[0], w3[1], selector); w6[2] = hc_byte_perm (w2[3], w3[0], selector); w6[1] = hc_byte_perm (w2[2], w2[3], selector); w6[0] = hc_byte_perm (w2[1], w2[2], selector); w5[3] = hc_byte_perm (w2[0], w2[1], selector); w5[2] = hc_byte_perm (w1[3], w2[0], selector); w5[1] = hc_byte_perm (w1[2], w1[3], selector); w5[0] = hc_byte_perm (w1[1], w1[2], selector); w4[3] = hc_byte_perm (w1[0], w1[1], selector); w4[2] = hc_byte_perm (w0[3], w1[0], selector); w4[1] = hc_byte_perm (w0[2], w0[3], selector); w4[0] = hc_byte_perm (w0[1], w0[2], selector); w3[3] = hc_byte_perm (w0[0], w0[1], selector); w3[2] = hc_byte_perm ( 0, w0[0], selector); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: c3[3] = hc_byte_perm (w7[3], 0, selector); c3[2] = hc_byte_perm (w7[2], w7[3], selector); c3[1] = hc_byte_perm (w7[1], w7[2], selector); c3[0] = hc_byte_perm (w7[0], w7[1], selector); c2[3] = hc_byte_perm (w6[3], w7[0], selector); c2[2] = hc_byte_perm (w6[2], w6[3], selector); c2[1] = hc_byte_perm (w6[1], w6[2], selector); c2[0] = hc_byte_perm (w6[0], w6[1], selector); c1[3] = hc_byte_perm (w5[3], w6[0], selector); c1[2] = hc_byte_perm (w5[2], w5[3], selector); c1[1] = hc_byte_perm (w5[1], w5[2], selector); c1[0] = hc_byte_perm (w5[0], w5[1], selector); c0[3] = hc_byte_perm (w4[3], w5[0], selector); c0[2] = hc_byte_perm (w4[2], w4[3], selector); c0[1] = hc_byte_perm (w4[1], w4[2], selector); c0[0] = hc_byte_perm (w4[0], w4[1], selector); w7[3] = hc_byte_perm (w3[3], w4[0], selector); w7[2] = hc_byte_perm (w3[2], w3[3], selector); w7[1] = hc_byte_perm (w3[1], w3[2], selector); w7[0] = hc_byte_perm (w3[0], w3[1], selector); w6[3] = hc_byte_perm (w2[3], w3[0], selector); w6[2] = hc_byte_perm (w2[2], w2[3], selector); w6[1] = hc_byte_perm (w2[1], w2[2], selector); w6[0] = hc_byte_perm (w2[0], w2[1], selector); w5[3] = hc_byte_perm (w1[3], w2[0], selector); w5[2] = hc_byte_perm (w1[2], w1[3], selector); w5[1] = hc_byte_perm (w1[1], w1[2], selector); w5[0] = hc_byte_perm (w1[0], w1[1], selector); w4[3] = hc_byte_perm (w0[3], w1[0], selector); w4[2] = hc_byte_perm (w0[2], w0[3], selector); w4[1] = hc_byte_perm (w0[1], w0[2], selector); w4[0] = hc_byte_perm (w0[0], w0[1], selector); w3[3] = hc_byte_perm ( 0, w0[0], selector); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 16: c4[0] = hc_byte_perm (w7[3], 0, selector); c3[3] = hc_byte_perm (w7[2], w7[3], selector); c3[2] = hc_byte_perm (w7[1], w7[2], selector); c3[1] = hc_byte_perm (w7[0], w7[1], selector); c3[0] = hc_byte_perm (w6[3], w7[0], selector); c2[3] = hc_byte_perm (w6[2], w6[3], selector); c2[2] = hc_byte_perm (w6[1], w6[2], selector); c2[1] = hc_byte_perm (w6[0], w6[1], selector); c2[0] = hc_byte_perm (w5[3], w6[0], selector); c1[3] = hc_byte_perm (w5[2], w5[3], selector); c1[2] = hc_byte_perm (w5[1], w5[2], selector); c1[1] = hc_byte_perm (w5[0], w5[1], selector); c1[0] = hc_byte_perm (w4[3], w5[0], selector); c0[3] = hc_byte_perm (w4[2], w4[3], selector); c0[2] = hc_byte_perm (w4[1], w4[2], selector); c0[1] = hc_byte_perm (w4[0], w4[1], selector); c0[0] = hc_byte_perm (w3[3], w4[0], selector); w7[3] = hc_byte_perm (w3[2], w3[3], selector); w7[2] = hc_byte_perm (w3[1], w3[2], selector); w7[1] = hc_byte_perm (w3[0], w3[1], selector); w7[0] = hc_byte_perm (w2[3], w3[0], selector); w6[3] = hc_byte_perm (w2[2], w2[3], selector); w6[2] = hc_byte_perm (w2[1], w2[2], selector); w6[1] = hc_byte_perm (w2[0], w2[1], selector); w6[0] = hc_byte_perm (w1[3], w2[0], selector); w5[3] = hc_byte_perm (w1[2], w1[3], selector); w5[2] = hc_byte_perm (w1[1], w1[2], selector); w5[1] = hc_byte_perm (w1[0], w1[1], selector); w5[0] = hc_byte_perm (w0[3], w1[0], selector); w4[3] = hc_byte_perm (w0[2], w0[3], selector); w4[2] = hc_byte_perm (w0[1], w0[2], selector); w4[1] = hc_byte_perm (w0[0], w0[1], selector); w4[0] = hc_byte_perm ( 0, w0[0], selector); w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 17: c4[1] = hc_byte_perm (w7[3], 0, selector); c4[0] = hc_byte_perm (w7[2], w7[3], selector); c3[3] = hc_byte_perm (w7[1], w7[2], selector); c3[2] = hc_byte_perm (w7[0], w7[1], selector); c3[1] = hc_byte_perm (w6[3], w7[0], selector); c3[0] = hc_byte_perm (w6[2], w6[3], selector); c2[3] = hc_byte_perm (w6[1], w6[2], selector); c2[2] = hc_byte_perm (w6[0], w6[1], selector); c2[1] = hc_byte_perm (w5[3], w6[0], selector); c2[0] = hc_byte_perm (w5[2], w5[3], selector); c1[3] = hc_byte_perm (w5[1], w5[2], selector); c1[2] = hc_byte_perm (w5[0], w5[1], selector); c1[1] = hc_byte_perm (w4[3], w5[0], selector); c1[0] = hc_byte_perm (w4[2], w4[3], selector); c0[3] = hc_byte_perm (w4[1], w4[2], selector); c0[2] = hc_byte_perm (w4[0], w4[1], selector); c0[1] = hc_byte_perm (w3[3], w4[0], selector); c0[0] = hc_byte_perm (w3[2], w3[3], selector); w7[3] = hc_byte_perm (w3[1], w3[2], selector); w7[2] = hc_byte_perm (w3[0], w3[1], selector); w7[1] = hc_byte_perm (w2[3], w3[0], selector); w7[0] = hc_byte_perm (w2[2], w2[3], selector); w6[3] = hc_byte_perm (w2[1], w2[2], selector); w6[2] = hc_byte_perm (w2[0], w2[1], selector); w6[1] = hc_byte_perm (w1[3], w2[0], selector); w6[0] = hc_byte_perm (w1[2], w1[3], selector); w5[3] = hc_byte_perm (w1[1], w1[2], selector); w5[2] = hc_byte_perm (w1[0], w1[1], selector); w5[1] = hc_byte_perm (w0[3], w1[0], selector); w5[0] = hc_byte_perm (w0[2], w0[3], selector); w4[3] = hc_byte_perm (w0[1], w0[2], selector); w4[2] = hc_byte_perm (w0[0], w0[1], selector); w4[1] = hc_byte_perm ( 0, w0[0], selector); w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 18: c4[2] = hc_byte_perm (w7[3], 0, selector); c4[1] = hc_byte_perm (w7[2], w7[3], selector); c4[0] = hc_byte_perm (w7[1], w7[2], selector); c3[3] = hc_byte_perm (w7[0], w7[1], selector); c3[2] = hc_byte_perm (w6[3], w7[0], selector); c3[1] = hc_byte_perm (w6[2], w6[3], selector); c3[0] = hc_byte_perm (w6[1], w6[2], selector); c2[3] = hc_byte_perm (w6[0], w6[1], selector); c2[2] = hc_byte_perm (w5[3], w6[0], selector); c2[1] = hc_byte_perm (w5[2], w5[3], selector); c2[0] = hc_byte_perm (w5[1], w5[2], selector); c1[3] = hc_byte_perm (w5[0], w5[1], selector); c1[2] = hc_byte_perm (w4[3], w5[0], selector); c1[1] = hc_byte_perm (w4[2], w4[3], selector); c1[0] = hc_byte_perm (w4[1], w4[2], selector); c0[3] = hc_byte_perm (w4[0], w4[1], selector); c0[2] = hc_byte_perm (w3[3], w4[0], selector); c0[1] = hc_byte_perm (w3[2], w3[3], selector); c0[0] = hc_byte_perm (w3[1], w3[2], selector); w7[3] = hc_byte_perm (w3[0], w3[1], selector); w7[2] = hc_byte_perm (w2[3], w3[0], selector); w7[1] = hc_byte_perm (w2[2], w2[3], selector); w7[0] = hc_byte_perm (w2[1], w2[2], selector); w6[3] = hc_byte_perm (w2[0], w2[1], selector); w6[2] = hc_byte_perm (w1[3], w2[0], selector); w6[1] = hc_byte_perm (w1[2], w1[3], selector); w6[0] = hc_byte_perm (w1[1], w1[2], selector); w5[3] = hc_byte_perm (w1[0], w1[1], selector); w5[2] = hc_byte_perm (w0[3], w1[0], selector); w5[1] = hc_byte_perm (w0[2], w0[3], selector); w5[0] = hc_byte_perm (w0[1], w0[2], selector); w4[3] = hc_byte_perm (w0[0], w0[1], selector); w4[2] = hc_byte_perm ( 0, w0[0], selector); w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 19: c4[3] = hc_byte_perm (w7[3], 0, selector); c4[2] = hc_byte_perm (w7[2], w7[3], selector); c4[1] = hc_byte_perm (w7[1], w7[2], selector); c4[0] = hc_byte_perm (w7[0], w7[1], selector); c3[3] = hc_byte_perm (w6[3], w7[0], selector); c3[2] = hc_byte_perm (w6[2], w6[3], selector); c3[1] = hc_byte_perm (w6[1], w6[2], selector); c3[0] = hc_byte_perm (w6[0], w6[1], selector); c2[3] = hc_byte_perm (w5[3], w6[0], selector); c2[2] = hc_byte_perm (w5[2], w5[3], selector); c2[1] = hc_byte_perm (w5[1], w5[2], selector); c2[0] = hc_byte_perm (w5[0], w5[1], selector); c1[3] = hc_byte_perm (w4[3], w5[0], selector); c1[2] = hc_byte_perm (w4[2], w4[3], selector); c1[1] = hc_byte_perm (w4[1], w4[2], selector); c1[0] = hc_byte_perm (w4[0], w4[1], selector); c0[3] = hc_byte_perm (w3[3], w4[0], selector); c0[2] = hc_byte_perm (w3[2], w3[3], selector); c0[1] = hc_byte_perm (w3[1], w3[2], selector); c0[0] = hc_byte_perm (w3[0], w3[1], selector); w7[3] = hc_byte_perm (w2[3], w3[0], selector); w7[2] = hc_byte_perm (w2[2], w2[3], selector); w7[1] = hc_byte_perm (w2[1], w2[2], selector); w7[0] = hc_byte_perm (w2[0], w2[1], selector); w6[3] = hc_byte_perm (w1[3], w2[0], selector); w6[2] = hc_byte_perm (w1[2], w1[3], selector); w6[1] = hc_byte_perm (w1[1], w1[2], selector); w6[0] = hc_byte_perm (w1[0], w1[1], selector); w5[3] = hc_byte_perm (w0[3], w1[0], selector); w5[2] = hc_byte_perm (w0[2], w0[3], selector); w5[1] = hc_byte_perm (w0[1], w0[2], selector); w5[0] = hc_byte_perm (w0[0], w0[1], selector); w4[3] = hc_byte_perm ( 0, w0[0], selector); w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 20: c5[0] = hc_byte_perm (w7[3], 0, selector); c4[3] = hc_byte_perm (w7[2], w7[3], selector); c4[2] = hc_byte_perm (w7[1], w7[2], selector); c4[1] = hc_byte_perm (w7[0], w7[1], selector); c4[0] = hc_byte_perm (w6[3], w7[0], selector); c3[3] = hc_byte_perm (w6[2], w6[3], selector); c3[2] = hc_byte_perm (w6[1], w6[2], selector); c3[1] = hc_byte_perm (w6[0], w6[1], selector); c3[0] = hc_byte_perm (w5[3], w6[0], selector); c2[3] = hc_byte_perm (w5[2], w5[3], selector); c2[2] = hc_byte_perm (w5[1], w5[2], selector); c2[1] = hc_byte_perm (w5[0], w5[1], selector); c2[0] = hc_byte_perm (w4[3], w5[0], selector); c1[3] = hc_byte_perm (w4[2], w4[3], selector); c1[2] = hc_byte_perm (w4[1], w4[2], selector); c1[1] = hc_byte_perm (w4[0], w4[1], selector); c1[0] = hc_byte_perm (w3[3], w4[0], selector); c0[3] = hc_byte_perm (w3[2], w3[3], selector); c0[2] = hc_byte_perm (w3[1], w3[2], selector); c0[1] = hc_byte_perm (w3[0], w3[1], selector); c0[0] = hc_byte_perm (w2[3], w3[0], selector); w7[3] = hc_byte_perm (w2[2], w2[3], selector); w7[2] = hc_byte_perm (w2[1], w2[2], selector); w7[1] = hc_byte_perm (w2[0], w2[1], selector); w7[0] = hc_byte_perm (w1[3], w2[0], selector); w6[3] = hc_byte_perm (w1[2], w1[3], selector); w6[2] = hc_byte_perm (w1[1], w1[2], selector); w6[1] = hc_byte_perm (w1[0], w1[1], selector); w6[0] = hc_byte_perm (w0[3], w1[0], selector); w5[3] = hc_byte_perm (w0[2], w0[3], selector); w5[2] = hc_byte_perm (w0[1], w0[2], selector); w5[1] = hc_byte_perm (w0[0], w0[1], selector); w5[0] = hc_byte_perm ( 0, w0[0], selector); w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 21: c5[1] = hc_byte_perm (w7[3], 0, selector); c5[0] = hc_byte_perm (w7[2], w7[3], selector); c4[3] = hc_byte_perm (w7[1], w7[2], selector); c4[2] = hc_byte_perm (w7[0], w7[1], selector); c4[1] = hc_byte_perm (w6[3], w7[0], selector); c4[0] = hc_byte_perm (w6[2], w6[3], selector); c3[3] = hc_byte_perm (w6[1], w6[2], selector); c3[2] = hc_byte_perm (w6[0], w6[1], selector); c3[1] = hc_byte_perm (w5[3], w6[0], selector); c3[0] = hc_byte_perm (w5[2], w5[3], selector); c2[3] = hc_byte_perm (w5[1], w5[2], selector); c2[2] = hc_byte_perm (w5[0], w5[1], selector); c2[1] = hc_byte_perm (w4[3], w5[0], selector); c2[0] = hc_byte_perm (w4[2], w4[3], selector); c1[3] = hc_byte_perm (w4[1], w4[2], selector); c1[2] = hc_byte_perm (w4[0], w4[1], selector); c1[1] = hc_byte_perm (w3[3], w4[0], selector); c1[0] = hc_byte_perm (w3[2], w3[3], selector); c0[3] = hc_byte_perm (w3[1], w3[2], selector); c0[2] = hc_byte_perm (w3[0], w3[1], selector); c0[1] = hc_byte_perm (w2[3], w3[0], selector); c0[0] = hc_byte_perm (w2[2], w2[3], selector); w7[3] = hc_byte_perm (w2[1], w2[2], selector); w7[2] = hc_byte_perm (w2[0], w2[1], selector); w7[1] = hc_byte_perm (w1[3], w2[0], selector); w7[0] = hc_byte_perm (w1[2], w1[3], selector); w6[3] = hc_byte_perm (w1[1], w1[2], selector); w6[2] = hc_byte_perm (w1[0], w1[1], selector); w6[1] = hc_byte_perm (w0[3], w1[0], selector); w6[0] = hc_byte_perm (w0[2], w0[3], selector); w5[3] = hc_byte_perm (w0[1], w0[2], selector); w5[2] = hc_byte_perm (w0[0], w0[1], selector); w5[1] = hc_byte_perm ( 0, w0[0], selector); w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 22: c5[2] = hc_byte_perm (w7[3], 0, selector); c5[1] = hc_byte_perm (w7[2], w7[3], selector); c5[0] = hc_byte_perm (w7[1], w7[2], selector); c4[3] = hc_byte_perm (w7[0], w7[1], selector); c4[2] = hc_byte_perm (w6[3], w7[0], selector); c4[1] = hc_byte_perm (w6[2], w6[3], selector); c4[0] = hc_byte_perm (w6[1], w6[2], selector); c3[3] = hc_byte_perm (w6[0], w6[1], selector); c3[2] = hc_byte_perm (w5[3], w6[0], selector); c3[1] = hc_byte_perm (w5[2], w5[3], selector); c3[0] = hc_byte_perm (w5[1], w5[2], selector); c2[3] = hc_byte_perm (w5[0], w5[1], selector); c2[2] = hc_byte_perm (w4[3], w5[0], selector); c2[1] = hc_byte_perm (w4[2], w4[3], selector); c2[0] = hc_byte_perm (w4[1], w4[2], selector); c1[3] = hc_byte_perm (w4[0], w4[1], selector); c1[2] = hc_byte_perm (w3[3], w4[0], selector); c1[1] = hc_byte_perm (w3[2], w3[3], selector); c1[0] = hc_byte_perm (w3[1], w3[2], selector); c0[3] = hc_byte_perm (w3[0], w3[1], selector); c0[2] = hc_byte_perm (w2[3], w3[0], selector); c0[1] = hc_byte_perm (w2[2], w2[3], selector); c0[0] = hc_byte_perm (w2[1], w2[2], selector); w7[3] = hc_byte_perm (w2[0], w2[1], selector); w7[2] = hc_byte_perm (w1[3], w2[0], selector); w7[1] = hc_byte_perm (w1[2], w1[3], selector); w7[0] = hc_byte_perm (w1[1], w1[2], selector); w6[3] = hc_byte_perm (w1[0], w1[1], selector); w6[2] = hc_byte_perm (w0[3], w1[0], selector); w6[1] = hc_byte_perm (w0[2], w0[3], selector); w6[0] = hc_byte_perm (w0[1], w0[2], selector); w5[3] = hc_byte_perm (w0[0], w0[1], selector); w5[2] = hc_byte_perm ( 0, w0[0], selector); w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 23: c5[3] = hc_byte_perm (w7[3], 0, selector); c5[2] = hc_byte_perm (w7[2], w7[3], selector); c5[1] = hc_byte_perm (w7[1], w7[2], selector); c5[0] = hc_byte_perm (w7[0], w7[1], selector); c4[3] = hc_byte_perm (w6[3], w7[0], selector); c4[2] = hc_byte_perm (w6[2], w6[3], selector); c4[1] = hc_byte_perm (w6[1], w6[2], selector); c4[0] = hc_byte_perm (w6[0], w6[1], selector); c3[3] = hc_byte_perm (w5[3], w6[0], selector); c3[2] = hc_byte_perm (w5[2], w5[3], selector); c3[1] = hc_byte_perm (w5[1], w5[2], selector); c3[0] = hc_byte_perm (w5[0], w5[1], selector); c2[3] = hc_byte_perm (w4[3], w5[0], selector); c2[2] = hc_byte_perm (w4[2], w4[3], selector); c2[1] = hc_byte_perm (w4[1], w4[2], selector); c2[0] = hc_byte_perm (w4[0], w4[1], selector); c1[3] = hc_byte_perm (w3[3], w4[0], selector); c1[2] = hc_byte_perm (w3[2], w3[3], selector); c1[1] = hc_byte_perm (w3[1], w3[2], selector); c1[0] = hc_byte_perm (w3[0], w3[1], selector); c0[3] = hc_byte_perm (w2[3], w3[0], selector); c0[2] = hc_byte_perm (w2[2], w2[3], selector); c0[1] = hc_byte_perm (w2[1], w2[2], selector); c0[0] = hc_byte_perm (w2[0], w2[1], selector); w7[3] = hc_byte_perm (w1[3], w2[0], selector); w7[2] = hc_byte_perm (w1[2], w1[3], selector); w7[1] = hc_byte_perm (w1[1], w1[2], selector); w7[0] = hc_byte_perm (w1[0], w1[1], selector); w6[3] = hc_byte_perm (w0[3], w1[0], selector); w6[2] = hc_byte_perm (w0[2], w0[3], selector); w6[1] = hc_byte_perm (w0[1], w0[2], selector); w6[0] = hc_byte_perm (w0[0], w0[1], selector); w5[3] = hc_byte_perm ( 0, w0[0], selector); w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 24: c6[0] = hc_byte_perm (w7[3], 0, selector); c5[3] = hc_byte_perm (w7[2], w7[3], selector); c5[2] = hc_byte_perm (w7[1], w7[2], selector); c5[1] = hc_byte_perm (w7[0], w7[1], selector); c5[0] = hc_byte_perm (w6[3], w7[0], selector); c4[3] = hc_byte_perm (w6[2], w6[3], selector); c4[2] = hc_byte_perm (w6[1], w6[2], selector); c4[1] = hc_byte_perm (w6[0], w6[1], selector); c4[0] = hc_byte_perm (w5[3], w6[0], selector); c3[3] = hc_byte_perm (w5[2], w5[3], selector); c3[2] = hc_byte_perm (w5[1], w5[2], selector); c3[1] = hc_byte_perm (w5[0], w5[1], selector); c3[0] = hc_byte_perm (w4[3], w5[0], selector); c2[3] = hc_byte_perm (w4[2], w4[3], selector); c2[2] = hc_byte_perm (w4[1], w4[2], selector); c2[1] = hc_byte_perm (w4[0], w4[1], selector); c2[0] = hc_byte_perm (w3[3], w4[0], selector); c1[3] = hc_byte_perm (w3[2], w3[3], selector); c1[2] = hc_byte_perm (w3[1], w3[2], selector); c1[1] = hc_byte_perm (w3[0], w3[1], selector); c1[0] = hc_byte_perm (w2[3], w3[0], selector); c0[3] = hc_byte_perm (w2[2], w2[3], selector); c0[2] = hc_byte_perm (w2[1], w2[2], selector); c0[1] = hc_byte_perm (w2[0], w2[1], selector); c0[0] = hc_byte_perm (w1[3], w2[0], selector); w7[3] = hc_byte_perm (w1[2], w1[3], selector); w7[2] = hc_byte_perm (w1[1], w1[2], selector); w7[1] = hc_byte_perm (w1[0], w1[1], selector); w7[0] = hc_byte_perm (w0[3], w1[0], selector); w6[3] = hc_byte_perm (w0[2], w0[3], selector); w6[2] = hc_byte_perm (w0[1], w0[2], selector); w6[1] = hc_byte_perm (w0[0], w0[1], selector); w6[0] = hc_byte_perm ( 0, w0[0], selector); w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 25: c6[1] = hc_byte_perm (w7[3], 0, selector); c6[0] = hc_byte_perm (w7[2], w7[3], selector); c5[3] = hc_byte_perm (w7[1], w7[2], selector); c5[2] = hc_byte_perm (w7[0], w7[1], selector); c5[1] = hc_byte_perm (w6[3], w7[0], selector); c5[0] = hc_byte_perm (w6[2], w6[3], selector); c4[3] = hc_byte_perm (w6[1], w6[2], selector); c4[2] = hc_byte_perm (w6[0], w6[1], selector); c4[1] = hc_byte_perm (w5[3], w6[0], selector); c4[0] = hc_byte_perm (w5[2], w5[3], selector); c3[3] = hc_byte_perm (w5[1], w5[2], selector); c3[2] = hc_byte_perm (w5[0], w5[1], selector); c3[1] = hc_byte_perm (w4[3], w5[0], selector); c3[0] = hc_byte_perm (w4[2], w4[3], selector); c2[3] = hc_byte_perm (w4[1], w4[2], selector); c2[2] = hc_byte_perm (w4[0], w4[1], selector); c2[1] = hc_byte_perm (w3[3], w4[0], selector); c2[0] = hc_byte_perm (w3[2], w3[3], selector); c1[3] = hc_byte_perm (w3[1], w3[2], selector); c1[2] = hc_byte_perm (w3[0], w3[1], selector); c1[1] = hc_byte_perm (w2[3], w3[0], selector); c1[0] = hc_byte_perm (w2[2], w2[3], selector); c0[3] = hc_byte_perm (w2[1], w2[2], selector); c0[2] = hc_byte_perm (w2[0], w2[1], selector); c0[1] = hc_byte_perm (w1[3], w2[0], selector); c0[0] = hc_byte_perm (w1[2], w1[3], selector); w7[3] = hc_byte_perm (w1[1], w1[2], selector); w7[2] = hc_byte_perm (w1[0], w1[1], selector); w7[1] = hc_byte_perm (w0[3], w1[0], selector); w7[0] = hc_byte_perm (w0[2], w0[3], selector); w6[3] = hc_byte_perm (w0[1], w0[2], selector); w6[2] = hc_byte_perm (w0[0], w0[1], selector); w6[1] = hc_byte_perm ( 0, w0[0], selector); w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 26: c6[2] = hc_byte_perm (w7[3], 0, selector); c6[1] = hc_byte_perm (w7[2], w7[3], selector); c6[0] = hc_byte_perm (w7[1], w7[2], selector); c5[3] = hc_byte_perm (w7[0], w7[1], selector); c5[2] = hc_byte_perm (w6[3], w7[0], selector); c5[1] = hc_byte_perm (w6[2], w6[3], selector); c5[0] = hc_byte_perm (w6[1], w6[2], selector); c4[3] = hc_byte_perm (w6[0], w6[1], selector); c4[2] = hc_byte_perm (w5[3], w6[0], selector); c4[1] = hc_byte_perm (w5[2], w5[3], selector); c4[0] = hc_byte_perm (w5[1], w5[2], selector); c3[3] = hc_byte_perm (w5[0], w5[1], selector); c3[2] = hc_byte_perm (w4[3], w5[0], selector); c3[1] = hc_byte_perm (w4[2], w4[3], selector); c3[0] = hc_byte_perm (w4[1], w4[2], selector); c2[3] = hc_byte_perm (w4[0], w4[1], selector); c2[2] = hc_byte_perm (w3[3], w4[0], selector); c2[1] = hc_byte_perm (w3[2], w3[3], selector); c2[0] = hc_byte_perm (w3[1], w3[2], selector); c1[3] = hc_byte_perm (w3[0], w3[1], selector); c1[2] = hc_byte_perm (w2[3], w3[0], selector); c1[1] = hc_byte_perm (w2[2], w2[3], selector); c1[0] = hc_byte_perm (w2[1], w2[2], selector); c0[3] = hc_byte_perm (w2[0], w2[1], selector); c0[2] = hc_byte_perm (w1[3], w2[0], selector); c0[1] = hc_byte_perm (w1[2], w1[3], selector); c0[0] = hc_byte_perm (w1[1], w1[2], selector); w7[3] = hc_byte_perm (w1[0], w1[1], selector); w7[2] = hc_byte_perm (w0[3], w1[0], selector); w7[1] = hc_byte_perm (w0[2], w0[3], selector); w7[0] = hc_byte_perm (w0[1], w0[2], selector); w6[3] = hc_byte_perm (w0[0], w0[1], selector); w6[2] = hc_byte_perm ( 0, w0[0], selector); w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 27: c6[3] = hc_byte_perm (w7[3], 0, selector); c6[2] = hc_byte_perm (w7[2], w7[3], selector); c6[1] = hc_byte_perm (w7[1], w7[2], selector); c6[0] = hc_byte_perm (w7[0], w7[1], selector); c5[3] = hc_byte_perm (w6[3], w7[0], selector); c5[2] = hc_byte_perm (w6[2], w6[3], selector); c5[1] = hc_byte_perm (w6[1], w6[2], selector); c5[0] = hc_byte_perm (w6[0], w6[1], selector); c4[3] = hc_byte_perm (w5[3], w6[0], selector); c4[2] = hc_byte_perm (w5[2], w5[3], selector); c4[1] = hc_byte_perm (w5[1], w5[2], selector); c4[0] = hc_byte_perm (w5[0], w5[1], selector); c3[3] = hc_byte_perm (w4[3], w5[0], selector); c3[2] = hc_byte_perm (w4[2], w4[3], selector); c3[1] = hc_byte_perm (w4[1], w4[2], selector); c3[0] = hc_byte_perm (w4[0], w4[1], selector); c2[3] = hc_byte_perm (w3[3], w4[0], selector); c2[2] = hc_byte_perm (w3[2], w3[3], selector); c2[1] = hc_byte_perm (w3[1], w3[2], selector); c2[0] = hc_byte_perm (w3[0], w3[1], selector); c1[3] = hc_byte_perm (w2[3], w3[0], selector); c1[2] = hc_byte_perm (w2[2], w2[3], selector); c1[1] = hc_byte_perm (w2[1], w2[2], selector); c1[0] = hc_byte_perm (w2[0], w2[1], selector); c0[3] = hc_byte_perm (w1[3], w2[0], selector); c0[2] = hc_byte_perm (w1[2], w1[3], selector); c0[1] = hc_byte_perm (w1[1], w1[2], selector); c0[0] = hc_byte_perm (w1[0], w1[1], selector); w7[3] = hc_byte_perm (w0[3], w1[0], selector); w7[2] = hc_byte_perm (w0[2], w0[3], selector); w7[1] = hc_byte_perm (w0[1], w0[2], selector); w7[0] = hc_byte_perm (w0[0], w0[1], selector); w6[3] = hc_byte_perm ( 0, w0[0], selector); w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 28: c7[0] = hc_byte_perm (w7[3], 0, selector); c6[3] = hc_byte_perm (w7[2], w7[3], selector); c6[2] = hc_byte_perm (w7[1], w7[2], selector); c6[1] = hc_byte_perm (w7[0], w7[1], selector); c6[0] = hc_byte_perm (w6[3], w7[0], selector); c5[3] = hc_byte_perm (w6[2], w6[3], selector); c5[2] = hc_byte_perm (w6[1], w6[2], selector); c5[1] = hc_byte_perm (w6[0], w6[1], selector); c5[0] = hc_byte_perm (w5[3], w6[0], selector); c4[3] = hc_byte_perm (w5[2], w5[3], selector); c4[2] = hc_byte_perm (w5[1], w5[2], selector); c4[1] = hc_byte_perm (w5[0], w5[1], selector); c4[0] = hc_byte_perm (w4[3], w5[0], selector); c3[3] = hc_byte_perm (w4[2], w4[3], selector); c3[2] = hc_byte_perm (w4[1], w4[2], selector); c3[1] = hc_byte_perm (w4[0], w4[1], selector); c3[0] = hc_byte_perm (w3[3], w4[0], selector); c2[3] = hc_byte_perm (w3[2], w3[3], selector); c2[2] = hc_byte_perm (w3[1], w3[2], selector); c2[1] = hc_byte_perm (w3[0], w3[1], selector); c2[0] = hc_byte_perm (w2[3], w3[0], selector); c1[3] = hc_byte_perm (w2[2], w2[3], selector); c1[2] = hc_byte_perm (w2[1], w2[2], selector); c1[1] = hc_byte_perm (w2[0], w2[1], selector); c1[0] = hc_byte_perm (w1[3], w2[0], selector); c0[3] = hc_byte_perm (w1[2], w1[3], selector); c0[2] = hc_byte_perm (w1[1], w1[2], selector); c0[1] = hc_byte_perm (w1[0], w1[1], selector); c0[0] = hc_byte_perm (w0[3], w1[0], selector); w7[3] = hc_byte_perm (w0[2], w0[3], selector); w7[2] = hc_byte_perm (w0[1], w0[2], selector); w7[1] = hc_byte_perm (w0[0], w0[1], selector); w7[0] = hc_byte_perm ( 0, w0[0], selector); w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 29: c7[1] = hc_byte_perm (w7[3], 0, selector); c7[0] = hc_byte_perm (w7[2], w7[3], selector); c6[3] = hc_byte_perm (w7[1], w7[2], selector); c6[2] = hc_byte_perm (w7[0], w7[1], selector); c6[1] = hc_byte_perm (w6[3], w7[0], selector); c6[0] = hc_byte_perm (w6[2], w6[3], selector); c5[3] = hc_byte_perm (w6[1], w6[2], selector); c5[2] = hc_byte_perm (w6[0], w6[1], selector); c5[1] = hc_byte_perm (w5[3], w6[0], selector); c5[0] = hc_byte_perm (w5[2], w5[3], selector); c4[3] = hc_byte_perm (w5[1], w5[2], selector); c4[2] = hc_byte_perm (w5[0], w5[1], selector); c4[1] = hc_byte_perm (w4[3], w5[0], selector); c4[0] = hc_byte_perm (w4[2], w4[3], selector); c3[3] = hc_byte_perm (w4[1], w4[2], selector); c3[2] = hc_byte_perm (w4[0], w4[1], selector); c3[1] = hc_byte_perm (w3[3], w4[0], selector); c3[0] = hc_byte_perm (w3[2], w3[3], selector); c2[3] = hc_byte_perm (w3[1], w3[2], selector); c2[2] = hc_byte_perm (w3[0], w3[1], selector); c2[1] = hc_byte_perm (w2[3], w3[0], selector); c2[0] = hc_byte_perm (w2[2], w2[3], selector); c1[3] = hc_byte_perm (w2[1], w2[2], selector); c1[2] = hc_byte_perm (w2[0], w2[1], selector); c1[1] = hc_byte_perm (w1[3], w2[0], selector); c1[0] = hc_byte_perm (w1[2], w1[3], selector); c0[3] = hc_byte_perm (w1[1], w1[2], selector); c0[2] = hc_byte_perm (w1[0], w1[1], selector); c0[1] = hc_byte_perm (w0[3], w1[0], selector); c0[0] = hc_byte_perm (w0[2], w0[3], selector); w7[3] = hc_byte_perm (w0[1], w0[2], selector); w7[2] = hc_byte_perm (w0[0], w0[1], selector); w7[1] = hc_byte_perm ( 0, w0[0], selector); w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 30: c7[2] = hc_byte_perm (w7[3], 0, selector); c7[1] = hc_byte_perm (w7[2], w7[3], selector); c7[0] = hc_byte_perm (w7[1], w7[2], selector); c6[3] = hc_byte_perm (w7[0], w7[1], selector); c6[2] = hc_byte_perm (w6[3], w7[0], selector); c6[1] = hc_byte_perm (w6[2], w6[3], selector); c6[0] = hc_byte_perm (w6[1], w6[2], selector); c5[3] = hc_byte_perm (w6[0], w6[1], selector); c5[2] = hc_byte_perm (w5[3], w6[0], selector); c5[1] = hc_byte_perm (w5[2], w5[3], selector); c5[0] = hc_byte_perm (w5[1], w5[2], selector); c4[3] = hc_byte_perm (w5[0], w5[1], selector); c4[2] = hc_byte_perm (w4[3], w5[0], selector); c4[1] = hc_byte_perm (w4[2], w4[3], selector); c4[0] = hc_byte_perm (w4[1], w4[2], selector); c3[3] = hc_byte_perm (w4[0], w4[1], selector); c3[2] = hc_byte_perm (w3[3], w4[0], selector); c3[1] = hc_byte_perm (w3[2], w3[3], selector); c3[0] = hc_byte_perm (w3[1], w3[2], selector); c2[3] = hc_byte_perm (w3[0], w3[1], selector); c2[2] = hc_byte_perm (w2[3], w3[0], selector); c2[1] = hc_byte_perm (w2[2], w2[3], selector); c2[0] = hc_byte_perm (w2[1], w2[2], selector); c1[3] = hc_byte_perm (w2[0], w2[1], selector); c1[2] = hc_byte_perm (w1[3], w2[0], selector); c1[1] = hc_byte_perm (w1[2], w1[3], selector); c1[0] = hc_byte_perm (w1[1], w1[2], selector); c0[3] = hc_byte_perm (w1[0], w1[1], selector); c0[2] = hc_byte_perm (w0[3], w1[0], selector); c0[1] = hc_byte_perm (w0[2], w0[3], selector); c0[0] = hc_byte_perm (w0[1], w0[2], selector); w7[3] = hc_byte_perm (w0[0], w0[1], selector); w7[2] = hc_byte_perm ( 0, w0[0], selector); w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 31: c7[3] = hc_byte_perm (w7[3], 0, selector); c7[2] = hc_byte_perm (w7[2], w7[3], selector); c7[1] = hc_byte_perm (w7[1], w7[2], selector); c7[0] = hc_byte_perm (w7[0], w7[1], selector); c6[3] = hc_byte_perm (w6[3], w7[0], selector); c6[2] = hc_byte_perm (w6[2], w6[3], selector); c6[1] = hc_byte_perm (w6[1], w6[2], selector); c6[0] = hc_byte_perm (w6[0], w6[1], selector); c5[3] = hc_byte_perm (w5[3], w6[0], selector); c5[2] = hc_byte_perm (w5[2], w5[3], selector); c5[1] = hc_byte_perm (w5[1], w5[2], selector); c5[0] = hc_byte_perm (w5[0], w5[1], selector); c4[3] = hc_byte_perm (w4[3], w5[0], selector); c4[2] = hc_byte_perm (w4[2], w4[3], selector); c4[1] = hc_byte_perm (w4[1], w4[2], selector); c4[0] = hc_byte_perm (w4[0], w4[1], selector); c3[3] = hc_byte_perm (w3[3], w4[0], selector); c3[2] = hc_byte_perm (w3[2], w3[3], selector); c3[1] = hc_byte_perm (w3[1], w3[2], selector); c3[0] = hc_byte_perm (w3[0], w3[1], selector); c2[3] = hc_byte_perm (w2[3], w3[0], selector); c2[2] = hc_byte_perm (w2[2], w2[3], selector); c2[1] = hc_byte_perm (w2[1], w2[2], selector); c2[0] = hc_byte_perm (w2[0], w2[1], selector); c1[3] = hc_byte_perm (w1[3], w2[0], selector); c1[2] = hc_byte_perm (w1[2], w1[3], selector); c1[1] = hc_byte_perm (w1[1], w1[2], selector); c1[0] = hc_byte_perm (w1[0], w1[1], selector); c0[3] = hc_byte_perm (w0[3], w1[0], selector); c0[2] = hc_byte_perm (w0[2], w0[3], selector); c0[1] = hc_byte_perm (w0[1], w0[2], selector); c0[0] = hc_byte_perm (w0[0], w0[1], selector); w7[3] = hc_byte_perm ( 0, w0[0], selector); w7[2] = 0; w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_8x4_be (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *w4, PRIVATE_AS u32x *w5, PRIVATE_AS u32x *w6, PRIVATE_AS u32x *w7, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: w7[3] = hc_bytealign_be (w7[2], w7[3], offset); w7[2] = hc_bytealign_be (w7[1], w7[2], offset); w7[1] = hc_bytealign_be (w7[0], w7[1], offset); w7[0] = hc_bytealign_be (w6[3], w7[0], offset); w6[3] = hc_bytealign_be (w6[2], w6[3], offset); w6[2] = hc_bytealign_be (w6[1], w6[2], offset); w6[1] = hc_bytealign_be (w6[0], w6[1], offset); w6[0] = hc_bytealign_be (w5[3], w6[0], offset); w5[3] = hc_bytealign_be (w5[2], w5[3], offset); w5[2] = hc_bytealign_be (w5[1], w5[2], offset); w5[1] = hc_bytealign_be (w5[0], w5[1], offset); w5[0] = hc_bytealign_be (w4[3], w5[0], offset); w4[3] = hc_bytealign_be (w4[2], w4[3], offset); w4[2] = hc_bytealign_be (w4[1], w4[2], offset); w4[1] = hc_bytealign_be (w4[0], w4[1], offset); w4[0] = hc_bytealign_be (w3[3], w4[0], offset); w3[3] = hc_bytealign_be (w3[2], w3[3], offset); w3[2] = hc_bytealign_be (w3[1], w3[2], offset); w3[1] = hc_bytealign_be (w3[0], w3[1], offset); w3[0] = hc_bytealign_be (w2[3], w3[0], offset); w2[3] = hc_bytealign_be (w2[2], w2[3], offset); w2[2] = hc_bytealign_be (w2[1], w2[2], offset); w2[1] = hc_bytealign_be (w2[0], w2[1], offset); w2[0] = hc_bytealign_be (w1[3], w2[0], offset); w1[3] = hc_bytealign_be (w1[2], w1[3], offset); w1[2] = hc_bytealign_be (w1[1], w1[2], offset); w1[1] = hc_bytealign_be (w1[0], w1[1], offset); w1[0] = hc_bytealign_be (w0[3], w1[0], offset); w0[3] = hc_bytealign_be (w0[2], w0[3], offset); w0[2] = hc_bytealign_be (w0[1], w0[2], offset); w0[1] = hc_bytealign_be (w0[0], w0[1], offset); w0[0] = hc_bytealign_be ( 0, w0[0], offset); break; case 1: w7[3] = hc_bytealign_be (w7[1], w7[2], offset); w7[2] = hc_bytealign_be (w7[0], w7[1], offset); w7[1] = hc_bytealign_be (w6[3], w7[0], offset); w7[0] = hc_bytealign_be (w6[2], w6[3], offset); w6[3] = hc_bytealign_be (w6[1], w6[2], offset); w6[2] = hc_bytealign_be (w6[0], w6[1], offset); w6[1] = hc_bytealign_be (w5[3], w6[0], offset); w6[0] = hc_bytealign_be (w5[2], w5[3], offset); w5[3] = hc_bytealign_be (w5[1], w5[2], offset); w5[2] = hc_bytealign_be (w5[0], w5[1], offset); w5[1] = hc_bytealign_be (w4[3], w5[0], offset); w5[0] = hc_bytealign_be (w4[2], w4[3], offset); w4[3] = hc_bytealign_be (w4[1], w4[2], offset); w4[2] = hc_bytealign_be (w4[0], w4[1], offset); w4[1] = hc_bytealign_be (w3[3], w4[0], offset); w4[0] = hc_bytealign_be (w3[2], w3[3], offset); w3[3] = hc_bytealign_be (w3[1], w3[2], offset); w3[2] = hc_bytealign_be (w3[0], w3[1], offset); w3[1] = hc_bytealign_be (w2[3], w3[0], offset); w3[0] = hc_bytealign_be (w2[2], w2[3], offset); w2[3] = hc_bytealign_be (w2[1], w2[2], offset); w2[2] = hc_bytealign_be (w2[0], w2[1], offset); w2[1] = hc_bytealign_be (w1[3], w2[0], offset); w2[0] = hc_bytealign_be (w1[2], w1[3], offset); w1[3] = hc_bytealign_be (w1[1], w1[2], offset); w1[2] = hc_bytealign_be (w1[0], w1[1], offset); w1[1] = hc_bytealign_be (w0[3], w1[0], offset); w1[0] = hc_bytealign_be (w0[2], w0[3], offset); w0[3] = hc_bytealign_be (w0[1], w0[2], offset); w0[2] = hc_bytealign_be (w0[0], w0[1], offset); w0[1] = hc_bytealign_be ( 0, w0[0], offset); w0[0] = 0; break; case 2: w7[3] = hc_bytealign_be (w7[0], w7[1], offset); w7[2] = hc_bytealign_be (w6[3], w7[0], offset); w7[1] = hc_bytealign_be (w6[2], w6[3], offset); w7[0] = hc_bytealign_be (w6[1], w6[2], offset); w6[3] = hc_bytealign_be (w6[0], w6[1], offset); w6[2] = hc_bytealign_be (w5[3], w6[0], offset); w6[1] = hc_bytealign_be (w5[2], w5[3], offset); w6[0] = hc_bytealign_be (w5[1], w5[2], offset); w5[3] = hc_bytealign_be (w5[0], w5[1], offset); w5[2] = hc_bytealign_be (w4[3], w5[0], offset); w5[1] = hc_bytealign_be (w4[2], w4[3], offset); w5[0] = hc_bytealign_be (w4[1], w4[2], offset); w4[3] = hc_bytealign_be (w4[0], w4[1], offset); w4[2] = hc_bytealign_be (w3[3], w4[0], offset); w4[1] = hc_bytealign_be (w3[2], w3[3], offset); w4[0] = hc_bytealign_be (w3[1], w3[2], offset); w3[3] = hc_bytealign_be (w3[0], w3[1], offset); w3[2] = hc_bytealign_be (w2[3], w3[0], offset); w3[1] = hc_bytealign_be (w2[2], w2[3], offset); w3[0] = hc_bytealign_be (w2[1], w2[2], offset); w2[3] = hc_bytealign_be (w2[0], w2[1], offset); w2[2] = hc_bytealign_be (w1[3], w2[0], offset); w2[1] = hc_bytealign_be (w1[2], w1[3], offset); w2[0] = hc_bytealign_be (w1[1], w1[2], offset); w1[3] = hc_bytealign_be (w1[0], w1[1], offset); w1[2] = hc_bytealign_be (w0[3], w1[0], offset); w1[1] = hc_bytealign_be (w0[2], w0[3], offset); w1[0] = hc_bytealign_be (w0[1], w0[2], offset); w0[3] = hc_bytealign_be (w0[0], w0[1], offset); w0[2] = hc_bytealign_be ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: w7[3] = hc_bytealign_be (w6[3], w7[0], offset); w7[2] = hc_bytealign_be (w6[2], w6[3], offset); w7[1] = hc_bytealign_be (w6[1], w6[2], offset); w7[0] = hc_bytealign_be (w6[0], w6[1], offset); w6[3] = hc_bytealign_be (w5[3], w6[0], offset); w6[2] = hc_bytealign_be (w5[2], w5[3], offset); w6[1] = hc_bytealign_be (w5[1], w5[2], offset); w6[0] = hc_bytealign_be (w5[0], w5[1], offset); w5[3] = hc_bytealign_be (w4[3], w5[0], offset); w5[2] = hc_bytealign_be (w4[2], w4[3], offset); w5[1] = hc_bytealign_be (w4[1], w4[2], offset); w5[0] = hc_bytealign_be (w4[0], w4[1], offset); w4[3] = hc_bytealign_be (w3[3], w4[0], offset); w4[2] = hc_bytealign_be (w3[2], w3[3], offset); w4[1] = hc_bytealign_be (w3[1], w3[2], offset); w4[0] = hc_bytealign_be (w3[0], w3[1], offset); w3[3] = hc_bytealign_be (w2[3], w3[0], offset); w3[2] = hc_bytealign_be (w2[2], w2[3], offset); w3[1] = hc_bytealign_be (w2[1], w2[2], offset); w3[0] = hc_bytealign_be (w2[0], w2[1], offset); w2[3] = hc_bytealign_be (w1[3], w2[0], offset); w2[2] = hc_bytealign_be (w1[2], w1[3], offset); w2[1] = hc_bytealign_be (w1[1], w1[2], offset); w2[0] = hc_bytealign_be (w1[0], w1[1], offset); w1[3] = hc_bytealign_be (w0[3], w1[0], offset); w1[2] = hc_bytealign_be (w0[2], w0[3], offset); w1[1] = hc_bytealign_be (w0[1], w0[2], offset); w1[0] = hc_bytealign_be (w0[0], w0[1], offset); w0[3] = hc_bytealign_be ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: w7[3] = hc_bytealign_be (w6[2], w6[3], offset); w7[2] = hc_bytealign_be (w6[1], w6[2], offset); w7[1] = hc_bytealign_be (w6[0], w6[1], offset); w7[0] = hc_bytealign_be (w5[3], w6[0], offset); w6[3] = hc_bytealign_be (w5[2], w5[3], offset); w6[2] = hc_bytealign_be (w5[1], w5[2], offset); w6[1] = hc_bytealign_be (w5[0], w5[1], offset); w6[0] = hc_bytealign_be (w4[3], w5[0], offset); w5[3] = hc_bytealign_be (w4[2], w4[3], offset); w5[2] = hc_bytealign_be (w4[1], w4[2], offset); w5[1] = hc_bytealign_be (w4[0], w4[1], offset); w5[0] = hc_bytealign_be (w3[3], w4[0], offset); w4[3] = hc_bytealign_be (w3[2], w3[3], offset); w4[2] = hc_bytealign_be (w3[1], w3[2], offset); w4[1] = hc_bytealign_be (w3[0], w3[1], offset); w4[0] = hc_bytealign_be (w2[3], w3[0], offset); w3[3] = hc_bytealign_be (w2[2], w2[3], offset); w3[2] = hc_bytealign_be (w2[1], w2[2], offset); w3[1] = hc_bytealign_be (w2[0], w2[1], offset); w3[0] = hc_bytealign_be (w1[3], w2[0], offset); w2[3] = hc_bytealign_be (w1[2], w1[3], offset); w2[2] = hc_bytealign_be (w1[1], w1[2], offset); w2[1] = hc_bytealign_be (w1[0], w1[1], offset); w2[0] = hc_bytealign_be (w0[3], w1[0], offset); w1[3] = hc_bytealign_be (w0[2], w0[3], offset); w1[2] = hc_bytealign_be (w0[1], w0[2], offset); w1[1] = hc_bytealign_be (w0[0], w0[1], offset); w1[0] = hc_bytealign_be ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: w7[3] = hc_bytealign_be (w6[1], w6[2], offset); w7[2] = hc_bytealign_be (w6[0], w6[1], offset); w7[1] = hc_bytealign_be (w5[3], w6[0], offset); w7[0] = hc_bytealign_be (w5[2], w5[3], offset); w6[3] = hc_bytealign_be (w5[1], w5[2], offset); w6[2] = hc_bytealign_be (w5[0], w5[1], offset); w6[1] = hc_bytealign_be (w4[3], w5[0], offset); w6[0] = hc_bytealign_be (w4[2], w4[3], offset); w5[3] = hc_bytealign_be (w4[1], w4[2], offset); w5[2] = hc_bytealign_be (w4[0], w4[1], offset); w5[1] = hc_bytealign_be (w3[3], w4[0], offset); w5[0] = hc_bytealign_be (w3[2], w3[3], offset); w4[3] = hc_bytealign_be (w3[1], w3[2], offset); w4[2] = hc_bytealign_be (w3[0], w3[1], offset); w4[1] = hc_bytealign_be (w2[3], w3[0], offset); w4[0] = hc_bytealign_be (w2[2], w2[3], offset); w3[3] = hc_bytealign_be (w2[1], w2[2], offset); w3[2] = hc_bytealign_be (w2[0], w2[1], offset); w3[1] = hc_bytealign_be (w1[3], w2[0], offset); w3[0] = hc_bytealign_be (w1[2], w1[3], offset); w2[3] = hc_bytealign_be (w1[1], w1[2], offset); w2[2] = hc_bytealign_be (w1[0], w1[1], offset); w2[1] = hc_bytealign_be (w0[3], w1[0], offset); w2[0] = hc_bytealign_be (w0[2], w0[3], offset); w1[3] = hc_bytealign_be (w0[1], w0[2], offset); w1[2] = hc_bytealign_be (w0[0], w0[1], offset); w1[1] = hc_bytealign_be ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: w7[3] = hc_bytealign_be (w6[0], w6[1], offset); w7[2] = hc_bytealign_be (w5[3], w6[0], offset); w7[1] = hc_bytealign_be (w5[2], w5[3], offset); w7[0] = hc_bytealign_be (w5[1], w5[2], offset); w6[3] = hc_bytealign_be (w5[0], w5[1], offset); w6[2] = hc_bytealign_be (w4[3], w5[0], offset); w6[1] = hc_bytealign_be (w4[2], w4[3], offset); w6[0] = hc_bytealign_be (w4[1], w4[2], offset); w5[3] = hc_bytealign_be (w4[0], w4[1], offset); w5[2] = hc_bytealign_be (w3[3], w4[0], offset); w5[1] = hc_bytealign_be (w3[2], w3[3], offset); w5[0] = hc_bytealign_be (w3[1], w3[2], offset); w4[3] = hc_bytealign_be (w3[0], w3[1], offset); w4[2] = hc_bytealign_be (w2[3], w3[0], offset); w4[1] = hc_bytealign_be (w2[2], w2[3], offset); w4[0] = hc_bytealign_be (w2[1], w2[2], offset); w3[3] = hc_bytealign_be (w2[0], w2[1], offset); w3[2] = hc_bytealign_be (w1[3], w2[0], offset); w3[1] = hc_bytealign_be (w1[2], w1[3], offset); w3[0] = hc_bytealign_be (w1[1], w1[2], offset); w2[3] = hc_bytealign_be (w1[0], w1[1], offset); w2[2] = hc_bytealign_be (w0[3], w1[0], offset); w2[1] = hc_bytealign_be (w0[2], w0[3], offset); w2[0] = hc_bytealign_be (w0[1], w0[2], offset); w1[3] = hc_bytealign_be (w0[0], w0[1], offset); w1[2] = hc_bytealign_be ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: w7[3] = hc_bytealign_be (w5[3], w6[0], offset); w7[2] = hc_bytealign_be (w5[2], w5[3], offset); w7[1] = hc_bytealign_be (w5[1], w5[2], offset); w7[0] = hc_bytealign_be (w5[0], w5[1], offset); w6[3] = hc_bytealign_be (w4[3], w5[0], offset); w6[2] = hc_bytealign_be (w4[2], w4[3], offset); w6[1] = hc_bytealign_be (w4[1], w4[2], offset); w6[0] = hc_bytealign_be (w4[0], w4[1], offset); w5[3] = hc_bytealign_be (w3[3], w4[0], offset); w5[2] = hc_bytealign_be (w3[2], w3[3], offset); w5[1] = hc_bytealign_be (w3[1], w3[2], offset); w5[0] = hc_bytealign_be (w3[0], w3[1], offset); w4[3] = hc_bytealign_be (w2[3], w3[0], offset); w4[2] = hc_bytealign_be (w2[2], w2[3], offset); w4[1] = hc_bytealign_be (w2[1], w2[2], offset); w4[0] = hc_bytealign_be (w2[0], w2[1], offset); w3[3] = hc_bytealign_be (w1[3], w2[0], offset); w3[2] = hc_bytealign_be (w1[2], w1[3], offset); w3[1] = hc_bytealign_be (w1[1], w1[2], offset); w3[0] = hc_bytealign_be (w1[0], w1[1], offset); w2[3] = hc_bytealign_be (w0[3], w1[0], offset); w2[2] = hc_bytealign_be (w0[2], w0[3], offset); w2[1] = hc_bytealign_be (w0[1], w0[2], offset); w2[0] = hc_bytealign_be (w0[0], w0[1], offset); w1[3] = hc_bytealign_be ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: w7[3] = hc_bytealign_be (w5[2], w5[3], offset); w7[2] = hc_bytealign_be (w5[1], w5[2], offset); w7[1] = hc_bytealign_be (w5[0], w5[1], offset); w7[0] = hc_bytealign_be (w4[3], w5[0], offset); w6[3] = hc_bytealign_be (w4[2], w4[3], offset); w6[2] = hc_bytealign_be (w4[1], w4[2], offset); w6[1] = hc_bytealign_be (w4[0], w4[1], offset); w6[0] = hc_bytealign_be (w3[3], w4[0], offset); w5[3] = hc_bytealign_be (w3[2], w3[3], offset); w5[2] = hc_bytealign_be (w3[1], w3[2], offset); w5[1] = hc_bytealign_be (w3[0], w3[1], offset); w5[0] = hc_bytealign_be (w2[3], w3[0], offset); w4[3] = hc_bytealign_be (w2[2], w2[3], offset); w4[2] = hc_bytealign_be (w2[1], w2[2], offset); w4[1] = hc_bytealign_be (w2[0], w2[1], offset); w4[0] = hc_bytealign_be (w1[3], w2[0], offset); w3[3] = hc_bytealign_be (w1[2], w1[3], offset); w3[2] = hc_bytealign_be (w1[1], w1[2], offset); w3[1] = hc_bytealign_be (w1[0], w1[1], offset); w3[0] = hc_bytealign_be (w0[3], w1[0], offset); w2[3] = hc_bytealign_be (w0[2], w0[3], offset); w2[2] = hc_bytealign_be (w0[1], w0[2], offset); w2[1] = hc_bytealign_be (w0[0], w0[1], offset); w2[0] = hc_bytealign_be ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: w7[3] = hc_bytealign_be (w5[1], w5[2], offset); w7[2] = hc_bytealign_be (w5[0], w5[1], offset); w7[1] = hc_bytealign_be (w4[3], w5[0], offset); w7[0] = hc_bytealign_be (w4[2], w4[3], offset); w6[3] = hc_bytealign_be (w4[1], w4[2], offset); w6[2] = hc_bytealign_be (w4[0], w4[1], offset); w6[1] = hc_bytealign_be (w3[3], w4[0], offset); w6[0] = hc_bytealign_be (w3[2], w3[3], offset); w5[3] = hc_bytealign_be (w3[1], w3[2], offset); w5[2] = hc_bytealign_be (w3[0], w3[1], offset); w5[1] = hc_bytealign_be (w2[3], w3[0], offset); w5[0] = hc_bytealign_be (w2[2], w2[3], offset); w4[3] = hc_bytealign_be (w2[1], w2[2], offset); w4[2] = hc_bytealign_be (w2[0], w2[1], offset); w4[1] = hc_bytealign_be (w1[3], w2[0], offset); w4[0] = hc_bytealign_be (w1[2], w1[3], offset); w3[3] = hc_bytealign_be (w1[1], w1[2], offset); w3[2] = hc_bytealign_be (w1[0], w1[1], offset); w3[1] = hc_bytealign_be (w0[3], w1[0], offset); w3[0] = hc_bytealign_be (w0[2], w0[3], offset); w2[3] = hc_bytealign_be (w0[1], w0[2], offset); w2[2] = hc_bytealign_be (w0[0], w0[1], offset); w2[1] = hc_bytealign_be ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: w7[3] = hc_bytealign_be (w5[0], w5[1], offset); w7[2] = hc_bytealign_be (w4[3], w5[0], offset); w7[1] = hc_bytealign_be (w4[2], w4[3], offset); w7[0] = hc_bytealign_be (w4[1], w4[2], offset); w6[3] = hc_bytealign_be (w4[0], w4[1], offset); w6[2] = hc_bytealign_be (w3[3], w4[0], offset); w6[1] = hc_bytealign_be (w3[2], w3[3], offset); w6[0] = hc_bytealign_be (w3[1], w3[2], offset); w5[3] = hc_bytealign_be (w3[0], w3[1], offset); w5[2] = hc_bytealign_be (w2[3], w3[0], offset); w5[1] = hc_bytealign_be (w2[2], w2[3], offset); w5[0] = hc_bytealign_be (w2[1], w2[2], offset); w4[3] = hc_bytealign_be (w2[0], w2[1], offset); w4[2] = hc_bytealign_be (w1[3], w2[0], offset); w4[1] = hc_bytealign_be (w1[2], w1[3], offset); w4[0] = hc_bytealign_be (w1[1], w1[2], offset); w3[3] = hc_bytealign_be (w1[0], w1[1], offset); w3[2] = hc_bytealign_be (w0[3], w1[0], offset); w3[1] = hc_bytealign_be (w0[2], w0[3], offset); w3[0] = hc_bytealign_be (w0[1], w0[2], offset); w2[3] = hc_bytealign_be (w0[0], w0[1], offset); w2[2] = hc_bytealign_be ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: w7[3] = hc_bytealign_be (w4[3], w5[0], offset); w7[2] = hc_bytealign_be (w4[2], w4[3], offset); w7[1] = hc_bytealign_be (w4[1], w4[2], offset); w7[0] = hc_bytealign_be (w4[0], w4[1], offset); w6[3] = hc_bytealign_be (w3[3], w4[0], offset); w6[2] = hc_bytealign_be (w3[2], w3[3], offset); w6[1] = hc_bytealign_be (w3[1], w3[2], offset); w6[0] = hc_bytealign_be (w3[0], w3[1], offset); w5[3] = hc_bytealign_be (w2[3], w3[0], offset); w5[2] = hc_bytealign_be (w2[2], w2[3], offset); w5[1] = hc_bytealign_be (w2[1], w2[2], offset); w5[0] = hc_bytealign_be (w2[0], w2[1], offset); w4[3] = hc_bytealign_be (w1[3], w2[0], offset); w4[2] = hc_bytealign_be (w1[2], w1[3], offset); w4[1] = hc_bytealign_be (w1[1], w1[2], offset); w4[0] = hc_bytealign_be (w1[0], w1[1], offset); w3[3] = hc_bytealign_be (w0[3], w1[0], offset); w3[2] = hc_bytealign_be (w0[2], w0[3], offset); w3[1] = hc_bytealign_be (w0[1], w0[2], offset); w3[0] = hc_bytealign_be (w0[0], w0[1], offset); w2[3] = hc_bytealign_be ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: w7[3] = hc_bytealign_be (w4[2], w4[3], offset); w7[2] = hc_bytealign_be (w4[1], w4[2], offset); w7[1] = hc_bytealign_be (w4[0], w4[1], offset); w7[0] = hc_bytealign_be (w3[3], w4[0], offset); w6[3] = hc_bytealign_be (w3[2], w3[3], offset); w6[2] = hc_bytealign_be (w3[1], w3[2], offset); w6[1] = hc_bytealign_be (w3[0], w3[1], offset); w6[0] = hc_bytealign_be (w2[3], w3[0], offset); w5[3] = hc_bytealign_be (w2[2], w2[3], offset); w5[2] = hc_bytealign_be (w2[1], w2[2], offset); w5[1] = hc_bytealign_be (w2[0], w2[1], offset); w5[0] = hc_bytealign_be (w1[3], w2[0], offset); w4[3] = hc_bytealign_be (w1[2], w1[3], offset); w4[2] = hc_bytealign_be (w1[1], w1[2], offset); w4[1] = hc_bytealign_be (w1[0], w1[1], offset); w4[0] = hc_bytealign_be (w0[3], w1[0], offset); w3[3] = hc_bytealign_be (w0[2], w0[3], offset); w3[2] = hc_bytealign_be (w0[1], w0[2], offset); w3[1] = hc_bytealign_be (w0[0], w0[1], offset); w3[0] = hc_bytealign_be ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: w7[3] = hc_bytealign_be (w4[1], w4[2], offset); w7[2] = hc_bytealign_be (w4[0], w4[1], offset); w7[1] = hc_bytealign_be (w3[3], w4[0], offset); w7[0] = hc_bytealign_be (w3[2], w3[3], offset); w6[3] = hc_bytealign_be (w3[1], w3[2], offset); w6[2] = hc_bytealign_be (w3[0], w3[1], offset); w6[1] = hc_bytealign_be (w2[3], w3[0], offset); w6[0] = hc_bytealign_be (w2[2], w2[3], offset); w5[3] = hc_bytealign_be (w2[1], w2[2], offset); w5[2] = hc_bytealign_be (w2[0], w2[1], offset); w5[1] = hc_bytealign_be (w1[3], w2[0], offset); w5[0] = hc_bytealign_be (w1[2], w1[3], offset); w4[3] = hc_bytealign_be (w1[1], w1[2], offset); w4[2] = hc_bytealign_be (w1[0], w1[1], offset); w4[1] = hc_bytealign_be (w0[3], w1[0], offset); w4[0] = hc_bytealign_be (w0[2], w0[3], offset); w3[3] = hc_bytealign_be (w0[1], w0[2], offset); w3[2] = hc_bytealign_be (w0[0], w0[1], offset); w3[1] = hc_bytealign_be ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: w7[3] = hc_bytealign_be (w4[0], w4[1], offset); w7[2] = hc_bytealign_be (w3[3], w4[0], offset); w7[1] = hc_bytealign_be (w3[2], w3[3], offset); w7[0] = hc_bytealign_be (w3[1], w3[2], offset); w6[3] = hc_bytealign_be (w3[0], w3[1], offset); w6[2] = hc_bytealign_be (w2[3], w3[0], offset); w6[1] = hc_bytealign_be (w2[2], w2[3], offset); w6[0] = hc_bytealign_be (w2[1], w2[2], offset); w5[3] = hc_bytealign_be (w2[0], w2[1], offset); w5[2] = hc_bytealign_be (w1[3], w2[0], offset); w5[1] = hc_bytealign_be (w1[2], w1[3], offset); w5[0] = hc_bytealign_be (w1[1], w1[2], offset); w4[3] = hc_bytealign_be (w1[0], w1[1], offset); w4[2] = hc_bytealign_be (w0[3], w1[0], offset); w4[1] = hc_bytealign_be (w0[2], w0[3], offset); w4[0] = hc_bytealign_be (w0[1], w0[2], offset); w3[3] = hc_bytealign_be (w0[0], w0[1], offset); w3[2] = hc_bytealign_be ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: w7[3] = hc_bytealign_be (w3[3], w4[0], offset); w7[2] = hc_bytealign_be (w3[2], w3[3], offset); w7[1] = hc_bytealign_be (w3[1], w3[2], offset); w7[0] = hc_bytealign_be (w3[0], w3[1], offset); w6[3] = hc_bytealign_be (w2[3], w3[0], offset); w6[2] = hc_bytealign_be (w2[2], w2[3], offset); w6[1] = hc_bytealign_be (w2[1], w2[2], offset); w6[0] = hc_bytealign_be (w2[0], w2[1], offset); w5[3] = hc_bytealign_be (w1[3], w2[0], offset); w5[2] = hc_bytealign_be (w1[2], w1[3], offset); w5[1] = hc_bytealign_be (w1[1], w1[2], offset); w5[0] = hc_bytealign_be (w1[0], w1[1], offset); w4[3] = hc_bytealign_be (w0[3], w1[0], offset); w4[2] = hc_bytealign_be (w0[2], w0[3], offset); w4[1] = hc_bytealign_be (w0[1], w0[2], offset); w4[0] = hc_bytealign_be (w0[0], w0[1], offset); w3[3] = hc_bytealign_be ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 16: w7[3] = hc_bytealign_be (w3[2], w3[3], offset); w7[2] = hc_bytealign_be (w3[1], w3[2], offset); w7[1] = hc_bytealign_be (w3[0], w3[1], offset); w7[0] = hc_bytealign_be (w2[3], w3[0], offset); w6[3] = hc_bytealign_be (w2[2], w2[3], offset); w6[2] = hc_bytealign_be (w2[1], w2[2], offset); w6[1] = hc_bytealign_be (w2[0], w2[1], offset); w6[0] = hc_bytealign_be (w1[3], w2[0], offset); w5[3] = hc_bytealign_be (w1[2], w1[3], offset); w5[2] = hc_bytealign_be (w1[1], w1[2], offset); w5[1] = hc_bytealign_be (w1[0], w1[1], offset); w5[0] = hc_bytealign_be (w0[3], w1[0], offset); w4[3] = hc_bytealign_be (w0[2], w0[3], offset); w4[2] = hc_bytealign_be (w0[1], w0[2], offset); w4[1] = hc_bytealign_be (w0[0], w0[1], offset); w4[0] = hc_bytealign_be ( 0, w0[0], offset); w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 17: w7[3] = hc_bytealign_be (w3[1], w3[2], offset); w7[2] = hc_bytealign_be (w3[0], w3[1], offset); w7[1] = hc_bytealign_be (w2[3], w3[0], offset); w7[0] = hc_bytealign_be (w2[2], w2[3], offset); w6[3] = hc_bytealign_be (w2[1], w2[2], offset); w6[2] = hc_bytealign_be (w2[0], w2[1], offset); w6[1] = hc_bytealign_be (w1[3], w2[0], offset); w6[0] = hc_bytealign_be (w1[2], w1[3], offset); w5[3] = hc_bytealign_be (w1[1], w1[2], offset); w5[2] = hc_bytealign_be (w1[0], w1[1], offset); w5[1] = hc_bytealign_be (w0[3], w1[0], offset); w5[0] = hc_bytealign_be (w0[2], w0[3], offset); w4[3] = hc_bytealign_be (w0[1], w0[2], offset); w4[2] = hc_bytealign_be (w0[0], w0[1], offset); w4[1] = hc_bytealign_be ( 0, w0[0], offset); w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 18: w7[3] = hc_bytealign_be (w3[0], w3[1], offset); w7[2] = hc_bytealign_be (w2[3], w3[0], offset); w7[1] = hc_bytealign_be (w2[2], w2[3], offset); w7[0] = hc_bytealign_be (w2[1], w2[2], offset); w6[3] = hc_bytealign_be (w2[0], w2[1], offset); w6[2] = hc_bytealign_be (w1[3], w2[0], offset); w6[1] = hc_bytealign_be (w1[2], w1[3], offset); w6[0] = hc_bytealign_be (w1[1], w1[2], offset); w5[3] = hc_bytealign_be (w1[0], w1[1], offset); w5[2] = hc_bytealign_be (w0[3], w1[0], offset); w5[1] = hc_bytealign_be (w0[2], w0[3], offset); w5[0] = hc_bytealign_be (w0[1], w0[2], offset); w4[3] = hc_bytealign_be (w0[0], w0[1], offset); w4[2] = hc_bytealign_be ( 0, w0[0], offset); w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 19: w7[3] = hc_bytealign_be (w2[3], w3[0], offset); w7[2] = hc_bytealign_be (w2[2], w2[3], offset); w7[1] = hc_bytealign_be (w2[1], w2[2], offset); w7[0] = hc_bytealign_be (w2[0], w2[1], offset); w6[3] = hc_bytealign_be (w1[3], w2[0], offset); w6[2] = hc_bytealign_be (w1[2], w1[3], offset); w6[1] = hc_bytealign_be (w1[1], w1[2], offset); w6[0] = hc_bytealign_be (w1[0], w1[1], offset); w5[3] = hc_bytealign_be (w0[3], w1[0], offset); w5[2] = hc_bytealign_be (w0[2], w0[3], offset); w5[1] = hc_bytealign_be (w0[1], w0[2], offset); w5[0] = hc_bytealign_be (w0[0], w0[1], offset); w4[3] = hc_bytealign_be ( 0, w0[0], offset); w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 20: w7[3] = hc_bytealign_be (w2[2], w2[3], offset); w7[2] = hc_bytealign_be (w2[1], w2[2], offset); w7[1] = hc_bytealign_be (w2[0], w2[1], offset); w7[0] = hc_bytealign_be (w1[3], w2[0], offset); w6[3] = hc_bytealign_be (w1[2], w1[3], offset); w6[2] = hc_bytealign_be (w1[1], w1[2], offset); w6[1] = hc_bytealign_be (w1[0], w1[1], offset); w6[0] = hc_bytealign_be (w0[3], w1[0], offset); w5[3] = hc_bytealign_be (w0[2], w0[3], offset); w5[2] = hc_bytealign_be (w0[1], w0[2], offset); w5[1] = hc_bytealign_be (w0[0], w0[1], offset); w5[0] = hc_bytealign_be ( 0, w0[0], offset); w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 21: w7[3] = hc_bytealign_be (w2[1], w2[2], offset); w7[2] = hc_bytealign_be (w2[0], w2[1], offset); w7[1] = hc_bytealign_be (w1[3], w2[0], offset); w7[0] = hc_bytealign_be (w1[2], w1[3], offset); w6[3] = hc_bytealign_be (w1[1], w1[2], offset); w6[2] = hc_bytealign_be (w1[0], w1[1], offset); w6[1] = hc_bytealign_be (w0[3], w1[0], offset); w6[0] = hc_bytealign_be (w0[2], w0[3], offset); w5[3] = hc_bytealign_be (w0[1], w0[2], offset); w5[2] = hc_bytealign_be (w0[0], w0[1], offset); w5[1] = hc_bytealign_be ( 0, w0[0], offset); w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 22: w7[3] = hc_bytealign_be (w2[0], w2[1], offset); w7[2] = hc_bytealign_be (w1[3], w2[0], offset); w7[1] = hc_bytealign_be (w1[2], w1[3], offset); w7[0] = hc_bytealign_be (w1[1], w1[2], offset); w6[3] = hc_bytealign_be (w1[0], w1[1], offset); w6[2] = hc_bytealign_be (w0[3], w1[0], offset); w6[1] = hc_bytealign_be (w0[2], w0[3], offset); w6[0] = hc_bytealign_be (w0[1], w0[2], offset); w5[3] = hc_bytealign_be (w0[0], w0[1], offset); w5[2] = hc_bytealign_be ( 0, w0[0], offset); w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 23: w7[3] = hc_bytealign_be (w1[3], w2[0], offset); w7[2] = hc_bytealign_be (w1[2], w1[3], offset); w7[1] = hc_bytealign_be (w1[1], w1[2], offset); w7[0] = hc_bytealign_be (w1[0], w1[1], offset); w6[3] = hc_bytealign_be (w0[3], w1[0], offset); w6[2] = hc_bytealign_be (w0[2], w0[3], offset); w6[1] = hc_bytealign_be (w0[1], w0[2], offset); w6[0] = hc_bytealign_be (w0[0], w0[1], offset); w5[3] = hc_bytealign_be ( 0, w0[0], offset); w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 24: w7[3] = hc_bytealign_be (w1[2], w1[3], offset); w7[2] = hc_bytealign_be (w1[1], w1[2], offset); w7[1] = hc_bytealign_be (w1[0], w1[1], offset); w7[0] = hc_bytealign_be (w0[3], w1[0], offset); w6[3] = hc_bytealign_be (w0[2], w0[3], offset); w6[2] = hc_bytealign_be (w0[1], w0[2], offset); w6[1] = hc_bytealign_be (w0[0], w0[1], offset); w6[0] = hc_bytealign_be ( 0, w0[0], offset); w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 25: w7[3] = hc_bytealign_be (w1[1], w1[2], offset); w7[2] = hc_bytealign_be (w1[0], w1[1], offset); w7[1] = hc_bytealign_be (w0[3], w1[0], offset); w7[0] = hc_bytealign_be (w0[2], w0[3], offset); w6[3] = hc_bytealign_be (w0[1], w0[2], offset); w6[2] = hc_bytealign_be (w0[0], w0[1], offset); w6[1] = hc_bytealign_be ( 0, w0[0], offset); w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 26: w7[3] = hc_bytealign_be (w1[0], w1[1], offset); w7[2] = hc_bytealign_be (w0[3], w1[0], offset); w7[1] = hc_bytealign_be (w0[2], w0[3], offset); w7[0] = hc_bytealign_be (w0[1], w0[2], offset); w6[3] = hc_bytealign_be (w0[0], w0[1], offset); w6[2] = hc_bytealign_be ( 0, w0[0], offset); w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 27: w7[3] = hc_bytealign_be (w0[3], w1[0], offset); w7[2] = hc_bytealign_be (w0[2], w0[3], offset); w7[1] = hc_bytealign_be (w0[1], w0[2], offset); w7[0] = hc_bytealign_be (w0[0], w0[1], offset); w6[3] = hc_bytealign_be ( 0, w0[0], offset); w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 28: w7[3] = hc_bytealign_be (w0[2], w0[3], offset); w7[2] = hc_bytealign_be (w0[1], w0[2], offset); w7[1] = hc_bytealign_be (w0[0], w0[1], offset); w7[0] = hc_bytealign_be ( 0, w0[0], offset); w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 29: w7[3] = hc_bytealign_be (w0[1], w0[2], offset); w7[2] = hc_bytealign_be (w0[0], w0[1], offset); w7[1] = hc_bytealign_be ( 0, w0[0], offset); w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 30: w7[3] = hc_bytealign_be (w0[0], w0[1], offset); w7[2] = hc_bytealign_be ( 0, w0[0], offset); w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 31: w7[3] = hc_bytealign_be ( 0, w0[0], offset); w7[2] = 0; w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV #if defined IS_NV const int selector = (0x76543210 >> ((offset & 3) * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> ((offset & 3) * 8)); #endif switch (offset_switch) { case 0: w7[3] = hc_byte_perm (w7[3], w7[2], selector); w7[2] = hc_byte_perm (w7[2], w7[1], selector); w7[1] = hc_byte_perm (w7[1], w7[0], selector); w7[0] = hc_byte_perm (w7[0], w6[3], selector); w6[3] = hc_byte_perm (w6[3], w6[2], selector); w6[2] = hc_byte_perm (w6[2], w6[1], selector); w6[1] = hc_byte_perm (w6[1], w6[0], selector); w6[0] = hc_byte_perm (w6[0], w5[3], selector); w5[3] = hc_byte_perm (w5[3], w5[2], selector); w5[2] = hc_byte_perm (w5[2], w5[1], selector); w5[1] = hc_byte_perm (w5[1], w5[0], selector); w5[0] = hc_byte_perm (w5[0], w4[3], selector); w4[3] = hc_byte_perm (w4[3], w4[2], selector); w4[2] = hc_byte_perm (w4[2], w4[1], selector); w4[1] = hc_byte_perm (w4[1], w4[0], selector); w4[0] = hc_byte_perm (w4[0], w3[3], selector); w3[3] = hc_byte_perm (w3[3], w3[2], selector); w3[2] = hc_byte_perm (w3[2], w3[1], selector); w3[1] = hc_byte_perm (w3[1], w3[0], selector); w3[0] = hc_byte_perm (w3[0], w2[3], selector); w2[3] = hc_byte_perm (w2[3], w2[2], selector); w2[2] = hc_byte_perm (w2[2], w2[1], selector); w2[1] = hc_byte_perm (w2[1], w2[0], selector); w2[0] = hc_byte_perm (w2[0], w1[3], selector); w1[3] = hc_byte_perm (w1[3], w1[2], selector); w1[2] = hc_byte_perm (w1[2], w1[1], selector); w1[1] = hc_byte_perm (w1[1], w1[0], selector); w1[0] = hc_byte_perm (w1[0], w0[3], selector); w0[3] = hc_byte_perm (w0[3], w0[2], selector); w0[2] = hc_byte_perm (w0[2], w0[1], selector); w0[1] = hc_byte_perm (w0[1], w0[0], selector); w0[0] = hc_byte_perm (w0[0], 0, selector); break; case 1: w7[3] = hc_byte_perm (w7[2], w7[1], selector); w7[2] = hc_byte_perm (w7[1], w7[0], selector); w7[1] = hc_byte_perm (w7[0], w6[3], selector); w7[0] = hc_byte_perm (w6[3], w6[2], selector); w6[3] = hc_byte_perm (w6[2], w6[1], selector); w6[2] = hc_byte_perm (w6[1], w6[0], selector); w6[1] = hc_byte_perm (w6[0], w5[3], selector); w6[0] = hc_byte_perm (w5[3], w5[2], selector); w5[3] = hc_byte_perm (w5[2], w5[1], selector); w5[2] = hc_byte_perm (w5[1], w5[0], selector); w5[1] = hc_byte_perm (w5[0], w4[3], selector); w5[0] = hc_byte_perm (w4[3], w4[2], selector); w4[3] = hc_byte_perm (w4[2], w4[1], selector); w4[2] = hc_byte_perm (w4[1], w4[0], selector); w4[1] = hc_byte_perm (w4[0], w3[3], selector); w4[0] = hc_byte_perm (w3[3], w3[2], selector); w3[3] = hc_byte_perm (w3[2], w3[1], selector); w3[2] = hc_byte_perm (w3[1], w3[0], selector); w3[1] = hc_byte_perm (w3[0], w2[3], selector); w3[0] = hc_byte_perm (w2[3], w2[2], selector); w2[3] = hc_byte_perm (w2[2], w2[1], selector); w2[2] = hc_byte_perm (w2[1], w2[0], selector); w2[1] = hc_byte_perm (w2[0], w1[3], selector); w2[0] = hc_byte_perm (w1[3], w1[2], selector); w1[3] = hc_byte_perm (w1[2], w1[1], selector); w1[2] = hc_byte_perm (w1[1], w1[0], selector); w1[1] = hc_byte_perm (w1[0], w0[3], selector); w1[0] = hc_byte_perm (w0[3], w0[2], selector); w0[3] = hc_byte_perm (w0[2], w0[1], selector); w0[2] = hc_byte_perm (w0[1], w0[0], selector); w0[1] = hc_byte_perm (w0[0], 0, selector); w0[0] = 0; break; case 2: w7[3] = hc_byte_perm (w7[1], w7[0], selector); w7[2] = hc_byte_perm (w7[0], w6[3], selector); w7[1] = hc_byte_perm (w6[3], w6[2], selector); w7[0] = hc_byte_perm (w6[2], w6[1], selector); w6[3] = hc_byte_perm (w6[1], w6[0], selector); w6[2] = hc_byte_perm (w6[0], w5[3], selector); w6[1] = hc_byte_perm (w5[3], w5[2], selector); w6[0] = hc_byte_perm (w5[2], w5[1], selector); w5[3] = hc_byte_perm (w5[1], w5[0], selector); w5[2] = hc_byte_perm (w5[0], w4[3], selector); w5[1] = hc_byte_perm (w4[3], w4[2], selector); w5[0] = hc_byte_perm (w4[2], w4[1], selector); w4[3] = hc_byte_perm (w4[1], w4[0], selector); w4[2] = hc_byte_perm (w4[0], w3[3], selector); w4[1] = hc_byte_perm (w3[3], w3[2], selector); w4[0] = hc_byte_perm (w3[2], w3[1], selector); w3[3] = hc_byte_perm (w3[1], w3[0], selector); w3[2] = hc_byte_perm (w3[0], w2[3], selector); w3[1] = hc_byte_perm (w2[3], w2[2], selector); w3[0] = hc_byte_perm (w2[2], w2[1], selector); w2[3] = hc_byte_perm (w2[1], w2[0], selector); w2[2] = hc_byte_perm (w2[0], w1[3], selector); w2[1] = hc_byte_perm (w1[3], w1[2], selector); w2[0] = hc_byte_perm (w1[2], w1[1], selector); w1[3] = hc_byte_perm (w1[1], w1[0], selector); w1[2] = hc_byte_perm (w1[0], w0[3], selector); w1[1] = hc_byte_perm (w0[3], w0[2], selector); w1[0] = hc_byte_perm (w0[2], w0[1], selector); w0[3] = hc_byte_perm (w0[1], w0[0], selector); w0[2] = hc_byte_perm (w0[0], 0, selector); w0[1] = 0; w0[0] = 0; break; case 3: w7[3] = hc_byte_perm (w7[0], w6[3], selector); w7[2] = hc_byte_perm (w6[3], w6[2], selector); w7[1] = hc_byte_perm (w6[2], w6[1], selector); w7[0] = hc_byte_perm (w6[1], w6[0], selector); w6[3] = hc_byte_perm (w6[0], w5[3], selector); w6[2] = hc_byte_perm (w5[3], w5[2], selector); w6[1] = hc_byte_perm (w5[2], w5[1], selector); w6[0] = hc_byte_perm (w5[1], w5[0], selector); w5[3] = hc_byte_perm (w5[0], w4[3], selector); w5[2] = hc_byte_perm (w4[3], w4[2], selector); w5[1] = hc_byte_perm (w4[2], w4[1], selector); w5[0] = hc_byte_perm (w4[1], w4[0], selector); w4[3] = hc_byte_perm (w4[0], w3[3], selector); w4[2] = hc_byte_perm (w3[3], w3[2], selector); w4[1] = hc_byte_perm (w3[2], w3[1], selector); w4[0] = hc_byte_perm (w3[1], w3[0], selector); w3[3] = hc_byte_perm (w3[0], w2[3], selector); w3[2] = hc_byte_perm (w2[3], w2[2], selector); w3[1] = hc_byte_perm (w2[2], w2[1], selector); w3[0] = hc_byte_perm (w2[1], w2[0], selector); w2[3] = hc_byte_perm (w2[0], w1[3], selector); w2[2] = hc_byte_perm (w1[3], w1[2], selector); w2[1] = hc_byte_perm (w1[2], w1[1], selector); w2[0] = hc_byte_perm (w1[1], w1[0], selector); w1[3] = hc_byte_perm (w1[0], w0[3], selector); w1[2] = hc_byte_perm (w0[3], w0[2], selector); w1[1] = hc_byte_perm (w0[2], w0[1], selector); w1[0] = hc_byte_perm (w0[1], w0[0], selector); w0[3] = hc_byte_perm (w0[0], 0, selector); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: w7[3] = hc_byte_perm (w6[3], w6[2], selector); w7[2] = hc_byte_perm (w6[2], w6[1], selector); w7[1] = hc_byte_perm (w6[1], w6[0], selector); w7[0] = hc_byte_perm (w6[0], w5[3], selector); w6[3] = hc_byte_perm (w5[3], w5[2], selector); w6[2] = hc_byte_perm (w5[2], w5[1], selector); w6[1] = hc_byte_perm (w5[1], w5[0], selector); w6[0] = hc_byte_perm (w5[0], w4[3], selector); w5[3] = hc_byte_perm (w4[3], w4[2], selector); w5[2] = hc_byte_perm (w4[2], w4[1], selector); w5[1] = hc_byte_perm (w4[1], w4[0], selector); w5[0] = hc_byte_perm (w4[0], w3[3], selector); w4[3] = hc_byte_perm (w3[3], w3[2], selector); w4[2] = hc_byte_perm (w3[2], w3[1], selector); w4[1] = hc_byte_perm (w3[1], w3[0], selector); w4[0] = hc_byte_perm (w3[0], w2[3], selector); w3[3] = hc_byte_perm (w2[3], w2[2], selector); w3[2] = hc_byte_perm (w2[2], w2[1], selector); w3[1] = hc_byte_perm (w2[1], w2[0], selector); w3[0] = hc_byte_perm (w2[0], w1[3], selector); w2[3] = hc_byte_perm (w1[3], w1[2], selector); w2[2] = hc_byte_perm (w1[2], w1[1], selector); w2[1] = hc_byte_perm (w1[1], w1[0], selector); w2[0] = hc_byte_perm (w1[0], w0[3], selector); w1[3] = hc_byte_perm (w0[3], w0[2], selector); w1[2] = hc_byte_perm (w0[2], w0[1], selector); w1[1] = hc_byte_perm (w0[1], w0[0], selector); w1[0] = hc_byte_perm (w0[0], 0, selector); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: w7[3] = hc_byte_perm (w6[2], w6[1], selector); w7[2] = hc_byte_perm (w6[1], w6[0], selector); w7[1] = hc_byte_perm (w6[0], w5[3], selector); w7[0] = hc_byte_perm (w5[3], w5[2], selector); w6[3] = hc_byte_perm (w5[2], w5[1], selector); w6[2] = hc_byte_perm (w5[1], w5[0], selector); w6[1] = hc_byte_perm (w5[0], w4[3], selector); w6[0] = hc_byte_perm (w4[3], w4[2], selector); w5[3] = hc_byte_perm (w4[2], w4[1], selector); w5[2] = hc_byte_perm (w4[1], w4[0], selector); w5[1] = hc_byte_perm (w4[0], w3[3], selector); w5[0] = hc_byte_perm (w3[3], w3[2], selector); w4[3] = hc_byte_perm (w3[2], w3[1], selector); w4[2] = hc_byte_perm (w3[1], w3[0], selector); w4[1] = hc_byte_perm (w3[0], w2[3], selector); w4[0] = hc_byte_perm (w2[3], w2[2], selector); w3[3] = hc_byte_perm (w2[2], w2[1], selector); w3[2] = hc_byte_perm (w2[1], w2[0], selector); w3[1] = hc_byte_perm (w2[0], w1[3], selector); w3[0] = hc_byte_perm (w1[3], w1[2], selector); w2[3] = hc_byte_perm (w1[2], w1[1], selector); w2[2] = hc_byte_perm (w1[1], w1[0], selector); w2[1] = hc_byte_perm (w1[0], w0[3], selector); w2[0] = hc_byte_perm (w0[3], w0[2], selector); w1[3] = hc_byte_perm (w0[2], w0[1], selector); w1[2] = hc_byte_perm (w0[1], w0[0], selector); w1[1] = hc_byte_perm (w0[0], 0, selector); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: w7[3] = hc_byte_perm (w6[1], w6[0], selector); w7[2] = hc_byte_perm (w6[0], w5[3], selector); w7[1] = hc_byte_perm (w5[3], w5[2], selector); w7[0] = hc_byte_perm (w5[2], w5[1], selector); w6[3] = hc_byte_perm (w5[1], w5[0], selector); w6[2] = hc_byte_perm (w5[0], w4[3], selector); w6[1] = hc_byte_perm (w4[3], w4[2], selector); w6[0] = hc_byte_perm (w4[2], w4[1], selector); w5[3] = hc_byte_perm (w4[1], w4[0], selector); w5[2] = hc_byte_perm (w4[0], w3[3], selector); w5[1] = hc_byte_perm (w3[3], w3[2], selector); w5[0] = hc_byte_perm (w3[2], w3[1], selector); w4[3] = hc_byte_perm (w3[1], w3[0], selector); w4[2] = hc_byte_perm (w3[0], w2[3], selector); w4[1] = hc_byte_perm (w2[3], w2[2], selector); w4[0] = hc_byte_perm (w2[2], w2[1], selector); w3[3] = hc_byte_perm (w2[1], w2[0], selector); w3[2] = hc_byte_perm (w2[0], w1[3], selector); w3[1] = hc_byte_perm (w1[3], w1[2], selector); w3[0] = hc_byte_perm (w1[2], w1[1], selector); w2[3] = hc_byte_perm (w1[1], w1[0], selector); w2[2] = hc_byte_perm (w1[0], w0[3], selector); w2[1] = hc_byte_perm (w0[3], w0[2], selector); w2[0] = hc_byte_perm (w0[2], w0[1], selector); w1[3] = hc_byte_perm (w0[1], w0[0], selector); w1[2] = hc_byte_perm (w0[0], 0, selector); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: w7[3] = hc_byte_perm (w6[0], w5[3], selector); w7[2] = hc_byte_perm (w5[3], w5[2], selector); w7[1] = hc_byte_perm (w5[2], w5[1], selector); w7[0] = hc_byte_perm (w5[1], w5[0], selector); w6[3] = hc_byte_perm (w5[0], w4[3], selector); w6[2] = hc_byte_perm (w4[3], w4[2], selector); w6[1] = hc_byte_perm (w4[2], w4[1], selector); w6[0] = hc_byte_perm (w4[1], w4[0], selector); w5[3] = hc_byte_perm (w4[0], w3[3], selector); w5[2] = hc_byte_perm (w3[3], w3[2], selector); w5[1] = hc_byte_perm (w3[2], w3[1], selector); w5[0] = hc_byte_perm (w3[1], w3[0], selector); w4[3] = hc_byte_perm (w3[0], w2[3], selector); w4[2] = hc_byte_perm (w2[3], w2[2], selector); w4[1] = hc_byte_perm (w2[2], w2[1], selector); w4[0] = hc_byte_perm (w2[1], w2[0], selector); w3[3] = hc_byte_perm (w2[0], w1[3], selector); w3[2] = hc_byte_perm (w1[3], w1[2], selector); w3[1] = hc_byte_perm (w1[2], w1[1], selector); w3[0] = hc_byte_perm (w1[1], w1[0], selector); w2[3] = hc_byte_perm (w1[0], w0[3], selector); w2[2] = hc_byte_perm (w0[3], w0[2], selector); w2[1] = hc_byte_perm (w0[2], w0[1], selector); w2[0] = hc_byte_perm (w0[1], w0[0], selector); w1[3] = hc_byte_perm (w0[0], 0, selector); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: w7[3] = hc_byte_perm (w5[3], w5[2], selector); w7[2] = hc_byte_perm (w5[2], w5[1], selector); w7[1] = hc_byte_perm (w5[1], w5[0], selector); w7[0] = hc_byte_perm (w5[0], w4[3], selector); w6[3] = hc_byte_perm (w4[3], w4[2], selector); w6[2] = hc_byte_perm (w4[2], w4[1], selector); w6[1] = hc_byte_perm (w4[1], w4[0], selector); w6[0] = hc_byte_perm (w4[0], w3[3], selector); w5[3] = hc_byte_perm (w3[3], w3[2], selector); w5[2] = hc_byte_perm (w3[2], w3[1], selector); w5[1] = hc_byte_perm (w3[1], w3[0], selector); w5[0] = hc_byte_perm (w3[0], w2[3], selector); w4[3] = hc_byte_perm (w2[3], w2[2], selector); w4[2] = hc_byte_perm (w2[2], w2[1], selector); w4[1] = hc_byte_perm (w2[1], w2[0], selector); w4[0] = hc_byte_perm (w2[0], w1[3], selector); w3[3] = hc_byte_perm (w1[3], w1[2], selector); w3[2] = hc_byte_perm (w1[2], w1[1], selector); w3[1] = hc_byte_perm (w1[1], w1[0], selector); w3[0] = hc_byte_perm (w1[0], w0[3], selector); w2[3] = hc_byte_perm (w0[3], w0[2], selector); w2[2] = hc_byte_perm (w0[2], w0[1], selector); w2[1] = hc_byte_perm (w0[1], w0[0], selector); w2[0] = hc_byte_perm (w0[0], 0, selector); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: w7[3] = hc_byte_perm (w5[2], w5[1], selector); w7[2] = hc_byte_perm (w5[1], w5[0], selector); w7[1] = hc_byte_perm (w5[0], w4[3], selector); w7[0] = hc_byte_perm (w4[3], w4[2], selector); w6[3] = hc_byte_perm (w4[2], w4[1], selector); w6[2] = hc_byte_perm (w4[1], w4[0], selector); w6[1] = hc_byte_perm (w4[0], w3[3], selector); w6[0] = hc_byte_perm (w3[3], w3[2], selector); w5[3] = hc_byte_perm (w3[2], w3[1], selector); w5[2] = hc_byte_perm (w3[1], w3[0], selector); w5[1] = hc_byte_perm (w3[0], w2[3], selector); w5[0] = hc_byte_perm (w2[3], w2[2], selector); w4[3] = hc_byte_perm (w2[2], w2[1], selector); w4[2] = hc_byte_perm (w2[1], w2[0], selector); w4[1] = hc_byte_perm (w2[0], w1[3], selector); w4[0] = hc_byte_perm (w1[3], w1[2], selector); w3[3] = hc_byte_perm (w1[2], w1[1], selector); w3[2] = hc_byte_perm (w1[1], w1[0], selector); w3[1] = hc_byte_perm (w1[0], w0[3], selector); w3[0] = hc_byte_perm (w0[3], w0[2], selector); w2[3] = hc_byte_perm (w0[2], w0[1], selector); w2[2] = hc_byte_perm (w0[1], w0[0], selector); w2[1] = hc_byte_perm (w0[0], 0, selector); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: w7[3] = hc_byte_perm (w5[1], w5[0], selector); w7[2] = hc_byte_perm (w5[0], w4[3], selector); w7[1] = hc_byte_perm (w4[3], w4[2], selector); w7[0] = hc_byte_perm (w4[2], w4[1], selector); w6[3] = hc_byte_perm (w4[1], w4[0], selector); w6[2] = hc_byte_perm (w4[0], w3[3], selector); w6[1] = hc_byte_perm (w3[3], w3[2], selector); w6[0] = hc_byte_perm (w3[2], w3[1], selector); w5[3] = hc_byte_perm (w3[1], w3[0], selector); w5[2] = hc_byte_perm (w3[0], w2[3], selector); w5[1] = hc_byte_perm (w2[3], w2[2], selector); w5[0] = hc_byte_perm (w2[2], w2[1], selector); w4[3] = hc_byte_perm (w2[1], w2[0], selector); w4[2] = hc_byte_perm (w2[0], w1[3], selector); w4[1] = hc_byte_perm (w1[3], w1[2], selector); w4[0] = hc_byte_perm (w1[2], w1[1], selector); w3[3] = hc_byte_perm (w1[1], w1[0], selector); w3[2] = hc_byte_perm (w1[0], w0[3], selector); w3[1] = hc_byte_perm (w0[3], w0[2], selector); w3[0] = hc_byte_perm (w0[2], w0[1], selector); w2[3] = hc_byte_perm (w0[1], w0[0], selector); w2[2] = hc_byte_perm (w0[0], 0, selector); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: w7[3] = hc_byte_perm (w5[0], w4[3], selector); w7[2] = hc_byte_perm (w4[3], w4[2], selector); w7[1] = hc_byte_perm (w4[2], w4[1], selector); w7[0] = hc_byte_perm (w4[1], w4[0], selector); w6[3] = hc_byte_perm (w4[0], w3[3], selector); w6[2] = hc_byte_perm (w3[3], w3[2], selector); w6[1] = hc_byte_perm (w3[2], w3[1], selector); w6[0] = hc_byte_perm (w3[1], w3[0], selector); w5[3] = hc_byte_perm (w3[0], w2[3], selector); w5[2] = hc_byte_perm (w2[3], w2[2], selector); w5[1] = hc_byte_perm (w2[2], w2[1], selector); w5[0] = hc_byte_perm (w2[1], w2[0], selector); w4[3] = hc_byte_perm (w2[0], w1[3], selector); w4[2] = hc_byte_perm (w1[3], w1[2], selector); w4[1] = hc_byte_perm (w1[2], w1[1], selector); w4[0] = hc_byte_perm (w1[1], w1[0], selector); w3[3] = hc_byte_perm (w1[0], w0[3], selector); w3[2] = hc_byte_perm (w0[3], w0[2], selector); w3[1] = hc_byte_perm (w0[2], w0[1], selector); w3[0] = hc_byte_perm (w0[1], w0[0], selector); w2[3] = hc_byte_perm (w0[0], 0, selector); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: w7[3] = hc_byte_perm (w4[3], w4[2], selector); w7[2] = hc_byte_perm (w4[2], w4[1], selector); w7[1] = hc_byte_perm (w4[1], w4[0], selector); w7[0] = hc_byte_perm (w4[0], w3[3], selector); w6[3] = hc_byte_perm (w3[3], w3[2], selector); w6[2] = hc_byte_perm (w3[2], w3[1], selector); w6[1] = hc_byte_perm (w3[1], w3[0], selector); w6[0] = hc_byte_perm (w3[0], w2[3], selector); w5[3] = hc_byte_perm (w2[3], w2[2], selector); w5[2] = hc_byte_perm (w2[2], w2[1], selector); w5[1] = hc_byte_perm (w2[1], w2[0], selector); w5[0] = hc_byte_perm (w2[0], w1[3], selector); w4[3] = hc_byte_perm (w1[3], w1[2], selector); w4[2] = hc_byte_perm (w1[2], w1[1], selector); w4[1] = hc_byte_perm (w1[1], w1[0], selector); w4[0] = hc_byte_perm (w1[0], w0[3], selector); w3[3] = hc_byte_perm (w0[3], w0[2], selector); w3[2] = hc_byte_perm (w0[2], w0[1], selector); w3[1] = hc_byte_perm (w0[1], w0[0], selector); w3[0] = hc_byte_perm (w0[0], 0, selector); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: w7[3] = hc_byte_perm (w4[2], w4[1], selector); w7[2] = hc_byte_perm (w4[1], w4[0], selector); w7[1] = hc_byte_perm (w4[0], w3[3], selector); w7[0] = hc_byte_perm (w3[3], w3[2], selector); w6[3] = hc_byte_perm (w3[2], w3[1], selector); w6[2] = hc_byte_perm (w3[1], w3[0], selector); w6[1] = hc_byte_perm (w3[0], w2[3], selector); w6[0] = hc_byte_perm (w2[3], w2[2], selector); w5[3] = hc_byte_perm (w2[2], w2[1], selector); w5[2] = hc_byte_perm (w2[1], w2[0], selector); w5[1] = hc_byte_perm (w2[0], w1[3], selector); w5[0] = hc_byte_perm (w1[3], w1[2], selector); w4[3] = hc_byte_perm (w1[2], w1[1], selector); w4[2] = hc_byte_perm (w1[1], w1[0], selector); w4[1] = hc_byte_perm (w1[0], w0[3], selector); w4[0] = hc_byte_perm (w0[3], w0[2], selector); w3[3] = hc_byte_perm (w0[2], w0[1], selector); w3[2] = hc_byte_perm (w0[1], w0[0], selector); w3[1] = hc_byte_perm (w0[0], 0, selector); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: w7[3] = hc_byte_perm (w4[1], w4[0], selector); w7[2] = hc_byte_perm (w4[0], w3[3], selector); w7[1] = hc_byte_perm (w3[3], w3[2], selector); w7[0] = hc_byte_perm (w3[2], w3[1], selector); w6[3] = hc_byte_perm (w3[1], w3[0], selector); w6[2] = hc_byte_perm (w3[0], w2[3], selector); w6[1] = hc_byte_perm (w2[3], w2[2], selector); w6[0] = hc_byte_perm (w2[2], w2[1], selector); w5[3] = hc_byte_perm (w2[1], w2[0], selector); w5[2] = hc_byte_perm (w2[0], w1[3], selector); w5[1] = hc_byte_perm (w1[3], w1[2], selector); w5[0] = hc_byte_perm (w1[2], w1[1], selector); w4[3] = hc_byte_perm (w1[1], w1[0], selector); w4[2] = hc_byte_perm (w1[0], w0[3], selector); w4[1] = hc_byte_perm (w0[3], w0[2], selector); w4[0] = hc_byte_perm (w0[2], w0[1], selector); w3[3] = hc_byte_perm (w0[1], w0[0], selector); w3[2] = hc_byte_perm (w0[0], 0, selector); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: w7[3] = hc_byte_perm (w4[0], w3[3], selector); w7[2] = hc_byte_perm (w3[3], w3[2], selector); w7[1] = hc_byte_perm (w3[2], w3[1], selector); w7[0] = hc_byte_perm (w3[1], w3[0], selector); w6[3] = hc_byte_perm (w3[0], w2[3], selector); w6[2] = hc_byte_perm (w2[3], w2[2], selector); w6[1] = hc_byte_perm (w2[2], w2[1], selector); w6[0] = hc_byte_perm (w2[1], w2[0], selector); w5[3] = hc_byte_perm (w2[0], w1[3], selector); w5[2] = hc_byte_perm (w1[3], w1[2], selector); w5[1] = hc_byte_perm (w1[2], w1[1], selector); w5[0] = hc_byte_perm (w1[1], w1[0], selector); w4[3] = hc_byte_perm (w1[0], w0[3], selector); w4[2] = hc_byte_perm (w0[3], w0[2], selector); w4[1] = hc_byte_perm (w0[2], w0[1], selector); w4[0] = hc_byte_perm (w0[1], w0[0], selector); w3[3] = hc_byte_perm (w0[0], 0, selector); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 16: w7[3] = hc_byte_perm (w3[3], w3[2], selector); w7[2] = hc_byte_perm (w3[2], w3[1], selector); w7[1] = hc_byte_perm (w3[1], w3[0], selector); w7[0] = hc_byte_perm (w3[0], w2[3], selector); w6[3] = hc_byte_perm (w2[3], w2[2], selector); w6[2] = hc_byte_perm (w2[2], w2[1], selector); w6[1] = hc_byte_perm (w2[1], w2[0], selector); w6[0] = hc_byte_perm (w2[0], w1[3], selector); w5[3] = hc_byte_perm (w1[3], w1[2], selector); w5[2] = hc_byte_perm (w1[2], w1[1], selector); w5[1] = hc_byte_perm (w1[1], w1[0], selector); w5[0] = hc_byte_perm (w1[0], w0[3], selector); w4[3] = hc_byte_perm (w0[3], w0[2], selector); w4[2] = hc_byte_perm (w0[2], w0[1], selector); w4[1] = hc_byte_perm (w0[1], w0[0], selector); w4[0] = hc_byte_perm (w0[0], 0, selector); w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 17: w7[3] = hc_byte_perm (w3[2], w3[1], selector); w7[2] = hc_byte_perm (w3[1], w3[0], selector); w7[1] = hc_byte_perm (w3[0], w2[3], selector); w7[0] = hc_byte_perm (w2[3], w2[2], selector); w6[3] = hc_byte_perm (w2[2], w2[1], selector); w6[2] = hc_byte_perm (w2[1], w2[0], selector); w6[1] = hc_byte_perm (w2[0], w1[3], selector); w6[0] = hc_byte_perm (w1[3], w1[2], selector); w5[3] = hc_byte_perm (w1[2], w1[1], selector); w5[2] = hc_byte_perm (w1[1], w1[0], selector); w5[1] = hc_byte_perm (w1[0], w0[3], selector); w5[0] = hc_byte_perm (w0[3], w0[2], selector); w4[3] = hc_byte_perm (w0[2], w0[1], selector); w4[2] = hc_byte_perm (w0[1], w0[0], selector); w4[1] = hc_byte_perm (w0[0], 0, selector); w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 18: w7[3] = hc_byte_perm (w3[1], w3[0], selector); w7[2] = hc_byte_perm (w3[0], w2[3], selector); w7[1] = hc_byte_perm (w2[3], w2[2], selector); w7[0] = hc_byte_perm (w2[2], w2[1], selector); w6[3] = hc_byte_perm (w2[1], w2[0], selector); w6[2] = hc_byte_perm (w2[0], w1[3], selector); w6[1] = hc_byte_perm (w1[3], w1[2], selector); w6[0] = hc_byte_perm (w1[2], w1[1], selector); w5[3] = hc_byte_perm (w1[1], w1[0], selector); w5[2] = hc_byte_perm (w1[0], w0[3], selector); w5[1] = hc_byte_perm (w0[3], w0[2], selector); w5[0] = hc_byte_perm (w0[2], w0[1], selector); w4[3] = hc_byte_perm (w0[1], w0[0], selector); w4[2] = hc_byte_perm (w0[0], 0, selector); w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 19: w7[3] = hc_byte_perm (w3[0], w2[3], selector); w7[2] = hc_byte_perm (w2[3], w2[2], selector); w7[1] = hc_byte_perm (w2[2], w2[1], selector); w7[0] = hc_byte_perm (w2[1], w2[0], selector); w6[3] = hc_byte_perm (w2[0], w1[3], selector); w6[2] = hc_byte_perm (w1[3], w1[2], selector); w6[1] = hc_byte_perm (w1[2], w1[1], selector); w6[0] = hc_byte_perm (w1[1], w1[0], selector); w5[3] = hc_byte_perm (w1[0], w0[3], selector); w5[2] = hc_byte_perm (w0[3], w0[2], selector); w5[1] = hc_byte_perm (w0[2], w0[1], selector); w5[0] = hc_byte_perm (w0[1], w0[0], selector); w4[3] = hc_byte_perm (w0[0], 0, selector); w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 20: w7[3] = hc_byte_perm (w2[3], w2[2], selector); w7[2] = hc_byte_perm (w2[2], w2[1], selector); w7[1] = hc_byte_perm (w2[1], w2[0], selector); w7[0] = hc_byte_perm (w2[0], w1[3], selector); w6[3] = hc_byte_perm (w1[3], w1[2], selector); w6[2] = hc_byte_perm (w1[2], w1[1], selector); w6[1] = hc_byte_perm (w1[1], w1[0], selector); w6[0] = hc_byte_perm (w1[0], w0[3], selector); w5[3] = hc_byte_perm (w0[3], w0[2], selector); w5[2] = hc_byte_perm (w0[2], w0[1], selector); w5[1] = hc_byte_perm (w0[1], w0[0], selector); w5[0] = hc_byte_perm (w0[0], 0, selector); w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 21: w7[3] = hc_byte_perm (w2[2], w2[1], selector); w7[2] = hc_byte_perm (w2[1], w2[0], selector); w7[1] = hc_byte_perm (w2[0], w1[3], selector); w7[0] = hc_byte_perm (w1[3], w1[2], selector); w6[3] = hc_byte_perm (w1[2], w1[1], selector); w6[2] = hc_byte_perm (w1[1], w1[0], selector); w6[1] = hc_byte_perm (w1[0], w0[3], selector); w6[0] = hc_byte_perm (w0[3], w0[2], selector); w5[3] = hc_byte_perm (w0[2], w0[1], selector); w5[2] = hc_byte_perm (w0[1], w0[0], selector); w5[1] = hc_byte_perm (w0[0], 0, selector); w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 22: w7[3] = hc_byte_perm (w2[1], w2[0], selector); w7[2] = hc_byte_perm (w2[0], w1[3], selector); w7[1] = hc_byte_perm (w1[3], w1[2], selector); w7[0] = hc_byte_perm (w1[2], w1[1], selector); w6[3] = hc_byte_perm (w1[1], w1[0], selector); w6[2] = hc_byte_perm (w1[0], w0[3], selector); w6[1] = hc_byte_perm (w0[3], w0[2], selector); w6[0] = hc_byte_perm (w0[2], w0[1], selector); w5[3] = hc_byte_perm (w0[1], w0[0], selector); w5[2] = hc_byte_perm (w0[0], 0, selector); w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 23: w7[3] = hc_byte_perm (w2[0], w1[3], selector); w7[2] = hc_byte_perm (w1[3], w1[2], selector); w7[1] = hc_byte_perm (w1[2], w1[1], selector); w7[0] = hc_byte_perm (w1[1], w1[0], selector); w6[3] = hc_byte_perm (w1[0], w0[3], selector); w6[2] = hc_byte_perm (w0[3], w0[2], selector); w6[1] = hc_byte_perm (w0[2], w0[1], selector); w6[0] = hc_byte_perm (w0[1], w0[0], selector); w5[3] = hc_byte_perm (w0[0], 0, selector); w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 24: w7[3] = hc_byte_perm (w1[3], w1[2], selector); w7[2] = hc_byte_perm (w1[2], w1[1], selector); w7[1] = hc_byte_perm (w1[1], w1[0], selector); w7[0] = hc_byte_perm (w1[0], w0[3], selector); w6[3] = hc_byte_perm (w0[3], w0[2], selector); w6[2] = hc_byte_perm (w0[2], w0[1], selector); w6[1] = hc_byte_perm (w0[1], w0[0], selector); w6[0] = hc_byte_perm (w0[0], 0, selector); w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 25: w7[3] = hc_byte_perm (w1[2], w1[1], selector); w7[2] = hc_byte_perm (w1[1], w1[0], selector); w7[1] = hc_byte_perm (w1[0], w0[3], selector); w7[0] = hc_byte_perm (w0[3], w0[2], selector); w6[3] = hc_byte_perm (w0[2], w0[1], selector); w6[2] = hc_byte_perm (w0[1], w0[0], selector); w6[1] = hc_byte_perm (w0[0], 0, selector); w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 26: w7[3] = hc_byte_perm (w1[1], w1[0], selector); w7[2] = hc_byte_perm (w1[0], w0[3], selector); w7[1] = hc_byte_perm (w0[3], w0[2], selector); w7[0] = hc_byte_perm (w0[2], w0[1], selector); w6[3] = hc_byte_perm (w0[1], w0[0], selector); w6[2] = hc_byte_perm (w0[0], 0, selector); w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 27: w7[3] = hc_byte_perm (w1[0], w0[3], selector); w7[2] = hc_byte_perm (w0[3], w0[2], selector); w7[1] = hc_byte_perm (w0[2], w0[1], selector); w7[0] = hc_byte_perm (w0[1], w0[0], selector); w6[3] = hc_byte_perm (w0[0], 0, selector); w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 28: w7[3] = hc_byte_perm (w0[3], w0[2], selector); w7[2] = hc_byte_perm (w0[2], w0[1], selector); w7[1] = hc_byte_perm (w0[1], w0[0], selector); w7[0] = hc_byte_perm (w0[0], 0, selector); w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 29: w7[3] = hc_byte_perm (w0[2], w0[1], selector); w7[2] = hc_byte_perm (w0[1], w0[0], selector); w7[1] = hc_byte_perm (w0[0], 0, selector); w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 30: w7[3] = hc_byte_perm (w0[1], w0[0], selector); w7[2] = hc_byte_perm (w0[0], 0, selector); w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 31: w7[3] = hc_byte_perm (w0[0], 0, selector); w7[2] = 0; w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_8x4_carry_be (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *w4, PRIVATE_AS u32x *w5, PRIVATE_AS u32x *w6, PRIVATE_AS u32x *w7, PRIVATE_AS u32x *c0, PRIVATE_AS u32x *c1, PRIVATE_AS u32x *c2, PRIVATE_AS u32x *c3, PRIVATE_AS u32x *c4, PRIVATE_AS u32x *c5, PRIVATE_AS u32x *c6, PRIVATE_AS u32x *c7, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: c0[0] = hc_bytealign_be (w7[3], 0, offset); w7[3] = hc_bytealign_be (w7[2], w7[3], offset); w7[2] = hc_bytealign_be (w7[1], w7[2], offset); w7[1] = hc_bytealign_be (w7[0], w7[1], offset); w7[0] = hc_bytealign_be (w6[3], w7[0], offset); w6[3] = hc_bytealign_be (w6[2], w6[3], offset); w6[2] = hc_bytealign_be (w6[1], w6[2], offset); w6[1] = hc_bytealign_be (w6[0], w6[1], offset); w6[0] = hc_bytealign_be (w5[3], w6[0], offset); w5[3] = hc_bytealign_be (w5[2], w5[3], offset); w5[2] = hc_bytealign_be (w5[1], w5[2], offset); w5[1] = hc_bytealign_be (w5[0], w5[1], offset); w5[0] = hc_bytealign_be (w4[3], w5[0], offset); w4[3] = hc_bytealign_be (w4[2], w4[3], offset); w4[2] = hc_bytealign_be (w4[1], w4[2], offset); w4[1] = hc_bytealign_be (w4[0], w4[1], offset); w4[0] = hc_bytealign_be (w3[3], w4[0], offset); w3[3] = hc_bytealign_be (w3[2], w3[3], offset); w3[2] = hc_bytealign_be (w3[1], w3[2], offset); w3[1] = hc_bytealign_be (w3[0], w3[1], offset); w3[0] = hc_bytealign_be (w2[3], w3[0], offset); w2[3] = hc_bytealign_be (w2[2], w2[3], offset); w2[2] = hc_bytealign_be (w2[1], w2[2], offset); w2[1] = hc_bytealign_be (w2[0], w2[1], offset); w2[0] = hc_bytealign_be (w1[3], w2[0], offset); w1[3] = hc_bytealign_be (w1[2], w1[3], offset); w1[2] = hc_bytealign_be (w1[1], w1[2], offset); w1[1] = hc_bytealign_be (w1[0], w1[1], offset); w1[0] = hc_bytealign_be (w0[3], w1[0], offset); w0[3] = hc_bytealign_be (w0[2], w0[3], offset); w0[2] = hc_bytealign_be (w0[1], w0[2], offset); w0[1] = hc_bytealign_be (w0[0], w0[1], offset); w0[0] = hc_bytealign_be ( 0, w0[0], offset); break; case 1: c0[1] = hc_bytealign_be (w7[3], 0, offset); c0[0] = hc_bytealign_be (w7[2], w7[3], offset); w7[3] = hc_bytealign_be (w7[1], w7[2], offset); w7[2] = hc_bytealign_be (w7[0], w7[1], offset); w7[1] = hc_bytealign_be (w6[3], w7[0], offset); w7[0] = hc_bytealign_be (w6[2], w6[3], offset); w6[3] = hc_bytealign_be (w6[1], w6[2], offset); w6[2] = hc_bytealign_be (w6[0], w6[1], offset); w6[1] = hc_bytealign_be (w5[3], w6[0], offset); w6[0] = hc_bytealign_be (w5[2], w5[3], offset); w5[3] = hc_bytealign_be (w5[1], w5[2], offset); w5[2] = hc_bytealign_be (w5[0], w5[1], offset); w5[1] = hc_bytealign_be (w4[3], w5[0], offset); w5[0] = hc_bytealign_be (w4[2], w4[3], offset); w4[3] = hc_bytealign_be (w4[1], w4[2], offset); w4[2] = hc_bytealign_be (w4[0], w4[1], offset); w4[1] = hc_bytealign_be (w3[3], w4[0], offset); w4[0] = hc_bytealign_be (w3[2], w3[3], offset); w3[3] = hc_bytealign_be (w3[1], w3[2], offset); w3[2] = hc_bytealign_be (w3[0], w3[1], offset); w3[1] = hc_bytealign_be (w2[3], w3[0], offset); w3[0] = hc_bytealign_be (w2[2], w2[3], offset); w2[3] = hc_bytealign_be (w2[1], w2[2], offset); w2[2] = hc_bytealign_be (w2[0], w2[1], offset); w2[1] = hc_bytealign_be (w1[3], w2[0], offset); w2[0] = hc_bytealign_be (w1[2], w1[3], offset); w1[3] = hc_bytealign_be (w1[1], w1[2], offset); w1[2] = hc_bytealign_be (w1[0], w1[1], offset); w1[1] = hc_bytealign_be (w0[3], w1[0], offset); w1[0] = hc_bytealign_be (w0[2], w0[3], offset); w0[3] = hc_bytealign_be (w0[1], w0[2], offset); w0[2] = hc_bytealign_be (w0[0], w0[1], offset); w0[1] = hc_bytealign_be ( 0, w0[0], offset); w0[0] = 0; break; case 2: c0[2] = hc_bytealign_be (w7[3], 0, offset); c0[1] = hc_bytealign_be (w7[2], w7[3], offset); c0[0] = hc_bytealign_be (w7[1], w7[2], offset); w7[3] = hc_bytealign_be (w7[0], w7[1], offset); w7[2] = hc_bytealign_be (w6[3], w7[0], offset); w7[1] = hc_bytealign_be (w6[2], w6[3], offset); w7[0] = hc_bytealign_be (w6[1], w6[2], offset); w6[3] = hc_bytealign_be (w6[0], w6[1], offset); w6[2] = hc_bytealign_be (w5[3], w6[0], offset); w6[1] = hc_bytealign_be (w5[2], w5[3], offset); w6[0] = hc_bytealign_be (w5[1], w5[2], offset); w5[3] = hc_bytealign_be (w5[0], w5[1], offset); w5[2] = hc_bytealign_be (w4[3], w5[0], offset); w5[1] = hc_bytealign_be (w4[2], w4[3], offset); w5[0] = hc_bytealign_be (w4[1], w4[2], offset); w4[3] = hc_bytealign_be (w4[0], w4[1], offset); w4[2] = hc_bytealign_be (w3[3], w4[0], offset); w4[1] = hc_bytealign_be (w3[2], w3[3], offset); w4[0] = hc_bytealign_be (w3[1], w3[2], offset); w3[3] = hc_bytealign_be (w3[0], w3[1], offset); w3[2] = hc_bytealign_be (w2[3], w3[0], offset); w3[1] = hc_bytealign_be (w2[2], w2[3], offset); w3[0] = hc_bytealign_be (w2[1], w2[2], offset); w2[3] = hc_bytealign_be (w2[0], w2[1], offset); w2[2] = hc_bytealign_be (w1[3], w2[0], offset); w2[1] = hc_bytealign_be (w1[2], w1[3], offset); w2[0] = hc_bytealign_be (w1[1], w1[2], offset); w1[3] = hc_bytealign_be (w1[0], w1[1], offset); w1[2] = hc_bytealign_be (w0[3], w1[0], offset); w1[1] = hc_bytealign_be (w0[2], w0[3], offset); w1[0] = hc_bytealign_be (w0[1], w0[2], offset); w0[3] = hc_bytealign_be (w0[0], w0[1], offset); w0[2] = hc_bytealign_be ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: c0[3] = hc_bytealign_be (w7[3], 0, offset); c0[2] = hc_bytealign_be (w7[2], w7[3], offset); c0[1] = hc_bytealign_be (w7[1], w7[2], offset); c0[0] = hc_bytealign_be (w7[0], w7[1], offset); w7[3] = hc_bytealign_be (w6[3], w7[0], offset); w7[2] = hc_bytealign_be (w6[2], w6[3], offset); w7[1] = hc_bytealign_be (w6[1], w6[2], offset); w7[0] = hc_bytealign_be (w6[0], w6[1], offset); w6[3] = hc_bytealign_be (w5[3], w6[0], offset); w6[2] = hc_bytealign_be (w5[2], w5[3], offset); w6[1] = hc_bytealign_be (w5[1], w5[2], offset); w6[0] = hc_bytealign_be (w5[0], w5[1], offset); w5[3] = hc_bytealign_be (w4[3], w5[0], offset); w5[2] = hc_bytealign_be (w4[2], w4[3], offset); w5[1] = hc_bytealign_be (w4[1], w4[2], offset); w5[0] = hc_bytealign_be (w4[0], w4[1], offset); w4[3] = hc_bytealign_be (w3[3], w4[0], offset); w4[2] = hc_bytealign_be (w3[2], w3[3], offset); w4[1] = hc_bytealign_be (w3[1], w3[2], offset); w4[0] = hc_bytealign_be (w3[0], w3[1], offset); w3[3] = hc_bytealign_be (w2[3], w3[0], offset); w3[2] = hc_bytealign_be (w2[2], w2[3], offset); w3[1] = hc_bytealign_be (w2[1], w2[2], offset); w3[0] = hc_bytealign_be (w2[0], w2[1], offset); w2[3] = hc_bytealign_be (w1[3], w2[0], offset); w2[2] = hc_bytealign_be (w1[2], w1[3], offset); w2[1] = hc_bytealign_be (w1[1], w1[2], offset); w2[0] = hc_bytealign_be (w1[0], w1[1], offset); w1[3] = hc_bytealign_be (w0[3], w1[0], offset); w1[2] = hc_bytealign_be (w0[2], w0[3], offset); w1[1] = hc_bytealign_be (w0[1], w0[2], offset); w1[0] = hc_bytealign_be (w0[0], w0[1], offset); w0[3] = hc_bytealign_be ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: c1[0] = hc_bytealign_be (w7[3], 0, offset); c0[3] = hc_bytealign_be (w7[2], w7[3], offset); c0[2] = hc_bytealign_be (w7[1], w7[2], offset); c0[1] = hc_bytealign_be (w7[0], w7[1], offset); c0[0] = hc_bytealign_be (w6[3], w7[0], offset); w7[3] = hc_bytealign_be (w6[2], w6[3], offset); w7[2] = hc_bytealign_be (w6[1], w6[2], offset); w7[1] = hc_bytealign_be (w6[0], w6[1], offset); w7[0] = hc_bytealign_be (w5[3], w6[0], offset); w6[3] = hc_bytealign_be (w5[2], w5[3], offset); w6[2] = hc_bytealign_be (w5[1], w5[2], offset); w6[1] = hc_bytealign_be (w5[0], w5[1], offset); w6[0] = hc_bytealign_be (w4[3], w5[0], offset); w5[3] = hc_bytealign_be (w4[2], w4[3], offset); w5[2] = hc_bytealign_be (w4[1], w4[2], offset); w5[1] = hc_bytealign_be (w4[0], w4[1], offset); w5[0] = hc_bytealign_be (w3[3], w4[0], offset); w4[3] = hc_bytealign_be (w3[2], w3[3], offset); w4[2] = hc_bytealign_be (w3[1], w3[2], offset); w4[1] = hc_bytealign_be (w3[0], w3[1], offset); w4[0] = hc_bytealign_be (w2[3], w3[0], offset); w3[3] = hc_bytealign_be (w2[2], w2[3], offset); w3[2] = hc_bytealign_be (w2[1], w2[2], offset); w3[1] = hc_bytealign_be (w2[0], w2[1], offset); w3[0] = hc_bytealign_be (w1[3], w2[0], offset); w2[3] = hc_bytealign_be (w1[2], w1[3], offset); w2[2] = hc_bytealign_be (w1[1], w1[2], offset); w2[1] = hc_bytealign_be (w1[0], w1[1], offset); w2[0] = hc_bytealign_be (w0[3], w1[0], offset); w1[3] = hc_bytealign_be (w0[2], w0[3], offset); w1[2] = hc_bytealign_be (w0[1], w0[2], offset); w1[1] = hc_bytealign_be (w0[0], w0[1], offset); w1[0] = hc_bytealign_be ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: c1[1] = hc_bytealign_be (w7[3], 0, offset); c1[0] = hc_bytealign_be (w7[2], w7[3], offset); c0[3] = hc_bytealign_be (w7[1], w7[2], offset); c0[2] = hc_bytealign_be (w7[0], w7[1], offset); c0[1] = hc_bytealign_be (w6[3], w7[0], offset); c0[0] = hc_bytealign_be (w6[2], w6[3], offset); w7[3] = hc_bytealign_be (w6[1], w6[2], offset); w7[2] = hc_bytealign_be (w6[0], w6[1], offset); w7[1] = hc_bytealign_be (w5[3], w6[0], offset); w7[0] = hc_bytealign_be (w5[2], w5[3], offset); w6[3] = hc_bytealign_be (w5[1], w5[2], offset); w6[2] = hc_bytealign_be (w5[0], w5[1], offset); w6[1] = hc_bytealign_be (w4[3], w5[0], offset); w6[0] = hc_bytealign_be (w4[2], w4[3], offset); w5[3] = hc_bytealign_be (w4[1], w4[2], offset); w5[2] = hc_bytealign_be (w4[0], w4[1], offset); w5[1] = hc_bytealign_be (w3[3], w4[0], offset); w5[0] = hc_bytealign_be (w3[2], w3[3], offset); w4[3] = hc_bytealign_be (w3[1], w3[2], offset); w4[2] = hc_bytealign_be (w3[0], w3[1], offset); w4[1] = hc_bytealign_be (w2[3], w3[0], offset); w4[0] = hc_bytealign_be (w2[2], w2[3], offset); w3[3] = hc_bytealign_be (w2[1], w2[2], offset); w3[2] = hc_bytealign_be (w2[0], w2[1], offset); w3[1] = hc_bytealign_be (w1[3], w2[0], offset); w3[0] = hc_bytealign_be (w1[2], w1[3], offset); w2[3] = hc_bytealign_be (w1[1], w1[2], offset); w2[2] = hc_bytealign_be (w1[0], w1[1], offset); w2[1] = hc_bytealign_be (w0[3], w1[0], offset); w2[0] = hc_bytealign_be (w0[2], w0[3], offset); w1[3] = hc_bytealign_be (w0[1], w0[2], offset); w1[2] = hc_bytealign_be (w0[0], w0[1], offset); w1[1] = hc_bytealign_be ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: c1[2] = hc_bytealign_be (w7[3], 0, offset); c1[1] = hc_bytealign_be (w7[2], w7[3], offset); c1[0] = hc_bytealign_be (w7[1], w7[2], offset); c0[3] = hc_bytealign_be (w7[0], w7[1], offset); c0[2] = hc_bytealign_be (w6[3], w7[0], offset); c0[1] = hc_bytealign_be (w6[2], w6[3], offset); c0[0] = hc_bytealign_be (w6[1], w6[2], offset); w7[3] = hc_bytealign_be (w6[0], w6[1], offset); w7[2] = hc_bytealign_be (w5[3], w6[0], offset); w7[1] = hc_bytealign_be (w5[2], w5[3], offset); w7[0] = hc_bytealign_be (w5[1], w5[2], offset); w6[3] = hc_bytealign_be (w5[0], w5[1], offset); w6[2] = hc_bytealign_be (w4[3], w5[0], offset); w6[1] = hc_bytealign_be (w4[2], w4[3], offset); w6[0] = hc_bytealign_be (w4[1], w4[2], offset); w5[3] = hc_bytealign_be (w4[0], w4[1], offset); w5[2] = hc_bytealign_be (w3[3], w4[0], offset); w5[1] = hc_bytealign_be (w3[2], w3[3], offset); w5[0] = hc_bytealign_be (w3[1], w3[2], offset); w4[3] = hc_bytealign_be (w3[0], w3[1], offset); w4[2] = hc_bytealign_be (w2[3], w3[0], offset); w4[1] = hc_bytealign_be (w2[2], w2[3], offset); w4[0] = hc_bytealign_be (w2[1], w2[2], offset); w3[3] = hc_bytealign_be (w2[0], w2[1], offset); w3[2] = hc_bytealign_be (w1[3], w2[0], offset); w3[1] = hc_bytealign_be (w1[2], w1[3], offset); w3[0] = hc_bytealign_be (w1[1], w1[2], offset); w2[3] = hc_bytealign_be (w1[0], w1[1], offset); w2[2] = hc_bytealign_be (w0[3], w1[0], offset); w2[1] = hc_bytealign_be (w0[2], w0[3], offset); w2[0] = hc_bytealign_be (w0[1], w0[2], offset); w1[3] = hc_bytealign_be (w0[0], w0[1], offset); w1[2] = hc_bytealign_be ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: c1[3] = hc_bytealign_be (w7[3], 0, offset); c1[2] = hc_bytealign_be (w7[2], w7[3], offset); c1[1] = hc_bytealign_be (w7[1], w7[2], offset); c1[0] = hc_bytealign_be (w7[0], w7[1], offset); c0[3] = hc_bytealign_be (w6[3], w7[0], offset); c0[2] = hc_bytealign_be (w6[2], w6[3], offset); c0[1] = hc_bytealign_be (w6[1], w6[2], offset); c0[0] = hc_bytealign_be (w6[0], w6[1], offset); w7[3] = hc_bytealign_be (w5[3], w6[0], offset); w7[2] = hc_bytealign_be (w5[2], w5[3], offset); w7[1] = hc_bytealign_be (w5[1], w5[2], offset); w7[0] = hc_bytealign_be (w5[0], w5[1], offset); w6[3] = hc_bytealign_be (w4[3], w5[0], offset); w6[2] = hc_bytealign_be (w4[2], w4[3], offset); w6[1] = hc_bytealign_be (w4[1], w4[2], offset); w6[0] = hc_bytealign_be (w4[0], w4[1], offset); w5[3] = hc_bytealign_be (w3[3], w4[0], offset); w5[2] = hc_bytealign_be (w3[2], w3[3], offset); w5[1] = hc_bytealign_be (w3[1], w3[2], offset); w5[0] = hc_bytealign_be (w3[0], w3[1], offset); w4[3] = hc_bytealign_be (w2[3], w3[0], offset); w4[2] = hc_bytealign_be (w2[2], w2[3], offset); w4[1] = hc_bytealign_be (w2[1], w2[2], offset); w4[0] = hc_bytealign_be (w2[0], w2[1], offset); w3[3] = hc_bytealign_be (w1[3], w2[0], offset); w3[2] = hc_bytealign_be (w1[2], w1[3], offset); w3[1] = hc_bytealign_be (w1[1], w1[2], offset); w3[0] = hc_bytealign_be (w1[0], w1[1], offset); w2[3] = hc_bytealign_be (w0[3], w1[0], offset); w2[2] = hc_bytealign_be (w0[2], w0[3], offset); w2[1] = hc_bytealign_be (w0[1], w0[2], offset); w2[0] = hc_bytealign_be (w0[0], w0[1], offset); w1[3] = hc_bytealign_be ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: c2[0] = hc_bytealign_be (w7[3], 0, offset); c1[3] = hc_bytealign_be (w7[2], w7[3], offset); c1[2] = hc_bytealign_be (w7[1], w7[2], offset); c1[1] = hc_bytealign_be (w7[0], w7[1], offset); c1[0] = hc_bytealign_be (w6[3], w7[0], offset); c0[3] = hc_bytealign_be (w6[2], w6[3], offset); c0[2] = hc_bytealign_be (w6[1], w6[2], offset); c0[1] = hc_bytealign_be (w6[0], w6[1], offset); c0[0] = hc_bytealign_be (w5[3], w6[0], offset); w7[3] = hc_bytealign_be (w5[2], w5[3], offset); w7[2] = hc_bytealign_be (w5[1], w5[2], offset); w7[1] = hc_bytealign_be (w5[0], w5[1], offset); w7[0] = hc_bytealign_be (w4[3], w5[0], offset); w6[3] = hc_bytealign_be (w4[2], w4[3], offset); w6[2] = hc_bytealign_be (w4[1], w4[2], offset); w6[1] = hc_bytealign_be (w4[0], w4[1], offset); w6[0] = hc_bytealign_be (w3[3], w4[0], offset); w5[3] = hc_bytealign_be (w3[2], w3[3], offset); w5[2] = hc_bytealign_be (w3[1], w3[2], offset); w5[1] = hc_bytealign_be (w3[0], w3[1], offset); w5[0] = hc_bytealign_be (w2[3], w3[0], offset); w4[3] = hc_bytealign_be (w2[2], w2[3], offset); w4[2] = hc_bytealign_be (w2[1], w2[2], offset); w4[1] = hc_bytealign_be (w2[0], w2[1], offset); w4[0] = hc_bytealign_be (w1[3], w2[0], offset); w3[3] = hc_bytealign_be (w1[2], w1[3], offset); w3[2] = hc_bytealign_be (w1[1], w1[2], offset); w3[1] = hc_bytealign_be (w1[0], w1[1], offset); w3[0] = hc_bytealign_be (w0[3], w1[0], offset); w2[3] = hc_bytealign_be (w0[2], w0[3], offset); w2[2] = hc_bytealign_be (w0[1], w0[2], offset); w2[1] = hc_bytealign_be (w0[0], w0[1], offset); w2[0] = hc_bytealign_be ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: c2[1] = hc_bytealign_be (w7[3], 0, offset); c2[0] = hc_bytealign_be (w7[2], w7[3], offset); c1[3] = hc_bytealign_be (w7[1], w7[2], offset); c1[2] = hc_bytealign_be (w7[0], w7[1], offset); c1[1] = hc_bytealign_be (w6[3], w7[0], offset); c1[0] = hc_bytealign_be (w6[2], w6[3], offset); c0[3] = hc_bytealign_be (w6[1], w6[2], offset); c0[2] = hc_bytealign_be (w6[0], w6[1], offset); c0[1] = hc_bytealign_be (w5[3], w6[0], offset); c0[0] = hc_bytealign_be (w5[2], w5[3], offset); w7[3] = hc_bytealign_be (w5[1], w5[2], offset); w7[2] = hc_bytealign_be (w5[0], w5[1], offset); w7[1] = hc_bytealign_be (w4[3], w5[0], offset); w7[0] = hc_bytealign_be (w4[2], w4[3], offset); w6[3] = hc_bytealign_be (w4[1], w4[2], offset); w6[2] = hc_bytealign_be (w4[0], w4[1], offset); w6[1] = hc_bytealign_be (w3[3], w4[0], offset); w6[0] = hc_bytealign_be (w3[2], w3[3], offset); w5[3] = hc_bytealign_be (w3[1], w3[2], offset); w5[2] = hc_bytealign_be (w3[0], w3[1], offset); w5[1] = hc_bytealign_be (w2[3], w3[0], offset); w5[0] = hc_bytealign_be (w2[2], w2[3], offset); w4[3] = hc_bytealign_be (w2[1], w2[2], offset); w4[2] = hc_bytealign_be (w2[0], w2[1], offset); w4[1] = hc_bytealign_be (w1[3], w2[0], offset); w4[0] = hc_bytealign_be (w1[2], w1[3], offset); w3[3] = hc_bytealign_be (w1[1], w1[2], offset); w3[2] = hc_bytealign_be (w1[0], w1[1], offset); w3[1] = hc_bytealign_be (w0[3], w1[0], offset); w3[0] = hc_bytealign_be (w0[2], w0[3], offset); w2[3] = hc_bytealign_be (w0[1], w0[2], offset); w2[2] = hc_bytealign_be (w0[0], w0[1], offset); w2[1] = hc_bytealign_be ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: c2[2] = hc_bytealign_be (w7[3], 0, offset); c2[1] = hc_bytealign_be (w7[2], w7[3], offset); c2[0] = hc_bytealign_be (w7[1], w7[2], offset); c1[3] = hc_bytealign_be (w7[0], w7[1], offset); c1[2] = hc_bytealign_be (w6[3], w7[0], offset); c1[1] = hc_bytealign_be (w6[2], w6[3], offset); c1[0] = hc_bytealign_be (w6[1], w6[2], offset); c0[3] = hc_bytealign_be (w6[0], w6[1], offset); c0[2] = hc_bytealign_be (w5[3], w6[0], offset); c0[1] = hc_bytealign_be (w5[2], w5[3], offset); c0[0] = hc_bytealign_be (w5[1], w5[2], offset); w7[3] = hc_bytealign_be (w5[0], w5[1], offset); w7[2] = hc_bytealign_be (w4[3], w5[0], offset); w7[1] = hc_bytealign_be (w4[2], w4[3], offset); w7[0] = hc_bytealign_be (w4[1], w4[2], offset); w6[3] = hc_bytealign_be (w4[0], w4[1], offset); w6[2] = hc_bytealign_be (w3[3], w4[0], offset); w6[1] = hc_bytealign_be (w3[2], w3[3], offset); w6[0] = hc_bytealign_be (w3[1], w3[2], offset); w5[3] = hc_bytealign_be (w3[0], w3[1], offset); w5[2] = hc_bytealign_be (w2[3], w3[0], offset); w5[1] = hc_bytealign_be (w2[2], w2[3], offset); w5[0] = hc_bytealign_be (w2[1], w2[2], offset); w4[3] = hc_bytealign_be (w2[0], w2[1], offset); w4[2] = hc_bytealign_be (w1[3], w2[0], offset); w4[1] = hc_bytealign_be (w1[2], w1[3], offset); w4[0] = hc_bytealign_be (w1[1], w1[2], offset); w3[3] = hc_bytealign_be (w1[0], w1[1], offset); w3[2] = hc_bytealign_be (w0[3], w1[0], offset); w3[1] = hc_bytealign_be (w0[2], w0[3], offset); w3[0] = hc_bytealign_be (w0[1], w0[2], offset); w2[3] = hc_bytealign_be (w0[0], w0[1], offset); w2[2] = hc_bytealign_be ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: c2[3] = hc_bytealign_be (w7[3], 0, offset); c2[2] = hc_bytealign_be (w7[2], w7[3], offset); c2[1] = hc_bytealign_be (w7[1], w7[2], offset); c2[0] = hc_bytealign_be (w7[0], w7[1], offset); c1[3] = hc_bytealign_be (w6[3], w7[0], offset); c1[2] = hc_bytealign_be (w6[2], w6[3], offset); c1[1] = hc_bytealign_be (w6[1], w6[2], offset); c1[0] = hc_bytealign_be (w6[0], w6[1], offset); c0[3] = hc_bytealign_be (w5[3], w6[0], offset); c0[2] = hc_bytealign_be (w5[2], w5[3], offset); c0[1] = hc_bytealign_be (w5[1], w5[2], offset); c0[0] = hc_bytealign_be (w5[0], w5[1], offset); w7[3] = hc_bytealign_be (w4[3], w5[0], offset); w7[2] = hc_bytealign_be (w4[2], w4[3], offset); w7[1] = hc_bytealign_be (w4[1], w4[2], offset); w7[0] = hc_bytealign_be (w4[0], w4[1], offset); w6[3] = hc_bytealign_be (w3[3], w4[0], offset); w6[2] = hc_bytealign_be (w3[2], w3[3], offset); w6[1] = hc_bytealign_be (w3[1], w3[2], offset); w6[0] = hc_bytealign_be (w3[0], w3[1], offset); w5[3] = hc_bytealign_be (w2[3], w3[0], offset); w5[2] = hc_bytealign_be (w2[2], w2[3], offset); w5[1] = hc_bytealign_be (w2[1], w2[2], offset); w5[0] = hc_bytealign_be (w2[0], w2[1], offset); w4[3] = hc_bytealign_be (w1[3], w2[0], offset); w4[2] = hc_bytealign_be (w1[2], w1[3], offset); w4[1] = hc_bytealign_be (w1[1], w1[2], offset); w4[0] = hc_bytealign_be (w1[0], w1[1], offset); w3[3] = hc_bytealign_be (w0[3], w1[0], offset); w3[2] = hc_bytealign_be (w0[2], w0[3], offset); w3[1] = hc_bytealign_be (w0[1], w0[2], offset); w3[0] = hc_bytealign_be (w0[0], w0[1], offset); w2[3] = hc_bytealign_be ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: c3[0] = hc_bytealign_be (w7[3], 0, offset); c2[3] = hc_bytealign_be (w7[2], w7[3], offset); c2[2] = hc_bytealign_be (w7[1], w7[2], offset); c2[1] = hc_bytealign_be (w7[0], w7[1], offset); c2[0] = hc_bytealign_be (w6[3], w7[0], offset); c1[3] = hc_bytealign_be (w6[2], w6[3], offset); c1[2] = hc_bytealign_be (w6[1], w6[2], offset); c1[1] = hc_bytealign_be (w6[0], w6[1], offset); c1[0] = hc_bytealign_be (w5[3], w6[0], offset); c0[3] = hc_bytealign_be (w5[2], w5[3], offset); c0[2] = hc_bytealign_be (w5[1], w5[2], offset); c0[1] = hc_bytealign_be (w5[0], w5[1], offset); c0[0] = hc_bytealign_be (w4[3], w5[0], offset); w7[3] = hc_bytealign_be (w4[2], w4[3], offset); w7[2] = hc_bytealign_be (w4[1], w4[2], offset); w7[1] = hc_bytealign_be (w4[0], w4[1], offset); w7[0] = hc_bytealign_be (w3[3], w4[0], offset); w6[3] = hc_bytealign_be (w3[2], w3[3], offset); w6[2] = hc_bytealign_be (w3[1], w3[2], offset); w6[1] = hc_bytealign_be (w3[0], w3[1], offset); w6[0] = hc_bytealign_be (w2[3], w3[0], offset); w5[3] = hc_bytealign_be (w2[2], w2[3], offset); w5[2] = hc_bytealign_be (w2[1], w2[2], offset); w5[1] = hc_bytealign_be (w2[0], w2[1], offset); w5[0] = hc_bytealign_be (w1[3], w2[0], offset); w4[3] = hc_bytealign_be (w1[2], w1[3], offset); w4[2] = hc_bytealign_be (w1[1], w1[2], offset); w4[1] = hc_bytealign_be (w1[0], w1[1], offset); w4[0] = hc_bytealign_be (w0[3], w1[0], offset); w3[3] = hc_bytealign_be (w0[2], w0[3], offset); w3[2] = hc_bytealign_be (w0[1], w0[2], offset); w3[1] = hc_bytealign_be (w0[0], w0[1], offset); w3[0] = hc_bytealign_be ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: c3[1] = hc_bytealign_be (w7[3], 0, offset); c3[0] = hc_bytealign_be (w7[2], w7[3], offset); c2[3] = hc_bytealign_be (w7[1], w7[2], offset); c2[2] = hc_bytealign_be (w7[0], w7[1], offset); c2[1] = hc_bytealign_be (w6[3], w7[0], offset); c2[0] = hc_bytealign_be (w6[2], w6[3], offset); c1[3] = hc_bytealign_be (w6[1], w6[2], offset); c1[2] = hc_bytealign_be (w6[0], w6[1], offset); c1[1] = hc_bytealign_be (w5[3], w6[0], offset); c1[0] = hc_bytealign_be (w5[2], w5[3], offset); c0[3] = hc_bytealign_be (w5[1], w5[2], offset); c0[2] = hc_bytealign_be (w5[0], w5[1], offset); c0[1] = hc_bytealign_be (w4[3], w5[0], offset); c0[0] = hc_bytealign_be (w4[2], w4[3], offset); w7[3] = hc_bytealign_be (w4[1], w4[2], offset); w7[2] = hc_bytealign_be (w4[0], w4[1], offset); w7[1] = hc_bytealign_be (w3[3], w4[0], offset); w7[0] = hc_bytealign_be (w3[2], w3[3], offset); w6[3] = hc_bytealign_be (w3[1], w3[2], offset); w6[2] = hc_bytealign_be (w3[0], w3[1], offset); w6[1] = hc_bytealign_be (w2[3], w3[0], offset); w6[0] = hc_bytealign_be (w2[2], w2[3], offset); w5[3] = hc_bytealign_be (w2[1], w2[2], offset); w5[2] = hc_bytealign_be (w2[0], w2[1], offset); w5[1] = hc_bytealign_be (w1[3], w2[0], offset); w5[0] = hc_bytealign_be (w1[2], w1[3], offset); w4[3] = hc_bytealign_be (w1[1], w1[2], offset); w4[2] = hc_bytealign_be (w1[0], w1[1], offset); w4[1] = hc_bytealign_be (w0[3], w1[0], offset); w4[0] = hc_bytealign_be (w0[2], w0[3], offset); w3[3] = hc_bytealign_be (w0[1], w0[2], offset); w3[2] = hc_bytealign_be (w0[0], w0[1], offset); w3[1] = hc_bytealign_be ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: c3[2] = hc_bytealign_be (w7[3], 0, offset); c3[1] = hc_bytealign_be (w7[2], w7[3], offset); c3[0] = hc_bytealign_be (w7[1], w7[2], offset); c2[3] = hc_bytealign_be (w7[0], w7[1], offset); c2[2] = hc_bytealign_be (w6[3], w7[0], offset); c2[1] = hc_bytealign_be (w6[2], w6[3], offset); c2[0] = hc_bytealign_be (w6[1], w6[2], offset); c1[3] = hc_bytealign_be (w6[0], w6[1], offset); c1[2] = hc_bytealign_be (w5[3], w6[0], offset); c1[1] = hc_bytealign_be (w5[2], w5[3], offset); c1[0] = hc_bytealign_be (w5[1], w5[2], offset); c0[3] = hc_bytealign_be (w5[0], w5[1], offset); c0[2] = hc_bytealign_be (w4[3], w5[0], offset); c0[1] = hc_bytealign_be (w4[2], w4[3], offset); c0[0] = hc_bytealign_be (w4[1], w4[2], offset); w7[3] = hc_bytealign_be (w4[0], w4[1], offset); w7[2] = hc_bytealign_be (w3[3], w4[0], offset); w7[1] = hc_bytealign_be (w3[2], w3[3], offset); w7[0] = hc_bytealign_be (w3[1], w3[2], offset); w6[3] = hc_bytealign_be (w3[0], w3[1], offset); w6[2] = hc_bytealign_be (w2[3], w3[0], offset); w6[1] = hc_bytealign_be (w2[2], w2[3], offset); w6[0] = hc_bytealign_be (w2[1], w2[2], offset); w5[3] = hc_bytealign_be (w2[0], w2[1], offset); w5[2] = hc_bytealign_be (w1[3], w2[0], offset); w5[1] = hc_bytealign_be (w1[2], w1[3], offset); w5[0] = hc_bytealign_be (w1[1], w1[2], offset); w4[3] = hc_bytealign_be (w1[0], w1[1], offset); w4[2] = hc_bytealign_be (w0[3], w1[0], offset); w4[1] = hc_bytealign_be (w0[2], w0[3], offset); w4[0] = hc_bytealign_be (w0[1], w0[2], offset); w3[3] = hc_bytealign_be (w0[0], w0[1], offset); w3[2] = hc_bytealign_be ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: c3[3] = hc_bytealign_be (w7[3], 0, offset); c3[2] = hc_bytealign_be (w7[2], w7[3], offset); c3[1] = hc_bytealign_be (w7[1], w7[2], offset); c3[0] = hc_bytealign_be (w7[0], w7[1], offset); c2[3] = hc_bytealign_be (w6[3], w7[0], offset); c2[2] = hc_bytealign_be (w6[2], w6[3], offset); c2[1] = hc_bytealign_be (w6[1], w6[2], offset); c2[0] = hc_bytealign_be (w6[0], w6[1], offset); c1[3] = hc_bytealign_be (w5[3], w6[0], offset); c1[2] = hc_bytealign_be (w5[2], w5[3], offset); c1[1] = hc_bytealign_be (w5[1], w5[2], offset); c1[0] = hc_bytealign_be (w5[0], w5[1], offset); c0[3] = hc_bytealign_be (w4[3], w5[0], offset); c0[2] = hc_bytealign_be (w4[2], w4[3], offset); c0[1] = hc_bytealign_be (w4[1], w4[2], offset); c0[0] = hc_bytealign_be (w4[0], w4[1], offset); w7[3] = hc_bytealign_be (w3[3], w4[0], offset); w7[2] = hc_bytealign_be (w3[2], w3[3], offset); w7[1] = hc_bytealign_be (w3[1], w3[2], offset); w7[0] = hc_bytealign_be (w3[0], w3[1], offset); w6[3] = hc_bytealign_be (w2[3], w3[0], offset); w6[2] = hc_bytealign_be (w2[2], w2[3], offset); w6[1] = hc_bytealign_be (w2[1], w2[2], offset); w6[0] = hc_bytealign_be (w2[0], w2[1], offset); w5[3] = hc_bytealign_be (w1[3], w2[0], offset); w5[2] = hc_bytealign_be (w1[2], w1[3], offset); w5[1] = hc_bytealign_be (w1[1], w1[2], offset); w5[0] = hc_bytealign_be (w1[0], w1[1], offset); w4[3] = hc_bytealign_be (w0[3], w1[0], offset); w4[2] = hc_bytealign_be (w0[2], w0[3], offset); w4[1] = hc_bytealign_be (w0[1], w0[2], offset); w4[0] = hc_bytealign_be (w0[0], w0[1], offset); w3[3] = hc_bytealign_be ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 16: c4[0] = hc_bytealign_be (w7[3], 0, offset); c3[3] = hc_bytealign_be (w7[2], w7[3], offset); c3[2] = hc_bytealign_be (w7[1], w7[2], offset); c3[1] = hc_bytealign_be (w7[0], w7[1], offset); c3[0] = hc_bytealign_be (w6[3], w7[0], offset); c2[3] = hc_bytealign_be (w6[2], w6[3], offset); c2[2] = hc_bytealign_be (w6[1], w6[2], offset); c2[1] = hc_bytealign_be (w6[0], w6[1], offset); c2[0] = hc_bytealign_be (w5[3], w6[0], offset); c1[3] = hc_bytealign_be (w5[2], w5[3], offset); c1[2] = hc_bytealign_be (w5[1], w5[2], offset); c1[1] = hc_bytealign_be (w5[0], w5[1], offset); c1[0] = hc_bytealign_be (w4[3], w5[0], offset); c0[3] = hc_bytealign_be (w4[2], w4[3], offset); c0[2] = hc_bytealign_be (w4[1], w4[2], offset); c0[1] = hc_bytealign_be (w4[0], w4[1], offset); c0[0] = hc_bytealign_be (w3[3], w4[0], offset); w7[3] = hc_bytealign_be (w3[2], w3[3], offset); w7[2] = hc_bytealign_be (w3[1], w3[2], offset); w7[1] = hc_bytealign_be (w3[0], w3[1], offset); w7[0] = hc_bytealign_be (w2[3], w3[0], offset); w6[3] = hc_bytealign_be (w2[2], w2[3], offset); w6[2] = hc_bytealign_be (w2[1], w2[2], offset); w6[1] = hc_bytealign_be (w2[0], w2[1], offset); w6[0] = hc_bytealign_be (w1[3], w2[0], offset); w5[3] = hc_bytealign_be (w1[2], w1[3], offset); w5[2] = hc_bytealign_be (w1[1], w1[2], offset); w5[1] = hc_bytealign_be (w1[0], w1[1], offset); w5[0] = hc_bytealign_be (w0[3], w1[0], offset); w4[3] = hc_bytealign_be (w0[2], w0[3], offset); w4[2] = hc_bytealign_be (w0[1], w0[2], offset); w4[1] = hc_bytealign_be (w0[0], w0[1], offset); w4[0] = hc_bytealign_be ( 0, w0[0], offset); w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 17: c4[1] = hc_bytealign_be (w7[3], 0, offset); c4[0] = hc_bytealign_be (w7[2], w7[3], offset); c3[3] = hc_bytealign_be (w7[1], w7[2], offset); c3[2] = hc_bytealign_be (w7[0], w7[1], offset); c3[1] = hc_bytealign_be (w6[3], w7[0], offset); c3[0] = hc_bytealign_be (w6[2], w6[3], offset); c2[3] = hc_bytealign_be (w6[1], w6[2], offset); c2[2] = hc_bytealign_be (w6[0], w6[1], offset); c2[1] = hc_bytealign_be (w5[3], w6[0], offset); c2[0] = hc_bytealign_be (w5[2], w5[3], offset); c1[3] = hc_bytealign_be (w5[1], w5[2], offset); c1[2] = hc_bytealign_be (w5[0], w5[1], offset); c1[1] = hc_bytealign_be (w4[3], w5[0], offset); c1[0] = hc_bytealign_be (w4[2], w4[3], offset); c0[3] = hc_bytealign_be (w4[1], w4[2], offset); c0[2] = hc_bytealign_be (w4[0], w4[1], offset); c0[1] = hc_bytealign_be (w3[3], w4[0], offset); c0[0] = hc_bytealign_be (w3[2], w3[3], offset); w7[3] = hc_bytealign_be (w3[1], w3[2], offset); w7[2] = hc_bytealign_be (w3[0], w3[1], offset); w7[1] = hc_bytealign_be (w2[3], w3[0], offset); w7[0] = hc_bytealign_be (w2[2], w2[3], offset); w6[3] = hc_bytealign_be (w2[1], w2[2], offset); w6[2] = hc_bytealign_be (w2[0], w2[1], offset); w6[1] = hc_bytealign_be (w1[3], w2[0], offset); w6[0] = hc_bytealign_be (w1[2], w1[3], offset); w5[3] = hc_bytealign_be (w1[1], w1[2], offset); w5[2] = hc_bytealign_be (w1[0], w1[1], offset); w5[1] = hc_bytealign_be (w0[3], w1[0], offset); w5[0] = hc_bytealign_be (w0[2], w0[3], offset); w4[3] = hc_bytealign_be (w0[1], w0[2], offset); w4[2] = hc_bytealign_be (w0[0], w0[1], offset); w4[1] = hc_bytealign_be ( 0, w0[0], offset); w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 18: c4[2] = hc_bytealign_be (w7[3], 0, offset); c4[1] = hc_bytealign_be (w7[2], w7[3], offset); c4[0] = hc_bytealign_be (w7[1], w7[2], offset); c3[3] = hc_bytealign_be (w7[0], w7[1], offset); c3[2] = hc_bytealign_be (w6[3], w7[0], offset); c3[1] = hc_bytealign_be (w6[2], w6[3], offset); c3[0] = hc_bytealign_be (w6[1], w6[2], offset); c2[3] = hc_bytealign_be (w6[0], w6[1], offset); c2[2] = hc_bytealign_be (w5[3], w6[0], offset); c2[1] = hc_bytealign_be (w5[2], w5[3], offset); c2[0] = hc_bytealign_be (w5[1], w5[2], offset); c1[3] = hc_bytealign_be (w5[0], w5[1], offset); c1[2] = hc_bytealign_be (w4[3], w5[0], offset); c1[1] = hc_bytealign_be (w4[2], w4[3], offset); c1[0] = hc_bytealign_be (w4[1], w4[2], offset); c0[3] = hc_bytealign_be (w4[0], w4[1], offset); c0[2] = hc_bytealign_be (w3[3], w4[0], offset); c0[1] = hc_bytealign_be (w3[2], w3[3], offset); c0[0] = hc_bytealign_be (w3[1], w3[2], offset); w7[3] = hc_bytealign_be (w3[0], w3[1], offset); w7[2] = hc_bytealign_be (w2[3], w3[0], offset); w7[1] = hc_bytealign_be (w2[2], w2[3], offset); w7[0] = hc_bytealign_be (w2[1], w2[2], offset); w6[3] = hc_bytealign_be (w2[0], w2[1], offset); w6[2] = hc_bytealign_be (w1[3], w2[0], offset); w6[1] = hc_bytealign_be (w1[2], w1[3], offset); w6[0] = hc_bytealign_be (w1[1], w1[2], offset); w5[3] = hc_bytealign_be (w1[0], w1[1], offset); w5[2] = hc_bytealign_be (w0[3], w1[0], offset); w5[1] = hc_bytealign_be (w0[2], w0[3], offset); w5[0] = hc_bytealign_be (w0[1], w0[2], offset); w4[3] = hc_bytealign_be (w0[0], w0[1], offset); w4[2] = hc_bytealign_be ( 0, w0[0], offset); w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 19: c4[3] = hc_bytealign_be (w7[3], 0, offset); c4[2] = hc_bytealign_be (w7[2], w7[3], offset); c4[1] = hc_bytealign_be (w7[1], w7[2], offset); c4[0] = hc_bytealign_be (w7[0], w7[1], offset); c3[3] = hc_bytealign_be (w6[3], w7[0], offset); c3[2] = hc_bytealign_be (w6[2], w6[3], offset); c3[1] = hc_bytealign_be (w6[1], w6[2], offset); c3[0] = hc_bytealign_be (w6[0], w6[1], offset); c2[3] = hc_bytealign_be (w5[3], w6[0], offset); c2[2] = hc_bytealign_be (w5[2], w5[3], offset); c2[1] = hc_bytealign_be (w5[1], w5[2], offset); c2[0] = hc_bytealign_be (w5[0], w5[1], offset); c1[3] = hc_bytealign_be (w4[3], w5[0], offset); c1[2] = hc_bytealign_be (w4[2], w4[3], offset); c1[1] = hc_bytealign_be (w4[1], w4[2], offset); c1[0] = hc_bytealign_be (w4[0], w4[1], offset); c0[3] = hc_bytealign_be (w3[3], w4[0], offset); c0[2] = hc_bytealign_be (w3[2], w3[3], offset); c0[1] = hc_bytealign_be (w3[1], w3[2], offset); c0[0] = hc_bytealign_be (w3[0], w3[1], offset); w7[3] = hc_bytealign_be (w2[3], w3[0], offset); w7[2] = hc_bytealign_be (w2[2], w2[3], offset); w7[1] = hc_bytealign_be (w2[1], w2[2], offset); w7[0] = hc_bytealign_be (w2[0], w2[1], offset); w6[3] = hc_bytealign_be (w1[3], w2[0], offset); w6[2] = hc_bytealign_be (w1[2], w1[3], offset); w6[1] = hc_bytealign_be (w1[1], w1[2], offset); w6[0] = hc_bytealign_be (w1[0], w1[1], offset); w5[3] = hc_bytealign_be (w0[3], w1[0], offset); w5[2] = hc_bytealign_be (w0[2], w0[3], offset); w5[1] = hc_bytealign_be (w0[1], w0[2], offset); w5[0] = hc_bytealign_be (w0[0], w0[1], offset); w4[3] = hc_bytealign_be ( 0, w0[0], offset); w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 20: c5[0] = hc_bytealign_be (w7[3], 0, offset); c4[3] = hc_bytealign_be (w7[2], w7[3], offset); c4[2] = hc_bytealign_be (w7[1], w7[2], offset); c4[1] = hc_bytealign_be (w7[0], w7[1], offset); c4[0] = hc_bytealign_be (w6[3], w7[0], offset); c3[3] = hc_bytealign_be (w6[2], w6[3], offset); c3[2] = hc_bytealign_be (w6[1], w6[2], offset); c3[1] = hc_bytealign_be (w6[0], w6[1], offset); c3[0] = hc_bytealign_be (w5[3], w6[0], offset); c2[3] = hc_bytealign_be (w5[2], w5[3], offset); c2[2] = hc_bytealign_be (w5[1], w5[2], offset); c2[1] = hc_bytealign_be (w5[0], w5[1], offset); c2[0] = hc_bytealign_be (w4[3], w5[0], offset); c1[3] = hc_bytealign_be (w4[2], w4[3], offset); c1[2] = hc_bytealign_be (w4[1], w4[2], offset); c1[1] = hc_bytealign_be (w4[0], w4[1], offset); c1[0] = hc_bytealign_be (w3[3], w4[0], offset); c0[3] = hc_bytealign_be (w3[2], w3[3], offset); c0[2] = hc_bytealign_be (w3[1], w3[2], offset); c0[1] = hc_bytealign_be (w3[0], w3[1], offset); c0[0] = hc_bytealign_be (w2[3], w3[0], offset); w7[3] = hc_bytealign_be (w2[2], w2[3], offset); w7[2] = hc_bytealign_be (w2[1], w2[2], offset); w7[1] = hc_bytealign_be (w2[0], w2[1], offset); w7[0] = hc_bytealign_be (w1[3], w2[0], offset); w6[3] = hc_bytealign_be (w1[2], w1[3], offset); w6[2] = hc_bytealign_be (w1[1], w1[2], offset); w6[1] = hc_bytealign_be (w1[0], w1[1], offset); w6[0] = hc_bytealign_be (w0[3], w1[0], offset); w5[3] = hc_bytealign_be (w0[2], w0[3], offset); w5[2] = hc_bytealign_be (w0[1], w0[2], offset); w5[1] = hc_bytealign_be (w0[0], w0[1], offset); w5[0] = hc_bytealign_be ( 0, w0[0], offset); w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 21: c5[1] = hc_bytealign_be (w7[3], 0, offset); c5[0] = hc_bytealign_be (w7[2], w7[3], offset); c4[3] = hc_bytealign_be (w7[1], w7[2], offset); c4[2] = hc_bytealign_be (w7[0], w7[1], offset); c4[1] = hc_bytealign_be (w6[3], w7[0], offset); c4[0] = hc_bytealign_be (w6[2], w6[3], offset); c3[3] = hc_bytealign_be (w6[1], w6[2], offset); c3[2] = hc_bytealign_be (w6[0], w6[1], offset); c3[1] = hc_bytealign_be (w5[3], w6[0], offset); c3[0] = hc_bytealign_be (w5[2], w5[3], offset); c2[3] = hc_bytealign_be (w5[1], w5[2], offset); c2[2] = hc_bytealign_be (w5[0], w5[1], offset); c2[1] = hc_bytealign_be (w4[3], w5[0], offset); c2[0] = hc_bytealign_be (w4[2], w4[3], offset); c1[3] = hc_bytealign_be (w4[1], w4[2], offset); c1[2] = hc_bytealign_be (w4[0], w4[1], offset); c1[1] = hc_bytealign_be (w3[3], w4[0], offset); c1[0] = hc_bytealign_be (w3[2], w3[3], offset); c0[3] = hc_bytealign_be (w3[1], w3[2], offset); c0[2] = hc_bytealign_be (w3[0], w3[1], offset); c0[1] = hc_bytealign_be (w2[3], w3[0], offset); c0[0] = hc_bytealign_be (w2[2], w2[3], offset); w7[3] = hc_bytealign_be (w2[1], w2[2], offset); w7[2] = hc_bytealign_be (w2[0], w2[1], offset); w7[1] = hc_bytealign_be (w1[3], w2[0], offset); w7[0] = hc_bytealign_be (w1[2], w1[3], offset); w6[3] = hc_bytealign_be (w1[1], w1[2], offset); w6[2] = hc_bytealign_be (w1[0], w1[1], offset); w6[1] = hc_bytealign_be (w0[3], w1[0], offset); w6[0] = hc_bytealign_be (w0[2], w0[3], offset); w5[3] = hc_bytealign_be (w0[1], w0[2], offset); w5[2] = hc_bytealign_be (w0[0], w0[1], offset); w5[1] = hc_bytealign_be ( 0, w0[0], offset); w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 22: c5[2] = hc_bytealign_be (w7[3], 0, offset); c5[1] = hc_bytealign_be (w7[2], w7[3], offset); c5[0] = hc_bytealign_be (w7[1], w7[2], offset); c4[3] = hc_bytealign_be (w7[0], w7[1], offset); c4[2] = hc_bytealign_be (w6[3], w7[0], offset); c4[1] = hc_bytealign_be (w6[2], w6[3], offset); c4[0] = hc_bytealign_be (w6[1], w6[2], offset); c3[3] = hc_bytealign_be (w6[0], w6[1], offset); c3[2] = hc_bytealign_be (w5[3], w6[0], offset); c3[1] = hc_bytealign_be (w5[2], w5[3], offset); c3[0] = hc_bytealign_be (w5[1], w5[2], offset); c2[3] = hc_bytealign_be (w5[0], w5[1], offset); c2[2] = hc_bytealign_be (w4[3], w5[0], offset); c2[1] = hc_bytealign_be (w4[2], w4[3], offset); c2[0] = hc_bytealign_be (w4[1], w4[2], offset); c1[3] = hc_bytealign_be (w4[0], w4[1], offset); c1[2] = hc_bytealign_be (w3[3], w4[0], offset); c1[1] = hc_bytealign_be (w3[2], w3[3], offset); c1[0] = hc_bytealign_be (w3[1], w3[2], offset); c0[3] = hc_bytealign_be (w3[0], w3[1], offset); c0[2] = hc_bytealign_be (w2[3], w3[0], offset); c0[1] = hc_bytealign_be (w2[2], w2[3], offset); c0[0] = hc_bytealign_be (w2[1], w2[2], offset); w7[3] = hc_bytealign_be (w2[0], w2[1], offset); w7[2] = hc_bytealign_be (w1[3], w2[0], offset); w7[1] = hc_bytealign_be (w1[2], w1[3], offset); w7[0] = hc_bytealign_be (w1[1], w1[2], offset); w6[3] = hc_bytealign_be (w1[0], w1[1], offset); w6[2] = hc_bytealign_be (w0[3], w1[0], offset); w6[1] = hc_bytealign_be (w0[2], w0[3], offset); w6[0] = hc_bytealign_be (w0[1], w0[2], offset); w5[3] = hc_bytealign_be (w0[0], w0[1], offset); w5[2] = hc_bytealign_be ( 0, w0[0], offset); w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 23: c5[3] = hc_bytealign_be (w7[3], 0, offset); c5[2] = hc_bytealign_be (w7[2], w7[3], offset); c5[1] = hc_bytealign_be (w7[1], w7[2], offset); c5[0] = hc_bytealign_be (w7[0], w7[1], offset); c4[3] = hc_bytealign_be (w6[3], w7[0], offset); c4[2] = hc_bytealign_be (w6[2], w6[3], offset); c4[1] = hc_bytealign_be (w6[1], w6[2], offset); c4[0] = hc_bytealign_be (w6[0], w6[1], offset); c3[3] = hc_bytealign_be (w5[3], w6[0], offset); c3[2] = hc_bytealign_be (w5[2], w5[3], offset); c3[1] = hc_bytealign_be (w5[1], w5[2], offset); c3[0] = hc_bytealign_be (w5[0], w5[1], offset); c2[3] = hc_bytealign_be (w4[3], w5[0], offset); c2[2] = hc_bytealign_be (w4[2], w4[3], offset); c2[1] = hc_bytealign_be (w4[1], w4[2], offset); c2[0] = hc_bytealign_be (w4[0], w4[1], offset); c1[3] = hc_bytealign_be (w3[3], w4[0], offset); c1[2] = hc_bytealign_be (w3[2], w3[3], offset); c1[1] = hc_bytealign_be (w3[1], w3[2], offset); c1[0] = hc_bytealign_be (w3[0], w3[1], offset); c0[3] = hc_bytealign_be (w2[3], w3[0], offset); c0[2] = hc_bytealign_be (w2[2], w2[3], offset); c0[1] = hc_bytealign_be (w2[1], w2[2], offset); c0[0] = hc_bytealign_be (w2[0], w2[1], offset); w7[3] = hc_bytealign_be (w1[3], w2[0], offset); w7[2] = hc_bytealign_be (w1[2], w1[3], offset); w7[1] = hc_bytealign_be (w1[1], w1[2], offset); w7[0] = hc_bytealign_be (w1[0], w1[1], offset); w6[3] = hc_bytealign_be (w0[3], w1[0], offset); w6[2] = hc_bytealign_be (w0[2], w0[3], offset); w6[1] = hc_bytealign_be (w0[1], w0[2], offset); w6[0] = hc_bytealign_be (w0[0], w0[1], offset); w5[3] = hc_bytealign_be ( 0, w0[0], offset); w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 24: c6[0] = hc_bytealign_be (w7[3], 0, offset); c5[3] = hc_bytealign_be (w7[2], w7[3], offset); c5[2] = hc_bytealign_be (w7[1], w7[2], offset); c5[1] = hc_bytealign_be (w7[0], w7[1], offset); c5[0] = hc_bytealign_be (w6[3], w7[0], offset); c4[3] = hc_bytealign_be (w6[2], w6[3], offset); c4[2] = hc_bytealign_be (w6[1], w6[2], offset); c4[1] = hc_bytealign_be (w6[0], w6[1], offset); c4[0] = hc_bytealign_be (w5[3], w6[0], offset); c3[3] = hc_bytealign_be (w5[2], w5[3], offset); c3[2] = hc_bytealign_be (w5[1], w5[2], offset); c3[1] = hc_bytealign_be (w5[0], w5[1], offset); c3[0] = hc_bytealign_be (w4[3], w5[0], offset); c2[3] = hc_bytealign_be (w4[2], w4[3], offset); c2[2] = hc_bytealign_be (w4[1], w4[2], offset); c2[1] = hc_bytealign_be (w4[0], w4[1], offset); c2[0] = hc_bytealign_be (w3[3], w4[0], offset); c1[3] = hc_bytealign_be (w3[2], w3[3], offset); c1[2] = hc_bytealign_be (w3[1], w3[2], offset); c1[1] = hc_bytealign_be (w3[0], w3[1], offset); c1[0] = hc_bytealign_be (w2[3], w3[0], offset); c0[3] = hc_bytealign_be (w2[2], w2[3], offset); c0[2] = hc_bytealign_be (w2[1], w2[2], offset); c0[1] = hc_bytealign_be (w2[0], w2[1], offset); c0[0] = hc_bytealign_be (w1[3], w2[0], offset); w7[3] = hc_bytealign_be (w1[2], w1[3], offset); w7[2] = hc_bytealign_be (w1[1], w1[2], offset); w7[1] = hc_bytealign_be (w1[0], w1[1], offset); w7[0] = hc_bytealign_be (w0[3], w1[0], offset); w6[3] = hc_bytealign_be (w0[2], w0[3], offset); w6[2] = hc_bytealign_be (w0[1], w0[2], offset); w6[1] = hc_bytealign_be (w0[0], w0[1], offset); w6[0] = hc_bytealign_be ( 0, w0[0], offset); w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 25: c6[1] = hc_bytealign_be (w7[3], 0, offset); c6[0] = hc_bytealign_be (w7[2], w7[3], offset); c5[3] = hc_bytealign_be (w7[1], w7[2], offset); c5[2] = hc_bytealign_be (w7[0], w7[1], offset); c5[1] = hc_bytealign_be (w6[3], w7[0], offset); c5[0] = hc_bytealign_be (w6[2], w6[3], offset); c4[3] = hc_bytealign_be (w6[1], w6[2], offset); c4[2] = hc_bytealign_be (w6[0], w6[1], offset); c4[1] = hc_bytealign_be (w5[3], w6[0], offset); c4[0] = hc_bytealign_be (w5[2], w5[3], offset); c3[3] = hc_bytealign_be (w5[1], w5[2], offset); c3[2] = hc_bytealign_be (w5[0], w5[1], offset); c3[1] = hc_bytealign_be (w4[3], w5[0], offset); c3[0] = hc_bytealign_be (w4[2], w4[3], offset); c2[3] = hc_bytealign_be (w4[1], w4[2], offset); c2[2] = hc_bytealign_be (w4[0], w4[1], offset); c2[1] = hc_bytealign_be (w3[3], w4[0], offset); c2[0] = hc_bytealign_be (w3[2], w3[3], offset); c1[3] = hc_bytealign_be (w3[1], w3[2], offset); c1[2] = hc_bytealign_be (w3[0], w3[1], offset); c1[1] = hc_bytealign_be (w2[3], w3[0], offset); c1[0] = hc_bytealign_be (w2[2], w2[3], offset); c0[3] = hc_bytealign_be (w2[1], w2[2], offset); c0[2] = hc_bytealign_be (w2[0], w2[1], offset); c0[1] = hc_bytealign_be (w1[3], w2[0], offset); c0[0] = hc_bytealign_be (w1[2], w1[3], offset); w7[3] = hc_bytealign_be (w1[1], w1[2], offset); w7[2] = hc_bytealign_be (w1[0], w1[1], offset); w7[1] = hc_bytealign_be (w0[3], w1[0], offset); w7[0] = hc_bytealign_be (w0[2], w0[3], offset); w6[3] = hc_bytealign_be (w0[1], w0[2], offset); w6[2] = hc_bytealign_be (w0[0], w0[1], offset); w6[1] = hc_bytealign_be ( 0, w0[0], offset); w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 26: c6[2] = hc_bytealign_be (w7[3], 0, offset); c6[1] = hc_bytealign_be (w7[2], w7[3], offset); c6[0] = hc_bytealign_be (w7[1], w7[2], offset); c5[3] = hc_bytealign_be (w7[0], w7[1], offset); c5[2] = hc_bytealign_be (w6[3], w7[0], offset); c5[1] = hc_bytealign_be (w6[2], w6[3], offset); c5[0] = hc_bytealign_be (w6[1], w6[2], offset); c4[3] = hc_bytealign_be (w6[0], w6[1], offset); c4[2] = hc_bytealign_be (w5[3], w6[0], offset); c4[1] = hc_bytealign_be (w5[2], w5[3], offset); c4[0] = hc_bytealign_be (w5[1], w5[2], offset); c3[3] = hc_bytealign_be (w5[0], w5[1], offset); c3[2] = hc_bytealign_be (w4[3], w5[0], offset); c3[1] = hc_bytealign_be (w4[2], w4[3], offset); c3[0] = hc_bytealign_be (w4[1], w4[2], offset); c2[3] = hc_bytealign_be (w4[0], w4[1], offset); c2[2] = hc_bytealign_be (w3[3], w4[0], offset); c2[1] = hc_bytealign_be (w3[2], w3[3], offset); c2[0] = hc_bytealign_be (w3[1], w3[2], offset); c1[3] = hc_bytealign_be (w3[0], w3[1], offset); c1[2] = hc_bytealign_be (w2[3], w3[0], offset); c1[1] = hc_bytealign_be (w2[2], w2[3], offset); c1[0] = hc_bytealign_be (w2[1], w2[2], offset); c0[3] = hc_bytealign_be (w2[0], w2[1], offset); c0[2] = hc_bytealign_be (w1[3], w2[0], offset); c0[1] = hc_bytealign_be (w1[2], w1[3], offset); c0[0] = hc_bytealign_be (w1[1], w1[2], offset); w7[3] = hc_bytealign_be (w1[0], w1[1], offset); w7[2] = hc_bytealign_be (w0[3], w1[0], offset); w7[1] = hc_bytealign_be (w0[2], w0[3], offset); w7[0] = hc_bytealign_be (w0[1], w0[2], offset); w6[3] = hc_bytealign_be (w0[0], w0[1], offset); w6[2] = hc_bytealign_be ( 0, w0[0], offset); w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 27: c6[3] = hc_bytealign_be (w7[3], 0, offset); c6[2] = hc_bytealign_be (w7[2], w7[3], offset); c6[1] = hc_bytealign_be (w7[1], w7[2], offset); c6[0] = hc_bytealign_be (w7[0], w7[1], offset); c5[3] = hc_bytealign_be (w6[3], w7[0], offset); c5[2] = hc_bytealign_be (w6[2], w6[3], offset); c5[1] = hc_bytealign_be (w6[1], w6[2], offset); c5[0] = hc_bytealign_be (w6[0], w6[1], offset); c4[3] = hc_bytealign_be (w5[3], w6[0], offset); c4[2] = hc_bytealign_be (w5[2], w5[3], offset); c4[1] = hc_bytealign_be (w5[1], w5[2], offset); c4[0] = hc_bytealign_be (w5[0], w5[1], offset); c3[3] = hc_bytealign_be (w4[3], w5[0], offset); c3[2] = hc_bytealign_be (w4[2], w4[3], offset); c3[1] = hc_bytealign_be (w4[1], w4[2], offset); c3[0] = hc_bytealign_be (w4[0], w4[1], offset); c2[3] = hc_bytealign_be (w3[3], w4[0], offset); c2[2] = hc_bytealign_be (w3[2], w3[3], offset); c2[1] = hc_bytealign_be (w3[1], w3[2], offset); c2[0] = hc_bytealign_be (w3[0], w3[1], offset); c1[3] = hc_bytealign_be (w2[3], w3[0], offset); c1[2] = hc_bytealign_be (w2[2], w2[3], offset); c1[1] = hc_bytealign_be (w2[1], w2[2], offset); c1[0] = hc_bytealign_be (w2[0], w2[1], offset); c0[3] = hc_bytealign_be (w1[3], w2[0], offset); c0[2] = hc_bytealign_be (w1[2], w1[3], offset); c0[1] = hc_bytealign_be (w1[1], w1[2], offset); c0[0] = hc_bytealign_be (w1[0], w1[1], offset); w7[3] = hc_bytealign_be (w0[3], w1[0], offset); w7[2] = hc_bytealign_be (w0[2], w0[3], offset); w7[1] = hc_bytealign_be (w0[1], w0[2], offset); w7[0] = hc_bytealign_be (w0[0], w0[1], offset); w6[3] = hc_bytealign_be ( 0, w0[0], offset); w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 28: c7[0] = hc_bytealign_be (w7[3], 0, offset); c6[3] = hc_bytealign_be (w7[2], w7[3], offset); c6[2] = hc_bytealign_be (w7[1], w7[2], offset); c6[1] = hc_bytealign_be (w7[0], w7[1], offset); c6[0] = hc_bytealign_be (w6[3], w7[0], offset); c5[3] = hc_bytealign_be (w6[2], w6[3], offset); c5[2] = hc_bytealign_be (w6[1], w6[2], offset); c5[1] = hc_bytealign_be (w6[0], w6[1], offset); c5[0] = hc_bytealign_be (w5[3], w6[0], offset); c4[3] = hc_bytealign_be (w5[2], w5[3], offset); c4[2] = hc_bytealign_be (w5[1], w5[2], offset); c4[1] = hc_bytealign_be (w5[0], w5[1], offset); c4[0] = hc_bytealign_be (w4[3], w5[0], offset); c3[3] = hc_bytealign_be (w4[2], w4[3], offset); c3[2] = hc_bytealign_be (w4[1], w4[2], offset); c3[1] = hc_bytealign_be (w4[0], w4[1], offset); c3[0] = hc_bytealign_be (w3[3], w4[0], offset); c2[3] = hc_bytealign_be (w3[2], w3[3], offset); c2[2] = hc_bytealign_be (w3[1], w3[2], offset); c2[1] = hc_bytealign_be (w3[0], w3[1], offset); c2[0] = hc_bytealign_be (w2[3], w3[0], offset); c1[3] = hc_bytealign_be (w2[2], w2[3], offset); c1[2] = hc_bytealign_be (w2[1], w2[2], offset); c1[1] = hc_bytealign_be (w2[0], w2[1], offset); c1[0] = hc_bytealign_be (w1[3], w2[0], offset); c0[3] = hc_bytealign_be (w1[2], w1[3], offset); c0[2] = hc_bytealign_be (w1[1], w1[2], offset); c0[1] = hc_bytealign_be (w1[0], w1[1], offset); c0[0] = hc_bytealign_be (w0[3], w1[0], offset); w7[3] = hc_bytealign_be (w0[2], w0[3], offset); w7[2] = hc_bytealign_be (w0[1], w0[2], offset); w7[1] = hc_bytealign_be (w0[0], w0[1], offset); w7[0] = hc_bytealign_be ( 0, w0[0], offset); w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 29: c7[1] = hc_bytealign_be (w7[3], 0, offset); c7[0] = hc_bytealign_be (w7[2], w7[3], offset); c6[3] = hc_bytealign_be (w7[1], w7[2], offset); c6[2] = hc_bytealign_be (w7[0], w7[1], offset); c6[1] = hc_bytealign_be (w6[3], w7[0], offset); c6[0] = hc_bytealign_be (w6[2], w6[3], offset); c5[3] = hc_bytealign_be (w6[1], w6[2], offset); c5[2] = hc_bytealign_be (w6[0], w6[1], offset); c5[1] = hc_bytealign_be (w5[3], w6[0], offset); c5[0] = hc_bytealign_be (w5[2], w5[3], offset); c4[3] = hc_bytealign_be (w5[1], w5[2], offset); c4[2] = hc_bytealign_be (w5[0], w5[1], offset); c4[1] = hc_bytealign_be (w4[3], w5[0], offset); c4[0] = hc_bytealign_be (w4[2], w4[3], offset); c3[3] = hc_bytealign_be (w4[1], w4[2], offset); c3[2] = hc_bytealign_be (w4[0], w4[1], offset); c3[1] = hc_bytealign_be (w3[3], w4[0], offset); c3[0] = hc_bytealign_be (w3[2], w3[3], offset); c2[3] = hc_bytealign_be (w3[1], w3[2], offset); c2[2] = hc_bytealign_be (w3[0], w3[1], offset); c2[1] = hc_bytealign_be (w2[3], w3[0], offset); c2[0] = hc_bytealign_be (w2[2], w2[3], offset); c1[3] = hc_bytealign_be (w2[1], w2[2], offset); c1[2] = hc_bytealign_be (w2[0], w2[1], offset); c1[1] = hc_bytealign_be (w1[3], w2[0], offset); c1[0] = hc_bytealign_be (w1[2], w1[3], offset); c0[3] = hc_bytealign_be (w1[1], w1[2], offset); c0[2] = hc_bytealign_be (w1[0], w1[1], offset); c0[1] = hc_bytealign_be (w0[3], w1[0], offset); c0[0] = hc_bytealign_be (w0[2], w0[3], offset); w7[3] = hc_bytealign_be (w0[1], w0[2], offset); w7[2] = hc_bytealign_be (w0[0], w0[1], offset); w7[1] = hc_bytealign_be ( 0, w0[0], offset); w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 30: c7[2] = hc_bytealign_be (w7[3], 0, offset); c7[1] = hc_bytealign_be (w7[2], w7[3], offset); c7[0] = hc_bytealign_be (w7[1], w7[2], offset); c6[3] = hc_bytealign_be (w7[0], w7[1], offset); c6[2] = hc_bytealign_be (w6[3], w7[0], offset); c6[1] = hc_bytealign_be (w6[2], w6[3], offset); c6[0] = hc_bytealign_be (w6[1], w6[2], offset); c5[3] = hc_bytealign_be (w6[0], w6[1], offset); c5[2] = hc_bytealign_be (w5[3], w6[0], offset); c5[1] = hc_bytealign_be (w5[2], w5[3], offset); c5[0] = hc_bytealign_be (w5[1], w5[2], offset); c4[3] = hc_bytealign_be (w5[0], w5[1], offset); c4[2] = hc_bytealign_be (w4[3], w5[0], offset); c4[1] = hc_bytealign_be (w4[2], w4[3], offset); c4[0] = hc_bytealign_be (w4[1], w4[2], offset); c3[3] = hc_bytealign_be (w4[0], w4[1], offset); c3[2] = hc_bytealign_be (w3[3], w4[0], offset); c3[1] = hc_bytealign_be (w3[2], w3[3], offset); c3[0] = hc_bytealign_be (w3[1], w3[2], offset); c2[3] = hc_bytealign_be (w3[0], w3[1], offset); c2[2] = hc_bytealign_be (w2[3], w3[0], offset); c2[1] = hc_bytealign_be (w2[2], w2[3], offset); c2[0] = hc_bytealign_be (w2[1], w2[2], offset); c1[3] = hc_bytealign_be (w2[0], w2[1], offset); c1[2] = hc_bytealign_be (w1[3], w2[0], offset); c1[1] = hc_bytealign_be (w1[2], w1[3], offset); c1[0] = hc_bytealign_be (w1[1], w1[2], offset); c0[3] = hc_bytealign_be (w1[0], w1[1], offset); c0[2] = hc_bytealign_be (w0[3], w1[0], offset); c0[1] = hc_bytealign_be (w0[2], w0[3], offset); c0[0] = hc_bytealign_be (w0[1], w0[2], offset); w7[3] = hc_bytealign_be (w0[0], w0[1], offset); w7[2] = hc_bytealign_be ( 0, w0[0], offset); w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 31: c7[3] = hc_bytealign_be (w7[3], 0, offset); c7[2] = hc_bytealign_be (w7[2], w7[3], offset); c7[1] = hc_bytealign_be (w7[1], w7[2], offset); c7[0] = hc_bytealign_be (w7[0], w7[1], offset); c6[3] = hc_bytealign_be (w6[3], w7[0], offset); c6[2] = hc_bytealign_be (w6[2], w6[3], offset); c6[1] = hc_bytealign_be (w6[1], w6[2], offset); c6[0] = hc_bytealign_be (w6[0], w6[1], offset); c5[3] = hc_bytealign_be (w5[3], w6[0], offset); c5[2] = hc_bytealign_be (w5[2], w5[3], offset); c5[1] = hc_bytealign_be (w5[1], w5[2], offset); c5[0] = hc_bytealign_be (w5[0], w5[1], offset); c4[3] = hc_bytealign_be (w4[3], w5[0], offset); c4[2] = hc_bytealign_be (w4[2], w4[3], offset); c4[1] = hc_bytealign_be (w4[1], w4[2], offset); c4[0] = hc_bytealign_be (w4[0], w4[1], offset); c3[3] = hc_bytealign_be (w3[3], w4[0], offset); c3[2] = hc_bytealign_be (w3[2], w3[3], offset); c3[1] = hc_bytealign_be (w3[1], w3[2], offset); c3[0] = hc_bytealign_be (w3[0], w3[1], offset); c2[3] = hc_bytealign_be (w2[3], w3[0], offset); c2[2] = hc_bytealign_be (w2[2], w2[3], offset); c2[1] = hc_bytealign_be (w2[1], w2[2], offset); c2[0] = hc_bytealign_be (w2[0], w2[1], offset); c1[3] = hc_bytealign_be (w1[3], w2[0], offset); c1[2] = hc_bytealign_be (w1[2], w1[3], offset); c1[1] = hc_bytealign_be (w1[1], w1[2], offset); c1[0] = hc_bytealign_be (w1[0], w1[1], offset); c0[3] = hc_bytealign_be (w0[3], w1[0], offset); c0[2] = hc_bytealign_be (w0[2], w0[3], offset); c0[1] = hc_bytealign_be (w0[1], w0[2], offset); c0[0] = hc_bytealign_be (w0[0], w0[1], offset); w7[3] = hc_bytealign_be ( 0, w0[0], offset); w7[2] = 0; w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV #if defined IS_NV const int selector = (0x76543210 >> ((offset & 3) * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> ((offset & 3) * 8)); #endif switch (offset_switch) { case 0: c0[0] = hc_byte_perm ( 0, w7[3], selector); w7[3] = hc_byte_perm (w7[3], w7[2], selector); w7[2] = hc_byte_perm (w7[2], w7[1], selector); w7[1] = hc_byte_perm (w7[1], w7[0], selector); w7[0] = hc_byte_perm (w7[0], w6[3], selector); w6[3] = hc_byte_perm (w6[3], w6[2], selector); w6[2] = hc_byte_perm (w6[2], w6[1], selector); w6[1] = hc_byte_perm (w6[1], w6[0], selector); w6[0] = hc_byte_perm (w6[0], w5[3], selector); w5[3] = hc_byte_perm (w5[3], w5[2], selector); w5[2] = hc_byte_perm (w5[2], w5[1], selector); w5[1] = hc_byte_perm (w5[1], w5[0], selector); w5[0] = hc_byte_perm (w5[0], w4[3], selector); w4[3] = hc_byte_perm (w4[3], w4[2], selector); w4[2] = hc_byte_perm (w4[2], w4[1], selector); w4[1] = hc_byte_perm (w4[1], w4[0], selector); w4[0] = hc_byte_perm (w4[0], w3[3], selector); w3[3] = hc_byte_perm (w3[3], w3[2], selector); w3[2] = hc_byte_perm (w3[2], w3[1], selector); w3[1] = hc_byte_perm (w3[1], w3[0], selector); w3[0] = hc_byte_perm (w3[0], w2[3], selector); w2[3] = hc_byte_perm (w2[3], w2[2], selector); w2[2] = hc_byte_perm (w2[2], w2[1], selector); w2[1] = hc_byte_perm (w2[1], w2[0], selector); w2[0] = hc_byte_perm (w2[0], w1[3], selector); w1[3] = hc_byte_perm (w1[3], w1[2], selector); w1[2] = hc_byte_perm (w1[2], w1[1], selector); w1[1] = hc_byte_perm (w1[1], w1[0], selector); w1[0] = hc_byte_perm (w1[0], w0[3], selector); w0[3] = hc_byte_perm (w0[3], w0[2], selector); w0[2] = hc_byte_perm (w0[2], w0[1], selector); w0[1] = hc_byte_perm (w0[1], w0[0], selector); w0[0] = hc_byte_perm (w0[0], 0, selector); break; case 1: c0[1] = hc_byte_perm ( 0, w7[3], selector); c0[0] = hc_byte_perm (w7[3], w7[2], selector); w7[3] = hc_byte_perm (w7[2], w7[1], selector); w7[2] = hc_byte_perm (w7[1], w7[0], selector); w7[1] = hc_byte_perm (w7[0], w6[3], selector); w7[0] = hc_byte_perm (w6[3], w6[2], selector); w6[3] = hc_byte_perm (w6[2], w6[1], selector); w6[2] = hc_byte_perm (w6[1], w6[0], selector); w6[1] = hc_byte_perm (w6[0], w5[3], selector); w6[0] = hc_byte_perm (w5[3], w5[2], selector); w5[3] = hc_byte_perm (w5[2], w5[1], selector); w5[2] = hc_byte_perm (w5[1], w5[0], selector); w5[1] = hc_byte_perm (w5[0], w4[3], selector); w5[0] = hc_byte_perm (w4[3], w4[2], selector); w4[3] = hc_byte_perm (w4[2], w4[1], selector); w4[2] = hc_byte_perm (w4[1], w4[0], selector); w4[1] = hc_byte_perm (w4[0], w3[3], selector); w4[0] = hc_byte_perm (w3[3], w3[2], selector); w3[3] = hc_byte_perm (w3[2], w3[1], selector); w3[2] = hc_byte_perm (w3[1], w3[0], selector); w3[1] = hc_byte_perm (w3[0], w2[3], selector); w3[0] = hc_byte_perm (w2[3], w2[2], selector); w2[3] = hc_byte_perm (w2[2], w2[1], selector); w2[2] = hc_byte_perm (w2[1], w2[0], selector); w2[1] = hc_byte_perm (w2[0], w1[3], selector); w2[0] = hc_byte_perm (w1[3], w1[2], selector); w1[3] = hc_byte_perm (w1[2], w1[1], selector); w1[2] = hc_byte_perm (w1[1], w1[0], selector); w1[1] = hc_byte_perm (w1[0], w0[3], selector); w1[0] = hc_byte_perm (w0[3], w0[2], selector); w0[3] = hc_byte_perm (w0[2], w0[1], selector); w0[2] = hc_byte_perm (w0[1], w0[0], selector); w0[1] = hc_byte_perm (w0[0], 0, selector); w0[0] = 0; break; case 2: c0[2] = hc_byte_perm ( 0, w7[3], selector); c0[1] = hc_byte_perm (w7[3], w7[2], selector); c0[0] = hc_byte_perm (w7[2], w7[1], selector); w7[3] = hc_byte_perm (w7[1], w7[0], selector); w7[2] = hc_byte_perm (w7[0], w6[3], selector); w7[1] = hc_byte_perm (w6[3], w6[2], selector); w7[0] = hc_byte_perm (w6[2], w6[1], selector); w6[3] = hc_byte_perm (w6[1], w6[0], selector); w6[2] = hc_byte_perm (w6[0], w5[3], selector); w6[1] = hc_byte_perm (w5[3], w5[2], selector); w6[0] = hc_byte_perm (w5[2], w5[1], selector); w5[3] = hc_byte_perm (w5[1], w5[0], selector); w5[2] = hc_byte_perm (w5[0], w4[3], selector); w5[1] = hc_byte_perm (w4[3], w4[2], selector); w5[0] = hc_byte_perm (w4[2], w4[1], selector); w4[3] = hc_byte_perm (w4[1], w4[0], selector); w4[2] = hc_byte_perm (w4[0], w3[3], selector); w4[1] = hc_byte_perm (w3[3], w3[2], selector); w4[0] = hc_byte_perm (w3[2], w3[1], selector); w3[3] = hc_byte_perm (w3[1], w3[0], selector); w3[2] = hc_byte_perm (w3[0], w2[3], selector); w3[1] = hc_byte_perm (w2[3], w2[2], selector); w3[0] = hc_byte_perm (w2[2], w2[1], selector); w2[3] = hc_byte_perm (w2[1], w2[0], selector); w2[2] = hc_byte_perm (w2[0], w1[3], selector); w2[1] = hc_byte_perm (w1[3], w1[2], selector); w2[0] = hc_byte_perm (w1[2], w1[1], selector); w1[3] = hc_byte_perm (w1[1], w1[0], selector); w1[2] = hc_byte_perm (w1[0], w0[3], selector); w1[1] = hc_byte_perm (w0[3], w0[2], selector); w1[0] = hc_byte_perm (w0[2], w0[1], selector); w0[3] = hc_byte_perm (w0[1], w0[0], selector); w0[2] = hc_byte_perm (w0[0], 0, selector); w0[1] = 0; w0[0] = 0; break; case 3: c0[3] = hc_byte_perm ( 0, w7[3], selector); c0[2] = hc_byte_perm (w7[3], w7[2], selector); c0[1] = hc_byte_perm (w7[2], w7[1], selector); c0[0] = hc_byte_perm (w7[1], w7[0], selector); w7[3] = hc_byte_perm (w7[0], w6[3], selector); w7[2] = hc_byte_perm (w6[3], w6[2], selector); w7[1] = hc_byte_perm (w6[2], w6[1], selector); w7[0] = hc_byte_perm (w6[1], w6[0], selector); w6[3] = hc_byte_perm (w6[0], w5[3], selector); w6[2] = hc_byte_perm (w5[3], w5[2], selector); w6[1] = hc_byte_perm (w5[2], w5[1], selector); w6[0] = hc_byte_perm (w5[1], w5[0], selector); w5[3] = hc_byte_perm (w5[0], w4[3], selector); w5[2] = hc_byte_perm (w4[3], w4[2], selector); w5[1] = hc_byte_perm (w4[2], w4[1], selector); w5[0] = hc_byte_perm (w4[1], w4[0], selector); w4[3] = hc_byte_perm (w4[0], w3[3], selector); w4[2] = hc_byte_perm (w3[3], w3[2], selector); w4[1] = hc_byte_perm (w3[2], w3[1], selector); w4[0] = hc_byte_perm (w3[1], w3[0], selector); w3[3] = hc_byte_perm (w3[0], w2[3], selector); w3[2] = hc_byte_perm (w2[3], w2[2], selector); w3[1] = hc_byte_perm (w2[2], w2[1], selector); w3[0] = hc_byte_perm (w2[1], w2[0], selector); w2[3] = hc_byte_perm (w2[0], w1[3], selector); w2[2] = hc_byte_perm (w1[3], w1[2], selector); w2[1] = hc_byte_perm (w1[2], w1[1], selector); w2[0] = hc_byte_perm (w1[1], w1[0], selector); w1[3] = hc_byte_perm (w1[0], w0[3], selector); w1[2] = hc_byte_perm (w0[3], w0[2], selector); w1[1] = hc_byte_perm (w0[2], w0[1], selector); w1[0] = hc_byte_perm (w0[1], w0[0], selector); w0[3] = hc_byte_perm (w0[0], 0, selector); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: c1[0] = hc_byte_perm ( 0, w7[3], selector); c0[3] = hc_byte_perm (w7[3], w7[2], selector); c0[2] = hc_byte_perm (w7[2], w7[1], selector); c0[1] = hc_byte_perm (w7[1], w7[0], selector); c0[0] = hc_byte_perm (w7[0], w6[3], selector); w7[3] = hc_byte_perm (w6[3], w6[2], selector); w7[2] = hc_byte_perm (w6[2], w6[1], selector); w7[1] = hc_byte_perm (w6[1], w6[0], selector); w7[0] = hc_byte_perm (w6[0], w5[3], selector); w6[3] = hc_byte_perm (w5[3], w5[2], selector); w6[2] = hc_byte_perm (w5[2], w5[1], selector); w6[1] = hc_byte_perm (w5[1], w5[0], selector); w6[0] = hc_byte_perm (w5[0], w4[3], selector); w5[3] = hc_byte_perm (w4[3], w4[2], selector); w5[2] = hc_byte_perm (w4[2], w4[1], selector); w5[1] = hc_byte_perm (w4[1], w4[0], selector); w5[0] = hc_byte_perm (w4[0], w3[3], selector); w4[3] = hc_byte_perm (w3[3], w3[2], selector); w4[2] = hc_byte_perm (w3[2], w3[1], selector); w4[1] = hc_byte_perm (w3[1], w3[0], selector); w4[0] = hc_byte_perm (w3[0], w2[3], selector); w3[3] = hc_byte_perm (w2[3], w2[2], selector); w3[2] = hc_byte_perm (w2[2], w2[1], selector); w3[1] = hc_byte_perm (w2[1], w2[0], selector); w3[0] = hc_byte_perm (w2[0], w1[3], selector); w2[3] = hc_byte_perm (w1[3], w1[2], selector); w2[2] = hc_byte_perm (w1[2], w1[1], selector); w2[1] = hc_byte_perm (w1[1], w1[0], selector); w2[0] = hc_byte_perm (w1[0], w0[3], selector); w1[3] = hc_byte_perm (w0[3], w0[2], selector); w1[2] = hc_byte_perm (w0[2], w0[1], selector); w1[1] = hc_byte_perm (w0[1], w0[0], selector); w1[0] = hc_byte_perm (w0[0], 0, selector); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: c1[1] = hc_byte_perm ( 0, w7[3], selector); c1[0] = hc_byte_perm (w7[3], w7[2], selector); c0[3] = hc_byte_perm (w7[2], w7[1], selector); c0[2] = hc_byte_perm (w7[1], w7[0], selector); c0[1] = hc_byte_perm (w7[0], w6[3], selector); c0[0] = hc_byte_perm (w6[3], w6[2], selector); w7[3] = hc_byte_perm (w6[2], w6[1], selector); w7[2] = hc_byte_perm (w6[1], w6[0], selector); w7[1] = hc_byte_perm (w6[0], w5[3], selector); w7[0] = hc_byte_perm (w5[3], w5[2], selector); w6[3] = hc_byte_perm (w5[2], w5[1], selector); w6[2] = hc_byte_perm (w5[1], w5[0], selector); w6[1] = hc_byte_perm (w5[0], w4[3], selector); w6[0] = hc_byte_perm (w4[3], w4[2], selector); w5[3] = hc_byte_perm (w4[2], w4[1], selector); w5[2] = hc_byte_perm (w4[1], w4[0], selector); w5[1] = hc_byte_perm (w4[0], w3[3], selector); w5[0] = hc_byte_perm (w3[3], w3[2], selector); w4[3] = hc_byte_perm (w3[2], w3[1], selector); w4[2] = hc_byte_perm (w3[1], w3[0], selector); w4[1] = hc_byte_perm (w3[0], w2[3], selector); w4[0] = hc_byte_perm (w2[3], w2[2], selector); w3[3] = hc_byte_perm (w2[2], w2[1], selector); w3[2] = hc_byte_perm (w2[1], w2[0], selector); w3[1] = hc_byte_perm (w2[0], w1[3], selector); w3[0] = hc_byte_perm (w1[3], w1[2], selector); w2[3] = hc_byte_perm (w1[2], w1[1], selector); w2[2] = hc_byte_perm (w1[1], w1[0], selector); w2[1] = hc_byte_perm (w1[0], w0[3], selector); w2[0] = hc_byte_perm (w0[3], w0[2], selector); w1[3] = hc_byte_perm (w0[2], w0[1], selector); w1[2] = hc_byte_perm (w0[1], w0[0], selector); w1[1] = hc_byte_perm (w0[0], 0, selector); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: c1[2] = hc_byte_perm ( 0, w7[3], selector); c1[1] = hc_byte_perm (w7[3], w7[2], selector); c1[0] = hc_byte_perm (w7[2], w7[1], selector); c0[3] = hc_byte_perm (w7[1], w7[0], selector); c0[2] = hc_byte_perm (w7[0], w6[3], selector); c0[1] = hc_byte_perm (w6[3], w6[2], selector); c0[0] = hc_byte_perm (w6[2], w6[1], selector); w7[3] = hc_byte_perm (w6[1], w6[0], selector); w7[2] = hc_byte_perm (w6[0], w5[3], selector); w7[1] = hc_byte_perm (w5[3], w5[2], selector); w7[0] = hc_byte_perm (w5[2], w5[1], selector); w6[3] = hc_byte_perm (w5[1], w5[0], selector); w6[2] = hc_byte_perm (w5[0], w4[3], selector); w6[1] = hc_byte_perm (w4[3], w4[2], selector); w6[0] = hc_byte_perm (w4[2], w4[1], selector); w5[3] = hc_byte_perm (w4[1], w4[0], selector); w5[2] = hc_byte_perm (w4[0], w3[3], selector); w5[1] = hc_byte_perm (w3[3], w3[2], selector); w5[0] = hc_byte_perm (w3[2], w3[1], selector); w4[3] = hc_byte_perm (w3[1], w3[0], selector); w4[2] = hc_byte_perm (w3[0], w2[3], selector); w4[1] = hc_byte_perm (w2[3], w2[2], selector); w4[0] = hc_byte_perm (w2[2], w2[1], selector); w3[3] = hc_byte_perm (w2[1], w2[0], selector); w3[2] = hc_byte_perm (w2[0], w1[3], selector); w3[1] = hc_byte_perm (w1[3], w1[2], selector); w3[0] = hc_byte_perm (w1[2], w1[1], selector); w2[3] = hc_byte_perm (w1[1], w1[0], selector); w2[2] = hc_byte_perm (w1[0], w0[3], selector); w2[1] = hc_byte_perm (w0[3], w0[2], selector); w2[0] = hc_byte_perm (w0[2], w0[1], selector); w1[3] = hc_byte_perm (w0[1], w0[0], selector); w1[2] = hc_byte_perm (w0[0], 0, selector); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: c1[3] = hc_byte_perm ( 0, w7[3], selector); c1[2] = hc_byte_perm (w7[3], w7[2], selector); c1[1] = hc_byte_perm (w7[2], w7[1], selector); c1[0] = hc_byte_perm (w7[1], w7[0], selector); c0[3] = hc_byte_perm (w7[0], w6[3], selector); c0[2] = hc_byte_perm (w6[3], w6[2], selector); c0[1] = hc_byte_perm (w6[2], w6[1], selector); c0[0] = hc_byte_perm (w6[1], w6[0], selector); w7[3] = hc_byte_perm (w6[0], w5[3], selector); w7[2] = hc_byte_perm (w5[3], w5[2], selector); w7[1] = hc_byte_perm (w5[2], w5[1], selector); w7[0] = hc_byte_perm (w5[1], w5[0], selector); w6[3] = hc_byte_perm (w5[0], w4[3], selector); w6[2] = hc_byte_perm (w4[3], w4[2], selector); w6[1] = hc_byte_perm (w4[2], w4[1], selector); w6[0] = hc_byte_perm (w4[1], w4[0], selector); w5[3] = hc_byte_perm (w4[0], w3[3], selector); w5[2] = hc_byte_perm (w3[3], w3[2], selector); w5[1] = hc_byte_perm (w3[2], w3[1], selector); w5[0] = hc_byte_perm (w3[1], w3[0], selector); w4[3] = hc_byte_perm (w3[0], w2[3], selector); w4[2] = hc_byte_perm (w2[3], w2[2], selector); w4[1] = hc_byte_perm (w2[2], w2[1], selector); w4[0] = hc_byte_perm (w2[1], w2[0], selector); w3[3] = hc_byte_perm (w2[0], w1[3], selector); w3[2] = hc_byte_perm (w1[3], w1[2], selector); w3[1] = hc_byte_perm (w1[2], w1[1], selector); w3[0] = hc_byte_perm (w1[1], w1[0], selector); w2[3] = hc_byte_perm (w1[0], w0[3], selector); w2[2] = hc_byte_perm (w0[3], w0[2], selector); w2[1] = hc_byte_perm (w0[2], w0[1], selector); w2[0] = hc_byte_perm (w0[1], w0[0], selector); w1[3] = hc_byte_perm (w0[0], 0, selector); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: c2[0] = hc_byte_perm ( 0, w7[3], selector); c1[3] = hc_byte_perm (w7[3], w7[2], selector); c1[2] = hc_byte_perm (w7[2], w7[1], selector); c1[1] = hc_byte_perm (w7[1], w7[0], selector); c1[0] = hc_byte_perm (w7[0], w6[3], selector); c0[3] = hc_byte_perm (w6[3], w6[2], selector); c0[2] = hc_byte_perm (w6[2], w6[1], selector); c0[1] = hc_byte_perm (w6[1], w6[0], selector); c0[0] = hc_byte_perm (w6[0], w5[3], selector); w7[3] = hc_byte_perm (w5[3], w5[2], selector); w7[2] = hc_byte_perm (w5[2], w5[1], selector); w7[1] = hc_byte_perm (w5[1], w5[0], selector); w7[0] = hc_byte_perm (w5[0], w4[3], selector); w6[3] = hc_byte_perm (w4[3], w4[2], selector); w6[2] = hc_byte_perm (w4[2], w4[1], selector); w6[1] = hc_byte_perm (w4[1], w4[0], selector); w6[0] = hc_byte_perm (w4[0], w3[3], selector); w5[3] = hc_byte_perm (w3[3], w3[2], selector); w5[2] = hc_byte_perm (w3[2], w3[1], selector); w5[1] = hc_byte_perm (w3[1], w3[0], selector); w5[0] = hc_byte_perm (w3[0], w2[3], selector); w4[3] = hc_byte_perm (w2[3], w2[2], selector); w4[2] = hc_byte_perm (w2[2], w2[1], selector); w4[1] = hc_byte_perm (w2[1], w2[0], selector); w4[0] = hc_byte_perm (w2[0], w1[3], selector); w3[3] = hc_byte_perm (w1[3], w1[2], selector); w3[2] = hc_byte_perm (w1[2], w1[1], selector); w3[1] = hc_byte_perm (w1[1], w1[0], selector); w3[0] = hc_byte_perm (w1[0], w0[3], selector); w2[3] = hc_byte_perm (w0[3], w0[2], selector); w2[2] = hc_byte_perm (w0[2], w0[1], selector); w2[1] = hc_byte_perm (w0[1], w0[0], selector); w2[0] = hc_byte_perm (w0[0], 0, selector); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: c2[1] = hc_byte_perm ( 0, w7[3], selector); c2[0] = hc_byte_perm (w7[3], w7[2], selector); c1[3] = hc_byte_perm (w7[2], w7[1], selector); c1[2] = hc_byte_perm (w7[1], w7[0], selector); c1[1] = hc_byte_perm (w7[0], w6[3], selector); c1[0] = hc_byte_perm (w6[3], w6[2], selector); c0[3] = hc_byte_perm (w6[2], w6[1], selector); c0[2] = hc_byte_perm (w6[1], w6[0], selector); c0[1] = hc_byte_perm (w6[0], w5[3], selector); c0[0] = hc_byte_perm (w5[3], w5[2], selector); w7[3] = hc_byte_perm (w5[2], w5[1], selector); w7[2] = hc_byte_perm (w5[1], w5[0], selector); w7[1] = hc_byte_perm (w5[0], w4[3], selector); w7[0] = hc_byte_perm (w4[3], w4[2], selector); w6[3] = hc_byte_perm (w4[2], w4[1], selector); w6[2] = hc_byte_perm (w4[1], w4[0], selector); w6[1] = hc_byte_perm (w4[0], w3[3], selector); w6[0] = hc_byte_perm (w3[3], w3[2], selector); w5[3] = hc_byte_perm (w3[2], w3[1], selector); w5[2] = hc_byte_perm (w3[1], w3[0], selector); w5[1] = hc_byte_perm (w3[0], w2[3], selector); w5[0] = hc_byte_perm (w2[3], w2[2], selector); w4[3] = hc_byte_perm (w2[2], w2[1], selector); w4[2] = hc_byte_perm (w2[1], w2[0], selector); w4[1] = hc_byte_perm (w2[0], w1[3], selector); w4[0] = hc_byte_perm (w1[3], w1[2], selector); w3[3] = hc_byte_perm (w1[2], w1[1], selector); w3[2] = hc_byte_perm (w1[1], w1[0], selector); w3[1] = hc_byte_perm (w1[0], w0[3], selector); w3[0] = hc_byte_perm (w0[3], w0[2], selector); w2[3] = hc_byte_perm (w0[2], w0[1], selector); w2[2] = hc_byte_perm (w0[1], w0[0], selector); w2[1] = hc_byte_perm (w0[0], 0, selector); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: c2[2] = hc_byte_perm ( 0, w7[3], selector); c2[1] = hc_byte_perm (w7[3], w7[2], selector); c2[0] = hc_byte_perm (w7[2], w7[1], selector); c1[3] = hc_byte_perm (w7[1], w7[0], selector); c1[2] = hc_byte_perm (w7[0], w6[3], selector); c1[1] = hc_byte_perm (w6[3], w6[2], selector); c1[0] = hc_byte_perm (w6[2], w6[1], selector); c0[3] = hc_byte_perm (w6[1], w6[0], selector); c0[2] = hc_byte_perm (w6[0], w5[3], selector); c0[1] = hc_byte_perm (w5[3], w5[2], selector); c0[0] = hc_byte_perm (w5[2], w5[1], selector); w7[3] = hc_byte_perm (w5[1], w5[0], selector); w7[2] = hc_byte_perm (w5[0], w4[3], selector); w7[1] = hc_byte_perm (w4[3], w4[2], selector); w7[0] = hc_byte_perm (w4[2], w4[1], selector); w6[3] = hc_byte_perm (w4[1], w4[0], selector); w6[2] = hc_byte_perm (w4[0], w3[3], selector); w6[1] = hc_byte_perm (w3[3], w3[2], selector); w6[0] = hc_byte_perm (w3[2], w3[1], selector); w5[3] = hc_byte_perm (w3[1], w3[0], selector); w5[2] = hc_byte_perm (w3[0], w2[3], selector); w5[1] = hc_byte_perm (w2[3], w2[2], selector); w5[0] = hc_byte_perm (w2[2], w2[1], selector); w4[3] = hc_byte_perm (w2[1], w2[0], selector); w4[2] = hc_byte_perm (w2[0], w1[3], selector); w4[1] = hc_byte_perm (w1[3], w1[2], selector); w4[0] = hc_byte_perm (w1[2], w1[1], selector); w3[3] = hc_byte_perm (w1[1], w1[0], selector); w3[2] = hc_byte_perm (w1[0], w0[3], selector); w3[1] = hc_byte_perm (w0[3], w0[2], selector); w3[0] = hc_byte_perm (w0[2], w0[1], selector); w2[3] = hc_byte_perm (w0[1], w0[0], selector); w2[2] = hc_byte_perm (w0[0], 0, selector); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: c2[3] = hc_byte_perm ( 0, w7[3], selector); c2[2] = hc_byte_perm (w7[3], w7[2], selector); c2[1] = hc_byte_perm (w7[2], w7[1], selector); c2[0] = hc_byte_perm (w7[1], w7[0], selector); c1[3] = hc_byte_perm (w7[0], w6[3], selector); c1[2] = hc_byte_perm (w6[3], w6[2], selector); c1[1] = hc_byte_perm (w6[2], w6[1], selector); c1[0] = hc_byte_perm (w6[1], w6[0], selector); c0[3] = hc_byte_perm (w6[0], w5[3], selector); c0[2] = hc_byte_perm (w5[3], w5[2], selector); c0[1] = hc_byte_perm (w5[2], w5[1], selector); c0[0] = hc_byte_perm (w5[1], w5[0], selector); w7[3] = hc_byte_perm (w5[0], w4[3], selector); w7[2] = hc_byte_perm (w4[3], w4[2], selector); w7[1] = hc_byte_perm (w4[2], w4[1], selector); w7[0] = hc_byte_perm (w4[1], w4[0], selector); w6[3] = hc_byte_perm (w4[0], w3[3], selector); w6[2] = hc_byte_perm (w3[3], w3[2], selector); w6[1] = hc_byte_perm (w3[2], w3[1], selector); w6[0] = hc_byte_perm (w3[1], w3[0], selector); w5[3] = hc_byte_perm (w3[0], w2[3], selector); w5[2] = hc_byte_perm (w2[3], w2[2], selector); w5[1] = hc_byte_perm (w2[2], w2[1], selector); w5[0] = hc_byte_perm (w2[1], w2[0], selector); w4[3] = hc_byte_perm (w2[0], w1[3], selector); w4[2] = hc_byte_perm (w1[3], w1[2], selector); w4[1] = hc_byte_perm (w1[2], w1[1], selector); w4[0] = hc_byte_perm (w1[1], w1[0], selector); w3[3] = hc_byte_perm (w1[0], w0[3], selector); w3[2] = hc_byte_perm (w0[3], w0[2], selector); w3[1] = hc_byte_perm (w0[2], w0[1], selector); w3[0] = hc_byte_perm (w0[1], w0[0], selector); w2[3] = hc_byte_perm (w0[0], 0, selector); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: c3[0] = hc_byte_perm ( 0, w7[3], selector); c2[3] = hc_byte_perm (w7[3], w7[2], selector); c2[2] = hc_byte_perm (w7[2], w7[1], selector); c2[1] = hc_byte_perm (w7[1], w7[0], selector); c2[0] = hc_byte_perm (w7[0], w6[3], selector); c1[3] = hc_byte_perm (w6[3], w6[2], selector); c1[2] = hc_byte_perm (w6[2], w6[1], selector); c1[1] = hc_byte_perm (w6[1], w6[0], selector); c1[0] = hc_byte_perm (w6[0], w5[3], selector); c0[3] = hc_byte_perm (w5[3], w5[2], selector); c0[2] = hc_byte_perm (w5[2], w5[1], selector); c0[1] = hc_byte_perm (w5[1], w5[0], selector); c0[0] = hc_byte_perm (w5[0], w4[3], selector); w7[3] = hc_byte_perm (w4[3], w4[2], selector); w7[2] = hc_byte_perm (w4[2], w4[1], selector); w7[1] = hc_byte_perm (w4[1], w4[0], selector); w7[0] = hc_byte_perm (w4[0], w3[3], selector); w6[3] = hc_byte_perm (w3[3], w3[2], selector); w6[2] = hc_byte_perm (w3[2], w3[1], selector); w6[1] = hc_byte_perm (w3[1], w3[0], selector); w6[0] = hc_byte_perm (w3[0], w2[3], selector); w5[3] = hc_byte_perm (w2[3], w2[2], selector); w5[2] = hc_byte_perm (w2[2], w2[1], selector); w5[1] = hc_byte_perm (w2[1], w2[0], selector); w5[0] = hc_byte_perm (w2[0], w1[3], selector); w4[3] = hc_byte_perm (w1[3], w1[2], selector); w4[2] = hc_byte_perm (w1[2], w1[1], selector); w4[1] = hc_byte_perm (w1[1], w1[0], selector); w4[0] = hc_byte_perm (w1[0], w0[3], selector); w3[3] = hc_byte_perm (w0[3], w0[2], selector); w3[2] = hc_byte_perm (w0[2], w0[1], selector); w3[1] = hc_byte_perm (w0[1], w0[0], selector); w3[0] = hc_byte_perm (w0[0], 0, selector); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: c3[1] = hc_byte_perm ( 0, w7[3], selector); c3[0] = hc_byte_perm (w7[3], w7[2], selector); c2[3] = hc_byte_perm (w7[2], w7[1], selector); c2[2] = hc_byte_perm (w7[1], w7[0], selector); c2[1] = hc_byte_perm (w7[0], w6[3], selector); c2[0] = hc_byte_perm (w6[3], w6[2], selector); c1[3] = hc_byte_perm (w6[2], w6[1], selector); c1[2] = hc_byte_perm (w6[1], w6[0], selector); c1[1] = hc_byte_perm (w6[0], w5[3], selector); c1[0] = hc_byte_perm (w5[3], w5[2], selector); c0[3] = hc_byte_perm (w5[2], w5[1], selector); c0[2] = hc_byte_perm (w5[1], w5[0], selector); c0[1] = hc_byte_perm (w5[0], w4[3], selector); c0[0] = hc_byte_perm (w4[3], w4[2], selector); w7[3] = hc_byte_perm (w4[2], w4[1], selector); w7[2] = hc_byte_perm (w4[1], w4[0], selector); w7[1] = hc_byte_perm (w4[0], w3[3], selector); w7[0] = hc_byte_perm (w3[3], w3[2], selector); w6[3] = hc_byte_perm (w3[2], w3[1], selector); w6[2] = hc_byte_perm (w3[1], w3[0], selector); w6[1] = hc_byte_perm (w3[0], w2[3], selector); w6[0] = hc_byte_perm (w2[3], w2[2], selector); w5[3] = hc_byte_perm (w2[2], w2[1], selector); w5[2] = hc_byte_perm (w2[1], w2[0], selector); w5[1] = hc_byte_perm (w2[0], w1[3], selector); w5[0] = hc_byte_perm (w1[3], w1[2], selector); w4[3] = hc_byte_perm (w1[2], w1[1], selector); w4[2] = hc_byte_perm (w1[1], w1[0], selector); w4[1] = hc_byte_perm (w1[0], w0[3], selector); w4[0] = hc_byte_perm (w0[3], w0[2], selector); w3[3] = hc_byte_perm (w0[2], w0[1], selector); w3[2] = hc_byte_perm (w0[1], w0[0], selector); w3[1] = hc_byte_perm (w0[0], 0, selector); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: c3[2] = hc_byte_perm ( 0, w7[3], selector); c3[1] = hc_byte_perm (w7[3], w7[2], selector); c3[0] = hc_byte_perm (w7[2], w7[1], selector); c2[3] = hc_byte_perm (w7[1], w7[0], selector); c2[2] = hc_byte_perm (w7[0], w6[3], selector); c2[1] = hc_byte_perm (w6[3], w6[2], selector); c2[0] = hc_byte_perm (w6[2], w6[1], selector); c1[3] = hc_byte_perm (w6[1], w6[0], selector); c1[2] = hc_byte_perm (w6[0], w5[3], selector); c1[1] = hc_byte_perm (w5[3], w5[2], selector); c1[0] = hc_byte_perm (w5[2], w5[1], selector); c0[3] = hc_byte_perm (w5[1], w5[0], selector); c0[2] = hc_byte_perm (w5[0], w4[3], selector); c0[1] = hc_byte_perm (w4[3], w4[2], selector); c0[0] = hc_byte_perm (w4[2], w4[1], selector); w7[3] = hc_byte_perm (w4[1], w4[0], selector); w7[2] = hc_byte_perm (w4[0], w3[3], selector); w7[1] = hc_byte_perm (w3[3], w3[2], selector); w7[0] = hc_byte_perm (w3[2], w3[1], selector); w6[3] = hc_byte_perm (w3[1], w3[0], selector); w6[2] = hc_byte_perm (w3[0], w2[3], selector); w6[1] = hc_byte_perm (w2[3], w2[2], selector); w6[0] = hc_byte_perm (w2[2], w2[1], selector); w5[3] = hc_byte_perm (w2[1], w2[0], selector); w5[2] = hc_byte_perm (w2[0], w1[3], selector); w5[1] = hc_byte_perm (w1[3], w1[2], selector); w5[0] = hc_byte_perm (w1[2], w1[1], selector); w4[3] = hc_byte_perm (w1[1], w1[0], selector); w4[2] = hc_byte_perm (w1[0], w0[3], selector); w4[1] = hc_byte_perm (w0[3], w0[2], selector); w4[0] = hc_byte_perm (w0[2], w0[1], selector); w3[3] = hc_byte_perm (w0[1], w0[0], selector); w3[2] = hc_byte_perm (w0[0], 0, selector); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: c3[3] = hc_byte_perm ( 0, w7[3], selector); c3[2] = hc_byte_perm (w7[3], w7[2], selector); c3[1] = hc_byte_perm (w7[2], w7[1], selector); c3[0] = hc_byte_perm (w7[1], w7[0], selector); c2[3] = hc_byte_perm (w7[0], w6[3], selector); c2[2] = hc_byte_perm (w6[3], w6[2], selector); c2[1] = hc_byte_perm (w6[2], w6[1], selector); c2[0] = hc_byte_perm (w6[1], w6[0], selector); c1[3] = hc_byte_perm (w6[0], w5[3], selector); c1[2] = hc_byte_perm (w5[3], w5[2], selector); c1[1] = hc_byte_perm (w5[2], w5[1], selector); c1[0] = hc_byte_perm (w5[1], w5[0], selector); c0[3] = hc_byte_perm (w5[0], w4[3], selector); c0[2] = hc_byte_perm (w4[3], w4[2], selector); c0[1] = hc_byte_perm (w4[2], w4[1], selector); c0[0] = hc_byte_perm (w4[1], w4[0], selector); w7[3] = hc_byte_perm (w4[0], w3[3], selector); w7[2] = hc_byte_perm (w3[3], w3[2], selector); w7[1] = hc_byte_perm (w3[2], w3[1], selector); w7[0] = hc_byte_perm (w3[1], w3[0], selector); w6[3] = hc_byte_perm (w3[0], w2[3], selector); w6[2] = hc_byte_perm (w2[3], w2[2], selector); w6[1] = hc_byte_perm (w2[2], w2[1], selector); w6[0] = hc_byte_perm (w2[1], w2[0], selector); w5[3] = hc_byte_perm (w2[0], w1[3], selector); w5[2] = hc_byte_perm (w1[3], w1[2], selector); w5[1] = hc_byte_perm (w1[2], w1[1], selector); w5[0] = hc_byte_perm (w1[1], w1[0], selector); w4[3] = hc_byte_perm (w1[0], w0[3], selector); w4[2] = hc_byte_perm (w0[3], w0[2], selector); w4[1] = hc_byte_perm (w0[2], w0[1], selector); w4[0] = hc_byte_perm (w0[1], w0[0], selector); w3[3] = hc_byte_perm (w0[0], 0, selector); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 16: c4[0] = hc_byte_perm ( 0, w7[3], selector); c3[3] = hc_byte_perm (w7[3], w7[2], selector); c3[2] = hc_byte_perm (w7[2], w7[1], selector); c3[1] = hc_byte_perm (w7[1], w7[0], selector); c3[0] = hc_byte_perm (w7[0], w6[3], selector); c2[3] = hc_byte_perm (w6[3], w6[2], selector); c2[2] = hc_byte_perm (w6[2], w6[1], selector); c2[1] = hc_byte_perm (w6[1], w6[0], selector); c2[0] = hc_byte_perm (w6[0], w5[3], selector); c1[3] = hc_byte_perm (w5[3], w5[2], selector); c1[2] = hc_byte_perm (w5[2], w5[1], selector); c1[1] = hc_byte_perm (w5[1], w5[0], selector); c1[0] = hc_byte_perm (w5[0], w4[3], selector); c0[3] = hc_byte_perm (w4[3], w4[2], selector); c0[2] = hc_byte_perm (w4[2], w4[1], selector); c0[1] = hc_byte_perm (w4[1], w4[0], selector); c0[0] = hc_byte_perm (w4[0], w3[3], selector); w7[3] = hc_byte_perm (w3[3], w3[2], selector); w7[2] = hc_byte_perm (w3[2], w3[1], selector); w7[1] = hc_byte_perm (w3[1], w3[0], selector); w7[0] = hc_byte_perm (w3[0], w2[3], selector); w6[3] = hc_byte_perm (w2[3], w2[2], selector); w6[2] = hc_byte_perm (w2[2], w2[1], selector); w6[1] = hc_byte_perm (w2[1], w2[0], selector); w6[0] = hc_byte_perm (w2[0], w1[3], selector); w5[3] = hc_byte_perm (w1[3], w1[2], selector); w5[2] = hc_byte_perm (w1[2], w1[1], selector); w5[1] = hc_byte_perm (w1[1], w1[0], selector); w5[0] = hc_byte_perm (w1[0], w0[3], selector); w4[3] = hc_byte_perm (w0[3], w0[2], selector); w4[2] = hc_byte_perm (w0[2], w0[1], selector); w4[1] = hc_byte_perm (w0[1], w0[0], selector); w4[0] = hc_byte_perm (w0[0], 0, selector); w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 17: c4[1] = hc_byte_perm ( 0, w7[3], selector); c4[0] = hc_byte_perm (w7[3], w7[2], selector); c3[3] = hc_byte_perm (w7[2], w7[1], selector); c3[2] = hc_byte_perm (w7[1], w7[0], selector); c3[1] = hc_byte_perm (w7[0], w6[3], selector); c3[0] = hc_byte_perm (w6[3], w6[2], selector); c2[3] = hc_byte_perm (w6[2], w6[1], selector); c2[2] = hc_byte_perm (w6[1], w6[0], selector); c2[1] = hc_byte_perm (w6[0], w5[3], selector); c2[0] = hc_byte_perm (w5[3], w5[2], selector); c1[3] = hc_byte_perm (w5[2], w5[1], selector); c1[2] = hc_byte_perm (w5[1], w5[0], selector); c1[1] = hc_byte_perm (w5[0], w4[3], selector); c1[0] = hc_byte_perm (w4[3], w4[2], selector); c0[3] = hc_byte_perm (w4[2], w4[1], selector); c0[2] = hc_byte_perm (w4[1], w4[0], selector); c0[1] = hc_byte_perm (w4[0], w3[3], selector); c0[0] = hc_byte_perm (w3[3], w3[2], selector); w7[3] = hc_byte_perm (w3[2], w3[1], selector); w7[2] = hc_byte_perm (w3[1], w3[0], selector); w7[1] = hc_byte_perm (w3[0], w2[3], selector); w7[0] = hc_byte_perm (w2[3], w2[2], selector); w6[3] = hc_byte_perm (w2[2], w2[1], selector); w6[2] = hc_byte_perm (w2[1], w2[0], selector); w6[1] = hc_byte_perm (w2[0], w1[3], selector); w6[0] = hc_byte_perm (w1[3], w1[2], selector); w5[3] = hc_byte_perm (w1[2], w1[1], selector); w5[2] = hc_byte_perm (w1[1], w1[0], selector); w5[1] = hc_byte_perm (w1[0], w0[3], selector); w5[0] = hc_byte_perm (w0[3], w0[2], selector); w4[3] = hc_byte_perm (w0[2], w0[1], selector); w4[2] = hc_byte_perm (w0[1], w0[0], selector); w4[1] = hc_byte_perm (w0[0], 0, selector); w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 18: c4[2] = hc_byte_perm ( 0, w7[3], selector); c4[1] = hc_byte_perm (w7[3], w7[2], selector); c4[0] = hc_byte_perm (w7[2], w7[1], selector); c3[3] = hc_byte_perm (w7[1], w7[0], selector); c3[2] = hc_byte_perm (w7[0], w6[3], selector); c3[1] = hc_byte_perm (w6[3], w6[2], selector); c3[0] = hc_byte_perm (w6[2], w6[1], selector); c2[3] = hc_byte_perm (w6[1], w6[0], selector); c2[2] = hc_byte_perm (w6[0], w5[3], selector); c2[1] = hc_byte_perm (w5[3], w5[2], selector); c2[0] = hc_byte_perm (w5[2], w5[1], selector); c1[3] = hc_byte_perm (w5[1], w5[0], selector); c1[2] = hc_byte_perm (w5[0], w4[3], selector); c1[1] = hc_byte_perm (w4[3], w4[2], selector); c1[0] = hc_byte_perm (w4[2], w4[1], selector); c0[3] = hc_byte_perm (w4[1], w4[0], selector); c0[2] = hc_byte_perm (w4[0], w3[3], selector); c0[1] = hc_byte_perm (w3[3], w3[2], selector); c0[0] = hc_byte_perm (w3[2], w3[1], selector); w7[3] = hc_byte_perm (w3[1], w3[0], selector); w7[2] = hc_byte_perm (w3[0], w2[3], selector); w7[1] = hc_byte_perm (w2[3], w2[2], selector); w7[0] = hc_byte_perm (w2[2], w2[1], selector); w6[3] = hc_byte_perm (w2[1], w2[0], selector); w6[2] = hc_byte_perm (w2[0], w1[3], selector); w6[1] = hc_byte_perm (w1[3], w1[2], selector); w6[0] = hc_byte_perm (w1[2], w1[1], selector); w5[3] = hc_byte_perm (w1[1], w1[0], selector); w5[2] = hc_byte_perm (w1[0], w0[3], selector); w5[1] = hc_byte_perm (w0[3], w0[2], selector); w5[0] = hc_byte_perm (w0[2], w0[1], selector); w4[3] = hc_byte_perm (w0[1], w0[0], selector); w4[2] = hc_byte_perm (w0[0], 0, selector); w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 19: c4[3] = hc_byte_perm ( 0, w7[3], selector); c4[2] = hc_byte_perm (w7[3], w7[2], selector); c4[1] = hc_byte_perm (w7[2], w7[1], selector); c4[0] = hc_byte_perm (w7[1], w7[0], selector); c3[3] = hc_byte_perm (w7[0], w6[3], selector); c3[2] = hc_byte_perm (w6[3], w6[2], selector); c3[1] = hc_byte_perm (w6[2], w6[1], selector); c3[0] = hc_byte_perm (w6[1], w6[0], selector); c2[3] = hc_byte_perm (w6[0], w5[3], selector); c2[2] = hc_byte_perm (w5[3], w5[2], selector); c2[1] = hc_byte_perm (w5[2], w5[1], selector); c2[0] = hc_byte_perm (w5[1], w5[0], selector); c1[3] = hc_byte_perm (w5[0], w4[3], selector); c1[2] = hc_byte_perm (w4[3], w4[2], selector); c1[1] = hc_byte_perm (w4[2], w4[1], selector); c1[0] = hc_byte_perm (w4[1], w4[0], selector); c0[3] = hc_byte_perm (w4[0], w3[3], selector); c0[2] = hc_byte_perm (w3[3], w3[2], selector); c0[1] = hc_byte_perm (w3[2], w3[1], selector); c0[0] = hc_byte_perm (w3[1], w3[0], selector); w7[3] = hc_byte_perm (w3[0], w2[3], selector); w7[2] = hc_byte_perm (w2[3], w2[2], selector); w7[1] = hc_byte_perm (w2[2], w2[1], selector); w7[0] = hc_byte_perm (w2[1], w2[0], selector); w6[3] = hc_byte_perm (w2[0], w1[3], selector); w6[2] = hc_byte_perm (w1[3], w1[2], selector); w6[1] = hc_byte_perm (w1[2], w1[1], selector); w6[0] = hc_byte_perm (w1[1], w1[0], selector); w5[3] = hc_byte_perm (w1[0], w0[3], selector); w5[2] = hc_byte_perm (w0[3], w0[2], selector); w5[1] = hc_byte_perm (w0[2], w0[1], selector); w5[0] = hc_byte_perm (w0[1], w0[0], selector); w4[3] = hc_byte_perm (w0[0], 0, selector); w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 20: c5[0] = hc_byte_perm ( 0, w7[3], selector); c4[3] = hc_byte_perm (w7[3], w7[2], selector); c4[2] = hc_byte_perm (w7[2], w7[1], selector); c4[1] = hc_byte_perm (w7[1], w7[0], selector); c4[0] = hc_byte_perm (w7[0], w6[3], selector); c3[3] = hc_byte_perm (w6[3], w6[2], selector); c3[2] = hc_byte_perm (w6[2], w6[1], selector); c3[1] = hc_byte_perm (w6[1], w6[0], selector); c3[0] = hc_byte_perm (w6[0], w5[3], selector); c2[3] = hc_byte_perm (w5[3], w5[2], selector); c2[2] = hc_byte_perm (w5[2], w5[1], selector); c2[1] = hc_byte_perm (w5[1], w5[0], selector); c2[0] = hc_byte_perm (w5[0], w4[3], selector); c1[3] = hc_byte_perm (w4[3], w4[2], selector); c1[2] = hc_byte_perm (w4[2], w4[1], selector); c1[1] = hc_byte_perm (w4[1], w4[0], selector); c1[0] = hc_byte_perm (w4[0], w3[3], selector); c0[3] = hc_byte_perm (w3[3], w3[2], selector); c0[2] = hc_byte_perm (w3[2], w3[1], selector); c0[1] = hc_byte_perm (w3[1], w3[0], selector); c0[0] = hc_byte_perm (w3[0], w2[3], selector); w7[3] = hc_byte_perm (w2[3], w2[2], selector); w7[2] = hc_byte_perm (w2[2], w2[1], selector); w7[1] = hc_byte_perm (w2[1], w2[0], selector); w7[0] = hc_byte_perm (w2[0], w1[3], selector); w6[3] = hc_byte_perm (w1[3], w1[2], selector); w6[2] = hc_byte_perm (w1[2], w1[1], selector); w6[1] = hc_byte_perm (w1[1], w1[0], selector); w6[0] = hc_byte_perm (w1[0], w0[3], selector); w5[3] = hc_byte_perm (w0[3], w0[2], selector); w5[2] = hc_byte_perm (w0[2], w0[1], selector); w5[1] = hc_byte_perm (w0[1], w0[0], selector); w5[0] = hc_byte_perm (w0[0], 0, selector); w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 21: c5[1] = hc_byte_perm ( 0, w7[3], selector); c5[0] = hc_byte_perm (w7[3], w7[2], selector); c4[3] = hc_byte_perm (w7[2], w7[1], selector); c4[2] = hc_byte_perm (w7[1], w7[0], selector); c4[1] = hc_byte_perm (w7[0], w6[3], selector); c4[0] = hc_byte_perm (w6[3], w6[2], selector); c3[3] = hc_byte_perm (w6[2], w6[1], selector); c3[2] = hc_byte_perm (w6[1], w6[0], selector); c3[1] = hc_byte_perm (w6[0], w5[3], selector); c3[0] = hc_byte_perm (w5[3], w5[2], selector); c2[3] = hc_byte_perm (w5[2], w5[1], selector); c2[2] = hc_byte_perm (w5[1], w5[0], selector); c2[1] = hc_byte_perm (w5[0], w4[3], selector); c2[0] = hc_byte_perm (w4[3], w4[2], selector); c1[3] = hc_byte_perm (w4[2], w4[1], selector); c1[2] = hc_byte_perm (w4[1], w4[0], selector); c1[1] = hc_byte_perm (w4[0], w3[3], selector); c1[0] = hc_byte_perm (w3[3], w3[2], selector); c0[3] = hc_byte_perm (w3[2], w3[1], selector); c0[2] = hc_byte_perm (w3[1], w3[0], selector); c0[1] = hc_byte_perm (w3[0], w2[3], selector); c0[0] = hc_byte_perm (w2[3], w2[2], selector); w7[3] = hc_byte_perm (w2[2], w2[1], selector); w7[2] = hc_byte_perm (w2[1], w2[0], selector); w7[1] = hc_byte_perm (w2[0], w1[3], selector); w7[0] = hc_byte_perm (w1[3], w1[2], selector); w6[3] = hc_byte_perm (w1[2], w1[1], selector); w6[2] = hc_byte_perm (w1[1], w1[0], selector); w6[1] = hc_byte_perm (w1[0], w0[3], selector); w6[0] = hc_byte_perm (w0[3], w0[2], selector); w5[3] = hc_byte_perm (w0[2], w0[1], selector); w5[2] = hc_byte_perm (w0[1], w0[0], selector); w5[1] = hc_byte_perm (w0[0], 0, selector); w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 22: c5[2] = hc_byte_perm ( 0, w7[3], selector); c5[1] = hc_byte_perm (w7[3], w7[2], selector); c5[0] = hc_byte_perm (w7[2], w7[1], selector); c4[3] = hc_byte_perm (w7[1], w7[0], selector); c4[2] = hc_byte_perm (w7[0], w6[3], selector); c4[1] = hc_byte_perm (w6[3], w6[2], selector); c4[0] = hc_byte_perm (w6[2], w6[1], selector); c3[3] = hc_byte_perm (w6[1], w6[0], selector); c3[2] = hc_byte_perm (w6[0], w5[3], selector); c3[1] = hc_byte_perm (w5[3], w5[2], selector); c3[0] = hc_byte_perm (w5[2], w5[1], selector); c2[3] = hc_byte_perm (w5[1], w5[0], selector); c2[2] = hc_byte_perm (w5[0], w4[3], selector); c2[1] = hc_byte_perm (w4[3], w4[2], selector); c2[0] = hc_byte_perm (w4[2], w4[1], selector); c1[3] = hc_byte_perm (w4[1], w4[0], selector); c1[2] = hc_byte_perm (w4[0], w3[3], selector); c1[1] = hc_byte_perm (w3[3], w3[2], selector); c1[0] = hc_byte_perm (w3[2], w3[1], selector); c0[3] = hc_byte_perm (w3[1], w3[0], selector); c0[2] = hc_byte_perm (w3[0], w2[3], selector); c0[1] = hc_byte_perm (w2[3], w2[2], selector); c0[0] = hc_byte_perm (w2[2], w2[1], selector); w7[3] = hc_byte_perm (w2[1], w2[0], selector); w7[2] = hc_byte_perm (w2[0], w1[3], selector); w7[1] = hc_byte_perm (w1[3], w1[2], selector); w7[0] = hc_byte_perm (w1[2], w1[1], selector); w6[3] = hc_byte_perm (w1[1], w1[0], selector); w6[2] = hc_byte_perm (w1[0], w0[3], selector); w6[1] = hc_byte_perm (w0[3], w0[2], selector); w6[0] = hc_byte_perm (w0[2], w0[1], selector); w5[3] = hc_byte_perm (w0[1], w0[0], selector); w5[2] = hc_byte_perm (w0[0], 0, selector); w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 23: c5[3] = hc_byte_perm ( 0, w7[3], selector); c5[2] = hc_byte_perm (w7[3], w7[2], selector); c5[1] = hc_byte_perm (w7[2], w7[1], selector); c5[0] = hc_byte_perm (w7[1], w7[0], selector); c4[3] = hc_byte_perm (w7[0], w6[3], selector); c4[2] = hc_byte_perm (w6[3], w6[2], selector); c4[1] = hc_byte_perm (w6[2], w6[1], selector); c4[0] = hc_byte_perm (w6[1], w6[0], selector); c3[3] = hc_byte_perm (w6[0], w5[3], selector); c3[2] = hc_byte_perm (w5[3], w5[2], selector); c3[1] = hc_byte_perm (w5[2], w5[1], selector); c3[0] = hc_byte_perm (w5[1], w5[0], selector); c2[3] = hc_byte_perm (w5[0], w4[3], selector); c2[2] = hc_byte_perm (w4[3], w4[2], selector); c2[1] = hc_byte_perm (w4[2], w4[1], selector); c2[0] = hc_byte_perm (w4[1], w4[0], selector); c1[3] = hc_byte_perm (w4[0], w3[3], selector); c1[2] = hc_byte_perm (w3[3], w3[2], selector); c1[1] = hc_byte_perm (w3[2], w3[1], selector); c1[0] = hc_byte_perm (w3[1], w3[0], selector); c0[3] = hc_byte_perm (w3[0], w2[3], selector); c0[2] = hc_byte_perm (w2[3], w2[2], selector); c0[1] = hc_byte_perm (w2[2], w2[1], selector); c0[0] = hc_byte_perm (w2[1], w2[0], selector); w7[3] = hc_byte_perm (w2[0], w1[3], selector); w7[2] = hc_byte_perm (w1[3], w1[2], selector); w7[1] = hc_byte_perm (w1[2], w1[1], selector); w7[0] = hc_byte_perm (w1[1], w1[0], selector); w6[3] = hc_byte_perm (w1[0], w0[3], selector); w6[2] = hc_byte_perm (w0[3], w0[2], selector); w6[1] = hc_byte_perm (w0[2], w0[1], selector); w6[0] = hc_byte_perm (w0[1], w0[0], selector); w5[3] = hc_byte_perm (w0[0], 0, selector); w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 24: c6[0] = hc_byte_perm ( 0, w7[3], selector); c5[3] = hc_byte_perm (w7[3], w7[2], selector); c5[2] = hc_byte_perm (w7[2], w7[1], selector); c5[1] = hc_byte_perm (w7[1], w7[0], selector); c5[0] = hc_byte_perm (w7[0], w6[3], selector); c4[3] = hc_byte_perm (w6[3], w6[2], selector); c4[2] = hc_byte_perm (w6[2], w6[1], selector); c4[1] = hc_byte_perm (w6[1], w6[0], selector); c4[0] = hc_byte_perm (w6[0], w5[3], selector); c3[3] = hc_byte_perm (w5[3], w5[2], selector); c3[2] = hc_byte_perm (w5[2], w5[1], selector); c3[1] = hc_byte_perm (w5[1], w5[0], selector); c3[0] = hc_byte_perm (w5[0], w4[3], selector); c2[3] = hc_byte_perm (w4[3], w4[2], selector); c2[2] = hc_byte_perm (w4[2], w4[1], selector); c2[1] = hc_byte_perm (w4[1], w4[0], selector); c2[0] = hc_byte_perm (w4[0], w3[3], selector); c1[3] = hc_byte_perm (w3[3], w3[2], selector); c1[2] = hc_byte_perm (w3[2], w3[1], selector); c1[1] = hc_byte_perm (w3[1], w3[0], selector); c1[0] = hc_byte_perm (w3[0], w2[3], selector); c0[3] = hc_byte_perm (w2[3], w2[2], selector); c0[2] = hc_byte_perm (w2[2], w2[1], selector); c0[1] = hc_byte_perm (w2[1], w2[0], selector); c0[0] = hc_byte_perm (w2[0], w1[3], selector); w7[3] = hc_byte_perm (w1[3], w1[2], selector); w7[2] = hc_byte_perm (w1[2], w1[1], selector); w7[1] = hc_byte_perm (w1[1], w1[0], selector); w7[0] = hc_byte_perm (w1[0], w0[3], selector); w6[3] = hc_byte_perm (w0[3], w0[2], selector); w6[2] = hc_byte_perm (w0[2], w0[1], selector); w6[1] = hc_byte_perm (w0[1], w0[0], selector); w6[0] = hc_byte_perm (w0[0], 0, selector); w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 25: c6[1] = hc_byte_perm ( 0, w7[3], selector); c6[0] = hc_byte_perm (w7[3], w7[2], selector); c5[3] = hc_byte_perm (w7[2], w7[1], selector); c5[2] = hc_byte_perm (w7[1], w7[0], selector); c5[1] = hc_byte_perm (w7[0], w6[3], selector); c5[0] = hc_byte_perm (w6[3], w6[2], selector); c4[3] = hc_byte_perm (w6[2], w6[1], selector); c4[2] = hc_byte_perm (w6[1], w6[0], selector); c4[1] = hc_byte_perm (w6[0], w5[3], selector); c4[0] = hc_byte_perm (w5[3], w5[2], selector); c3[3] = hc_byte_perm (w5[2], w5[1], selector); c3[2] = hc_byte_perm (w5[1], w5[0], selector); c3[1] = hc_byte_perm (w5[0], w4[3], selector); c3[0] = hc_byte_perm (w4[3], w4[2], selector); c2[3] = hc_byte_perm (w4[2], w4[1], selector); c2[2] = hc_byte_perm (w4[1], w4[0], selector); c2[1] = hc_byte_perm (w4[0], w3[3], selector); c2[0] = hc_byte_perm (w3[3], w3[2], selector); c1[3] = hc_byte_perm (w3[2], w3[1], selector); c1[2] = hc_byte_perm (w3[1], w3[0], selector); c1[1] = hc_byte_perm (w3[0], w2[3], selector); c1[0] = hc_byte_perm (w2[3], w2[2], selector); c0[3] = hc_byte_perm (w2[2], w2[1], selector); c0[2] = hc_byte_perm (w2[1], w2[0], selector); c0[1] = hc_byte_perm (w2[0], w1[3], selector); c0[0] = hc_byte_perm (w1[3], w1[2], selector); w7[3] = hc_byte_perm (w1[2], w1[1], selector); w7[2] = hc_byte_perm (w1[1], w1[0], selector); w7[1] = hc_byte_perm (w1[0], w0[3], selector); w7[0] = hc_byte_perm (w0[3], w0[2], selector); w6[3] = hc_byte_perm (w0[2], w0[1], selector); w6[2] = hc_byte_perm (w0[1], w0[0], selector); w6[1] = hc_byte_perm (w0[0], 0, selector); w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 26: c6[2] = hc_byte_perm ( 0, w7[3], selector); c6[1] = hc_byte_perm (w7[3], w7[2], selector); c6[0] = hc_byte_perm (w7[2], w7[1], selector); c5[3] = hc_byte_perm (w7[1], w7[0], selector); c5[2] = hc_byte_perm (w7[0], w6[3], selector); c5[1] = hc_byte_perm (w6[3], w6[2], selector); c5[0] = hc_byte_perm (w6[2], w6[1], selector); c4[3] = hc_byte_perm (w6[1], w6[0], selector); c4[2] = hc_byte_perm (w6[0], w5[3], selector); c4[1] = hc_byte_perm (w5[3], w5[2], selector); c4[0] = hc_byte_perm (w5[2], w5[1], selector); c3[3] = hc_byte_perm (w5[1], w5[0], selector); c3[2] = hc_byte_perm (w5[0], w4[3], selector); c3[1] = hc_byte_perm (w4[3], w4[2], selector); c3[0] = hc_byte_perm (w4[2], w4[1], selector); c2[3] = hc_byte_perm (w4[1], w4[0], selector); c2[2] = hc_byte_perm (w4[0], w3[3], selector); c2[1] = hc_byte_perm (w3[3], w3[2], selector); c2[0] = hc_byte_perm (w3[2], w3[1], selector); c1[3] = hc_byte_perm (w3[1], w3[0], selector); c1[2] = hc_byte_perm (w3[0], w2[3], selector); c1[1] = hc_byte_perm (w2[3], w2[2], selector); c1[0] = hc_byte_perm (w2[2], w2[1], selector); c0[3] = hc_byte_perm (w2[1], w2[0], selector); c0[2] = hc_byte_perm (w2[0], w1[3], selector); c0[1] = hc_byte_perm (w1[3], w1[2], selector); c0[0] = hc_byte_perm (w1[2], w1[1], selector); w7[3] = hc_byte_perm (w1[1], w1[0], selector); w7[2] = hc_byte_perm (w1[0], w0[3], selector); w7[1] = hc_byte_perm (w0[3], w0[2], selector); w7[0] = hc_byte_perm (w0[2], w0[1], selector); w6[3] = hc_byte_perm (w0[1], w0[0], selector); w6[2] = hc_byte_perm (w0[0], 0, selector); w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 27: c6[3] = hc_byte_perm ( 0, w7[3], selector); c6[2] = hc_byte_perm (w7[3], w7[2], selector); c6[1] = hc_byte_perm (w7[2], w7[1], selector); c6[0] = hc_byte_perm (w7[1], w7[0], selector); c5[3] = hc_byte_perm (w7[0], w6[3], selector); c5[2] = hc_byte_perm (w6[3], w6[2], selector); c5[1] = hc_byte_perm (w6[2], w6[1], selector); c5[0] = hc_byte_perm (w6[1], w6[0], selector); c4[3] = hc_byte_perm (w6[0], w5[3], selector); c4[2] = hc_byte_perm (w5[3], w5[2], selector); c4[1] = hc_byte_perm (w5[2], w5[1], selector); c4[0] = hc_byte_perm (w5[1], w5[0], selector); c3[3] = hc_byte_perm (w5[0], w4[3], selector); c3[2] = hc_byte_perm (w4[3], w4[2], selector); c3[1] = hc_byte_perm (w4[2], w4[1], selector); c3[0] = hc_byte_perm (w4[1], w4[0], selector); c2[3] = hc_byte_perm (w4[0], w3[3], selector); c2[2] = hc_byte_perm (w3[3], w3[2], selector); c2[1] = hc_byte_perm (w3[2], w3[1], selector); c2[0] = hc_byte_perm (w3[1], w3[0], selector); c1[3] = hc_byte_perm (w3[0], w2[3], selector); c1[2] = hc_byte_perm (w2[3], w2[2], selector); c1[1] = hc_byte_perm (w2[2], w2[1], selector); c1[0] = hc_byte_perm (w2[1], w2[0], selector); c0[3] = hc_byte_perm (w2[0], w1[3], selector); c0[2] = hc_byte_perm (w1[3], w1[2], selector); c0[1] = hc_byte_perm (w1[2], w1[1], selector); c0[0] = hc_byte_perm (w1[1], w1[0], selector); w7[3] = hc_byte_perm (w1[0], w0[3], selector); w7[2] = hc_byte_perm (w0[3], w0[2], selector); w7[1] = hc_byte_perm (w0[2], w0[1], selector); w7[0] = hc_byte_perm (w0[1], w0[0], selector); w6[3] = hc_byte_perm (w0[0], 0, selector); w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 28: c7[0] = hc_byte_perm ( 0, w7[3], selector); c6[3] = hc_byte_perm (w7[3], w7[2], selector); c6[2] = hc_byte_perm (w7[2], w7[1], selector); c6[1] = hc_byte_perm (w7[1], w7[0], selector); c6[0] = hc_byte_perm (w7[0], w6[3], selector); c5[3] = hc_byte_perm (w6[3], w6[2], selector); c5[2] = hc_byte_perm (w6[2], w6[1], selector); c5[1] = hc_byte_perm (w6[1], w6[0], selector); c5[0] = hc_byte_perm (w6[0], w5[3], selector); c4[3] = hc_byte_perm (w5[3], w5[2], selector); c4[2] = hc_byte_perm (w5[2], w5[1], selector); c4[1] = hc_byte_perm (w5[1], w5[0], selector); c4[0] = hc_byte_perm (w5[0], w4[3], selector); c3[3] = hc_byte_perm (w4[3], w4[2], selector); c3[2] = hc_byte_perm (w4[2], w4[1], selector); c3[1] = hc_byte_perm (w4[1], w4[0], selector); c3[0] = hc_byte_perm (w4[0], w3[3], selector); c2[3] = hc_byte_perm (w3[3], w3[2], selector); c2[2] = hc_byte_perm (w3[2], w3[1], selector); c2[1] = hc_byte_perm (w3[1], w3[0], selector); c2[0] = hc_byte_perm (w3[0], w2[3], selector); c1[3] = hc_byte_perm (w2[3], w2[2], selector); c1[2] = hc_byte_perm (w2[2], w2[1], selector); c1[1] = hc_byte_perm (w2[1], w2[0], selector); c1[0] = hc_byte_perm (w2[0], w1[3], selector); c0[3] = hc_byte_perm (w1[3], w1[2], selector); c0[2] = hc_byte_perm (w1[2], w1[1], selector); c0[1] = hc_byte_perm (w1[1], w1[0], selector); c0[0] = hc_byte_perm (w1[0], w0[3], selector); w7[3] = hc_byte_perm (w0[3], w0[2], selector); w7[2] = hc_byte_perm (w0[2], w0[1], selector); w7[1] = hc_byte_perm (w0[1], w0[0], selector); w7[0] = hc_byte_perm (w0[0], 0, selector); w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 29: c7[1] = hc_byte_perm ( 0, w7[3], selector); c7[0] = hc_byte_perm (w7[3], w7[2], selector); c6[3] = hc_byte_perm (w7[2], w7[1], selector); c6[2] = hc_byte_perm (w7[1], w7[0], selector); c6[1] = hc_byte_perm (w7[0], w6[3], selector); c6[0] = hc_byte_perm (w6[3], w6[2], selector); c5[3] = hc_byte_perm (w6[2], w6[1], selector); c5[2] = hc_byte_perm (w6[1], w6[0], selector); c5[1] = hc_byte_perm (w6[0], w5[3], selector); c5[0] = hc_byte_perm (w5[3], w5[2], selector); c4[3] = hc_byte_perm (w5[2], w5[1], selector); c4[2] = hc_byte_perm (w5[1], w5[0], selector); c4[1] = hc_byte_perm (w5[0], w4[3], selector); c4[0] = hc_byte_perm (w4[3], w4[2], selector); c3[3] = hc_byte_perm (w4[2], w4[1], selector); c3[2] = hc_byte_perm (w4[1], w4[0], selector); c3[1] = hc_byte_perm (w4[0], w3[3], selector); c3[0] = hc_byte_perm (w3[3], w3[2], selector); c2[3] = hc_byte_perm (w3[2], w3[1], selector); c2[2] = hc_byte_perm (w3[1], w3[0], selector); c2[1] = hc_byte_perm (w3[0], w2[3], selector); c2[0] = hc_byte_perm (w2[3], w2[2], selector); c1[3] = hc_byte_perm (w2[2], w2[1], selector); c1[2] = hc_byte_perm (w2[1], w2[0], selector); c1[1] = hc_byte_perm (w2[0], w1[3], selector); c1[0] = hc_byte_perm (w1[3], w1[2], selector); c0[3] = hc_byte_perm (w1[2], w1[1], selector); c0[2] = hc_byte_perm (w1[1], w1[0], selector); c0[1] = hc_byte_perm (w1[0], w0[3], selector); c0[0] = hc_byte_perm (w0[3], w0[2], selector); w7[3] = hc_byte_perm (w0[2], w0[1], selector); w7[2] = hc_byte_perm (w0[1], w0[0], selector); w7[1] = hc_byte_perm (w0[0], 0, selector); w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 30: c7[2] = hc_byte_perm ( 0, w7[3], selector); c7[1] = hc_byte_perm (w7[3], w7[2], selector); c7[0] = hc_byte_perm (w7[2], w7[1], selector); c6[3] = hc_byte_perm (w7[1], w7[0], selector); c6[2] = hc_byte_perm (w7[0], w6[3], selector); c6[1] = hc_byte_perm (w6[3], w6[2], selector); c6[0] = hc_byte_perm (w6[2], w6[1], selector); c5[3] = hc_byte_perm (w6[1], w6[0], selector); c5[2] = hc_byte_perm (w6[0], w5[3], selector); c5[1] = hc_byte_perm (w5[3], w5[2], selector); c5[0] = hc_byte_perm (w5[2], w5[1], selector); c4[3] = hc_byte_perm (w5[1], w5[0], selector); c4[2] = hc_byte_perm (w5[0], w4[3], selector); c4[1] = hc_byte_perm (w4[3], w4[2], selector); c4[0] = hc_byte_perm (w4[2], w4[1], selector); c3[3] = hc_byte_perm (w4[1], w4[0], selector); c3[2] = hc_byte_perm (w4[0], w3[3], selector); c3[1] = hc_byte_perm (w3[3], w3[2], selector); c3[0] = hc_byte_perm (w3[2], w3[1], selector); c2[3] = hc_byte_perm (w3[1], w3[0], selector); c2[2] = hc_byte_perm (w3[0], w2[3], selector); c2[1] = hc_byte_perm (w2[3], w2[2], selector); c2[0] = hc_byte_perm (w2[2], w2[1], selector); c1[3] = hc_byte_perm (w2[1], w2[0], selector); c1[2] = hc_byte_perm (w2[0], w1[3], selector); c1[1] = hc_byte_perm (w1[3], w1[2], selector); c1[0] = hc_byte_perm (w1[2], w1[1], selector); c0[3] = hc_byte_perm (w1[1], w1[0], selector); c0[2] = hc_byte_perm (w1[0], w0[3], selector); c0[1] = hc_byte_perm (w0[3], w0[2], selector); c0[0] = hc_byte_perm (w0[2], w0[1], selector); w7[3] = hc_byte_perm (w0[1], w0[0], selector); w7[2] = hc_byte_perm (w0[0], 0, selector); w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 31: c7[3] = hc_byte_perm ( 0, w7[3], selector); c7[2] = hc_byte_perm (w7[3], w7[2], selector); c7[1] = hc_byte_perm (w7[2], w7[1], selector); c7[0] = hc_byte_perm (w7[1], w7[0], selector); c6[3] = hc_byte_perm (w7[0], w6[3], selector); c6[2] = hc_byte_perm (w6[3], w6[2], selector); c6[1] = hc_byte_perm (w6[2], w6[1], selector); c6[0] = hc_byte_perm (w6[1], w6[0], selector); c5[3] = hc_byte_perm (w6[0], w5[3], selector); c5[2] = hc_byte_perm (w5[3], w5[2], selector); c5[1] = hc_byte_perm (w5[2], w5[1], selector); c5[0] = hc_byte_perm (w5[1], w5[0], selector); c4[3] = hc_byte_perm (w5[0], w4[3], selector); c4[2] = hc_byte_perm (w4[3], w4[2], selector); c4[1] = hc_byte_perm (w4[2], w4[1], selector); c4[0] = hc_byte_perm (w4[1], w4[0], selector); c3[3] = hc_byte_perm (w4[0], w3[3], selector); c3[2] = hc_byte_perm (w3[3], w3[2], selector); c3[1] = hc_byte_perm (w3[2], w3[1], selector); c3[0] = hc_byte_perm (w3[1], w3[0], selector); c2[3] = hc_byte_perm (w3[0], w2[3], selector); c2[2] = hc_byte_perm (w2[3], w2[2], selector); c2[1] = hc_byte_perm (w2[2], w2[1], selector); c2[0] = hc_byte_perm (w2[1], w2[0], selector); c1[3] = hc_byte_perm (w2[0], w1[3], selector); c1[2] = hc_byte_perm (w1[3], w1[2], selector); c1[1] = hc_byte_perm (w1[2], w1[1], selector); c1[0] = hc_byte_perm (w1[1], w1[0], selector); c0[3] = hc_byte_perm (w1[0], w0[3], selector); c0[2] = hc_byte_perm (w0[3], w0[2], selector); c0[1] = hc_byte_perm (w0[2], w0[1], selector); c0[0] = hc_byte_perm (w0[1], w0[0], selector); w7[3] = hc_byte_perm (w0[0], 0, selector); w7[2] = 0; w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_1x64_le (PRIVATE_AS u32x *w, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: w[63] = hc_bytealign (w[62], w[63], offset); w[62] = hc_bytealign (w[61], w[62], offset); w[61] = hc_bytealign (w[60], w[61], offset); w[60] = hc_bytealign (w[59], w[60], offset); w[59] = hc_bytealign (w[58], w[59], offset); w[58] = hc_bytealign (w[57], w[58], offset); w[57] = hc_bytealign (w[56], w[57], offset); w[56] = hc_bytealign (w[55], w[56], offset); w[55] = hc_bytealign (w[54], w[55], offset); w[54] = hc_bytealign (w[53], w[54], offset); w[53] = hc_bytealign (w[52], w[53], offset); w[52] = hc_bytealign (w[51], w[52], offset); w[51] = hc_bytealign (w[50], w[51], offset); w[50] = hc_bytealign (w[49], w[50], offset); w[49] = hc_bytealign (w[48], w[49], offset); w[48] = hc_bytealign (w[47], w[48], offset); w[47] = hc_bytealign (w[46], w[47], offset); w[46] = hc_bytealign (w[45], w[46], offset); w[45] = hc_bytealign (w[44], w[45], offset); w[44] = hc_bytealign (w[43], w[44], offset); w[43] = hc_bytealign (w[42], w[43], offset); w[42] = hc_bytealign (w[41], w[42], offset); w[41] = hc_bytealign (w[40], w[41], offset); w[40] = hc_bytealign (w[39], w[40], offset); w[39] = hc_bytealign (w[38], w[39], offset); w[38] = hc_bytealign (w[37], w[38], offset); w[37] = hc_bytealign (w[36], w[37], offset); w[36] = hc_bytealign (w[35], w[36], offset); w[35] = hc_bytealign (w[34], w[35], offset); w[34] = hc_bytealign (w[33], w[34], offset); w[33] = hc_bytealign (w[32], w[33], offset); w[32] = hc_bytealign (w[31], w[32], offset); w[31] = hc_bytealign (w[30], w[31], offset); w[30] = hc_bytealign (w[29], w[30], offset); w[29] = hc_bytealign (w[28], w[29], offset); w[28] = hc_bytealign (w[27], w[28], offset); w[27] = hc_bytealign (w[26], w[27], offset); w[26] = hc_bytealign (w[25], w[26], offset); w[25] = hc_bytealign (w[24], w[25], offset); w[24] = hc_bytealign (w[23], w[24], offset); w[23] = hc_bytealign (w[22], w[23], offset); w[22] = hc_bytealign (w[21], w[22], offset); w[21] = hc_bytealign (w[20], w[21], offset); w[20] = hc_bytealign (w[19], w[20], offset); w[19] = hc_bytealign (w[18], w[19], offset); w[18] = hc_bytealign (w[17], w[18], offset); w[17] = hc_bytealign (w[16], w[17], offset); w[16] = hc_bytealign (w[15], w[16], offset); w[15] = hc_bytealign (w[14], w[15], offset); w[14] = hc_bytealign (w[13], w[14], offset); w[13] = hc_bytealign (w[12], w[13], offset); w[12] = hc_bytealign (w[11], w[12], offset); w[11] = hc_bytealign (w[10], w[11], offset); w[10] = hc_bytealign (w[ 9], w[10], offset); w[ 9] = hc_bytealign (w[ 8], w[ 9], offset); w[ 8] = hc_bytealign (w[ 7], w[ 8], offset); w[ 7] = hc_bytealign (w[ 6], w[ 7], offset); w[ 6] = hc_bytealign (w[ 5], w[ 6], offset); w[ 5] = hc_bytealign (w[ 4], w[ 5], offset); w[ 4] = hc_bytealign (w[ 3], w[ 4], offset); w[ 3] = hc_bytealign (w[ 2], w[ 3], offset); w[ 2] = hc_bytealign (w[ 1], w[ 2], offset); w[ 1] = hc_bytealign (w[ 0], w[ 1], offset); w[ 0] = hc_bytealign ( 0, w[ 0], offset); break; case 1: w[63] = hc_bytealign (w[61], w[62], offset); w[62] = hc_bytealign (w[60], w[61], offset); w[61] = hc_bytealign (w[59], w[60], offset); w[60] = hc_bytealign (w[58], w[59], offset); w[59] = hc_bytealign (w[57], w[58], offset); w[58] = hc_bytealign (w[56], w[57], offset); w[57] = hc_bytealign (w[55], w[56], offset); w[56] = hc_bytealign (w[54], w[55], offset); w[55] = hc_bytealign (w[53], w[54], offset); w[54] = hc_bytealign (w[52], w[53], offset); w[53] = hc_bytealign (w[51], w[52], offset); w[52] = hc_bytealign (w[50], w[51], offset); w[51] = hc_bytealign (w[49], w[50], offset); w[50] = hc_bytealign (w[48], w[49], offset); w[49] = hc_bytealign (w[47], w[48], offset); w[48] = hc_bytealign (w[46], w[47], offset); w[47] = hc_bytealign (w[45], w[46], offset); w[46] = hc_bytealign (w[44], w[45], offset); w[45] = hc_bytealign (w[43], w[44], offset); w[44] = hc_bytealign (w[42], w[43], offset); w[43] = hc_bytealign (w[41], w[42], offset); w[42] = hc_bytealign (w[40], w[41], offset); w[41] = hc_bytealign (w[39], w[40], offset); w[40] = hc_bytealign (w[38], w[39], offset); w[39] = hc_bytealign (w[37], w[38], offset); w[38] = hc_bytealign (w[36], w[37], offset); w[37] = hc_bytealign (w[35], w[36], offset); w[36] = hc_bytealign (w[34], w[35], offset); w[35] = hc_bytealign (w[33], w[34], offset); w[34] = hc_bytealign (w[32], w[33], offset); w[33] = hc_bytealign (w[31], w[32], offset); w[32] = hc_bytealign (w[30], w[31], offset); w[31] = hc_bytealign (w[29], w[30], offset); w[30] = hc_bytealign (w[28], w[29], offset); w[29] = hc_bytealign (w[27], w[28], offset); w[28] = hc_bytealign (w[26], w[27], offset); w[27] = hc_bytealign (w[25], w[26], offset); w[26] = hc_bytealign (w[24], w[25], offset); w[25] = hc_bytealign (w[23], w[24], offset); w[24] = hc_bytealign (w[22], w[23], offset); w[23] = hc_bytealign (w[21], w[22], offset); w[22] = hc_bytealign (w[20], w[21], offset); w[21] = hc_bytealign (w[19], w[20], offset); w[20] = hc_bytealign (w[18], w[19], offset); w[19] = hc_bytealign (w[17], w[18], offset); w[18] = hc_bytealign (w[16], w[17], offset); w[17] = hc_bytealign (w[15], w[16], offset); w[16] = hc_bytealign (w[14], w[15], offset); w[15] = hc_bytealign (w[13], w[14], offset); w[14] = hc_bytealign (w[12], w[13], offset); w[13] = hc_bytealign (w[11], w[12], offset); w[12] = hc_bytealign (w[10], w[11], offset); w[11] = hc_bytealign (w[ 9], w[10], offset); w[10] = hc_bytealign (w[ 8], w[ 9], offset); w[ 9] = hc_bytealign (w[ 7], w[ 8], offset); w[ 8] = hc_bytealign (w[ 6], w[ 7], offset); w[ 7] = hc_bytealign (w[ 5], w[ 6], offset); w[ 6] = hc_bytealign (w[ 4], w[ 5], offset); w[ 5] = hc_bytealign (w[ 3], w[ 4], offset); w[ 4] = hc_bytealign (w[ 2], w[ 3], offset); w[ 3] = hc_bytealign (w[ 1], w[ 2], offset); w[ 2] = hc_bytealign (w[ 0], w[ 1], offset); w[ 1] = hc_bytealign ( 0, w[ 0], offset); w[ 0] = 0; break; case 2: w[63] = hc_bytealign (w[60], w[61], offset); w[62] = hc_bytealign (w[59], w[60], offset); w[61] = hc_bytealign (w[58], w[59], offset); w[60] = hc_bytealign (w[57], w[58], offset); w[59] = hc_bytealign (w[56], w[57], offset); w[58] = hc_bytealign (w[55], w[56], offset); w[57] = hc_bytealign (w[54], w[55], offset); w[56] = hc_bytealign (w[53], w[54], offset); w[55] = hc_bytealign (w[52], w[53], offset); w[54] = hc_bytealign (w[51], w[52], offset); w[53] = hc_bytealign (w[50], w[51], offset); w[52] = hc_bytealign (w[49], w[50], offset); w[51] = hc_bytealign (w[48], w[49], offset); w[50] = hc_bytealign (w[47], w[48], offset); w[49] = hc_bytealign (w[46], w[47], offset); w[48] = hc_bytealign (w[45], w[46], offset); w[47] = hc_bytealign (w[44], w[45], offset); w[46] = hc_bytealign (w[43], w[44], offset); w[45] = hc_bytealign (w[42], w[43], offset); w[44] = hc_bytealign (w[41], w[42], offset); w[43] = hc_bytealign (w[40], w[41], offset); w[42] = hc_bytealign (w[39], w[40], offset); w[41] = hc_bytealign (w[38], w[39], offset); w[40] = hc_bytealign (w[37], w[38], offset); w[39] = hc_bytealign (w[36], w[37], offset); w[38] = hc_bytealign (w[35], w[36], offset); w[37] = hc_bytealign (w[34], w[35], offset); w[36] = hc_bytealign (w[33], w[34], offset); w[35] = hc_bytealign (w[32], w[33], offset); w[34] = hc_bytealign (w[31], w[32], offset); w[33] = hc_bytealign (w[30], w[31], offset); w[32] = hc_bytealign (w[29], w[30], offset); w[31] = hc_bytealign (w[28], w[29], offset); w[30] = hc_bytealign (w[27], w[28], offset); w[29] = hc_bytealign (w[26], w[27], offset); w[28] = hc_bytealign (w[25], w[26], offset); w[27] = hc_bytealign (w[24], w[25], offset); w[26] = hc_bytealign (w[23], w[24], offset); w[25] = hc_bytealign (w[22], w[23], offset); w[24] = hc_bytealign (w[21], w[22], offset); w[23] = hc_bytealign (w[20], w[21], offset); w[22] = hc_bytealign (w[19], w[20], offset); w[21] = hc_bytealign (w[18], w[19], offset); w[20] = hc_bytealign (w[17], w[18], offset); w[19] = hc_bytealign (w[16], w[17], offset); w[18] = hc_bytealign (w[15], w[16], offset); w[17] = hc_bytealign (w[14], w[15], offset); w[16] = hc_bytealign (w[13], w[14], offset); w[15] = hc_bytealign (w[12], w[13], offset); w[14] = hc_bytealign (w[11], w[12], offset); w[13] = hc_bytealign (w[10], w[11], offset); w[12] = hc_bytealign (w[ 9], w[10], offset); w[11] = hc_bytealign (w[ 8], w[ 9], offset); w[10] = hc_bytealign (w[ 7], w[ 8], offset); w[ 9] = hc_bytealign (w[ 6], w[ 7], offset); w[ 8] = hc_bytealign (w[ 5], w[ 6], offset); w[ 7] = hc_bytealign (w[ 4], w[ 5], offset); w[ 6] = hc_bytealign (w[ 3], w[ 4], offset); w[ 5] = hc_bytealign (w[ 2], w[ 3], offset); w[ 4] = hc_bytealign (w[ 1], w[ 2], offset); w[ 3] = hc_bytealign (w[ 0], w[ 1], offset); w[ 2] = hc_bytealign ( 0, w[ 0], offset); w[ 1] = 0; w[ 0] = 0; break; case 3: w[63] = hc_bytealign (w[59], w[60], offset); w[62] = hc_bytealign (w[58], w[59], offset); w[61] = hc_bytealign (w[57], w[58], offset); w[60] = hc_bytealign (w[56], w[57], offset); w[59] = hc_bytealign (w[55], w[56], offset); w[58] = hc_bytealign (w[54], w[55], offset); w[57] = hc_bytealign (w[53], w[54], offset); w[56] = hc_bytealign (w[52], w[53], offset); w[55] = hc_bytealign (w[51], w[52], offset); w[54] = hc_bytealign (w[50], w[51], offset); w[53] = hc_bytealign (w[49], w[50], offset); w[52] = hc_bytealign (w[48], w[49], offset); w[51] = hc_bytealign (w[47], w[48], offset); w[50] = hc_bytealign (w[46], w[47], offset); w[49] = hc_bytealign (w[45], w[46], offset); w[48] = hc_bytealign (w[44], w[45], offset); w[47] = hc_bytealign (w[43], w[44], offset); w[46] = hc_bytealign (w[42], w[43], offset); w[45] = hc_bytealign (w[41], w[42], offset); w[44] = hc_bytealign (w[40], w[41], offset); w[43] = hc_bytealign (w[39], w[40], offset); w[42] = hc_bytealign (w[38], w[39], offset); w[41] = hc_bytealign (w[37], w[38], offset); w[40] = hc_bytealign (w[36], w[37], offset); w[39] = hc_bytealign (w[35], w[36], offset); w[38] = hc_bytealign (w[34], w[35], offset); w[37] = hc_bytealign (w[33], w[34], offset); w[36] = hc_bytealign (w[32], w[33], offset); w[35] = hc_bytealign (w[31], w[32], offset); w[34] = hc_bytealign (w[30], w[31], offset); w[33] = hc_bytealign (w[29], w[30], offset); w[32] = hc_bytealign (w[28], w[29], offset); w[31] = hc_bytealign (w[27], w[28], offset); w[30] = hc_bytealign (w[26], w[27], offset); w[29] = hc_bytealign (w[25], w[26], offset); w[28] = hc_bytealign (w[24], w[25], offset); w[27] = hc_bytealign (w[23], w[24], offset); w[26] = hc_bytealign (w[22], w[23], offset); w[25] = hc_bytealign (w[21], w[22], offset); w[24] = hc_bytealign (w[20], w[21], offset); w[23] = hc_bytealign (w[19], w[20], offset); w[22] = hc_bytealign (w[18], w[19], offset); w[21] = hc_bytealign (w[17], w[18], offset); w[20] = hc_bytealign (w[16], w[17], offset); w[19] = hc_bytealign (w[15], w[16], offset); w[18] = hc_bytealign (w[14], w[15], offset); w[17] = hc_bytealign (w[13], w[14], offset); w[16] = hc_bytealign (w[12], w[13], offset); w[15] = hc_bytealign (w[11], w[12], offset); w[14] = hc_bytealign (w[10], w[11], offset); w[13] = hc_bytealign (w[ 9], w[10], offset); w[12] = hc_bytealign (w[ 8], w[ 9], offset); w[11] = hc_bytealign (w[ 7], w[ 8], offset); w[10] = hc_bytealign (w[ 6], w[ 7], offset); w[ 9] = hc_bytealign (w[ 5], w[ 6], offset); w[ 8] = hc_bytealign (w[ 4], w[ 5], offset); w[ 7] = hc_bytealign (w[ 3], w[ 4], offset); w[ 6] = hc_bytealign (w[ 2], w[ 3], offset); w[ 5] = hc_bytealign (w[ 1], w[ 2], offset); w[ 4] = hc_bytealign (w[ 0], w[ 1], offset); w[ 3] = hc_bytealign ( 0, w[ 0], offset); w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 4: w[63] = hc_bytealign (w[58], w[59], offset); w[62] = hc_bytealign (w[57], w[58], offset); w[61] = hc_bytealign (w[56], w[57], offset); w[60] = hc_bytealign (w[55], w[56], offset); w[59] = hc_bytealign (w[54], w[55], offset); w[58] = hc_bytealign (w[53], w[54], offset); w[57] = hc_bytealign (w[52], w[53], offset); w[56] = hc_bytealign (w[51], w[52], offset); w[55] = hc_bytealign (w[50], w[51], offset); w[54] = hc_bytealign (w[49], w[50], offset); w[53] = hc_bytealign (w[48], w[49], offset); w[52] = hc_bytealign (w[47], w[48], offset); w[51] = hc_bytealign (w[46], w[47], offset); w[50] = hc_bytealign (w[45], w[46], offset); w[49] = hc_bytealign (w[44], w[45], offset); w[48] = hc_bytealign (w[43], w[44], offset); w[47] = hc_bytealign (w[42], w[43], offset); w[46] = hc_bytealign (w[41], w[42], offset); w[45] = hc_bytealign (w[40], w[41], offset); w[44] = hc_bytealign (w[39], w[40], offset); w[43] = hc_bytealign (w[38], w[39], offset); w[42] = hc_bytealign (w[37], w[38], offset); w[41] = hc_bytealign (w[36], w[37], offset); w[40] = hc_bytealign (w[35], w[36], offset); w[39] = hc_bytealign (w[34], w[35], offset); w[38] = hc_bytealign (w[33], w[34], offset); w[37] = hc_bytealign (w[32], w[33], offset); w[36] = hc_bytealign (w[31], w[32], offset); w[35] = hc_bytealign (w[30], w[31], offset); w[34] = hc_bytealign (w[29], w[30], offset); w[33] = hc_bytealign (w[28], w[29], offset); w[32] = hc_bytealign (w[27], w[28], offset); w[31] = hc_bytealign (w[26], w[27], offset); w[30] = hc_bytealign (w[25], w[26], offset); w[29] = hc_bytealign (w[24], w[25], offset); w[28] = hc_bytealign (w[23], w[24], offset); w[27] = hc_bytealign (w[22], w[23], offset); w[26] = hc_bytealign (w[21], w[22], offset); w[25] = hc_bytealign (w[20], w[21], offset); w[24] = hc_bytealign (w[19], w[20], offset); w[23] = hc_bytealign (w[18], w[19], offset); w[22] = hc_bytealign (w[17], w[18], offset); w[21] = hc_bytealign (w[16], w[17], offset); w[20] = hc_bytealign (w[15], w[16], offset); w[19] = hc_bytealign (w[14], w[15], offset); w[18] = hc_bytealign (w[13], w[14], offset); w[17] = hc_bytealign (w[12], w[13], offset); w[16] = hc_bytealign (w[11], w[12], offset); w[15] = hc_bytealign (w[10], w[11], offset); w[14] = hc_bytealign (w[ 9], w[10], offset); w[13] = hc_bytealign (w[ 8], w[ 9], offset); w[12] = hc_bytealign (w[ 7], w[ 8], offset); w[11] = hc_bytealign (w[ 6], w[ 7], offset); w[10] = hc_bytealign (w[ 5], w[ 6], offset); w[ 9] = hc_bytealign (w[ 4], w[ 5], offset); w[ 8] = hc_bytealign (w[ 3], w[ 4], offset); w[ 7] = hc_bytealign (w[ 2], w[ 3], offset); w[ 6] = hc_bytealign (w[ 1], w[ 2], offset); w[ 5] = hc_bytealign (w[ 0], w[ 1], offset); w[ 4] = hc_bytealign ( 0, w[ 0], offset); w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 5: w[63] = hc_bytealign (w[57], w[58], offset); w[62] = hc_bytealign (w[56], w[57], offset); w[61] = hc_bytealign (w[55], w[56], offset); w[60] = hc_bytealign (w[54], w[55], offset); w[59] = hc_bytealign (w[53], w[54], offset); w[58] = hc_bytealign (w[52], w[53], offset); w[57] = hc_bytealign (w[51], w[52], offset); w[56] = hc_bytealign (w[50], w[51], offset); w[55] = hc_bytealign (w[49], w[50], offset); w[54] = hc_bytealign (w[48], w[49], offset); w[53] = hc_bytealign (w[47], w[48], offset); w[52] = hc_bytealign (w[46], w[47], offset); w[51] = hc_bytealign (w[45], w[46], offset); w[50] = hc_bytealign (w[44], w[45], offset); w[49] = hc_bytealign (w[43], w[44], offset); w[48] = hc_bytealign (w[42], w[43], offset); w[47] = hc_bytealign (w[41], w[42], offset); w[46] = hc_bytealign (w[40], w[41], offset); w[45] = hc_bytealign (w[39], w[40], offset); w[44] = hc_bytealign (w[38], w[39], offset); w[43] = hc_bytealign (w[37], w[38], offset); w[42] = hc_bytealign (w[36], w[37], offset); w[41] = hc_bytealign (w[35], w[36], offset); w[40] = hc_bytealign (w[34], w[35], offset); w[39] = hc_bytealign (w[33], w[34], offset); w[38] = hc_bytealign (w[32], w[33], offset); w[37] = hc_bytealign (w[31], w[32], offset); w[36] = hc_bytealign (w[30], w[31], offset); w[35] = hc_bytealign (w[29], w[30], offset); w[34] = hc_bytealign (w[28], w[29], offset); w[33] = hc_bytealign (w[27], w[28], offset); w[32] = hc_bytealign (w[26], w[27], offset); w[31] = hc_bytealign (w[25], w[26], offset); w[30] = hc_bytealign (w[24], w[25], offset); w[29] = hc_bytealign (w[23], w[24], offset); w[28] = hc_bytealign (w[22], w[23], offset); w[27] = hc_bytealign (w[21], w[22], offset); w[26] = hc_bytealign (w[20], w[21], offset); w[25] = hc_bytealign (w[19], w[20], offset); w[24] = hc_bytealign (w[18], w[19], offset); w[23] = hc_bytealign (w[17], w[18], offset); w[22] = hc_bytealign (w[16], w[17], offset); w[21] = hc_bytealign (w[15], w[16], offset); w[20] = hc_bytealign (w[14], w[15], offset); w[19] = hc_bytealign (w[13], w[14], offset); w[18] = hc_bytealign (w[12], w[13], offset); w[17] = hc_bytealign (w[11], w[12], offset); w[16] = hc_bytealign (w[10], w[11], offset); w[15] = hc_bytealign (w[ 9], w[10], offset); w[14] = hc_bytealign (w[ 8], w[ 9], offset); w[13] = hc_bytealign (w[ 7], w[ 8], offset); w[12] = hc_bytealign (w[ 6], w[ 7], offset); w[11] = hc_bytealign (w[ 5], w[ 6], offset); w[10] = hc_bytealign (w[ 4], w[ 5], offset); w[ 9] = hc_bytealign (w[ 3], w[ 4], offset); w[ 8] = hc_bytealign (w[ 2], w[ 3], offset); w[ 7] = hc_bytealign (w[ 1], w[ 2], offset); w[ 6] = hc_bytealign (w[ 0], w[ 1], offset); w[ 5] = hc_bytealign ( 0, w[ 0], offset); w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 6: w[63] = hc_bytealign (w[56], w[57], offset); w[62] = hc_bytealign (w[55], w[56], offset); w[61] = hc_bytealign (w[54], w[55], offset); w[60] = hc_bytealign (w[53], w[54], offset); w[59] = hc_bytealign (w[52], w[53], offset); w[58] = hc_bytealign (w[51], w[52], offset); w[57] = hc_bytealign (w[50], w[51], offset); w[56] = hc_bytealign (w[49], w[50], offset); w[55] = hc_bytealign (w[48], w[49], offset); w[54] = hc_bytealign (w[47], w[48], offset); w[53] = hc_bytealign (w[46], w[47], offset); w[52] = hc_bytealign (w[45], w[46], offset); w[51] = hc_bytealign (w[44], w[45], offset); w[50] = hc_bytealign (w[43], w[44], offset); w[49] = hc_bytealign (w[42], w[43], offset); w[48] = hc_bytealign (w[41], w[42], offset); w[47] = hc_bytealign (w[40], w[41], offset); w[46] = hc_bytealign (w[39], w[40], offset); w[45] = hc_bytealign (w[38], w[39], offset); w[44] = hc_bytealign (w[37], w[38], offset); w[43] = hc_bytealign (w[36], w[37], offset); w[42] = hc_bytealign (w[35], w[36], offset); w[41] = hc_bytealign (w[34], w[35], offset); w[40] = hc_bytealign (w[33], w[34], offset); w[39] = hc_bytealign (w[32], w[33], offset); w[38] = hc_bytealign (w[31], w[32], offset); w[37] = hc_bytealign (w[30], w[31], offset); w[36] = hc_bytealign (w[29], w[30], offset); w[35] = hc_bytealign (w[28], w[29], offset); w[34] = hc_bytealign (w[27], w[28], offset); w[33] = hc_bytealign (w[26], w[27], offset); w[32] = hc_bytealign (w[25], w[26], offset); w[31] = hc_bytealign (w[24], w[25], offset); w[30] = hc_bytealign (w[23], w[24], offset); w[29] = hc_bytealign (w[22], w[23], offset); w[28] = hc_bytealign (w[21], w[22], offset); w[27] = hc_bytealign (w[20], w[21], offset); w[26] = hc_bytealign (w[19], w[20], offset); w[25] = hc_bytealign (w[18], w[19], offset); w[24] = hc_bytealign (w[17], w[18], offset); w[23] = hc_bytealign (w[16], w[17], offset); w[22] = hc_bytealign (w[15], w[16], offset); w[21] = hc_bytealign (w[14], w[15], offset); w[20] = hc_bytealign (w[13], w[14], offset); w[19] = hc_bytealign (w[12], w[13], offset); w[18] = hc_bytealign (w[11], w[12], offset); w[17] = hc_bytealign (w[10], w[11], offset); w[16] = hc_bytealign (w[ 9], w[10], offset); w[15] = hc_bytealign (w[ 8], w[ 9], offset); w[14] = hc_bytealign (w[ 7], w[ 8], offset); w[13] = hc_bytealign (w[ 6], w[ 7], offset); w[12] = hc_bytealign (w[ 5], w[ 6], offset); w[11] = hc_bytealign (w[ 4], w[ 5], offset); w[10] = hc_bytealign (w[ 3], w[ 4], offset); w[ 9] = hc_bytealign (w[ 2], w[ 3], offset); w[ 8] = hc_bytealign (w[ 1], w[ 2], offset); w[ 7] = hc_bytealign (w[ 0], w[ 1], offset); w[ 6] = hc_bytealign ( 0, w[ 0], offset); w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 7: w[63] = hc_bytealign (w[55], w[56], offset); w[62] = hc_bytealign (w[54], w[55], offset); w[61] = hc_bytealign (w[53], w[54], offset); w[60] = hc_bytealign (w[52], w[53], offset); w[59] = hc_bytealign (w[51], w[52], offset); w[58] = hc_bytealign (w[50], w[51], offset); w[57] = hc_bytealign (w[49], w[50], offset); w[56] = hc_bytealign (w[48], w[49], offset); w[55] = hc_bytealign (w[47], w[48], offset); w[54] = hc_bytealign (w[46], w[47], offset); w[53] = hc_bytealign (w[45], w[46], offset); w[52] = hc_bytealign (w[44], w[45], offset); w[51] = hc_bytealign (w[43], w[44], offset); w[50] = hc_bytealign (w[42], w[43], offset); w[49] = hc_bytealign (w[41], w[42], offset); w[48] = hc_bytealign (w[40], w[41], offset); w[47] = hc_bytealign (w[39], w[40], offset); w[46] = hc_bytealign (w[38], w[39], offset); w[45] = hc_bytealign (w[37], w[38], offset); w[44] = hc_bytealign (w[36], w[37], offset); w[43] = hc_bytealign (w[35], w[36], offset); w[42] = hc_bytealign (w[34], w[35], offset); w[41] = hc_bytealign (w[33], w[34], offset); w[40] = hc_bytealign (w[32], w[33], offset); w[39] = hc_bytealign (w[31], w[32], offset); w[38] = hc_bytealign (w[30], w[31], offset); w[37] = hc_bytealign (w[29], w[30], offset); w[36] = hc_bytealign (w[28], w[29], offset); w[35] = hc_bytealign (w[27], w[28], offset); w[34] = hc_bytealign (w[26], w[27], offset); w[33] = hc_bytealign (w[25], w[26], offset); w[32] = hc_bytealign (w[24], w[25], offset); w[31] = hc_bytealign (w[23], w[24], offset); w[30] = hc_bytealign (w[22], w[23], offset); w[29] = hc_bytealign (w[21], w[22], offset); w[28] = hc_bytealign (w[20], w[21], offset); w[27] = hc_bytealign (w[19], w[20], offset); w[26] = hc_bytealign (w[18], w[19], offset); w[25] = hc_bytealign (w[17], w[18], offset); w[24] = hc_bytealign (w[16], w[17], offset); w[23] = hc_bytealign (w[15], w[16], offset); w[22] = hc_bytealign (w[14], w[15], offset); w[21] = hc_bytealign (w[13], w[14], offset); w[20] = hc_bytealign (w[12], w[13], offset); w[19] = hc_bytealign (w[11], w[12], offset); w[18] = hc_bytealign (w[10], w[11], offset); w[17] = hc_bytealign (w[ 9], w[10], offset); w[16] = hc_bytealign (w[ 8], w[ 9], offset); w[15] = hc_bytealign (w[ 7], w[ 8], offset); w[14] = hc_bytealign (w[ 6], w[ 7], offset); w[13] = hc_bytealign (w[ 5], w[ 6], offset); w[12] = hc_bytealign (w[ 4], w[ 5], offset); w[11] = hc_bytealign (w[ 3], w[ 4], offset); w[10] = hc_bytealign (w[ 2], w[ 3], offset); w[ 9] = hc_bytealign (w[ 1], w[ 2], offset); w[ 8] = hc_bytealign (w[ 0], w[ 1], offset); w[ 7] = hc_bytealign ( 0, w[ 0], offset); w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 8: w[63] = hc_bytealign (w[54], w[55], offset); w[62] = hc_bytealign (w[53], w[54], offset); w[61] = hc_bytealign (w[52], w[53], offset); w[60] = hc_bytealign (w[51], w[52], offset); w[59] = hc_bytealign (w[50], w[51], offset); w[58] = hc_bytealign (w[49], w[50], offset); w[57] = hc_bytealign (w[48], w[49], offset); w[56] = hc_bytealign (w[47], w[48], offset); w[55] = hc_bytealign (w[46], w[47], offset); w[54] = hc_bytealign (w[45], w[46], offset); w[53] = hc_bytealign (w[44], w[45], offset); w[52] = hc_bytealign (w[43], w[44], offset); w[51] = hc_bytealign (w[42], w[43], offset); w[50] = hc_bytealign (w[41], w[42], offset); w[49] = hc_bytealign (w[40], w[41], offset); w[48] = hc_bytealign (w[39], w[40], offset); w[47] = hc_bytealign (w[38], w[39], offset); w[46] = hc_bytealign (w[37], w[38], offset); w[45] = hc_bytealign (w[36], w[37], offset); w[44] = hc_bytealign (w[35], w[36], offset); w[43] = hc_bytealign (w[34], w[35], offset); w[42] = hc_bytealign (w[33], w[34], offset); w[41] = hc_bytealign (w[32], w[33], offset); w[40] = hc_bytealign (w[31], w[32], offset); w[39] = hc_bytealign (w[30], w[31], offset); w[38] = hc_bytealign (w[29], w[30], offset); w[37] = hc_bytealign (w[28], w[29], offset); w[36] = hc_bytealign (w[27], w[28], offset); w[35] = hc_bytealign (w[26], w[27], offset); w[34] = hc_bytealign (w[25], w[26], offset); w[33] = hc_bytealign (w[24], w[25], offset); w[32] = hc_bytealign (w[23], w[24], offset); w[31] = hc_bytealign (w[22], w[23], offset); w[30] = hc_bytealign (w[21], w[22], offset); w[29] = hc_bytealign (w[20], w[21], offset); w[28] = hc_bytealign (w[19], w[20], offset); w[27] = hc_bytealign (w[18], w[19], offset); w[26] = hc_bytealign (w[17], w[18], offset); w[25] = hc_bytealign (w[16], w[17], offset); w[24] = hc_bytealign (w[15], w[16], offset); w[23] = hc_bytealign (w[14], w[15], offset); w[22] = hc_bytealign (w[13], w[14], offset); w[21] = hc_bytealign (w[12], w[13], offset); w[20] = hc_bytealign (w[11], w[12], offset); w[19] = hc_bytealign (w[10], w[11], offset); w[18] = hc_bytealign (w[ 9], w[10], offset); w[17] = hc_bytealign (w[ 8], w[ 9], offset); w[16] = hc_bytealign (w[ 7], w[ 8], offset); w[15] = hc_bytealign (w[ 6], w[ 7], offset); w[14] = hc_bytealign (w[ 5], w[ 6], offset); w[13] = hc_bytealign (w[ 4], w[ 5], offset); w[12] = hc_bytealign (w[ 3], w[ 4], offset); w[11] = hc_bytealign (w[ 2], w[ 3], offset); w[10] = hc_bytealign (w[ 1], w[ 2], offset); w[ 9] = hc_bytealign (w[ 0], w[ 1], offset); w[ 8] = hc_bytealign ( 0, w[ 0], offset); w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 9: w[63] = hc_bytealign (w[53], w[54], offset); w[62] = hc_bytealign (w[52], w[53], offset); w[61] = hc_bytealign (w[51], w[52], offset); w[60] = hc_bytealign (w[50], w[51], offset); w[59] = hc_bytealign (w[49], w[50], offset); w[58] = hc_bytealign (w[48], w[49], offset); w[57] = hc_bytealign (w[47], w[48], offset); w[56] = hc_bytealign (w[46], w[47], offset); w[55] = hc_bytealign (w[45], w[46], offset); w[54] = hc_bytealign (w[44], w[45], offset); w[53] = hc_bytealign (w[43], w[44], offset); w[52] = hc_bytealign (w[42], w[43], offset); w[51] = hc_bytealign (w[41], w[42], offset); w[50] = hc_bytealign (w[40], w[41], offset); w[49] = hc_bytealign (w[39], w[40], offset); w[48] = hc_bytealign (w[38], w[39], offset); w[47] = hc_bytealign (w[37], w[38], offset); w[46] = hc_bytealign (w[36], w[37], offset); w[45] = hc_bytealign (w[35], w[36], offset); w[44] = hc_bytealign (w[34], w[35], offset); w[43] = hc_bytealign (w[33], w[34], offset); w[42] = hc_bytealign (w[32], w[33], offset); w[41] = hc_bytealign (w[31], w[32], offset); w[40] = hc_bytealign (w[30], w[31], offset); w[39] = hc_bytealign (w[29], w[30], offset); w[38] = hc_bytealign (w[28], w[29], offset); w[37] = hc_bytealign (w[27], w[28], offset); w[36] = hc_bytealign (w[26], w[27], offset); w[35] = hc_bytealign (w[25], w[26], offset); w[34] = hc_bytealign (w[24], w[25], offset); w[33] = hc_bytealign (w[23], w[24], offset); w[32] = hc_bytealign (w[22], w[23], offset); w[31] = hc_bytealign (w[21], w[22], offset); w[30] = hc_bytealign (w[20], w[21], offset); w[29] = hc_bytealign (w[19], w[20], offset); w[28] = hc_bytealign (w[18], w[19], offset); w[27] = hc_bytealign (w[17], w[18], offset); w[26] = hc_bytealign (w[16], w[17], offset); w[25] = hc_bytealign (w[15], w[16], offset); w[24] = hc_bytealign (w[14], w[15], offset); w[23] = hc_bytealign (w[13], w[14], offset); w[22] = hc_bytealign (w[12], w[13], offset); w[21] = hc_bytealign (w[11], w[12], offset); w[20] = hc_bytealign (w[10], w[11], offset); w[19] = hc_bytealign (w[ 9], w[10], offset); w[18] = hc_bytealign (w[ 8], w[ 9], offset); w[17] = hc_bytealign (w[ 7], w[ 8], offset); w[16] = hc_bytealign (w[ 6], w[ 7], offset); w[15] = hc_bytealign (w[ 5], w[ 6], offset); w[14] = hc_bytealign (w[ 4], w[ 5], offset); w[13] = hc_bytealign (w[ 3], w[ 4], offset); w[12] = hc_bytealign (w[ 2], w[ 3], offset); w[11] = hc_bytealign (w[ 1], w[ 2], offset); w[10] = hc_bytealign (w[ 0], w[ 1], offset); w[ 9] = hc_bytealign ( 0, w[ 0], offset); w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 10: w[63] = hc_bytealign (w[52], w[53], offset); w[62] = hc_bytealign (w[51], w[52], offset); w[61] = hc_bytealign (w[50], w[51], offset); w[60] = hc_bytealign (w[49], w[50], offset); w[59] = hc_bytealign (w[48], w[49], offset); w[58] = hc_bytealign (w[47], w[48], offset); w[57] = hc_bytealign (w[46], w[47], offset); w[56] = hc_bytealign (w[45], w[46], offset); w[55] = hc_bytealign (w[44], w[45], offset); w[54] = hc_bytealign (w[43], w[44], offset); w[53] = hc_bytealign (w[42], w[43], offset); w[52] = hc_bytealign (w[41], w[42], offset); w[51] = hc_bytealign (w[40], w[41], offset); w[50] = hc_bytealign (w[39], w[40], offset); w[49] = hc_bytealign (w[38], w[39], offset); w[48] = hc_bytealign (w[37], w[38], offset); w[47] = hc_bytealign (w[36], w[37], offset); w[46] = hc_bytealign (w[35], w[36], offset); w[45] = hc_bytealign (w[34], w[35], offset); w[44] = hc_bytealign (w[33], w[34], offset); w[43] = hc_bytealign (w[32], w[33], offset); w[42] = hc_bytealign (w[31], w[32], offset); w[41] = hc_bytealign (w[30], w[31], offset); w[40] = hc_bytealign (w[29], w[30], offset); w[39] = hc_bytealign (w[28], w[29], offset); w[38] = hc_bytealign (w[27], w[28], offset); w[37] = hc_bytealign (w[26], w[27], offset); w[36] = hc_bytealign (w[25], w[26], offset); w[35] = hc_bytealign (w[24], w[25], offset); w[34] = hc_bytealign (w[23], w[24], offset); w[33] = hc_bytealign (w[22], w[23], offset); w[32] = hc_bytealign (w[21], w[22], offset); w[31] = hc_bytealign (w[20], w[21], offset); w[30] = hc_bytealign (w[19], w[20], offset); w[29] = hc_bytealign (w[18], w[19], offset); w[28] = hc_bytealign (w[17], w[18], offset); w[27] = hc_bytealign (w[16], w[17], offset); w[26] = hc_bytealign (w[15], w[16], offset); w[25] = hc_bytealign (w[14], w[15], offset); w[24] = hc_bytealign (w[13], w[14], offset); w[23] = hc_bytealign (w[12], w[13], offset); w[22] = hc_bytealign (w[11], w[12], offset); w[21] = hc_bytealign (w[10], w[11], offset); w[20] = hc_bytealign (w[ 9], w[10], offset); w[19] = hc_bytealign (w[ 8], w[ 9], offset); w[18] = hc_bytealign (w[ 7], w[ 8], offset); w[17] = hc_bytealign (w[ 6], w[ 7], offset); w[16] = hc_bytealign (w[ 5], w[ 6], offset); w[15] = hc_bytealign (w[ 4], w[ 5], offset); w[14] = hc_bytealign (w[ 3], w[ 4], offset); w[13] = hc_bytealign (w[ 2], w[ 3], offset); w[12] = hc_bytealign (w[ 1], w[ 2], offset); w[11] = hc_bytealign (w[ 0], w[ 1], offset); w[10] = hc_bytealign ( 0, w[ 0], offset); w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 11: w[63] = hc_bytealign (w[51], w[52], offset); w[62] = hc_bytealign (w[50], w[51], offset); w[61] = hc_bytealign (w[49], w[50], offset); w[60] = hc_bytealign (w[48], w[49], offset); w[59] = hc_bytealign (w[47], w[48], offset); w[58] = hc_bytealign (w[46], w[47], offset); w[57] = hc_bytealign (w[45], w[46], offset); w[56] = hc_bytealign (w[44], w[45], offset); w[55] = hc_bytealign (w[43], w[44], offset); w[54] = hc_bytealign (w[42], w[43], offset); w[53] = hc_bytealign (w[41], w[42], offset); w[52] = hc_bytealign (w[40], w[41], offset); w[51] = hc_bytealign (w[39], w[40], offset); w[50] = hc_bytealign (w[38], w[39], offset); w[49] = hc_bytealign (w[37], w[38], offset); w[48] = hc_bytealign (w[36], w[37], offset); w[47] = hc_bytealign (w[35], w[36], offset); w[46] = hc_bytealign (w[34], w[35], offset); w[45] = hc_bytealign (w[33], w[34], offset); w[44] = hc_bytealign (w[32], w[33], offset); w[43] = hc_bytealign (w[31], w[32], offset); w[42] = hc_bytealign (w[30], w[31], offset); w[41] = hc_bytealign (w[29], w[30], offset); w[40] = hc_bytealign (w[28], w[29], offset); w[39] = hc_bytealign (w[27], w[28], offset); w[38] = hc_bytealign (w[26], w[27], offset); w[37] = hc_bytealign (w[25], w[26], offset); w[36] = hc_bytealign (w[24], w[25], offset); w[35] = hc_bytealign (w[23], w[24], offset); w[34] = hc_bytealign (w[22], w[23], offset); w[33] = hc_bytealign (w[21], w[22], offset); w[32] = hc_bytealign (w[20], w[21], offset); w[31] = hc_bytealign (w[19], w[20], offset); w[30] = hc_bytealign (w[18], w[19], offset); w[29] = hc_bytealign (w[17], w[18], offset); w[28] = hc_bytealign (w[16], w[17], offset); w[27] = hc_bytealign (w[15], w[16], offset); w[26] = hc_bytealign (w[14], w[15], offset); w[25] = hc_bytealign (w[13], w[14], offset); w[24] = hc_bytealign (w[12], w[13], offset); w[23] = hc_bytealign (w[11], w[12], offset); w[22] = hc_bytealign (w[10], w[11], offset); w[21] = hc_bytealign (w[ 9], w[10], offset); w[20] = hc_bytealign (w[ 8], w[ 9], offset); w[19] = hc_bytealign (w[ 7], w[ 8], offset); w[18] = hc_bytealign (w[ 6], w[ 7], offset); w[17] = hc_bytealign (w[ 5], w[ 6], offset); w[16] = hc_bytealign (w[ 4], w[ 5], offset); w[15] = hc_bytealign (w[ 3], w[ 4], offset); w[14] = hc_bytealign (w[ 2], w[ 3], offset); w[13] = hc_bytealign (w[ 1], w[ 2], offset); w[12] = hc_bytealign (w[ 0], w[ 1], offset); w[11] = hc_bytealign ( 0, w[ 0], offset); w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 12: w[63] = hc_bytealign (w[50], w[51], offset); w[62] = hc_bytealign (w[49], w[50], offset); w[61] = hc_bytealign (w[48], w[49], offset); w[60] = hc_bytealign (w[47], w[48], offset); w[59] = hc_bytealign (w[46], w[47], offset); w[58] = hc_bytealign (w[45], w[46], offset); w[57] = hc_bytealign (w[44], w[45], offset); w[56] = hc_bytealign (w[43], w[44], offset); w[55] = hc_bytealign (w[42], w[43], offset); w[54] = hc_bytealign (w[41], w[42], offset); w[53] = hc_bytealign (w[40], w[41], offset); w[52] = hc_bytealign (w[39], w[40], offset); w[51] = hc_bytealign (w[38], w[39], offset); w[50] = hc_bytealign (w[37], w[38], offset); w[49] = hc_bytealign (w[36], w[37], offset); w[48] = hc_bytealign (w[35], w[36], offset); w[47] = hc_bytealign (w[34], w[35], offset); w[46] = hc_bytealign (w[33], w[34], offset); w[45] = hc_bytealign (w[32], w[33], offset); w[44] = hc_bytealign (w[31], w[32], offset); w[43] = hc_bytealign (w[30], w[31], offset); w[42] = hc_bytealign (w[29], w[30], offset); w[41] = hc_bytealign (w[28], w[29], offset); w[40] = hc_bytealign (w[27], w[28], offset); w[39] = hc_bytealign (w[26], w[27], offset); w[38] = hc_bytealign (w[25], w[26], offset); w[37] = hc_bytealign (w[24], w[25], offset); w[36] = hc_bytealign (w[23], w[24], offset); w[35] = hc_bytealign (w[22], w[23], offset); w[34] = hc_bytealign (w[21], w[22], offset); w[33] = hc_bytealign (w[20], w[21], offset); w[32] = hc_bytealign (w[19], w[20], offset); w[31] = hc_bytealign (w[18], w[19], offset); w[30] = hc_bytealign (w[17], w[18], offset); w[29] = hc_bytealign (w[16], w[17], offset); w[28] = hc_bytealign (w[15], w[16], offset); w[27] = hc_bytealign (w[14], w[15], offset); w[26] = hc_bytealign (w[13], w[14], offset); w[25] = hc_bytealign (w[12], w[13], offset); w[24] = hc_bytealign (w[11], w[12], offset); w[23] = hc_bytealign (w[10], w[11], offset); w[22] = hc_bytealign (w[ 9], w[10], offset); w[21] = hc_bytealign (w[ 8], w[ 9], offset); w[20] = hc_bytealign (w[ 7], w[ 8], offset); w[19] = hc_bytealign (w[ 6], w[ 7], offset); w[18] = hc_bytealign (w[ 5], w[ 6], offset); w[17] = hc_bytealign (w[ 4], w[ 5], offset); w[16] = hc_bytealign (w[ 3], w[ 4], offset); w[15] = hc_bytealign (w[ 2], w[ 3], offset); w[14] = hc_bytealign (w[ 1], w[ 2], offset); w[13] = hc_bytealign (w[ 0], w[ 1], offset); w[12] = hc_bytealign ( 0, w[ 0], offset); w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 13: w[63] = hc_bytealign (w[49], w[50], offset); w[62] = hc_bytealign (w[48], w[49], offset); w[61] = hc_bytealign (w[47], w[48], offset); w[60] = hc_bytealign (w[46], w[47], offset); w[59] = hc_bytealign (w[45], w[46], offset); w[58] = hc_bytealign (w[44], w[45], offset); w[57] = hc_bytealign (w[43], w[44], offset); w[56] = hc_bytealign (w[42], w[43], offset); w[55] = hc_bytealign (w[41], w[42], offset); w[54] = hc_bytealign (w[40], w[41], offset); w[53] = hc_bytealign (w[39], w[40], offset); w[52] = hc_bytealign (w[38], w[39], offset); w[51] = hc_bytealign (w[37], w[38], offset); w[50] = hc_bytealign (w[36], w[37], offset); w[49] = hc_bytealign (w[35], w[36], offset); w[48] = hc_bytealign (w[34], w[35], offset); w[47] = hc_bytealign (w[33], w[34], offset); w[46] = hc_bytealign (w[32], w[33], offset); w[45] = hc_bytealign (w[31], w[32], offset); w[44] = hc_bytealign (w[30], w[31], offset); w[43] = hc_bytealign (w[29], w[30], offset); w[42] = hc_bytealign (w[28], w[29], offset); w[41] = hc_bytealign (w[27], w[28], offset); w[40] = hc_bytealign (w[26], w[27], offset); w[39] = hc_bytealign (w[25], w[26], offset); w[38] = hc_bytealign (w[24], w[25], offset); w[37] = hc_bytealign (w[23], w[24], offset); w[36] = hc_bytealign (w[22], w[23], offset); w[35] = hc_bytealign (w[21], w[22], offset); w[34] = hc_bytealign (w[20], w[21], offset); w[33] = hc_bytealign (w[19], w[20], offset); w[32] = hc_bytealign (w[18], w[19], offset); w[31] = hc_bytealign (w[17], w[18], offset); w[30] = hc_bytealign (w[16], w[17], offset); w[29] = hc_bytealign (w[15], w[16], offset); w[28] = hc_bytealign (w[14], w[15], offset); w[27] = hc_bytealign (w[13], w[14], offset); w[26] = hc_bytealign (w[12], w[13], offset); w[25] = hc_bytealign (w[11], w[12], offset); w[24] = hc_bytealign (w[10], w[11], offset); w[23] = hc_bytealign (w[ 9], w[10], offset); w[22] = hc_bytealign (w[ 8], w[ 9], offset); w[21] = hc_bytealign (w[ 7], w[ 8], offset); w[20] = hc_bytealign (w[ 6], w[ 7], offset); w[19] = hc_bytealign (w[ 5], w[ 6], offset); w[18] = hc_bytealign (w[ 4], w[ 5], offset); w[17] = hc_bytealign (w[ 3], w[ 4], offset); w[16] = hc_bytealign (w[ 2], w[ 3], offset); w[15] = hc_bytealign (w[ 1], w[ 2], offset); w[14] = hc_bytealign (w[ 0], w[ 1], offset); w[13] = hc_bytealign ( 0, w[ 0], offset); w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 14: w[63] = hc_bytealign (w[48], w[49], offset); w[62] = hc_bytealign (w[47], w[48], offset); w[61] = hc_bytealign (w[46], w[47], offset); w[60] = hc_bytealign (w[45], w[46], offset); w[59] = hc_bytealign (w[44], w[45], offset); w[58] = hc_bytealign (w[43], w[44], offset); w[57] = hc_bytealign (w[42], w[43], offset); w[56] = hc_bytealign (w[41], w[42], offset); w[55] = hc_bytealign (w[40], w[41], offset); w[54] = hc_bytealign (w[39], w[40], offset); w[53] = hc_bytealign (w[38], w[39], offset); w[52] = hc_bytealign (w[37], w[38], offset); w[51] = hc_bytealign (w[36], w[37], offset); w[50] = hc_bytealign (w[35], w[36], offset); w[49] = hc_bytealign (w[34], w[35], offset); w[48] = hc_bytealign (w[33], w[34], offset); w[47] = hc_bytealign (w[32], w[33], offset); w[46] = hc_bytealign (w[31], w[32], offset); w[45] = hc_bytealign (w[30], w[31], offset); w[44] = hc_bytealign (w[29], w[30], offset); w[43] = hc_bytealign (w[28], w[29], offset); w[42] = hc_bytealign (w[27], w[28], offset); w[41] = hc_bytealign (w[26], w[27], offset); w[40] = hc_bytealign (w[25], w[26], offset); w[39] = hc_bytealign (w[24], w[25], offset); w[38] = hc_bytealign (w[23], w[24], offset); w[37] = hc_bytealign (w[22], w[23], offset); w[36] = hc_bytealign (w[21], w[22], offset); w[35] = hc_bytealign (w[20], w[21], offset); w[34] = hc_bytealign (w[19], w[20], offset); w[33] = hc_bytealign (w[18], w[19], offset); w[32] = hc_bytealign (w[17], w[18], offset); w[31] = hc_bytealign (w[16], w[17], offset); w[30] = hc_bytealign (w[15], w[16], offset); w[29] = hc_bytealign (w[14], w[15], offset); w[28] = hc_bytealign (w[13], w[14], offset); w[27] = hc_bytealign (w[12], w[13], offset); w[26] = hc_bytealign (w[11], w[12], offset); w[25] = hc_bytealign (w[10], w[11], offset); w[24] = hc_bytealign (w[ 9], w[10], offset); w[23] = hc_bytealign (w[ 8], w[ 9], offset); w[22] = hc_bytealign (w[ 7], w[ 8], offset); w[21] = hc_bytealign (w[ 6], w[ 7], offset); w[20] = hc_bytealign (w[ 5], w[ 6], offset); w[19] = hc_bytealign (w[ 4], w[ 5], offset); w[18] = hc_bytealign (w[ 3], w[ 4], offset); w[17] = hc_bytealign (w[ 2], w[ 3], offset); w[16] = hc_bytealign (w[ 1], w[ 2], offset); w[15] = hc_bytealign (w[ 0], w[ 1], offset); w[14] = hc_bytealign ( 0, w[ 0], offset); w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 15: w[63] = hc_bytealign (w[47], w[48], offset); w[62] = hc_bytealign (w[46], w[47], offset); w[61] = hc_bytealign (w[45], w[46], offset); w[60] = hc_bytealign (w[44], w[45], offset); w[59] = hc_bytealign (w[43], w[44], offset); w[58] = hc_bytealign (w[42], w[43], offset); w[57] = hc_bytealign (w[41], w[42], offset); w[56] = hc_bytealign (w[40], w[41], offset); w[55] = hc_bytealign (w[39], w[40], offset); w[54] = hc_bytealign (w[38], w[39], offset); w[53] = hc_bytealign (w[37], w[38], offset); w[52] = hc_bytealign (w[36], w[37], offset); w[51] = hc_bytealign (w[35], w[36], offset); w[50] = hc_bytealign (w[34], w[35], offset); w[49] = hc_bytealign (w[33], w[34], offset); w[48] = hc_bytealign (w[32], w[33], offset); w[47] = hc_bytealign (w[31], w[32], offset); w[46] = hc_bytealign (w[30], w[31], offset); w[45] = hc_bytealign (w[29], w[30], offset); w[44] = hc_bytealign (w[28], w[29], offset); w[43] = hc_bytealign (w[27], w[28], offset); w[42] = hc_bytealign (w[26], w[27], offset); w[41] = hc_bytealign (w[25], w[26], offset); w[40] = hc_bytealign (w[24], w[25], offset); w[39] = hc_bytealign (w[23], w[24], offset); w[38] = hc_bytealign (w[22], w[23], offset); w[37] = hc_bytealign (w[21], w[22], offset); w[36] = hc_bytealign (w[20], w[21], offset); w[35] = hc_bytealign (w[19], w[20], offset); w[34] = hc_bytealign (w[18], w[19], offset); w[33] = hc_bytealign (w[17], w[18], offset); w[32] = hc_bytealign (w[16], w[17], offset); w[31] = hc_bytealign (w[15], w[16], offset); w[30] = hc_bytealign (w[14], w[15], offset); w[29] = hc_bytealign (w[13], w[14], offset); w[28] = hc_bytealign (w[12], w[13], offset); w[27] = hc_bytealign (w[11], w[12], offset); w[26] = hc_bytealign (w[10], w[11], offset); w[25] = hc_bytealign (w[ 9], w[10], offset); w[24] = hc_bytealign (w[ 8], w[ 9], offset); w[23] = hc_bytealign (w[ 7], w[ 8], offset); w[22] = hc_bytealign (w[ 6], w[ 7], offset); w[21] = hc_bytealign (w[ 5], w[ 6], offset); w[20] = hc_bytealign (w[ 4], w[ 5], offset); w[19] = hc_bytealign (w[ 3], w[ 4], offset); w[18] = hc_bytealign (w[ 2], w[ 3], offset); w[17] = hc_bytealign (w[ 1], w[ 2], offset); w[16] = hc_bytealign (w[ 0], w[ 1], offset); w[15] = hc_bytealign ( 0, w[ 0], offset); w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 16: w[63] = hc_bytealign (w[46], w[47], offset); w[62] = hc_bytealign (w[45], w[46], offset); w[61] = hc_bytealign (w[44], w[45], offset); w[60] = hc_bytealign (w[43], w[44], offset); w[59] = hc_bytealign (w[42], w[43], offset); w[58] = hc_bytealign (w[41], w[42], offset); w[57] = hc_bytealign (w[40], w[41], offset); w[56] = hc_bytealign (w[39], w[40], offset); w[55] = hc_bytealign (w[38], w[39], offset); w[54] = hc_bytealign (w[37], w[38], offset); w[53] = hc_bytealign (w[36], w[37], offset); w[52] = hc_bytealign (w[35], w[36], offset); w[51] = hc_bytealign (w[34], w[35], offset); w[50] = hc_bytealign (w[33], w[34], offset); w[49] = hc_bytealign (w[32], w[33], offset); w[48] = hc_bytealign (w[31], w[32], offset); w[47] = hc_bytealign (w[30], w[31], offset); w[46] = hc_bytealign (w[29], w[30], offset); w[45] = hc_bytealign (w[28], w[29], offset); w[44] = hc_bytealign (w[27], w[28], offset); w[43] = hc_bytealign (w[26], w[27], offset); w[42] = hc_bytealign (w[25], w[26], offset); w[41] = hc_bytealign (w[24], w[25], offset); w[40] = hc_bytealign (w[23], w[24], offset); w[39] = hc_bytealign (w[22], w[23], offset); w[38] = hc_bytealign (w[21], w[22], offset); w[37] = hc_bytealign (w[20], w[21], offset); w[36] = hc_bytealign (w[19], w[20], offset); w[35] = hc_bytealign (w[18], w[19], offset); w[34] = hc_bytealign (w[17], w[18], offset); w[33] = hc_bytealign (w[16], w[17], offset); w[32] = hc_bytealign (w[15], w[16], offset); w[31] = hc_bytealign (w[14], w[15], offset); w[30] = hc_bytealign (w[13], w[14], offset); w[29] = hc_bytealign (w[12], w[13], offset); w[28] = hc_bytealign (w[11], w[12], offset); w[27] = hc_bytealign (w[10], w[11], offset); w[26] = hc_bytealign (w[ 9], w[10], offset); w[25] = hc_bytealign (w[ 8], w[ 9], offset); w[24] = hc_bytealign (w[ 7], w[ 8], offset); w[23] = hc_bytealign (w[ 6], w[ 7], offset); w[22] = hc_bytealign (w[ 5], w[ 6], offset); w[21] = hc_bytealign (w[ 4], w[ 5], offset); w[20] = hc_bytealign (w[ 3], w[ 4], offset); w[19] = hc_bytealign (w[ 2], w[ 3], offset); w[18] = hc_bytealign (w[ 1], w[ 2], offset); w[17] = hc_bytealign (w[ 0], w[ 1], offset); w[16] = hc_bytealign ( 0, w[ 0], offset); w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 17: w[63] = hc_bytealign (w[45], w[46], offset); w[62] = hc_bytealign (w[44], w[45], offset); w[61] = hc_bytealign (w[43], w[44], offset); w[60] = hc_bytealign (w[42], w[43], offset); w[59] = hc_bytealign (w[41], w[42], offset); w[58] = hc_bytealign (w[40], w[41], offset); w[57] = hc_bytealign (w[39], w[40], offset); w[56] = hc_bytealign (w[38], w[39], offset); w[55] = hc_bytealign (w[37], w[38], offset); w[54] = hc_bytealign (w[36], w[37], offset); w[53] = hc_bytealign (w[35], w[36], offset); w[52] = hc_bytealign (w[34], w[35], offset); w[51] = hc_bytealign (w[33], w[34], offset); w[50] = hc_bytealign (w[32], w[33], offset); w[49] = hc_bytealign (w[31], w[32], offset); w[48] = hc_bytealign (w[30], w[31], offset); w[47] = hc_bytealign (w[29], w[30], offset); w[46] = hc_bytealign (w[28], w[29], offset); w[45] = hc_bytealign (w[27], w[28], offset); w[44] = hc_bytealign (w[26], w[27], offset); w[43] = hc_bytealign (w[25], w[26], offset); w[42] = hc_bytealign (w[24], w[25], offset); w[41] = hc_bytealign (w[23], w[24], offset); w[40] = hc_bytealign (w[22], w[23], offset); w[39] = hc_bytealign (w[21], w[22], offset); w[38] = hc_bytealign (w[20], w[21], offset); w[37] = hc_bytealign (w[19], w[20], offset); w[36] = hc_bytealign (w[18], w[19], offset); w[35] = hc_bytealign (w[17], w[18], offset); w[34] = hc_bytealign (w[16], w[17], offset); w[33] = hc_bytealign (w[15], w[16], offset); w[32] = hc_bytealign (w[14], w[15], offset); w[31] = hc_bytealign (w[13], w[14], offset); w[30] = hc_bytealign (w[12], w[13], offset); w[29] = hc_bytealign (w[11], w[12], offset); w[28] = hc_bytealign (w[10], w[11], offset); w[27] = hc_bytealign (w[ 9], w[10], offset); w[26] = hc_bytealign (w[ 8], w[ 9], offset); w[25] = hc_bytealign (w[ 7], w[ 8], offset); w[24] = hc_bytealign (w[ 6], w[ 7], offset); w[23] = hc_bytealign (w[ 5], w[ 6], offset); w[22] = hc_bytealign (w[ 4], w[ 5], offset); w[21] = hc_bytealign (w[ 3], w[ 4], offset); w[20] = hc_bytealign (w[ 2], w[ 3], offset); w[19] = hc_bytealign (w[ 1], w[ 2], offset); w[18] = hc_bytealign (w[ 0], w[ 1], offset); w[17] = hc_bytealign ( 0, w[ 0], offset); w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 18: w[63] = hc_bytealign (w[44], w[45], offset); w[62] = hc_bytealign (w[43], w[44], offset); w[61] = hc_bytealign (w[42], w[43], offset); w[60] = hc_bytealign (w[41], w[42], offset); w[59] = hc_bytealign (w[40], w[41], offset); w[58] = hc_bytealign (w[39], w[40], offset); w[57] = hc_bytealign (w[38], w[39], offset); w[56] = hc_bytealign (w[37], w[38], offset); w[55] = hc_bytealign (w[36], w[37], offset); w[54] = hc_bytealign (w[35], w[36], offset); w[53] = hc_bytealign (w[34], w[35], offset); w[52] = hc_bytealign (w[33], w[34], offset); w[51] = hc_bytealign (w[32], w[33], offset); w[50] = hc_bytealign (w[31], w[32], offset); w[49] = hc_bytealign (w[30], w[31], offset); w[48] = hc_bytealign (w[29], w[30], offset); w[47] = hc_bytealign (w[28], w[29], offset); w[46] = hc_bytealign (w[27], w[28], offset); w[45] = hc_bytealign (w[26], w[27], offset); w[44] = hc_bytealign (w[25], w[26], offset); w[43] = hc_bytealign (w[24], w[25], offset); w[42] = hc_bytealign (w[23], w[24], offset); w[41] = hc_bytealign (w[22], w[23], offset); w[40] = hc_bytealign (w[21], w[22], offset); w[39] = hc_bytealign (w[20], w[21], offset); w[38] = hc_bytealign (w[19], w[20], offset); w[37] = hc_bytealign (w[18], w[19], offset); w[36] = hc_bytealign (w[17], w[18], offset); w[35] = hc_bytealign (w[16], w[17], offset); w[34] = hc_bytealign (w[15], w[16], offset); w[33] = hc_bytealign (w[14], w[15], offset); w[32] = hc_bytealign (w[13], w[14], offset); w[31] = hc_bytealign (w[12], w[13], offset); w[30] = hc_bytealign (w[11], w[12], offset); w[29] = hc_bytealign (w[10], w[11], offset); w[28] = hc_bytealign (w[ 9], w[10], offset); w[27] = hc_bytealign (w[ 8], w[ 9], offset); w[26] = hc_bytealign (w[ 7], w[ 8], offset); w[25] = hc_bytealign (w[ 6], w[ 7], offset); w[24] = hc_bytealign (w[ 5], w[ 6], offset); w[23] = hc_bytealign (w[ 4], w[ 5], offset); w[22] = hc_bytealign (w[ 3], w[ 4], offset); w[21] = hc_bytealign (w[ 2], w[ 3], offset); w[20] = hc_bytealign (w[ 1], w[ 2], offset); w[19] = hc_bytealign (w[ 0], w[ 1], offset); w[18] = hc_bytealign ( 0, w[ 0], offset); w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 19: w[63] = hc_bytealign (w[43], w[44], offset); w[62] = hc_bytealign (w[42], w[43], offset); w[61] = hc_bytealign (w[41], w[42], offset); w[60] = hc_bytealign (w[40], w[41], offset); w[59] = hc_bytealign (w[39], w[40], offset); w[58] = hc_bytealign (w[38], w[39], offset); w[57] = hc_bytealign (w[37], w[38], offset); w[56] = hc_bytealign (w[36], w[37], offset); w[55] = hc_bytealign (w[35], w[36], offset); w[54] = hc_bytealign (w[34], w[35], offset); w[53] = hc_bytealign (w[33], w[34], offset); w[52] = hc_bytealign (w[32], w[33], offset); w[51] = hc_bytealign (w[31], w[32], offset); w[50] = hc_bytealign (w[30], w[31], offset); w[49] = hc_bytealign (w[29], w[30], offset); w[48] = hc_bytealign (w[28], w[29], offset); w[47] = hc_bytealign (w[27], w[28], offset); w[46] = hc_bytealign (w[26], w[27], offset); w[45] = hc_bytealign (w[25], w[26], offset); w[44] = hc_bytealign (w[24], w[25], offset); w[43] = hc_bytealign (w[23], w[24], offset); w[42] = hc_bytealign (w[22], w[23], offset); w[41] = hc_bytealign (w[21], w[22], offset); w[40] = hc_bytealign (w[20], w[21], offset); w[39] = hc_bytealign (w[19], w[20], offset); w[38] = hc_bytealign (w[18], w[19], offset); w[37] = hc_bytealign (w[17], w[18], offset); w[36] = hc_bytealign (w[16], w[17], offset); w[35] = hc_bytealign (w[15], w[16], offset); w[34] = hc_bytealign (w[14], w[15], offset); w[33] = hc_bytealign (w[13], w[14], offset); w[32] = hc_bytealign (w[12], w[13], offset); w[31] = hc_bytealign (w[11], w[12], offset); w[30] = hc_bytealign (w[10], w[11], offset); w[29] = hc_bytealign (w[ 9], w[10], offset); w[28] = hc_bytealign (w[ 8], w[ 9], offset); w[27] = hc_bytealign (w[ 7], w[ 8], offset); w[26] = hc_bytealign (w[ 6], w[ 7], offset); w[25] = hc_bytealign (w[ 5], w[ 6], offset); w[24] = hc_bytealign (w[ 4], w[ 5], offset); w[23] = hc_bytealign (w[ 3], w[ 4], offset); w[22] = hc_bytealign (w[ 2], w[ 3], offset); w[21] = hc_bytealign (w[ 1], w[ 2], offset); w[20] = hc_bytealign (w[ 0], w[ 1], offset); w[19] = hc_bytealign ( 0, w[ 0], offset); w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 20: w[63] = hc_bytealign (w[42], w[43], offset); w[62] = hc_bytealign (w[41], w[42], offset); w[61] = hc_bytealign (w[40], w[41], offset); w[60] = hc_bytealign (w[39], w[40], offset); w[59] = hc_bytealign (w[38], w[39], offset); w[58] = hc_bytealign (w[37], w[38], offset); w[57] = hc_bytealign (w[36], w[37], offset); w[56] = hc_bytealign (w[35], w[36], offset); w[55] = hc_bytealign (w[34], w[35], offset); w[54] = hc_bytealign (w[33], w[34], offset); w[53] = hc_bytealign (w[32], w[33], offset); w[52] = hc_bytealign (w[31], w[32], offset); w[51] = hc_bytealign (w[30], w[31], offset); w[50] = hc_bytealign (w[29], w[30], offset); w[49] = hc_bytealign (w[28], w[29], offset); w[48] = hc_bytealign (w[27], w[28], offset); w[47] = hc_bytealign (w[26], w[27], offset); w[46] = hc_bytealign (w[25], w[26], offset); w[45] = hc_bytealign (w[24], w[25], offset); w[44] = hc_bytealign (w[23], w[24], offset); w[43] = hc_bytealign (w[22], w[23], offset); w[42] = hc_bytealign (w[21], w[22], offset); w[41] = hc_bytealign (w[20], w[21], offset); w[40] = hc_bytealign (w[19], w[20], offset); w[39] = hc_bytealign (w[18], w[19], offset); w[38] = hc_bytealign (w[17], w[18], offset); w[37] = hc_bytealign (w[16], w[17], offset); w[36] = hc_bytealign (w[15], w[16], offset); w[35] = hc_bytealign (w[14], w[15], offset); w[34] = hc_bytealign (w[13], w[14], offset); w[33] = hc_bytealign (w[12], w[13], offset); w[32] = hc_bytealign (w[11], w[12], offset); w[31] = hc_bytealign (w[10], w[11], offset); w[30] = hc_bytealign (w[ 9], w[10], offset); w[29] = hc_bytealign (w[ 8], w[ 9], offset); w[28] = hc_bytealign (w[ 7], w[ 8], offset); w[27] = hc_bytealign (w[ 6], w[ 7], offset); w[26] = hc_bytealign (w[ 5], w[ 6], offset); w[25] = hc_bytealign (w[ 4], w[ 5], offset); w[24] = hc_bytealign (w[ 3], w[ 4], offset); w[23] = hc_bytealign (w[ 2], w[ 3], offset); w[22] = hc_bytealign (w[ 1], w[ 2], offset); w[21] = hc_bytealign (w[ 0], w[ 1], offset); w[20] = hc_bytealign ( 0, w[ 0], offset); w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 21: w[63] = hc_bytealign (w[41], w[42], offset); w[62] = hc_bytealign (w[40], w[41], offset); w[61] = hc_bytealign (w[39], w[40], offset); w[60] = hc_bytealign (w[38], w[39], offset); w[59] = hc_bytealign (w[37], w[38], offset); w[58] = hc_bytealign (w[36], w[37], offset); w[57] = hc_bytealign (w[35], w[36], offset); w[56] = hc_bytealign (w[34], w[35], offset); w[55] = hc_bytealign (w[33], w[34], offset); w[54] = hc_bytealign (w[32], w[33], offset); w[53] = hc_bytealign (w[31], w[32], offset); w[52] = hc_bytealign (w[30], w[31], offset); w[51] = hc_bytealign (w[29], w[30], offset); w[50] = hc_bytealign (w[28], w[29], offset); w[49] = hc_bytealign (w[27], w[28], offset); w[48] = hc_bytealign (w[26], w[27], offset); w[47] = hc_bytealign (w[25], w[26], offset); w[46] = hc_bytealign (w[24], w[25], offset); w[45] = hc_bytealign (w[23], w[24], offset); w[44] = hc_bytealign (w[22], w[23], offset); w[43] = hc_bytealign (w[21], w[22], offset); w[42] = hc_bytealign (w[20], w[21], offset); w[41] = hc_bytealign (w[19], w[20], offset); w[40] = hc_bytealign (w[18], w[19], offset); w[39] = hc_bytealign (w[17], w[18], offset); w[38] = hc_bytealign (w[16], w[17], offset); w[37] = hc_bytealign (w[15], w[16], offset); w[36] = hc_bytealign (w[14], w[15], offset); w[35] = hc_bytealign (w[13], w[14], offset); w[34] = hc_bytealign (w[12], w[13], offset); w[33] = hc_bytealign (w[11], w[12], offset); w[32] = hc_bytealign (w[10], w[11], offset); w[31] = hc_bytealign (w[ 9], w[10], offset); w[30] = hc_bytealign (w[ 8], w[ 9], offset); w[29] = hc_bytealign (w[ 7], w[ 8], offset); w[28] = hc_bytealign (w[ 6], w[ 7], offset); w[27] = hc_bytealign (w[ 5], w[ 6], offset); w[26] = hc_bytealign (w[ 4], w[ 5], offset); w[25] = hc_bytealign (w[ 3], w[ 4], offset); w[24] = hc_bytealign (w[ 2], w[ 3], offset); w[23] = hc_bytealign (w[ 1], w[ 2], offset); w[22] = hc_bytealign (w[ 0], w[ 1], offset); w[21] = hc_bytealign ( 0, w[ 0], offset); w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 22: w[63] = hc_bytealign (w[40], w[41], offset); w[62] = hc_bytealign (w[39], w[40], offset); w[61] = hc_bytealign (w[38], w[39], offset); w[60] = hc_bytealign (w[37], w[38], offset); w[59] = hc_bytealign (w[36], w[37], offset); w[58] = hc_bytealign (w[35], w[36], offset); w[57] = hc_bytealign (w[34], w[35], offset); w[56] = hc_bytealign (w[33], w[34], offset); w[55] = hc_bytealign (w[32], w[33], offset); w[54] = hc_bytealign (w[31], w[32], offset); w[53] = hc_bytealign (w[30], w[31], offset); w[52] = hc_bytealign (w[29], w[30], offset); w[51] = hc_bytealign (w[28], w[29], offset); w[50] = hc_bytealign (w[27], w[28], offset); w[49] = hc_bytealign (w[26], w[27], offset); w[48] = hc_bytealign (w[25], w[26], offset); w[47] = hc_bytealign (w[24], w[25], offset); w[46] = hc_bytealign (w[23], w[24], offset); w[45] = hc_bytealign (w[22], w[23], offset); w[44] = hc_bytealign (w[21], w[22], offset); w[43] = hc_bytealign (w[20], w[21], offset); w[42] = hc_bytealign (w[19], w[20], offset); w[41] = hc_bytealign (w[18], w[19], offset); w[40] = hc_bytealign (w[17], w[18], offset); w[39] = hc_bytealign (w[16], w[17], offset); w[38] = hc_bytealign (w[15], w[16], offset); w[37] = hc_bytealign (w[14], w[15], offset); w[36] = hc_bytealign (w[13], w[14], offset); w[35] = hc_bytealign (w[12], w[13], offset); w[34] = hc_bytealign (w[11], w[12], offset); w[33] = hc_bytealign (w[10], w[11], offset); w[32] = hc_bytealign (w[ 9], w[10], offset); w[31] = hc_bytealign (w[ 8], w[ 9], offset); w[30] = hc_bytealign (w[ 7], w[ 8], offset); w[29] = hc_bytealign (w[ 6], w[ 7], offset); w[28] = hc_bytealign (w[ 5], w[ 6], offset); w[27] = hc_bytealign (w[ 4], w[ 5], offset); w[26] = hc_bytealign (w[ 3], w[ 4], offset); w[25] = hc_bytealign (w[ 2], w[ 3], offset); w[24] = hc_bytealign (w[ 1], w[ 2], offset); w[23] = hc_bytealign (w[ 0], w[ 1], offset); w[22] = hc_bytealign ( 0, w[ 0], offset); w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 23: w[63] = hc_bytealign (w[39], w[40], offset); w[62] = hc_bytealign (w[38], w[39], offset); w[61] = hc_bytealign (w[37], w[38], offset); w[60] = hc_bytealign (w[36], w[37], offset); w[59] = hc_bytealign (w[35], w[36], offset); w[58] = hc_bytealign (w[34], w[35], offset); w[57] = hc_bytealign (w[33], w[34], offset); w[56] = hc_bytealign (w[32], w[33], offset); w[55] = hc_bytealign (w[31], w[32], offset); w[54] = hc_bytealign (w[30], w[31], offset); w[53] = hc_bytealign (w[29], w[30], offset); w[52] = hc_bytealign (w[28], w[29], offset); w[51] = hc_bytealign (w[27], w[28], offset); w[50] = hc_bytealign (w[26], w[27], offset); w[49] = hc_bytealign (w[25], w[26], offset); w[48] = hc_bytealign (w[24], w[25], offset); w[47] = hc_bytealign (w[23], w[24], offset); w[46] = hc_bytealign (w[22], w[23], offset); w[45] = hc_bytealign (w[21], w[22], offset); w[44] = hc_bytealign (w[20], w[21], offset); w[43] = hc_bytealign (w[19], w[20], offset); w[42] = hc_bytealign (w[18], w[19], offset); w[41] = hc_bytealign (w[17], w[18], offset); w[40] = hc_bytealign (w[16], w[17], offset); w[39] = hc_bytealign (w[15], w[16], offset); w[38] = hc_bytealign (w[14], w[15], offset); w[37] = hc_bytealign (w[13], w[14], offset); w[36] = hc_bytealign (w[12], w[13], offset); w[35] = hc_bytealign (w[11], w[12], offset); w[34] = hc_bytealign (w[10], w[11], offset); w[33] = hc_bytealign (w[ 9], w[10], offset); w[32] = hc_bytealign (w[ 8], w[ 9], offset); w[31] = hc_bytealign (w[ 7], w[ 8], offset); w[30] = hc_bytealign (w[ 6], w[ 7], offset); w[29] = hc_bytealign (w[ 5], w[ 6], offset); w[28] = hc_bytealign (w[ 4], w[ 5], offset); w[27] = hc_bytealign (w[ 3], w[ 4], offset); w[26] = hc_bytealign (w[ 2], w[ 3], offset); w[25] = hc_bytealign (w[ 1], w[ 2], offset); w[24] = hc_bytealign (w[ 0], w[ 1], offset); w[23] = hc_bytealign ( 0, w[ 0], offset); w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 24: w[63] = hc_bytealign (w[38], w[39], offset); w[62] = hc_bytealign (w[37], w[38], offset); w[61] = hc_bytealign (w[36], w[37], offset); w[60] = hc_bytealign (w[35], w[36], offset); w[59] = hc_bytealign (w[34], w[35], offset); w[58] = hc_bytealign (w[33], w[34], offset); w[57] = hc_bytealign (w[32], w[33], offset); w[56] = hc_bytealign (w[31], w[32], offset); w[55] = hc_bytealign (w[30], w[31], offset); w[54] = hc_bytealign (w[29], w[30], offset); w[53] = hc_bytealign (w[28], w[29], offset); w[52] = hc_bytealign (w[27], w[28], offset); w[51] = hc_bytealign (w[26], w[27], offset); w[50] = hc_bytealign (w[25], w[26], offset); w[49] = hc_bytealign (w[24], w[25], offset); w[48] = hc_bytealign (w[23], w[24], offset); w[47] = hc_bytealign (w[22], w[23], offset); w[46] = hc_bytealign (w[21], w[22], offset); w[45] = hc_bytealign (w[20], w[21], offset); w[44] = hc_bytealign (w[19], w[20], offset); w[43] = hc_bytealign (w[18], w[19], offset); w[42] = hc_bytealign (w[17], w[18], offset); w[41] = hc_bytealign (w[16], w[17], offset); w[40] = hc_bytealign (w[15], w[16], offset); w[39] = hc_bytealign (w[14], w[15], offset); w[38] = hc_bytealign (w[13], w[14], offset); w[37] = hc_bytealign (w[12], w[13], offset); w[36] = hc_bytealign (w[11], w[12], offset); w[35] = hc_bytealign (w[10], w[11], offset); w[34] = hc_bytealign (w[ 9], w[10], offset); w[33] = hc_bytealign (w[ 8], w[ 9], offset); w[32] = hc_bytealign (w[ 7], w[ 8], offset); w[31] = hc_bytealign (w[ 6], w[ 7], offset); w[30] = hc_bytealign (w[ 5], w[ 6], offset); w[29] = hc_bytealign (w[ 4], w[ 5], offset); w[28] = hc_bytealign (w[ 3], w[ 4], offset); w[27] = hc_bytealign (w[ 2], w[ 3], offset); w[26] = hc_bytealign (w[ 1], w[ 2], offset); w[25] = hc_bytealign (w[ 0], w[ 1], offset); w[24] = hc_bytealign ( 0, w[ 0], offset); w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 25: w[63] = hc_bytealign (w[37], w[38], offset); w[62] = hc_bytealign (w[36], w[37], offset); w[61] = hc_bytealign (w[35], w[36], offset); w[60] = hc_bytealign (w[34], w[35], offset); w[59] = hc_bytealign (w[33], w[34], offset); w[58] = hc_bytealign (w[32], w[33], offset); w[57] = hc_bytealign (w[31], w[32], offset); w[56] = hc_bytealign (w[30], w[31], offset); w[55] = hc_bytealign (w[29], w[30], offset); w[54] = hc_bytealign (w[28], w[29], offset); w[53] = hc_bytealign (w[27], w[28], offset); w[52] = hc_bytealign (w[26], w[27], offset); w[51] = hc_bytealign (w[25], w[26], offset); w[50] = hc_bytealign (w[24], w[25], offset); w[49] = hc_bytealign (w[23], w[24], offset); w[48] = hc_bytealign (w[22], w[23], offset); w[47] = hc_bytealign (w[21], w[22], offset); w[46] = hc_bytealign (w[20], w[21], offset); w[45] = hc_bytealign (w[19], w[20], offset); w[44] = hc_bytealign (w[18], w[19], offset); w[43] = hc_bytealign (w[17], w[18], offset); w[42] = hc_bytealign (w[16], w[17], offset); w[41] = hc_bytealign (w[15], w[16], offset); w[40] = hc_bytealign (w[14], w[15], offset); w[39] = hc_bytealign (w[13], w[14], offset); w[38] = hc_bytealign (w[12], w[13], offset); w[37] = hc_bytealign (w[11], w[12], offset); w[36] = hc_bytealign (w[10], w[11], offset); w[35] = hc_bytealign (w[ 9], w[10], offset); w[34] = hc_bytealign (w[ 8], w[ 9], offset); w[33] = hc_bytealign (w[ 7], w[ 8], offset); w[32] = hc_bytealign (w[ 6], w[ 7], offset); w[31] = hc_bytealign (w[ 5], w[ 6], offset); w[30] = hc_bytealign (w[ 4], w[ 5], offset); w[29] = hc_bytealign (w[ 3], w[ 4], offset); w[28] = hc_bytealign (w[ 2], w[ 3], offset); w[27] = hc_bytealign (w[ 1], w[ 2], offset); w[26] = hc_bytealign (w[ 0], w[ 1], offset); w[25] = hc_bytealign ( 0, w[ 0], offset); w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 26: w[63] = hc_bytealign (w[36], w[37], offset); w[62] = hc_bytealign (w[35], w[36], offset); w[61] = hc_bytealign (w[34], w[35], offset); w[60] = hc_bytealign (w[33], w[34], offset); w[59] = hc_bytealign (w[32], w[33], offset); w[58] = hc_bytealign (w[31], w[32], offset); w[57] = hc_bytealign (w[30], w[31], offset); w[56] = hc_bytealign (w[29], w[30], offset); w[55] = hc_bytealign (w[28], w[29], offset); w[54] = hc_bytealign (w[27], w[28], offset); w[53] = hc_bytealign (w[26], w[27], offset); w[52] = hc_bytealign (w[25], w[26], offset); w[51] = hc_bytealign (w[24], w[25], offset); w[50] = hc_bytealign (w[23], w[24], offset); w[49] = hc_bytealign (w[22], w[23], offset); w[48] = hc_bytealign (w[21], w[22], offset); w[47] = hc_bytealign (w[20], w[21], offset); w[46] = hc_bytealign (w[19], w[20], offset); w[45] = hc_bytealign (w[18], w[19], offset); w[44] = hc_bytealign (w[17], w[18], offset); w[43] = hc_bytealign (w[16], w[17], offset); w[42] = hc_bytealign (w[15], w[16], offset); w[41] = hc_bytealign (w[14], w[15], offset); w[40] = hc_bytealign (w[13], w[14], offset); w[39] = hc_bytealign (w[12], w[13], offset); w[38] = hc_bytealign (w[11], w[12], offset); w[37] = hc_bytealign (w[10], w[11], offset); w[36] = hc_bytealign (w[ 9], w[10], offset); w[35] = hc_bytealign (w[ 8], w[ 9], offset); w[34] = hc_bytealign (w[ 7], w[ 8], offset); w[33] = hc_bytealign (w[ 6], w[ 7], offset); w[32] = hc_bytealign (w[ 5], w[ 6], offset); w[31] = hc_bytealign (w[ 4], w[ 5], offset); w[30] = hc_bytealign (w[ 3], w[ 4], offset); w[29] = hc_bytealign (w[ 2], w[ 3], offset); w[28] = hc_bytealign (w[ 1], w[ 2], offset); w[27] = hc_bytealign (w[ 0], w[ 1], offset); w[26] = hc_bytealign ( 0, w[ 0], offset); w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 27: w[63] = hc_bytealign (w[35], w[36], offset); w[62] = hc_bytealign (w[34], w[35], offset); w[61] = hc_bytealign (w[33], w[34], offset); w[60] = hc_bytealign (w[32], w[33], offset); w[59] = hc_bytealign (w[31], w[32], offset); w[58] = hc_bytealign (w[30], w[31], offset); w[57] = hc_bytealign (w[29], w[30], offset); w[56] = hc_bytealign (w[28], w[29], offset); w[55] = hc_bytealign (w[27], w[28], offset); w[54] = hc_bytealign (w[26], w[27], offset); w[53] = hc_bytealign (w[25], w[26], offset); w[52] = hc_bytealign (w[24], w[25], offset); w[51] = hc_bytealign (w[23], w[24], offset); w[50] = hc_bytealign (w[22], w[23], offset); w[49] = hc_bytealign (w[21], w[22], offset); w[48] = hc_bytealign (w[20], w[21], offset); w[47] = hc_bytealign (w[19], w[20], offset); w[46] = hc_bytealign (w[18], w[19], offset); w[45] = hc_bytealign (w[17], w[18], offset); w[44] = hc_bytealign (w[16], w[17], offset); w[43] = hc_bytealign (w[15], w[16], offset); w[42] = hc_bytealign (w[14], w[15], offset); w[41] = hc_bytealign (w[13], w[14], offset); w[40] = hc_bytealign (w[12], w[13], offset); w[39] = hc_bytealign (w[11], w[12], offset); w[38] = hc_bytealign (w[10], w[11], offset); w[37] = hc_bytealign (w[ 9], w[10], offset); w[36] = hc_bytealign (w[ 8], w[ 9], offset); w[35] = hc_bytealign (w[ 7], w[ 8], offset); w[34] = hc_bytealign (w[ 6], w[ 7], offset); w[33] = hc_bytealign (w[ 5], w[ 6], offset); w[32] = hc_bytealign (w[ 4], w[ 5], offset); w[31] = hc_bytealign (w[ 3], w[ 4], offset); w[30] = hc_bytealign (w[ 2], w[ 3], offset); w[29] = hc_bytealign (w[ 1], w[ 2], offset); w[28] = hc_bytealign (w[ 0], w[ 1], offset); w[27] = hc_bytealign ( 0, w[ 0], offset); w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 28: w[63] = hc_bytealign (w[34], w[35], offset); w[62] = hc_bytealign (w[33], w[34], offset); w[61] = hc_bytealign (w[32], w[33], offset); w[60] = hc_bytealign (w[31], w[32], offset); w[59] = hc_bytealign (w[30], w[31], offset); w[58] = hc_bytealign (w[29], w[30], offset); w[57] = hc_bytealign (w[28], w[29], offset); w[56] = hc_bytealign (w[27], w[28], offset); w[55] = hc_bytealign (w[26], w[27], offset); w[54] = hc_bytealign (w[25], w[26], offset); w[53] = hc_bytealign (w[24], w[25], offset); w[52] = hc_bytealign (w[23], w[24], offset); w[51] = hc_bytealign (w[22], w[23], offset); w[50] = hc_bytealign (w[21], w[22], offset); w[49] = hc_bytealign (w[20], w[21], offset); w[48] = hc_bytealign (w[19], w[20], offset); w[47] = hc_bytealign (w[18], w[19], offset); w[46] = hc_bytealign (w[17], w[18], offset); w[45] = hc_bytealign (w[16], w[17], offset); w[44] = hc_bytealign (w[15], w[16], offset); w[43] = hc_bytealign (w[14], w[15], offset); w[42] = hc_bytealign (w[13], w[14], offset); w[41] = hc_bytealign (w[12], w[13], offset); w[40] = hc_bytealign (w[11], w[12], offset); w[39] = hc_bytealign (w[10], w[11], offset); w[38] = hc_bytealign (w[ 9], w[10], offset); w[37] = hc_bytealign (w[ 8], w[ 9], offset); w[36] = hc_bytealign (w[ 7], w[ 8], offset); w[35] = hc_bytealign (w[ 6], w[ 7], offset); w[34] = hc_bytealign (w[ 5], w[ 6], offset); w[33] = hc_bytealign (w[ 4], w[ 5], offset); w[32] = hc_bytealign (w[ 3], w[ 4], offset); w[31] = hc_bytealign (w[ 2], w[ 3], offset); w[30] = hc_bytealign (w[ 1], w[ 2], offset); w[29] = hc_bytealign (w[ 0], w[ 1], offset); w[28] = hc_bytealign ( 0, w[ 0], offset); w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 29: w[63] = hc_bytealign (w[33], w[34], offset); w[62] = hc_bytealign (w[32], w[33], offset); w[61] = hc_bytealign (w[31], w[32], offset); w[60] = hc_bytealign (w[30], w[31], offset); w[59] = hc_bytealign (w[29], w[30], offset); w[58] = hc_bytealign (w[28], w[29], offset); w[57] = hc_bytealign (w[27], w[28], offset); w[56] = hc_bytealign (w[26], w[27], offset); w[55] = hc_bytealign (w[25], w[26], offset); w[54] = hc_bytealign (w[24], w[25], offset); w[53] = hc_bytealign (w[23], w[24], offset); w[52] = hc_bytealign (w[22], w[23], offset); w[51] = hc_bytealign (w[21], w[22], offset); w[50] = hc_bytealign (w[20], w[21], offset); w[49] = hc_bytealign (w[19], w[20], offset); w[48] = hc_bytealign (w[18], w[19], offset); w[47] = hc_bytealign (w[17], w[18], offset); w[46] = hc_bytealign (w[16], w[17], offset); w[45] = hc_bytealign (w[15], w[16], offset); w[44] = hc_bytealign (w[14], w[15], offset); w[43] = hc_bytealign (w[13], w[14], offset); w[42] = hc_bytealign (w[12], w[13], offset); w[41] = hc_bytealign (w[11], w[12], offset); w[40] = hc_bytealign (w[10], w[11], offset); w[39] = hc_bytealign (w[ 9], w[10], offset); w[38] = hc_bytealign (w[ 8], w[ 9], offset); w[37] = hc_bytealign (w[ 7], w[ 8], offset); w[36] = hc_bytealign (w[ 6], w[ 7], offset); w[35] = hc_bytealign (w[ 5], w[ 6], offset); w[34] = hc_bytealign (w[ 4], w[ 5], offset); w[33] = hc_bytealign (w[ 3], w[ 4], offset); w[32] = hc_bytealign (w[ 2], w[ 3], offset); w[31] = hc_bytealign (w[ 1], w[ 2], offset); w[30] = hc_bytealign (w[ 0], w[ 1], offset); w[29] = hc_bytealign ( 0, w[ 0], offset); w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 30: w[63] = hc_bytealign (w[32], w[33], offset); w[62] = hc_bytealign (w[31], w[32], offset); w[61] = hc_bytealign (w[30], w[31], offset); w[60] = hc_bytealign (w[29], w[30], offset); w[59] = hc_bytealign (w[28], w[29], offset); w[58] = hc_bytealign (w[27], w[28], offset); w[57] = hc_bytealign (w[26], w[27], offset); w[56] = hc_bytealign (w[25], w[26], offset); w[55] = hc_bytealign (w[24], w[25], offset); w[54] = hc_bytealign (w[23], w[24], offset); w[53] = hc_bytealign (w[22], w[23], offset); w[52] = hc_bytealign (w[21], w[22], offset); w[51] = hc_bytealign (w[20], w[21], offset); w[50] = hc_bytealign (w[19], w[20], offset); w[49] = hc_bytealign (w[18], w[19], offset); w[48] = hc_bytealign (w[17], w[18], offset); w[47] = hc_bytealign (w[16], w[17], offset); w[46] = hc_bytealign (w[15], w[16], offset); w[45] = hc_bytealign (w[14], w[15], offset); w[44] = hc_bytealign (w[13], w[14], offset); w[43] = hc_bytealign (w[12], w[13], offset); w[42] = hc_bytealign (w[11], w[12], offset); w[41] = hc_bytealign (w[10], w[11], offset); w[40] = hc_bytealign (w[ 9], w[10], offset); w[39] = hc_bytealign (w[ 8], w[ 9], offset); w[38] = hc_bytealign (w[ 7], w[ 8], offset); w[37] = hc_bytealign (w[ 6], w[ 7], offset); w[36] = hc_bytealign (w[ 5], w[ 6], offset); w[35] = hc_bytealign (w[ 4], w[ 5], offset); w[34] = hc_bytealign (w[ 3], w[ 4], offset); w[33] = hc_bytealign (w[ 2], w[ 3], offset); w[32] = hc_bytealign (w[ 1], w[ 2], offset); w[31] = hc_bytealign (w[ 0], w[ 1], offset); w[30] = hc_bytealign ( 0, w[ 0], offset); w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 31: w[63] = hc_bytealign (w[31], w[32], offset); w[62] = hc_bytealign (w[30], w[31], offset); w[61] = hc_bytealign (w[29], w[30], offset); w[60] = hc_bytealign (w[28], w[29], offset); w[59] = hc_bytealign (w[27], w[28], offset); w[58] = hc_bytealign (w[26], w[27], offset); w[57] = hc_bytealign (w[25], w[26], offset); w[56] = hc_bytealign (w[24], w[25], offset); w[55] = hc_bytealign (w[23], w[24], offset); w[54] = hc_bytealign (w[22], w[23], offset); w[53] = hc_bytealign (w[21], w[22], offset); w[52] = hc_bytealign (w[20], w[21], offset); w[51] = hc_bytealign (w[19], w[20], offset); w[50] = hc_bytealign (w[18], w[19], offset); w[49] = hc_bytealign (w[17], w[18], offset); w[48] = hc_bytealign (w[16], w[17], offset); w[47] = hc_bytealign (w[15], w[16], offset); w[46] = hc_bytealign (w[14], w[15], offset); w[45] = hc_bytealign (w[13], w[14], offset); w[44] = hc_bytealign (w[12], w[13], offset); w[43] = hc_bytealign (w[11], w[12], offset); w[42] = hc_bytealign (w[10], w[11], offset); w[41] = hc_bytealign (w[ 9], w[10], offset); w[40] = hc_bytealign (w[ 8], w[ 9], offset); w[39] = hc_bytealign (w[ 7], w[ 8], offset); w[38] = hc_bytealign (w[ 6], w[ 7], offset); w[37] = hc_bytealign (w[ 5], w[ 6], offset); w[36] = hc_bytealign (w[ 4], w[ 5], offset); w[35] = hc_bytealign (w[ 3], w[ 4], offset); w[34] = hc_bytealign (w[ 2], w[ 3], offset); w[33] = hc_bytealign (w[ 1], w[ 2], offset); w[32] = hc_bytealign (w[ 0], w[ 1], offset); w[31] = hc_bytealign ( 0, w[ 0], offset); w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 32: w[63] = hc_bytealign (w[30], w[31], offset); w[62] = hc_bytealign (w[29], w[30], offset); w[61] = hc_bytealign (w[28], w[29], offset); w[60] = hc_bytealign (w[27], w[28], offset); w[59] = hc_bytealign (w[26], w[27], offset); w[58] = hc_bytealign (w[25], w[26], offset); w[57] = hc_bytealign (w[24], w[25], offset); w[56] = hc_bytealign (w[23], w[24], offset); w[55] = hc_bytealign (w[22], w[23], offset); w[54] = hc_bytealign (w[21], w[22], offset); w[53] = hc_bytealign (w[20], w[21], offset); w[52] = hc_bytealign (w[19], w[20], offset); w[51] = hc_bytealign (w[18], w[19], offset); w[50] = hc_bytealign (w[17], w[18], offset); w[49] = hc_bytealign (w[16], w[17], offset); w[48] = hc_bytealign (w[15], w[16], offset); w[47] = hc_bytealign (w[14], w[15], offset); w[46] = hc_bytealign (w[13], w[14], offset); w[45] = hc_bytealign (w[12], w[13], offset); w[44] = hc_bytealign (w[11], w[12], offset); w[43] = hc_bytealign (w[10], w[11], offset); w[42] = hc_bytealign (w[ 9], w[10], offset); w[41] = hc_bytealign (w[ 8], w[ 9], offset); w[40] = hc_bytealign (w[ 7], w[ 8], offset); w[39] = hc_bytealign (w[ 6], w[ 7], offset); w[38] = hc_bytealign (w[ 5], w[ 6], offset); w[37] = hc_bytealign (w[ 4], w[ 5], offset); w[36] = hc_bytealign (w[ 3], w[ 4], offset); w[35] = hc_bytealign (w[ 2], w[ 3], offset); w[34] = hc_bytealign (w[ 1], w[ 2], offset); w[33] = hc_bytealign (w[ 0], w[ 1], offset); w[32] = hc_bytealign ( 0, w[ 0], offset); w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 33: w[63] = hc_bytealign (w[29], w[30], offset); w[62] = hc_bytealign (w[28], w[29], offset); w[61] = hc_bytealign (w[27], w[28], offset); w[60] = hc_bytealign (w[26], w[27], offset); w[59] = hc_bytealign (w[25], w[26], offset); w[58] = hc_bytealign (w[24], w[25], offset); w[57] = hc_bytealign (w[23], w[24], offset); w[56] = hc_bytealign (w[22], w[23], offset); w[55] = hc_bytealign (w[21], w[22], offset); w[54] = hc_bytealign (w[20], w[21], offset); w[53] = hc_bytealign (w[19], w[20], offset); w[52] = hc_bytealign (w[18], w[19], offset); w[51] = hc_bytealign (w[17], w[18], offset); w[50] = hc_bytealign (w[16], w[17], offset); w[49] = hc_bytealign (w[15], w[16], offset); w[48] = hc_bytealign (w[14], w[15], offset); w[47] = hc_bytealign (w[13], w[14], offset); w[46] = hc_bytealign (w[12], w[13], offset); w[45] = hc_bytealign (w[11], w[12], offset); w[44] = hc_bytealign (w[10], w[11], offset); w[43] = hc_bytealign (w[ 9], w[10], offset); w[42] = hc_bytealign (w[ 8], w[ 9], offset); w[41] = hc_bytealign (w[ 7], w[ 8], offset); w[40] = hc_bytealign (w[ 6], w[ 7], offset); w[39] = hc_bytealign (w[ 5], w[ 6], offset); w[38] = hc_bytealign (w[ 4], w[ 5], offset); w[37] = hc_bytealign (w[ 3], w[ 4], offset); w[36] = hc_bytealign (w[ 2], w[ 3], offset); w[35] = hc_bytealign (w[ 1], w[ 2], offset); w[34] = hc_bytealign (w[ 0], w[ 1], offset); w[33] = hc_bytealign ( 0, w[ 0], offset); w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 34: w[63] = hc_bytealign (w[28], w[29], offset); w[62] = hc_bytealign (w[27], w[28], offset); w[61] = hc_bytealign (w[26], w[27], offset); w[60] = hc_bytealign (w[25], w[26], offset); w[59] = hc_bytealign (w[24], w[25], offset); w[58] = hc_bytealign (w[23], w[24], offset); w[57] = hc_bytealign (w[22], w[23], offset); w[56] = hc_bytealign (w[21], w[22], offset); w[55] = hc_bytealign (w[20], w[21], offset); w[54] = hc_bytealign (w[19], w[20], offset); w[53] = hc_bytealign (w[18], w[19], offset); w[52] = hc_bytealign (w[17], w[18], offset); w[51] = hc_bytealign (w[16], w[17], offset); w[50] = hc_bytealign (w[15], w[16], offset); w[49] = hc_bytealign (w[14], w[15], offset); w[48] = hc_bytealign (w[13], w[14], offset); w[47] = hc_bytealign (w[12], w[13], offset); w[46] = hc_bytealign (w[11], w[12], offset); w[45] = hc_bytealign (w[10], w[11], offset); w[44] = hc_bytealign (w[ 9], w[10], offset); w[43] = hc_bytealign (w[ 8], w[ 9], offset); w[42] = hc_bytealign (w[ 7], w[ 8], offset); w[41] = hc_bytealign (w[ 6], w[ 7], offset); w[40] = hc_bytealign (w[ 5], w[ 6], offset); w[39] = hc_bytealign (w[ 4], w[ 5], offset); w[38] = hc_bytealign (w[ 3], w[ 4], offset); w[37] = hc_bytealign (w[ 2], w[ 3], offset); w[36] = hc_bytealign (w[ 1], w[ 2], offset); w[35] = hc_bytealign (w[ 0], w[ 1], offset); w[34] = hc_bytealign ( 0, w[ 0], offset); w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 35: w[63] = hc_bytealign (w[27], w[28], offset); w[62] = hc_bytealign (w[26], w[27], offset); w[61] = hc_bytealign (w[25], w[26], offset); w[60] = hc_bytealign (w[24], w[25], offset); w[59] = hc_bytealign (w[23], w[24], offset); w[58] = hc_bytealign (w[22], w[23], offset); w[57] = hc_bytealign (w[21], w[22], offset); w[56] = hc_bytealign (w[20], w[21], offset); w[55] = hc_bytealign (w[19], w[20], offset); w[54] = hc_bytealign (w[18], w[19], offset); w[53] = hc_bytealign (w[17], w[18], offset); w[52] = hc_bytealign (w[16], w[17], offset); w[51] = hc_bytealign (w[15], w[16], offset); w[50] = hc_bytealign (w[14], w[15], offset); w[49] = hc_bytealign (w[13], w[14], offset); w[48] = hc_bytealign (w[12], w[13], offset); w[47] = hc_bytealign (w[11], w[12], offset); w[46] = hc_bytealign (w[10], w[11], offset); w[45] = hc_bytealign (w[ 9], w[10], offset); w[44] = hc_bytealign (w[ 8], w[ 9], offset); w[43] = hc_bytealign (w[ 7], w[ 8], offset); w[42] = hc_bytealign (w[ 6], w[ 7], offset); w[41] = hc_bytealign (w[ 5], w[ 6], offset); w[40] = hc_bytealign (w[ 4], w[ 5], offset); w[39] = hc_bytealign (w[ 3], w[ 4], offset); w[38] = hc_bytealign (w[ 2], w[ 3], offset); w[37] = hc_bytealign (w[ 1], w[ 2], offset); w[36] = hc_bytealign (w[ 0], w[ 1], offset); w[35] = hc_bytealign ( 0, w[ 0], offset); w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 36: w[63] = hc_bytealign (w[26], w[27], offset); w[62] = hc_bytealign (w[25], w[26], offset); w[61] = hc_bytealign (w[24], w[25], offset); w[60] = hc_bytealign (w[23], w[24], offset); w[59] = hc_bytealign (w[22], w[23], offset); w[58] = hc_bytealign (w[21], w[22], offset); w[57] = hc_bytealign (w[20], w[21], offset); w[56] = hc_bytealign (w[19], w[20], offset); w[55] = hc_bytealign (w[18], w[19], offset); w[54] = hc_bytealign (w[17], w[18], offset); w[53] = hc_bytealign (w[16], w[17], offset); w[52] = hc_bytealign (w[15], w[16], offset); w[51] = hc_bytealign (w[14], w[15], offset); w[50] = hc_bytealign (w[13], w[14], offset); w[49] = hc_bytealign (w[12], w[13], offset); w[48] = hc_bytealign (w[11], w[12], offset); w[47] = hc_bytealign (w[10], w[11], offset); w[46] = hc_bytealign (w[ 9], w[10], offset); w[45] = hc_bytealign (w[ 8], w[ 9], offset); w[44] = hc_bytealign (w[ 7], w[ 8], offset); w[43] = hc_bytealign (w[ 6], w[ 7], offset); w[42] = hc_bytealign (w[ 5], w[ 6], offset); w[41] = hc_bytealign (w[ 4], w[ 5], offset); w[40] = hc_bytealign (w[ 3], w[ 4], offset); w[39] = hc_bytealign (w[ 2], w[ 3], offset); w[38] = hc_bytealign (w[ 1], w[ 2], offset); w[37] = hc_bytealign (w[ 0], w[ 1], offset); w[36] = hc_bytealign ( 0, w[ 0], offset); w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 37: w[63] = hc_bytealign (w[25], w[26], offset); w[62] = hc_bytealign (w[24], w[25], offset); w[61] = hc_bytealign (w[23], w[24], offset); w[60] = hc_bytealign (w[22], w[23], offset); w[59] = hc_bytealign (w[21], w[22], offset); w[58] = hc_bytealign (w[20], w[21], offset); w[57] = hc_bytealign (w[19], w[20], offset); w[56] = hc_bytealign (w[18], w[19], offset); w[55] = hc_bytealign (w[17], w[18], offset); w[54] = hc_bytealign (w[16], w[17], offset); w[53] = hc_bytealign (w[15], w[16], offset); w[52] = hc_bytealign (w[14], w[15], offset); w[51] = hc_bytealign (w[13], w[14], offset); w[50] = hc_bytealign (w[12], w[13], offset); w[49] = hc_bytealign (w[11], w[12], offset); w[48] = hc_bytealign (w[10], w[11], offset); w[47] = hc_bytealign (w[ 9], w[10], offset); w[46] = hc_bytealign (w[ 8], w[ 9], offset); w[45] = hc_bytealign (w[ 7], w[ 8], offset); w[44] = hc_bytealign (w[ 6], w[ 7], offset); w[43] = hc_bytealign (w[ 5], w[ 6], offset); w[42] = hc_bytealign (w[ 4], w[ 5], offset); w[41] = hc_bytealign (w[ 3], w[ 4], offset); w[40] = hc_bytealign (w[ 2], w[ 3], offset); w[39] = hc_bytealign (w[ 1], w[ 2], offset); w[38] = hc_bytealign (w[ 0], w[ 1], offset); w[37] = hc_bytealign ( 0, w[ 0], offset); w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 38: w[63] = hc_bytealign (w[24], w[25], offset); w[62] = hc_bytealign (w[23], w[24], offset); w[61] = hc_bytealign (w[22], w[23], offset); w[60] = hc_bytealign (w[21], w[22], offset); w[59] = hc_bytealign (w[20], w[21], offset); w[58] = hc_bytealign (w[19], w[20], offset); w[57] = hc_bytealign (w[18], w[19], offset); w[56] = hc_bytealign (w[17], w[18], offset); w[55] = hc_bytealign (w[16], w[17], offset); w[54] = hc_bytealign (w[15], w[16], offset); w[53] = hc_bytealign (w[14], w[15], offset); w[52] = hc_bytealign (w[13], w[14], offset); w[51] = hc_bytealign (w[12], w[13], offset); w[50] = hc_bytealign (w[11], w[12], offset); w[49] = hc_bytealign (w[10], w[11], offset); w[48] = hc_bytealign (w[ 9], w[10], offset); w[47] = hc_bytealign (w[ 8], w[ 9], offset); w[46] = hc_bytealign (w[ 7], w[ 8], offset); w[45] = hc_bytealign (w[ 6], w[ 7], offset); w[44] = hc_bytealign (w[ 5], w[ 6], offset); w[43] = hc_bytealign (w[ 4], w[ 5], offset); w[42] = hc_bytealign (w[ 3], w[ 4], offset); w[41] = hc_bytealign (w[ 2], w[ 3], offset); w[40] = hc_bytealign (w[ 1], w[ 2], offset); w[39] = hc_bytealign (w[ 0], w[ 1], offset); w[38] = hc_bytealign ( 0, w[ 0], offset); w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 39: w[63] = hc_bytealign (w[23], w[24], offset); w[62] = hc_bytealign (w[22], w[23], offset); w[61] = hc_bytealign (w[21], w[22], offset); w[60] = hc_bytealign (w[20], w[21], offset); w[59] = hc_bytealign (w[19], w[20], offset); w[58] = hc_bytealign (w[18], w[19], offset); w[57] = hc_bytealign (w[17], w[18], offset); w[56] = hc_bytealign (w[16], w[17], offset); w[55] = hc_bytealign (w[15], w[16], offset); w[54] = hc_bytealign (w[14], w[15], offset); w[53] = hc_bytealign (w[13], w[14], offset); w[52] = hc_bytealign (w[12], w[13], offset); w[51] = hc_bytealign (w[11], w[12], offset); w[50] = hc_bytealign (w[10], w[11], offset); w[49] = hc_bytealign (w[ 9], w[10], offset); w[48] = hc_bytealign (w[ 8], w[ 9], offset); w[47] = hc_bytealign (w[ 7], w[ 8], offset); w[46] = hc_bytealign (w[ 6], w[ 7], offset); w[45] = hc_bytealign (w[ 5], w[ 6], offset); w[44] = hc_bytealign (w[ 4], w[ 5], offset); w[43] = hc_bytealign (w[ 3], w[ 4], offset); w[42] = hc_bytealign (w[ 2], w[ 3], offset); w[41] = hc_bytealign (w[ 1], w[ 2], offset); w[40] = hc_bytealign (w[ 0], w[ 1], offset); w[39] = hc_bytealign ( 0, w[ 0], offset); w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 40: w[63] = hc_bytealign (w[22], w[23], offset); w[62] = hc_bytealign (w[21], w[22], offset); w[61] = hc_bytealign (w[20], w[21], offset); w[60] = hc_bytealign (w[19], w[20], offset); w[59] = hc_bytealign (w[18], w[19], offset); w[58] = hc_bytealign (w[17], w[18], offset); w[57] = hc_bytealign (w[16], w[17], offset); w[56] = hc_bytealign (w[15], w[16], offset); w[55] = hc_bytealign (w[14], w[15], offset); w[54] = hc_bytealign (w[13], w[14], offset); w[53] = hc_bytealign (w[12], w[13], offset); w[52] = hc_bytealign (w[11], w[12], offset); w[51] = hc_bytealign (w[10], w[11], offset); w[50] = hc_bytealign (w[ 9], w[10], offset); w[49] = hc_bytealign (w[ 8], w[ 9], offset); w[48] = hc_bytealign (w[ 7], w[ 8], offset); w[47] = hc_bytealign (w[ 6], w[ 7], offset); w[46] = hc_bytealign (w[ 5], w[ 6], offset); w[45] = hc_bytealign (w[ 4], w[ 5], offset); w[44] = hc_bytealign (w[ 3], w[ 4], offset); w[43] = hc_bytealign (w[ 2], w[ 3], offset); w[42] = hc_bytealign (w[ 1], w[ 2], offset); w[41] = hc_bytealign (w[ 0], w[ 1], offset); w[40] = hc_bytealign ( 0, w[ 0], offset); w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 41: w[63] = hc_bytealign (w[21], w[22], offset); w[62] = hc_bytealign (w[20], w[21], offset); w[61] = hc_bytealign (w[19], w[20], offset); w[60] = hc_bytealign (w[18], w[19], offset); w[59] = hc_bytealign (w[17], w[18], offset); w[58] = hc_bytealign (w[16], w[17], offset); w[57] = hc_bytealign (w[15], w[16], offset); w[56] = hc_bytealign (w[14], w[15], offset); w[55] = hc_bytealign (w[13], w[14], offset); w[54] = hc_bytealign (w[12], w[13], offset); w[53] = hc_bytealign (w[11], w[12], offset); w[52] = hc_bytealign (w[10], w[11], offset); w[51] = hc_bytealign (w[ 9], w[10], offset); w[50] = hc_bytealign (w[ 8], w[ 9], offset); w[49] = hc_bytealign (w[ 7], w[ 8], offset); w[48] = hc_bytealign (w[ 6], w[ 7], offset); w[47] = hc_bytealign (w[ 5], w[ 6], offset); w[46] = hc_bytealign (w[ 4], w[ 5], offset); w[45] = hc_bytealign (w[ 3], w[ 4], offset); w[44] = hc_bytealign (w[ 2], w[ 3], offset); w[43] = hc_bytealign (w[ 1], w[ 2], offset); w[42] = hc_bytealign (w[ 0], w[ 1], offset); w[41] = hc_bytealign ( 0, w[ 0], offset); w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 42: w[63] = hc_bytealign (w[20], w[21], offset); w[62] = hc_bytealign (w[19], w[20], offset); w[61] = hc_bytealign (w[18], w[19], offset); w[60] = hc_bytealign (w[17], w[18], offset); w[59] = hc_bytealign (w[16], w[17], offset); w[58] = hc_bytealign (w[15], w[16], offset); w[57] = hc_bytealign (w[14], w[15], offset); w[56] = hc_bytealign (w[13], w[14], offset); w[55] = hc_bytealign (w[12], w[13], offset); w[54] = hc_bytealign (w[11], w[12], offset); w[53] = hc_bytealign (w[10], w[11], offset); w[52] = hc_bytealign (w[ 9], w[10], offset); w[51] = hc_bytealign (w[ 8], w[ 9], offset); w[50] = hc_bytealign (w[ 7], w[ 8], offset); w[49] = hc_bytealign (w[ 6], w[ 7], offset); w[48] = hc_bytealign (w[ 5], w[ 6], offset); w[47] = hc_bytealign (w[ 4], w[ 5], offset); w[46] = hc_bytealign (w[ 3], w[ 4], offset); w[45] = hc_bytealign (w[ 2], w[ 3], offset); w[44] = hc_bytealign (w[ 1], w[ 2], offset); w[43] = hc_bytealign (w[ 0], w[ 1], offset); w[42] = hc_bytealign ( 0, w[ 0], offset); w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 43: w[63] = hc_bytealign (w[19], w[20], offset); w[62] = hc_bytealign (w[18], w[19], offset); w[61] = hc_bytealign (w[17], w[18], offset); w[60] = hc_bytealign (w[16], w[17], offset); w[59] = hc_bytealign (w[15], w[16], offset); w[58] = hc_bytealign (w[14], w[15], offset); w[57] = hc_bytealign (w[13], w[14], offset); w[56] = hc_bytealign (w[12], w[13], offset); w[55] = hc_bytealign (w[11], w[12], offset); w[54] = hc_bytealign (w[10], w[11], offset); w[53] = hc_bytealign (w[ 9], w[10], offset); w[52] = hc_bytealign (w[ 8], w[ 9], offset); w[51] = hc_bytealign (w[ 7], w[ 8], offset); w[50] = hc_bytealign (w[ 6], w[ 7], offset); w[49] = hc_bytealign (w[ 5], w[ 6], offset); w[48] = hc_bytealign (w[ 4], w[ 5], offset); w[47] = hc_bytealign (w[ 3], w[ 4], offset); w[46] = hc_bytealign (w[ 2], w[ 3], offset); w[45] = hc_bytealign (w[ 1], w[ 2], offset); w[44] = hc_bytealign (w[ 0], w[ 1], offset); w[43] = hc_bytealign ( 0, w[ 0], offset); w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 44: w[63] = hc_bytealign (w[18], w[19], offset); w[62] = hc_bytealign (w[17], w[18], offset); w[61] = hc_bytealign (w[16], w[17], offset); w[60] = hc_bytealign (w[15], w[16], offset); w[59] = hc_bytealign (w[14], w[15], offset); w[58] = hc_bytealign (w[13], w[14], offset); w[57] = hc_bytealign (w[12], w[13], offset); w[56] = hc_bytealign (w[11], w[12], offset); w[55] = hc_bytealign (w[10], w[11], offset); w[54] = hc_bytealign (w[ 9], w[10], offset); w[53] = hc_bytealign (w[ 8], w[ 9], offset); w[52] = hc_bytealign (w[ 7], w[ 8], offset); w[51] = hc_bytealign (w[ 6], w[ 7], offset); w[50] = hc_bytealign (w[ 5], w[ 6], offset); w[49] = hc_bytealign (w[ 4], w[ 5], offset); w[48] = hc_bytealign (w[ 3], w[ 4], offset); w[47] = hc_bytealign (w[ 2], w[ 3], offset); w[46] = hc_bytealign (w[ 1], w[ 2], offset); w[45] = hc_bytealign (w[ 0], w[ 1], offset); w[44] = hc_bytealign ( 0, w[ 0], offset); w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 45: w[63] = hc_bytealign (w[17], w[18], offset); w[62] = hc_bytealign (w[16], w[17], offset); w[61] = hc_bytealign (w[15], w[16], offset); w[60] = hc_bytealign (w[14], w[15], offset); w[59] = hc_bytealign (w[13], w[14], offset); w[58] = hc_bytealign (w[12], w[13], offset); w[57] = hc_bytealign (w[11], w[12], offset); w[56] = hc_bytealign (w[10], w[11], offset); w[55] = hc_bytealign (w[ 9], w[10], offset); w[54] = hc_bytealign (w[ 8], w[ 9], offset); w[53] = hc_bytealign (w[ 7], w[ 8], offset); w[52] = hc_bytealign (w[ 6], w[ 7], offset); w[51] = hc_bytealign (w[ 5], w[ 6], offset); w[50] = hc_bytealign (w[ 4], w[ 5], offset); w[49] = hc_bytealign (w[ 3], w[ 4], offset); w[48] = hc_bytealign (w[ 2], w[ 3], offset); w[47] = hc_bytealign (w[ 1], w[ 2], offset); w[46] = hc_bytealign (w[ 0], w[ 1], offset); w[45] = hc_bytealign ( 0, w[ 0], offset); w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 46: w[63] = hc_bytealign (w[16], w[17], offset); w[62] = hc_bytealign (w[15], w[16], offset); w[61] = hc_bytealign (w[14], w[15], offset); w[60] = hc_bytealign (w[13], w[14], offset); w[59] = hc_bytealign (w[12], w[13], offset); w[58] = hc_bytealign (w[11], w[12], offset); w[57] = hc_bytealign (w[10], w[11], offset); w[56] = hc_bytealign (w[ 9], w[10], offset); w[55] = hc_bytealign (w[ 8], w[ 9], offset); w[54] = hc_bytealign (w[ 7], w[ 8], offset); w[53] = hc_bytealign (w[ 6], w[ 7], offset); w[52] = hc_bytealign (w[ 5], w[ 6], offset); w[51] = hc_bytealign (w[ 4], w[ 5], offset); w[50] = hc_bytealign (w[ 3], w[ 4], offset); w[49] = hc_bytealign (w[ 2], w[ 3], offset); w[48] = hc_bytealign (w[ 1], w[ 2], offset); w[47] = hc_bytealign (w[ 0], w[ 1], offset); w[46] = hc_bytealign ( 0, w[ 0], offset); w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 47: w[63] = hc_bytealign (w[15], w[16], offset); w[62] = hc_bytealign (w[14], w[15], offset); w[61] = hc_bytealign (w[13], w[14], offset); w[60] = hc_bytealign (w[12], w[13], offset); w[59] = hc_bytealign (w[11], w[12], offset); w[58] = hc_bytealign (w[10], w[11], offset); w[57] = hc_bytealign (w[ 9], w[10], offset); w[56] = hc_bytealign (w[ 8], w[ 9], offset); w[55] = hc_bytealign (w[ 7], w[ 8], offset); w[54] = hc_bytealign (w[ 6], w[ 7], offset); w[53] = hc_bytealign (w[ 5], w[ 6], offset); w[52] = hc_bytealign (w[ 4], w[ 5], offset); w[51] = hc_bytealign (w[ 3], w[ 4], offset); w[50] = hc_bytealign (w[ 2], w[ 3], offset); w[49] = hc_bytealign (w[ 1], w[ 2], offset); w[48] = hc_bytealign (w[ 0], w[ 1], offset); w[47] = hc_bytealign ( 0, w[ 0], offset); w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 48: w[63] = hc_bytealign (w[14], w[15], offset); w[62] = hc_bytealign (w[13], w[14], offset); w[61] = hc_bytealign (w[12], w[13], offset); w[60] = hc_bytealign (w[11], w[12], offset); w[59] = hc_bytealign (w[10], w[11], offset); w[58] = hc_bytealign (w[ 9], w[10], offset); w[57] = hc_bytealign (w[ 8], w[ 9], offset); w[56] = hc_bytealign (w[ 7], w[ 8], offset); w[55] = hc_bytealign (w[ 6], w[ 7], offset); w[54] = hc_bytealign (w[ 5], w[ 6], offset); w[53] = hc_bytealign (w[ 4], w[ 5], offset); w[52] = hc_bytealign (w[ 3], w[ 4], offset); w[51] = hc_bytealign (w[ 2], w[ 3], offset); w[50] = hc_bytealign (w[ 1], w[ 2], offset); w[49] = hc_bytealign (w[ 0], w[ 1], offset); w[48] = hc_bytealign ( 0, w[ 0], offset); w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 49: w[63] = hc_bytealign (w[13], w[14], offset); w[62] = hc_bytealign (w[12], w[13], offset); w[61] = hc_bytealign (w[11], w[12], offset); w[60] = hc_bytealign (w[10], w[11], offset); w[59] = hc_bytealign (w[ 9], w[10], offset); w[58] = hc_bytealign (w[ 8], w[ 9], offset); w[57] = hc_bytealign (w[ 7], w[ 8], offset); w[56] = hc_bytealign (w[ 6], w[ 7], offset); w[55] = hc_bytealign (w[ 5], w[ 6], offset); w[54] = hc_bytealign (w[ 4], w[ 5], offset); w[53] = hc_bytealign (w[ 3], w[ 4], offset); w[52] = hc_bytealign (w[ 2], w[ 3], offset); w[51] = hc_bytealign (w[ 1], w[ 2], offset); w[50] = hc_bytealign (w[ 0], w[ 1], offset); w[49] = hc_bytealign ( 0, w[ 0], offset); w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 50: w[63] = hc_bytealign (w[12], w[13], offset); w[62] = hc_bytealign (w[11], w[12], offset); w[61] = hc_bytealign (w[10], w[11], offset); w[60] = hc_bytealign (w[ 9], w[10], offset); w[59] = hc_bytealign (w[ 8], w[ 9], offset); w[58] = hc_bytealign (w[ 7], w[ 8], offset); w[57] = hc_bytealign (w[ 6], w[ 7], offset); w[56] = hc_bytealign (w[ 5], w[ 6], offset); w[55] = hc_bytealign (w[ 4], w[ 5], offset); w[54] = hc_bytealign (w[ 3], w[ 4], offset); w[53] = hc_bytealign (w[ 2], w[ 3], offset); w[52] = hc_bytealign (w[ 1], w[ 2], offset); w[51] = hc_bytealign (w[ 0], w[ 1], offset); w[50] = hc_bytealign ( 0, w[ 0], offset); w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 51: w[63] = hc_bytealign (w[11], w[12], offset); w[62] = hc_bytealign (w[10], w[11], offset); w[61] = hc_bytealign (w[ 9], w[10], offset); w[60] = hc_bytealign (w[ 8], w[ 9], offset); w[59] = hc_bytealign (w[ 7], w[ 8], offset); w[58] = hc_bytealign (w[ 6], w[ 7], offset); w[57] = hc_bytealign (w[ 5], w[ 6], offset); w[56] = hc_bytealign (w[ 4], w[ 5], offset); w[55] = hc_bytealign (w[ 3], w[ 4], offset); w[54] = hc_bytealign (w[ 2], w[ 3], offset); w[53] = hc_bytealign (w[ 1], w[ 2], offset); w[52] = hc_bytealign (w[ 0], w[ 1], offset); w[51] = hc_bytealign ( 0, w[ 0], offset); w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 52: w[63] = hc_bytealign (w[10], w[11], offset); w[62] = hc_bytealign (w[ 9], w[10], offset); w[61] = hc_bytealign (w[ 8], w[ 9], offset); w[60] = hc_bytealign (w[ 7], w[ 8], offset); w[59] = hc_bytealign (w[ 6], w[ 7], offset); w[58] = hc_bytealign (w[ 5], w[ 6], offset); w[57] = hc_bytealign (w[ 4], w[ 5], offset); w[56] = hc_bytealign (w[ 3], w[ 4], offset); w[55] = hc_bytealign (w[ 2], w[ 3], offset); w[54] = hc_bytealign (w[ 1], w[ 2], offset); w[53] = hc_bytealign (w[ 0], w[ 1], offset); w[52] = hc_bytealign ( 0, w[ 0], offset); w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 53: w[63] = hc_bytealign (w[ 9], w[10], offset); w[62] = hc_bytealign (w[ 8], w[ 9], offset); w[61] = hc_bytealign (w[ 7], w[ 8], offset); w[60] = hc_bytealign (w[ 6], w[ 7], offset); w[59] = hc_bytealign (w[ 5], w[ 6], offset); w[58] = hc_bytealign (w[ 4], w[ 5], offset); w[57] = hc_bytealign (w[ 3], w[ 4], offset); w[56] = hc_bytealign (w[ 2], w[ 3], offset); w[55] = hc_bytealign (w[ 1], w[ 2], offset); w[54] = hc_bytealign (w[ 0], w[ 1], offset); w[53] = hc_bytealign ( 0, w[ 0], offset); w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 54: w[63] = hc_bytealign (w[ 8], w[ 9], offset); w[62] = hc_bytealign (w[ 7], w[ 8], offset); w[61] = hc_bytealign (w[ 6], w[ 7], offset); w[60] = hc_bytealign (w[ 5], w[ 6], offset); w[59] = hc_bytealign (w[ 4], w[ 5], offset); w[58] = hc_bytealign (w[ 3], w[ 4], offset); w[57] = hc_bytealign (w[ 2], w[ 3], offset); w[56] = hc_bytealign (w[ 1], w[ 2], offset); w[55] = hc_bytealign (w[ 0], w[ 1], offset); w[54] = hc_bytealign ( 0, w[ 0], offset); w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 55: w[63] = hc_bytealign (w[ 7], w[ 8], offset); w[62] = hc_bytealign (w[ 6], w[ 7], offset); w[61] = hc_bytealign (w[ 5], w[ 6], offset); w[60] = hc_bytealign (w[ 4], w[ 5], offset); w[59] = hc_bytealign (w[ 3], w[ 4], offset); w[58] = hc_bytealign (w[ 2], w[ 3], offset); w[57] = hc_bytealign (w[ 1], w[ 2], offset); w[56] = hc_bytealign (w[ 0], w[ 1], offset); w[55] = hc_bytealign ( 0, w[ 0], offset); w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 56: w[63] = hc_bytealign (w[ 6], w[ 7], offset); w[62] = hc_bytealign (w[ 5], w[ 6], offset); w[61] = hc_bytealign (w[ 4], w[ 5], offset); w[60] = hc_bytealign (w[ 3], w[ 4], offset); w[59] = hc_bytealign (w[ 2], w[ 3], offset); w[58] = hc_bytealign (w[ 1], w[ 2], offset); w[57] = hc_bytealign (w[ 0], w[ 1], offset); w[56] = hc_bytealign ( 0, w[ 0], offset); w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 57: w[63] = hc_bytealign (w[ 5], w[ 6], offset); w[62] = hc_bytealign (w[ 4], w[ 5], offset); w[61] = hc_bytealign (w[ 3], w[ 4], offset); w[60] = hc_bytealign (w[ 2], w[ 3], offset); w[59] = hc_bytealign (w[ 1], w[ 2], offset); w[58] = hc_bytealign (w[ 0], w[ 1], offset); w[57] = hc_bytealign ( 0, w[ 0], offset); w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 58: w[63] = hc_bytealign (w[ 4], w[ 5], offset); w[62] = hc_bytealign (w[ 3], w[ 4], offset); w[61] = hc_bytealign (w[ 2], w[ 3], offset); w[60] = hc_bytealign (w[ 1], w[ 2], offset); w[59] = hc_bytealign (w[ 0], w[ 1], offset); w[58] = hc_bytealign ( 0, w[ 0], offset); w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 59: w[63] = hc_bytealign (w[ 3], w[ 4], offset); w[62] = hc_bytealign (w[ 2], w[ 3], offset); w[61] = hc_bytealign (w[ 1], w[ 2], offset); w[60] = hc_bytealign (w[ 0], w[ 1], offset); w[59] = hc_bytealign ( 0, w[ 0], offset); w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 60: w[63] = hc_bytealign (w[ 2], w[ 3], offset); w[62] = hc_bytealign (w[ 1], w[ 2], offset); w[61] = hc_bytealign (w[ 0], w[ 1], offset); w[60] = hc_bytealign ( 0, w[ 0], offset); w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 61: w[63] = hc_bytealign (w[ 1], w[ 2], offset); w[62] = hc_bytealign (w[ 0], w[ 1], offset); w[61] = hc_bytealign ( 0, w[ 0], offset); w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 62: w[63] = hc_bytealign (w[ 0], w[ 1], offset); w[62] = hc_bytealign ( 0, w[ 0], offset); w[61] = 0; w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 63: w[63] = hc_bytealign ( 0, w[ 0], offset); w[62] = 0; w[61] = 0; w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV const int offset_mod_4 = offset & 3; const int offset_minus_4 = 4 - offset_mod_4; #if defined IS_NV const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> (offset_minus_4 * 8)); #endif switch (offset_switch) { case 0: w[63] = hc_byte_perm (w[62], w[63], selector); w[62] = hc_byte_perm (w[61], w[62], selector); w[61] = hc_byte_perm (w[60], w[61], selector); w[60] = hc_byte_perm (w[59], w[60], selector); w[59] = hc_byte_perm (w[58], w[59], selector); w[58] = hc_byte_perm (w[57], w[58], selector); w[57] = hc_byte_perm (w[56], w[57], selector); w[56] = hc_byte_perm (w[55], w[56], selector); w[55] = hc_byte_perm (w[54], w[55], selector); w[54] = hc_byte_perm (w[53], w[54], selector); w[53] = hc_byte_perm (w[52], w[53], selector); w[52] = hc_byte_perm (w[51], w[52], selector); w[51] = hc_byte_perm (w[50], w[51], selector); w[50] = hc_byte_perm (w[49], w[50], selector); w[49] = hc_byte_perm (w[48], w[49], selector); w[48] = hc_byte_perm (w[47], w[48], selector); w[47] = hc_byte_perm (w[46], w[47], selector); w[46] = hc_byte_perm (w[45], w[46], selector); w[45] = hc_byte_perm (w[44], w[45], selector); w[44] = hc_byte_perm (w[43], w[44], selector); w[43] = hc_byte_perm (w[42], w[43], selector); w[42] = hc_byte_perm (w[41], w[42], selector); w[41] = hc_byte_perm (w[40], w[41], selector); w[40] = hc_byte_perm (w[39], w[40], selector); w[39] = hc_byte_perm (w[38], w[39], selector); w[38] = hc_byte_perm (w[37], w[38], selector); w[37] = hc_byte_perm (w[36], w[37], selector); w[36] = hc_byte_perm (w[35], w[36], selector); w[35] = hc_byte_perm (w[34], w[35], selector); w[34] = hc_byte_perm (w[33], w[34], selector); w[33] = hc_byte_perm (w[32], w[33], selector); w[32] = hc_byte_perm (w[31], w[32], selector); w[31] = hc_byte_perm (w[30], w[31], selector); w[30] = hc_byte_perm (w[29], w[30], selector); w[29] = hc_byte_perm (w[28], w[29], selector); w[28] = hc_byte_perm (w[27], w[28], selector); w[27] = hc_byte_perm (w[26], w[27], selector); w[26] = hc_byte_perm (w[25], w[26], selector); w[25] = hc_byte_perm (w[24], w[25], selector); w[24] = hc_byte_perm (w[23], w[24], selector); w[23] = hc_byte_perm (w[22], w[23], selector); w[22] = hc_byte_perm (w[21], w[22], selector); w[21] = hc_byte_perm (w[20], w[21], selector); w[20] = hc_byte_perm (w[19], w[20], selector); w[19] = hc_byte_perm (w[18], w[19], selector); w[18] = hc_byte_perm (w[17], w[18], selector); w[17] = hc_byte_perm (w[16], w[17], selector); w[16] = hc_byte_perm (w[15], w[16], selector); w[15] = hc_byte_perm (w[14], w[15], selector); w[14] = hc_byte_perm (w[13], w[14], selector); w[13] = hc_byte_perm (w[12], w[13], selector); w[12] = hc_byte_perm (w[11], w[12], selector); w[11] = hc_byte_perm (w[10], w[11], selector); w[10] = hc_byte_perm (w[ 9], w[10], selector); w[ 9] = hc_byte_perm (w[ 8], w[ 9], selector); w[ 8] = hc_byte_perm (w[ 7], w[ 8], selector); w[ 7] = hc_byte_perm (w[ 6], w[ 7], selector); w[ 6] = hc_byte_perm (w[ 5], w[ 6], selector); w[ 5] = hc_byte_perm (w[ 4], w[ 5], selector); w[ 4] = hc_byte_perm (w[ 3], w[ 4], selector); w[ 3] = hc_byte_perm (w[ 2], w[ 3], selector); w[ 2] = hc_byte_perm (w[ 1], w[ 2], selector); w[ 1] = hc_byte_perm (w[ 0], w[ 1], selector); w[ 0] = hc_byte_perm ( 0, w[ 0], selector); break; case 1: w[63] = hc_byte_perm (w[61], w[62], selector); w[62] = hc_byte_perm (w[60], w[61], selector); w[61] = hc_byte_perm (w[59], w[60], selector); w[60] = hc_byte_perm (w[58], w[59], selector); w[59] = hc_byte_perm (w[57], w[58], selector); w[58] = hc_byte_perm (w[56], w[57], selector); w[57] = hc_byte_perm (w[55], w[56], selector); w[56] = hc_byte_perm (w[54], w[55], selector); w[55] = hc_byte_perm (w[53], w[54], selector); w[54] = hc_byte_perm (w[52], w[53], selector); w[53] = hc_byte_perm (w[51], w[52], selector); w[52] = hc_byte_perm (w[50], w[51], selector); w[51] = hc_byte_perm (w[49], w[50], selector); w[50] = hc_byte_perm (w[48], w[49], selector); w[49] = hc_byte_perm (w[47], w[48], selector); w[48] = hc_byte_perm (w[46], w[47], selector); w[47] = hc_byte_perm (w[45], w[46], selector); w[46] = hc_byte_perm (w[44], w[45], selector); w[45] = hc_byte_perm (w[43], w[44], selector); w[44] = hc_byte_perm (w[42], w[43], selector); w[43] = hc_byte_perm (w[41], w[42], selector); w[42] = hc_byte_perm (w[40], w[41], selector); w[41] = hc_byte_perm (w[39], w[40], selector); w[40] = hc_byte_perm (w[38], w[39], selector); w[39] = hc_byte_perm (w[37], w[38], selector); w[38] = hc_byte_perm (w[36], w[37], selector); w[37] = hc_byte_perm (w[35], w[36], selector); w[36] = hc_byte_perm (w[34], w[35], selector); w[35] = hc_byte_perm (w[33], w[34], selector); w[34] = hc_byte_perm (w[32], w[33], selector); w[33] = hc_byte_perm (w[31], w[32], selector); w[32] = hc_byte_perm (w[30], w[31], selector); w[31] = hc_byte_perm (w[29], w[30], selector); w[30] = hc_byte_perm (w[28], w[29], selector); w[29] = hc_byte_perm (w[27], w[28], selector); w[28] = hc_byte_perm (w[26], w[27], selector); w[27] = hc_byte_perm (w[25], w[26], selector); w[26] = hc_byte_perm (w[24], w[25], selector); w[25] = hc_byte_perm (w[23], w[24], selector); w[24] = hc_byte_perm (w[22], w[23], selector); w[23] = hc_byte_perm (w[21], w[22], selector); w[22] = hc_byte_perm (w[20], w[21], selector); w[21] = hc_byte_perm (w[19], w[20], selector); w[20] = hc_byte_perm (w[18], w[19], selector); w[19] = hc_byte_perm (w[17], w[18], selector); w[18] = hc_byte_perm (w[16], w[17], selector); w[17] = hc_byte_perm (w[15], w[16], selector); w[16] = hc_byte_perm (w[14], w[15], selector); w[15] = hc_byte_perm (w[13], w[14], selector); w[14] = hc_byte_perm (w[12], w[13], selector); w[13] = hc_byte_perm (w[11], w[12], selector); w[12] = hc_byte_perm (w[10], w[11], selector); w[11] = hc_byte_perm (w[ 9], w[10], selector); w[10] = hc_byte_perm (w[ 8], w[ 9], selector); w[ 9] = hc_byte_perm (w[ 7], w[ 8], selector); w[ 8] = hc_byte_perm (w[ 6], w[ 7], selector); w[ 7] = hc_byte_perm (w[ 5], w[ 6], selector); w[ 6] = hc_byte_perm (w[ 4], w[ 5], selector); w[ 5] = hc_byte_perm (w[ 3], w[ 4], selector); w[ 4] = hc_byte_perm (w[ 2], w[ 3], selector); w[ 3] = hc_byte_perm (w[ 1], w[ 2], selector); w[ 2] = hc_byte_perm (w[ 0], w[ 1], selector); w[ 1] = hc_byte_perm ( 0, w[ 0], selector); w[ 0] = 0; break; case 2: w[63] = hc_byte_perm (w[60], w[61], selector); w[62] = hc_byte_perm (w[59], w[60], selector); w[61] = hc_byte_perm (w[58], w[59], selector); w[60] = hc_byte_perm (w[57], w[58], selector); w[59] = hc_byte_perm (w[56], w[57], selector); w[58] = hc_byte_perm (w[55], w[56], selector); w[57] = hc_byte_perm (w[54], w[55], selector); w[56] = hc_byte_perm (w[53], w[54], selector); w[55] = hc_byte_perm (w[52], w[53], selector); w[54] = hc_byte_perm (w[51], w[52], selector); w[53] = hc_byte_perm (w[50], w[51], selector); w[52] = hc_byte_perm (w[49], w[50], selector); w[51] = hc_byte_perm (w[48], w[49], selector); w[50] = hc_byte_perm (w[47], w[48], selector); w[49] = hc_byte_perm (w[46], w[47], selector); w[48] = hc_byte_perm (w[45], w[46], selector); w[47] = hc_byte_perm (w[44], w[45], selector); w[46] = hc_byte_perm (w[43], w[44], selector); w[45] = hc_byte_perm (w[42], w[43], selector); w[44] = hc_byte_perm (w[41], w[42], selector); w[43] = hc_byte_perm (w[40], w[41], selector); w[42] = hc_byte_perm (w[39], w[40], selector); w[41] = hc_byte_perm (w[38], w[39], selector); w[40] = hc_byte_perm (w[37], w[38], selector); w[39] = hc_byte_perm (w[36], w[37], selector); w[38] = hc_byte_perm (w[35], w[36], selector); w[37] = hc_byte_perm (w[34], w[35], selector); w[36] = hc_byte_perm (w[33], w[34], selector); w[35] = hc_byte_perm (w[32], w[33], selector); w[34] = hc_byte_perm (w[31], w[32], selector); w[33] = hc_byte_perm (w[30], w[31], selector); w[32] = hc_byte_perm (w[29], w[30], selector); w[31] = hc_byte_perm (w[28], w[29], selector); w[30] = hc_byte_perm (w[27], w[28], selector); w[29] = hc_byte_perm (w[26], w[27], selector); w[28] = hc_byte_perm (w[25], w[26], selector); w[27] = hc_byte_perm (w[24], w[25], selector); w[26] = hc_byte_perm (w[23], w[24], selector); w[25] = hc_byte_perm (w[22], w[23], selector); w[24] = hc_byte_perm (w[21], w[22], selector); w[23] = hc_byte_perm (w[20], w[21], selector); w[22] = hc_byte_perm (w[19], w[20], selector); w[21] = hc_byte_perm (w[18], w[19], selector); w[20] = hc_byte_perm (w[17], w[18], selector); w[19] = hc_byte_perm (w[16], w[17], selector); w[18] = hc_byte_perm (w[15], w[16], selector); w[17] = hc_byte_perm (w[14], w[15], selector); w[16] = hc_byte_perm (w[13], w[14], selector); w[15] = hc_byte_perm (w[12], w[13], selector); w[14] = hc_byte_perm (w[11], w[12], selector); w[13] = hc_byte_perm (w[10], w[11], selector); w[12] = hc_byte_perm (w[ 9], w[10], selector); w[11] = hc_byte_perm (w[ 8], w[ 9], selector); w[10] = hc_byte_perm (w[ 7], w[ 8], selector); w[ 9] = hc_byte_perm (w[ 6], w[ 7], selector); w[ 8] = hc_byte_perm (w[ 5], w[ 6], selector); w[ 7] = hc_byte_perm (w[ 4], w[ 5], selector); w[ 6] = hc_byte_perm (w[ 3], w[ 4], selector); w[ 5] = hc_byte_perm (w[ 2], w[ 3], selector); w[ 4] = hc_byte_perm (w[ 1], w[ 2], selector); w[ 3] = hc_byte_perm (w[ 0], w[ 1], selector); w[ 2] = hc_byte_perm ( 0, w[ 0], selector); w[ 1] = 0; w[ 0] = 0; break; case 3: w[63] = hc_byte_perm (w[59], w[60], selector); w[62] = hc_byte_perm (w[58], w[59], selector); w[61] = hc_byte_perm (w[57], w[58], selector); w[60] = hc_byte_perm (w[56], w[57], selector); w[59] = hc_byte_perm (w[55], w[56], selector); w[58] = hc_byte_perm (w[54], w[55], selector); w[57] = hc_byte_perm (w[53], w[54], selector); w[56] = hc_byte_perm (w[52], w[53], selector); w[55] = hc_byte_perm (w[51], w[52], selector); w[54] = hc_byte_perm (w[50], w[51], selector); w[53] = hc_byte_perm (w[49], w[50], selector); w[52] = hc_byte_perm (w[48], w[49], selector); w[51] = hc_byte_perm (w[47], w[48], selector); w[50] = hc_byte_perm (w[46], w[47], selector); w[49] = hc_byte_perm (w[45], w[46], selector); w[48] = hc_byte_perm (w[44], w[45], selector); w[47] = hc_byte_perm (w[43], w[44], selector); w[46] = hc_byte_perm (w[42], w[43], selector); w[45] = hc_byte_perm (w[41], w[42], selector); w[44] = hc_byte_perm (w[40], w[41], selector); w[43] = hc_byte_perm (w[39], w[40], selector); w[42] = hc_byte_perm (w[38], w[39], selector); w[41] = hc_byte_perm (w[37], w[38], selector); w[40] = hc_byte_perm (w[36], w[37], selector); w[39] = hc_byte_perm (w[35], w[36], selector); w[38] = hc_byte_perm (w[34], w[35], selector); w[37] = hc_byte_perm (w[33], w[34], selector); w[36] = hc_byte_perm (w[32], w[33], selector); w[35] = hc_byte_perm (w[31], w[32], selector); w[34] = hc_byte_perm (w[30], w[31], selector); w[33] = hc_byte_perm (w[29], w[30], selector); w[32] = hc_byte_perm (w[28], w[29], selector); w[31] = hc_byte_perm (w[27], w[28], selector); w[30] = hc_byte_perm (w[26], w[27], selector); w[29] = hc_byte_perm (w[25], w[26], selector); w[28] = hc_byte_perm (w[24], w[25], selector); w[27] = hc_byte_perm (w[23], w[24], selector); w[26] = hc_byte_perm (w[22], w[23], selector); w[25] = hc_byte_perm (w[21], w[22], selector); w[24] = hc_byte_perm (w[20], w[21], selector); w[23] = hc_byte_perm (w[19], w[20], selector); w[22] = hc_byte_perm (w[18], w[19], selector); w[21] = hc_byte_perm (w[17], w[18], selector); w[20] = hc_byte_perm (w[16], w[17], selector); w[19] = hc_byte_perm (w[15], w[16], selector); w[18] = hc_byte_perm (w[14], w[15], selector); w[17] = hc_byte_perm (w[13], w[14], selector); w[16] = hc_byte_perm (w[12], w[13], selector); w[15] = hc_byte_perm (w[11], w[12], selector); w[14] = hc_byte_perm (w[10], w[11], selector); w[13] = hc_byte_perm (w[ 9], w[10], selector); w[12] = hc_byte_perm (w[ 8], w[ 9], selector); w[11] = hc_byte_perm (w[ 7], w[ 8], selector); w[10] = hc_byte_perm (w[ 6], w[ 7], selector); w[ 9] = hc_byte_perm (w[ 5], w[ 6], selector); w[ 8] = hc_byte_perm (w[ 4], w[ 5], selector); w[ 7] = hc_byte_perm (w[ 3], w[ 4], selector); w[ 6] = hc_byte_perm (w[ 2], w[ 3], selector); w[ 5] = hc_byte_perm (w[ 1], w[ 2], selector); w[ 4] = hc_byte_perm (w[ 0], w[ 1], selector); w[ 3] = hc_byte_perm ( 0, w[ 0], selector); w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 4: w[63] = hc_byte_perm (w[58], w[59], selector); w[62] = hc_byte_perm (w[57], w[58], selector); w[61] = hc_byte_perm (w[56], w[57], selector); w[60] = hc_byte_perm (w[55], w[56], selector); w[59] = hc_byte_perm (w[54], w[55], selector); w[58] = hc_byte_perm (w[53], w[54], selector); w[57] = hc_byte_perm (w[52], w[53], selector); w[56] = hc_byte_perm (w[51], w[52], selector); w[55] = hc_byte_perm (w[50], w[51], selector); w[54] = hc_byte_perm (w[49], w[50], selector); w[53] = hc_byte_perm (w[48], w[49], selector); w[52] = hc_byte_perm (w[47], w[48], selector); w[51] = hc_byte_perm (w[46], w[47], selector); w[50] = hc_byte_perm (w[45], w[46], selector); w[49] = hc_byte_perm (w[44], w[45], selector); w[48] = hc_byte_perm (w[43], w[44], selector); w[47] = hc_byte_perm (w[42], w[43], selector); w[46] = hc_byte_perm (w[41], w[42], selector); w[45] = hc_byte_perm (w[40], w[41], selector); w[44] = hc_byte_perm (w[39], w[40], selector); w[43] = hc_byte_perm (w[38], w[39], selector); w[42] = hc_byte_perm (w[37], w[38], selector); w[41] = hc_byte_perm (w[36], w[37], selector); w[40] = hc_byte_perm (w[35], w[36], selector); w[39] = hc_byte_perm (w[34], w[35], selector); w[38] = hc_byte_perm (w[33], w[34], selector); w[37] = hc_byte_perm (w[32], w[33], selector); w[36] = hc_byte_perm (w[31], w[32], selector); w[35] = hc_byte_perm (w[30], w[31], selector); w[34] = hc_byte_perm (w[29], w[30], selector); w[33] = hc_byte_perm (w[28], w[29], selector); w[32] = hc_byte_perm (w[27], w[28], selector); w[31] = hc_byte_perm (w[26], w[27], selector); w[30] = hc_byte_perm (w[25], w[26], selector); w[29] = hc_byte_perm (w[24], w[25], selector); w[28] = hc_byte_perm (w[23], w[24], selector); w[27] = hc_byte_perm (w[22], w[23], selector); w[26] = hc_byte_perm (w[21], w[22], selector); w[25] = hc_byte_perm (w[20], w[21], selector); w[24] = hc_byte_perm (w[19], w[20], selector); w[23] = hc_byte_perm (w[18], w[19], selector); w[22] = hc_byte_perm (w[17], w[18], selector); w[21] = hc_byte_perm (w[16], w[17], selector); w[20] = hc_byte_perm (w[15], w[16], selector); w[19] = hc_byte_perm (w[14], w[15], selector); w[18] = hc_byte_perm (w[13], w[14], selector); w[17] = hc_byte_perm (w[12], w[13], selector); w[16] = hc_byte_perm (w[11], w[12], selector); w[15] = hc_byte_perm (w[10], w[11], selector); w[14] = hc_byte_perm (w[ 9], w[10], selector); w[13] = hc_byte_perm (w[ 8], w[ 9], selector); w[12] = hc_byte_perm (w[ 7], w[ 8], selector); w[11] = hc_byte_perm (w[ 6], w[ 7], selector); w[10] = hc_byte_perm (w[ 5], w[ 6], selector); w[ 9] = hc_byte_perm (w[ 4], w[ 5], selector); w[ 8] = hc_byte_perm (w[ 3], w[ 4], selector); w[ 7] = hc_byte_perm (w[ 2], w[ 3], selector); w[ 6] = hc_byte_perm (w[ 1], w[ 2], selector); w[ 5] = hc_byte_perm (w[ 0], w[ 1], selector); w[ 4] = hc_byte_perm ( 0, w[ 0], selector); w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 5: w[63] = hc_byte_perm (w[57], w[58], selector); w[62] = hc_byte_perm (w[56], w[57], selector); w[61] = hc_byte_perm (w[55], w[56], selector); w[60] = hc_byte_perm (w[54], w[55], selector); w[59] = hc_byte_perm (w[53], w[54], selector); w[58] = hc_byte_perm (w[52], w[53], selector); w[57] = hc_byte_perm (w[51], w[52], selector); w[56] = hc_byte_perm (w[50], w[51], selector); w[55] = hc_byte_perm (w[49], w[50], selector); w[54] = hc_byte_perm (w[48], w[49], selector); w[53] = hc_byte_perm (w[47], w[48], selector); w[52] = hc_byte_perm (w[46], w[47], selector); w[51] = hc_byte_perm (w[45], w[46], selector); w[50] = hc_byte_perm (w[44], w[45], selector); w[49] = hc_byte_perm (w[43], w[44], selector); w[48] = hc_byte_perm (w[42], w[43], selector); w[47] = hc_byte_perm (w[41], w[42], selector); w[46] = hc_byte_perm (w[40], w[41], selector); w[45] = hc_byte_perm (w[39], w[40], selector); w[44] = hc_byte_perm (w[38], w[39], selector); w[43] = hc_byte_perm (w[37], w[38], selector); w[42] = hc_byte_perm (w[36], w[37], selector); w[41] = hc_byte_perm (w[35], w[36], selector); w[40] = hc_byte_perm (w[34], w[35], selector); w[39] = hc_byte_perm (w[33], w[34], selector); w[38] = hc_byte_perm (w[32], w[33], selector); w[37] = hc_byte_perm (w[31], w[32], selector); w[36] = hc_byte_perm (w[30], w[31], selector); w[35] = hc_byte_perm (w[29], w[30], selector); w[34] = hc_byte_perm (w[28], w[29], selector); w[33] = hc_byte_perm (w[27], w[28], selector); w[32] = hc_byte_perm (w[26], w[27], selector); w[31] = hc_byte_perm (w[25], w[26], selector); w[30] = hc_byte_perm (w[24], w[25], selector); w[29] = hc_byte_perm (w[23], w[24], selector); w[28] = hc_byte_perm (w[22], w[23], selector); w[27] = hc_byte_perm (w[21], w[22], selector); w[26] = hc_byte_perm (w[20], w[21], selector); w[25] = hc_byte_perm (w[19], w[20], selector); w[24] = hc_byte_perm (w[18], w[19], selector); w[23] = hc_byte_perm (w[17], w[18], selector); w[22] = hc_byte_perm (w[16], w[17], selector); w[21] = hc_byte_perm (w[15], w[16], selector); w[20] = hc_byte_perm (w[14], w[15], selector); w[19] = hc_byte_perm (w[13], w[14], selector); w[18] = hc_byte_perm (w[12], w[13], selector); w[17] = hc_byte_perm (w[11], w[12], selector); w[16] = hc_byte_perm (w[10], w[11], selector); w[15] = hc_byte_perm (w[ 9], w[10], selector); w[14] = hc_byte_perm (w[ 8], w[ 9], selector); w[13] = hc_byte_perm (w[ 7], w[ 8], selector); w[12] = hc_byte_perm (w[ 6], w[ 7], selector); w[11] = hc_byte_perm (w[ 5], w[ 6], selector); w[10] = hc_byte_perm (w[ 4], w[ 5], selector); w[ 9] = hc_byte_perm (w[ 3], w[ 4], selector); w[ 8] = hc_byte_perm (w[ 2], w[ 3], selector); w[ 7] = hc_byte_perm (w[ 1], w[ 2], selector); w[ 6] = hc_byte_perm (w[ 0], w[ 1], selector); w[ 5] = hc_byte_perm ( 0, w[ 0], selector); w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 6: w[63] = hc_byte_perm (w[56], w[57], selector); w[62] = hc_byte_perm (w[55], w[56], selector); w[61] = hc_byte_perm (w[54], w[55], selector); w[60] = hc_byte_perm (w[53], w[54], selector); w[59] = hc_byte_perm (w[52], w[53], selector); w[58] = hc_byte_perm (w[51], w[52], selector); w[57] = hc_byte_perm (w[50], w[51], selector); w[56] = hc_byte_perm (w[49], w[50], selector); w[55] = hc_byte_perm (w[48], w[49], selector); w[54] = hc_byte_perm (w[47], w[48], selector); w[53] = hc_byte_perm (w[46], w[47], selector); w[52] = hc_byte_perm (w[45], w[46], selector); w[51] = hc_byte_perm (w[44], w[45], selector); w[50] = hc_byte_perm (w[43], w[44], selector); w[49] = hc_byte_perm (w[42], w[43], selector); w[48] = hc_byte_perm (w[41], w[42], selector); w[47] = hc_byte_perm (w[40], w[41], selector); w[46] = hc_byte_perm (w[39], w[40], selector); w[45] = hc_byte_perm (w[38], w[39], selector); w[44] = hc_byte_perm (w[37], w[38], selector); w[43] = hc_byte_perm (w[36], w[37], selector); w[42] = hc_byte_perm (w[35], w[36], selector); w[41] = hc_byte_perm (w[34], w[35], selector); w[40] = hc_byte_perm (w[33], w[34], selector); w[39] = hc_byte_perm (w[32], w[33], selector); w[38] = hc_byte_perm (w[31], w[32], selector); w[37] = hc_byte_perm (w[30], w[31], selector); w[36] = hc_byte_perm (w[29], w[30], selector); w[35] = hc_byte_perm (w[28], w[29], selector); w[34] = hc_byte_perm (w[27], w[28], selector); w[33] = hc_byte_perm (w[26], w[27], selector); w[32] = hc_byte_perm (w[25], w[26], selector); w[31] = hc_byte_perm (w[24], w[25], selector); w[30] = hc_byte_perm (w[23], w[24], selector); w[29] = hc_byte_perm (w[22], w[23], selector); w[28] = hc_byte_perm (w[21], w[22], selector); w[27] = hc_byte_perm (w[20], w[21], selector); w[26] = hc_byte_perm (w[19], w[20], selector); w[25] = hc_byte_perm (w[18], w[19], selector); w[24] = hc_byte_perm (w[17], w[18], selector); w[23] = hc_byte_perm (w[16], w[17], selector); w[22] = hc_byte_perm (w[15], w[16], selector); w[21] = hc_byte_perm (w[14], w[15], selector); w[20] = hc_byte_perm (w[13], w[14], selector); w[19] = hc_byte_perm (w[12], w[13], selector); w[18] = hc_byte_perm (w[11], w[12], selector); w[17] = hc_byte_perm (w[10], w[11], selector); w[16] = hc_byte_perm (w[ 9], w[10], selector); w[15] = hc_byte_perm (w[ 8], w[ 9], selector); w[14] = hc_byte_perm (w[ 7], w[ 8], selector); w[13] = hc_byte_perm (w[ 6], w[ 7], selector); w[12] = hc_byte_perm (w[ 5], w[ 6], selector); w[11] = hc_byte_perm (w[ 4], w[ 5], selector); w[10] = hc_byte_perm (w[ 3], w[ 4], selector); w[ 9] = hc_byte_perm (w[ 2], w[ 3], selector); w[ 8] = hc_byte_perm (w[ 1], w[ 2], selector); w[ 7] = hc_byte_perm (w[ 0], w[ 1], selector); w[ 6] = hc_byte_perm ( 0, w[ 0], selector); w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 7: w[63] = hc_byte_perm (w[55], w[56], selector); w[62] = hc_byte_perm (w[54], w[55], selector); w[61] = hc_byte_perm (w[53], w[54], selector); w[60] = hc_byte_perm (w[52], w[53], selector); w[59] = hc_byte_perm (w[51], w[52], selector); w[58] = hc_byte_perm (w[50], w[51], selector); w[57] = hc_byte_perm (w[49], w[50], selector); w[56] = hc_byte_perm (w[48], w[49], selector); w[55] = hc_byte_perm (w[47], w[48], selector); w[54] = hc_byte_perm (w[46], w[47], selector); w[53] = hc_byte_perm (w[45], w[46], selector); w[52] = hc_byte_perm (w[44], w[45], selector); w[51] = hc_byte_perm (w[43], w[44], selector); w[50] = hc_byte_perm (w[42], w[43], selector); w[49] = hc_byte_perm (w[41], w[42], selector); w[48] = hc_byte_perm (w[40], w[41], selector); w[47] = hc_byte_perm (w[39], w[40], selector); w[46] = hc_byte_perm (w[38], w[39], selector); w[45] = hc_byte_perm (w[37], w[38], selector); w[44] = hc_byte_perm (w[36], w[37], selector); w[43] = hc_byte_perm (w[35], w[36], selector); w[42] = hc_byte_perm (w[34], w[35], selector); w[41] = hc_byte_perm (w[33], w[34], selector); w[40] = hc_byte_perm (w[32], w[33], selector); w[39] = hc_byte_perm (w[31], w[32], selector); w[38] = hc_byte_perm (w[30], w[31], selector); w[37] = hc_byte_perm (w[29], w[30], selector); w[36] = hc_byte_perm (w[28], w[29], selector); w[35] = hc_byte_perm (w[27], w[28], selector); w[34] = hc_byte_perm (w[26], w[27], selector); w[33] = hc_byte_perm (w[25], w[26], selector); w[32] = hc_byte_perm (w[24], w[25], selector); w[31] = hc_byte_perm (w[23], w[24], selector); w[30] = hc_byte_perm (w[22], w[23], selector); w[29] = hc_byte_perm (w[21], w[22], selector); w[28] = hc_byte_perm (w[20], w[21], selector); w[27] = hc_byte_perm (w[19], w[20], selector); w[26] = hc_byte_perm (w[18], w[19], selector); w[25] = hc_byte_perm (w[17], w[18], selector); w[24] = hc_byte_perm (w[16], w[17], selector); w[23] = hc_byte_perm (w[15], w[16], selector); w[22] = hc_byte_perm (w[14], w[15], selector); w[21] = hc_byte_perm (w[13], w[14], selector); w[20] = hc_byte_perm (w[12], w[13], selector); w[19] = hc_byte_perm (w[11], w[12], selector); w[18] = hc_byte_perm (w[10], w[11], selector); w[17] = hc_byte_perm (w[ 9], w[10], selector); w[16] = hc_byte_perm (w[ 8], w[ 9], selector); w[15] = hc_byte_perm (w[ 7], w[ 8], selector); w[14] = hc_byte_perm (w[ 6], w[ 7], selector); w[13] = hc_byte_perm (w[ 5], w[ 6], selector); w[12] = hc_byte_perm (w[ 4], w[ 5], selector); w[11] = hc_byte_perm (w[ 3], w[ 4], selector); w[10] = hc_byte_perm (w[ 2], w[ 3], selector); w[ 9] = hc_byte_perm (w[ 1], w[ 2], selector); w[ 8] = hc_byte_perm (w[ 0], w[ 1], selector); w[ 7] = hc_byte_perm ( 0, w[ 0], selector); w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 8: w[63] = hc_byte_perm (w[54], w[55], selector); w[62] = hc_byte_perm (w[53], w[54], selector); w[61] = hc_byte_perm (w[52], w[53], selector); w[60] = hc_byte_perm (w[51], w[52], selector); w[59] = hc_byte_perm (w[50], w[51], selector); w[58] = hc_byte_perm (w[49], w[50], selector); w[57] = hc_byte_perm (w[48], w[49], selector); w[56] = hc_byte_perm (w[47], w[48], selector); w[55] = hc_byte_perm (w[46], w[47], selector); w[54] = hc_byte_perm (w[45], w[46], selector); w[53] = hc_byte_perm (w[44], w[45], selector); w[52] = hc_byte_perm (w[43], w[44], selector); w[51] = hc_byte_perm (w[42], w[43], selector); w[50] = hc_byte_perm (w[41], w[42], selector); w[49] = hc_byte_perm (w[40], w[41], selector); w[48] = hc_byte_perm (w[39], w[40], selector); w[47] = hc_byte_perm (w[38], w[39], selector); w[46] = hc_byte_perm (w[37], w[38], selector); w[45] = hc_byte_perm (w[36], w[37], selector); w[44] = hc_byte_perm (w[35], w[36], selector); w[43] = hc_byte_perm (w[34], w[35], selector); w[42] = hc_byte_perm (w[33], w[34], selector); w[41] = hc_byte_perm (w[32], w[33], selector); w[40] = hc_byte_perm (w[31], w[32], selector); w[39] = hc_byte_perm (w[30], w[31], selector); w[38] = hc_byte_perm (w[29], w[30], selector); w[37] = hc_byte_perm (w[28], w[29], selector); w[36] = hc_byte_perm (w[27], w[28], selector); w[35] = hc_byte_perm (w[26], w[27], selector); w[34] = hc_byte_perm (w[25], w[26], selector); w[33] = hc_byte_perm (w[24], w[25], selector); w[32] = hc_byte_perm (w[23], w[24], selector); w[31] = hc_byte_perm (w[22], w[23], selector); w[30] = hc_byte_perm (w[21], w[22], selector); w[29] = hc_byte_perm (w[20], w[21], selector); w[28] = hc_byte_perm (w[19], w[20], selector); w[27] = hc_byte_perm (w[18], w[19], selector); w[26] = hc_byte_perm (w[17], w[18], selector); w[25] = hc_byte_perm (w[16], w[17], selector); w[24] = hc_byte_perm (w[15], w[16], selector); w[23] = hc_byte_perm (w[14], w[15], selector); w[22] = hc_byte_perm (w[13], w[14], selector); w[21] = hc_byte_perm (w[12], w[13], selector); w[20] = hc_byte_perm (w[11], w[12], selector); w[19] = hc_byte_perm (w[10], w[11], selector); w[18] = hc_byte_perm (w[ 9], w[10], selector); w[17] = hc_byte_perm (w[ 8], w[ 9], selector); w[16] = hc_byte_perm (w[ 7], w[ 8], selector); w[15] = hc_byte_perm (w[ 6], w[ 7], selector); w[14] = hc_byte_perm (w[ 5], w[ 6], selector); w[13] = hc_byte_perm (w[ 4], w[ 5], selector); w[12] = hc_byte_perm (w[ 3], w[ 4], selector); w[11] = hc_byte_perm (w[ 2], w[ 3], selector); w[10] = hc_byte_perm (w[ 1], w[ 2], selector); w[ 9] = hc_byte_perm (w[ 0], w[ 1], selector); w[ 8] = hc_byte_perm ( 0, w[ 0], selector); w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 9: w[63] = hc_byte_perm (w[53], w[54], selector); w[62] = hc_byte_perm (w[52], w[53], selector); w[61] = hc_byte_perm (w[51], w[52], selector); w[60] = hc_byte_perm (w[50], w[51], selector); w[59] = hc_byte_perm (w[49], w[50], selector); w[58] = hc_byte_perm (w[48], w[49], selector); w[57] = hc_byte_perm (w[47], w[48], selector); w[56] = hc_byte_perm (w[46], w[47], selector); w[55] = hc_byte_perm (w[45], w[46], selector); w[54] = hc_byte_perm (w[44], w[45], selector); w[53] = hc_byte_perm (w[43], w[44], selector); w[52] = hc_byte_perm (w[42], w[43], selector); w[51] = hc_byte_perm (w[41], w[42], selector); w[50] = hc_byte_perm (w[40], w[41], selector); w[49] = hc_byte_perm (w[39], w[40], selector); w[48] = hc_byte_perm (w[38], w[39], selector); w[47] = hc_byte_perm (w[37], w[38], selector); w[46] = hc_byte_perm (w[36], w[37], selector); w[45] = hc_byte_perm (w[35], w[36], selector); w[44] = hc_byte_perm (w[34], w[35], selector); w[43] = hc_byte_perm (w[33], w[34], selector); w[42] = hc_byte_perm (w[32], w[33], selector); w[41] = hc_byte_perm (w[31], w[32], selector); w[40] = hc_byte_perm (w[30], w[31], selector); w[39] = hc_byte_perm (w[29], w[30], selector); w[38] = hc_byte_perm (w[28], w[29], selector); w[37] = hc_byte_perm (w[27], w[28], selector); w[36] = hc_byte_perm (w[26], w[27], selector); w[35] = hc_byte_perm (w[25], w[26], selector); w[34] = hc_byte_perm (w[24], w[25], selector); w[33] = hc_byte_perm (w[23], w[24], selector); w[32] = hc_byte_perm (w[22], w[23], selector); w[31] = hc_byte_perm (w[21], w[22], selector); w[30] = hc_byte_perm (w[20], w[21], selector); w[29] = hc_byte_perm (w[19], w[20], selector); w[28] = hc_byte_perm (w[18], w[19], selector); w[27] = hc_byte_perm (w[17], w[18], selector); w[26] = hc_byte_perm (w[16], w[17], selector); w[25] = hc_byte_perm (w[15], w[16], selector); w[24] = hc_byte_perm (w[14], w[15], selector); w[23] = hc_byte_perm (w[13], w[14], selector); w[22] = hc_byte_perm (w[12], w[13], selector); w[21] = hc_byte_perm (w[11], w[12], selector); w[20] = hc_byte_perm (w[10], w[11], selector); w[19] = hc_byte_perm (w[ 9], w[10], selector); w[18] = hc_byte_perm (w[ 8], w[ 9], selector); w[17] = hc_byte_perm (w[ 7], w[ 8], selector); w[16] = hc_byte_perm (w[ 6], w[ 7], selector); w[15] = hc_byte_perm (w[ 5], w[ 6], selector); w[14] = hc_byte_perm (w[ 4], w[ 5], selector); w[13] = hc_byte_perm (w[ 3], w[ 4], selector); w[12] = hc_byte_perm (w[ 2], w[ 3], selector); w[11] = hc_byte_perm (w[ 1], w[ 2], selector); w[10] = hc_byte_perm (w[ 0], w[ 1], selector); w[ 9] = hc_byte_perm ( 0, w[ 0], selector); w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 10: w[63] = hc_byte_perm (w[52], w[53], selector); w[62] = hc_byte_perm (w[51], w[52], selector); w[61] = hc_byte_perm (w[50], w[51], selector); w[60] = hc_byte_perm (w[49], w[50], selector); w[59] = hc_byte_perm (w[48], w[49], selector); w[58] = hc_byte_perm (w[47], w[48], selector); w[57] = hc_byte_perm (w[46], w[47], selector); w[56] = hc_byte_perm (w[45], w[46], selector); w[55] = hc_byte_perm (w[44], w[45], selector); w[54] = hc_byte_perm (w[43], w[44], selector); w[53] = hc_byte_perm (w[42], w[43], selector); w[52] = hc_byte_perm (w[41], w[42], selector); w[51] = hc_byte_perm (w[40], w[41], selector); w[50] = hc_byte_perm (w[39], w[40], selector); w[49] = hc_byte_perm (w[38], w[39], selector); w[48] = hc_byte_perm (w[37], w[38], selector); w[47] = hc_byte_perm (w[36], w[37], selector); w[46] = hc_byte_perm (w[35], w[36], selector); w[45] = hc_byte_perm (w[34], w[35], selector); w[44] = hc_byte_perm (w[33], w[34], selector); w[43] = hc_byte_perm (w[32], w[33], selector); w[42] = hc_byte_perm (w[31], w[32], selector); w[41] = hc_byte_perm (w[30], w[31], selector); w[40] = hc_byte_perm (w[29], w[30], selector); w[39] = hc_byte_perm (w[28], w[29], selector); w[38] = hc_byte_perm (w[27], w[28], selector); w[37] = hc_byte_perm (w[26], w[27], selector); w[36] = hc_byte_perm (w[25], w[26], selector); w[35] = hc_byte_perm (w[24], w[25], selector); w[34] = hc_byte_perm (w[23], w[24], selector); w[33] = hc_byte_perm (w[22], w[23], selector); w[32] = hc_byte_perm (w[21], w[22], selector); w[31] = hc_byte_perm (w[20], w[21], selector); w[30] = hc_byte_perm (w[19], w[20], selector); w[29] = hc_byte_perm (w[18], w[19], selector); w[28] = hc_byte_perm (w[17], w[18], selector); w[27] = hc_byte_perm (w[16], w[17], selector); w[26] = hc_byte_perm (w[15], w[16], selector); w[25] = hc_byte_perm (w[14], w[15], selector); w[24] = hc_byte_perm (w[13], w[14], selector); w[23] = hc_byte_perm (w[12], w[13], selector); w[22] = hc_byte_perm (w[11], w[12], selector); w[21] = hc_byte_perm (w[10], w[11], selector); w[20] = hc_byte_perm (w[ 9], w[10], selector); w[19] = hc_byte_perm (w[ 8], w[ 9], selector); w[18] = hc_byte_perm (w[ 7], w[ 8], selector); w[17] = hc_byte_perm (w[ 6], w[ 7], selector); w[16] = hc_byte_perm (w[ 5], w[ 6], selector); w[15] = hc_byte_perm (w[ 4], w[ 5], selector); w[14] = hc_byte_perm (w[ 3], w[ 4], selector); w[13] = hc_byte_perm (w[ 2], w[ 3], selector); w[12] = hc_byte_perm (w[ 1], w[ 2], selector); w[11] = hc_byte_perm (w[ 0], w[ 1], selector); w[10] = hc_byte_perm ( 0, w[ 0], selector); w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 11: w[63] = hc_byte_perm (w[51], w[52], selector); w[62] = hc_byte_perm (w[50], w[51], selector); w[61] = hc_byte_perm (w[49], w[50], selector); w[60] = hc_byte_perm (w[48], w[49], selector); w[59] = hc_byte_perm (w[47], w[48], selector); w[58] = hc_byte_perm (w[46], w[47], selector); w[57] = hc_byte_perm (w[45], w[46], selector); w[56] = hc_byte_perm (w[44], w[45], selector); w[55] = hc_byte_perm (w[43], w[44], selector); w[54] = hc_byte_perm (w[42], w[43], selector); w[53] = hc_byte_perm (w[41], w[42], selector); w[52] = hc_byte_perm (w[40], w[41], selector); w[51] = hc_byte_perm (w[39], w[40], selector); w[50] = hc_byte_perm (w[38], w[39], selector); w[49] = hc_byte_perm (w[37], w[38], selector); w[48] = hc_byte_perm (w[36], w[37], selector); w[47] = hc_byte_perm (w[35], w[36], selector); w[46] = hc_byte_perm (w[34], w[35], selector); w[45] = hc_byte_perm (w[33], w[34], selector); w[44] = hc_byte_perm (w[32], w[33], selector); w[43] = hc_byte_perm (w[31], w[32], selector); w[42] = hc_byte_perm (w[30], w[31], selector); w[41] = hc_byte_perm (w[29], w[30], selector); w[40] = hc_byte_perm (w[28], w[29], selector); w[39] = hc_byte_perm (w[27], w[28], selector); w[38] = hc_byte_perm (w[26], w[27], selector); w[37] = hc_byte_perm (w[25], w[26], selector); w[36] = hc_byte_perm (w[24], w[25], selector); w[35] = hc_byte_perm (w[23], w[24], selector); w[34] = hc_byte_perm (w[22], w[23], selector); w[33] = hc_byte_perm (w[21], w[22], selector); w[32] = hc_byte_perm (w[20], w[21], selector); w[31] = hc_byte_perm (w[19], w[20], selector); w[30] = hc_byte_perm (w[18], w[19], selector); w[29] = hc_byte_perm (w[17], w[18], selector); w[28] = hc_byte_perm (w[16], w[17], selector); w[27] = hc_byte_perm (w[15], w[16], selector); w[26] = hc_byte_perm (w[14], w[15], selector); w[25] = hc_byte_perm (w[13], w[14], selector); w[24] = hc_byte_perm (w[12], w[13], selector); w[23] = hc_byte_perm (w[11], w[12], selector); w[22] = hc_byte_perm (w[10], w[11], selector); w[21] = hc_byte_perm (w[ 9], w[10], selector); w[20] = hc_byte_perm (w[ 8], w[ 9], selector); w[19] = hc_byte_perm (w[ 7], w[ 8], selector); w[18] = hc_byte_perm (w[ 6], w[ 7], selector); w[17] = hc_byte_perm (w[ 5], w[ 6], selector); w[16] = hc_byte_perm (w[ 4], w[ 5], selector); w[15] = hc_byte_perm (w[ 3], w[ 4], selector); w[14] = hc_byte_perm (w[ 2], w[ 3], selector); w[13] = hc_byte_perm (w[ 1], w[ 2], selector); w[12] = hc_byte_perm (w[ 0], w[ 1], selector); w[11] = hc_byte_perm ( 0, w[ 0], selector); w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 12: w[63] = hc_byte_perm (w[50], w[51], selector); w[62] = hc_byte_perm (w[49], w[50], selector); w[61] = hc_byte_perm (w[48], w[49], selector); w[60] = hc_byte_perm (w[47], w[48], selector); w[59] = hc_byte_perm (w[46], w[47], selector); w[58] = hc_byte_perm (w[45], w[46], selector); w[57] = hc_byte_perm (w[44], w[45], selector); w[56] = hc_byte_perm (w[43], w[44], selector); w[55] = hc_byte_perm (w[42], w[43], selector); w[54] = hc_byte_perm (w[41], w[42], selector); w[53] = hc_byte_perm (w[40], w[41], selector); w[52] = hc_byte_perm (w[39], w[40], selector); w[51] = hc_byte_perm (w[38], w[39], selector); w[50] = hc_byte_perm (w[37], w[38], selector); w[49] = hc_byte_perm (w[36], w[37], selector); w[48] = hc_byte_perm (w[35], w[36], selector); w[47] = hc_byte_perm (w[34], w[35], selector); w[46] = hc_byte_perm (w[33], w[34], selector); w[45] = hc_byte_perm (w[32], w[33], selector); w[44] = hc_byte_perm (w[31], w[32], selector); w[43] = hc_byte_perm (w[30], w[31], selector); w[42] = hc_byte_perm (w[29], w[30], selector); w[41] = hc_byte_perm (w[28], w[29], selector); w[40] = hc_byte_perm (w[27], w[28], selector); w[39] = hc_byte_perm (w[26], w[27], selector); w[38] = hc_byte_perm (w[25], w[26], selector); w[37] = hc_byte_perm (w[24], w[25], selector); w[36] = hc_byte_perm (w[23], w[24], selector); w[35] = hc_byte_perm (w[22], w[23], selector); w[34] = hc_byte_perm (w[21], w[22], selector); w[33] = hc_byte_perm (w[20], w[21], selector); w[32] = hc_byte_perm (w[19], w[20], selector); w[31] = hc_byte_perm (w[18], w[19], selector); w[30] = hc_byte_perm (w[17], w[18], selector); w[29] = hc_byte_perm (w[16], w[17], selector); w[28] = hc_byte_perm (w[15], w[16], selector); w[27] = hc_byte_perm (w[14], w[15], selector); w[26] = hc_byte_perm (w[13], w[14], selector); w[25] = hc_byte_perm (w[12], w[13], selector); w[24] = hc_byte_perm (w[11], w[12], selector); w[23] = hc_byte_perm (w[10], w[11], selector); w[22] = hc_byte_perm (w[ 9], w[10], selector); w[21] = hc_byte_perm (w[ 8], w[ 9], selector); w[20] = hc_byte_perm (w[ 7], w[ 8], selector); w[19] = hc_byte_perm (w[ 6], w[ 7], selector); w[18] = hc_byte_perm (w[ 5], w[ 6], selector); w[17] = hc_byte_perm (w[ 4], w[ 5], selector); w[16] = hc_byte_perm (w[ 3], w[ 4], selector); w[15] = hc_byte_perm (w[ 2], w[ 3], selector); w[14] = hc_byte_perm (w[ 1], w[ 2], selector); w[13] = hc_byte_perm (w[ 0], w[ 1], selector); w[12] = hc_byte_perm ( 0, w[ 0], selector); w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 13: w[63] = hc_byte_perm (w[49], w[50], selector); w[62] = hc_byte_perm (w[48], w[49], selector); w[61] = hc_byte_perm (w[47], w[48], selector); w[60] = hc_byte_perm (w[46], w[47], selector); w[59] = hc_byte_perm (w[45], w[46], selector); w[58] = hc_byte_perm (w[44], w[45], selector); w[57] = hc_byte_perm (w[43], w[44], selector); w[56] = hc_byte_perm (w[42], w[43], selector); w[55] = hc_byte_perm (w[41], w[42], selector); w[54] = hc_byte_perm (w[40], w[41], selector); w[53] = hc_byte_perm (w[39], w[40], selector); w[52] = hc_byte_perm (w[38], w[39], selector); w[51] = hc_byte_perm (w[37], w[38], selector); w[50] = hc_byte_perm (w[36], w[37], selector); w[49] = hc_byte_perm (w[35], w[36], selector); w[48] = hc_byte_perm (w[34], w[35], selector); w[47] = hc_byte_perm (w[33], w[34], selector); w[46] = hc_byte_perm (w[32], w[33], selector); w[45] = hc_byte_perm (w[31], w[32], selector); w[44] = hc_byte_perm (w[30], w[31], selector); w[43] = hc_byte_perm (w[29], w[30], selector); w[42] = hc_byte_perm (w[28], w[29], selector); w[41] = hc_byte_perm (w[27], w[28], selector); w[40] = hc_byte_perm (w[26], w[27], selector); w[39] = hc_byte_perm (w[25], w[26], selector); w[38] = hc_byte_perm (w[24], w[25], selector); w[37] = hc_byte_perm (w[23], w[24], selector); w[36] = hc_byte_perm (w[22], w[23], selector); w[35] = hc_byte_perm (w[21], w[22], selector); w[34] = hc_byte_perm (w[20], w[21], selector); w[33] = hc_byte_perm (w[19], w[20], selector); w[32] = hc_byte_perm (w[18], w[19], selector); w[31] = hc_byte_perm (w[17], w[18], selector); w[30] = hc_byte_perm (w[16], w[17], selector); w[29] = hc_byte_perm (w[15], w[16], selector); w[28] = hc_byte_perm (w[14], w[15], selector); w[27] = hc_byte_perm (w[13], w[14], selector); w[26] = hc_byte_perm (w[12], w[13], selector); w[25] = hc_byte_perm (w[11], w[12], selector); w[24] = hc_byte_perm (w[10], w[11], selector); w[23] = hc_byte_perm (w[ 9], w[10], selector); w[22] = hc_byte_perm (w[ 8], w[ 9], selector); w[21] = hc_byte_perm (w[ 7], w[ 8], selector); w[20] = hc_byte_perm (w[ 6], w[ 7], selector); w[19] = hc_byte_perm (w[ 5], w[ 6], selector); w[18] = hc_byte_perm (w[ 4], w[ 5], selector); w[17] = hc_byte_perm (w[ 3], w[ 4], selector); w[16] = hc_byte_perm (w[ 2], w[ 3], selector); w[15] = hc_byte_perm (w[ 1], w[ 2], selector); w[14] = hc_byte_perm (w[ 0], w[ 1], selector); w[13] = hc_byte_perm ( 0, w[ 0], selector); w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 14: w[63] = hc_byte_perm (w[48], w[49], selector); w[62] = hc_byte_perm (w[47], w[48], selector); w[61] = hc_byte_perm (w[46], w[47], selector); w[60] = hc_byte_perm (w[45], w[46], selector); w[59] = hc_byte_perm (w[44], w[45], selector); w[58] = hc_byte_perm (w[43], w[44], selector); w[57] = hc_byte_perm (w[42], w[43], selector); w[56] = hc_byte_perm (w[41], w[42], selector); w[55] = hc_byte_perm (w[40], w[41], selector); w[54] = hc_byte_perm (w[39], w[40], selector); w[53] = hc_byte_perm (w[38], w[39], selector); w[52] = hc_byte_perm (w[37], w[38], selector); w[51] = hc_byte_perm (w[36], w[37], selector); w[50] = hc_byte_perm (w[35], w[36], selector); w[49] = hc_byte_perm (w[34], w[35], selector); w[48] = hc_byte_perm (w[33], w[34], selector); w[47] = hc_byte_perm (w[32], w[33], selector); w[46] = hc_byte_perm (w[31], w[32], selector); w[45] = hc_byte_perm (w[30], w[31], selector); w[44] = hc_byte_perm (w[29], w[30], selector); w[43] = hc_byte_perm (w[28], w[29], selector); w[42] = hc_byte_perm (w[27], w[28], selector); w[41] = hc_byte_perm (w[26], w[27], selector); w[40] = hc_byte_perm (w[25], w[26], selector); w[39] = hc_byte_perm (w[24], w[25], selector); w[38] = hc_byte_perm (w[23], w[24], selector); w[37] = hc_byte_perm (w[22], w[23], selector); w[36] = hc_byte_perm (w[21], w[22], selector); w[35] = hc_byte_perm (w[20], w[21], selector); w[34] = hc_byte_perm (w[19], w[20], selector); w[33] = hc_byte_perm (w[18], w[19], selector); w[32] = hc_byte_perm (w[17], w[18], selector); w[31] = hc_byte_perm (w[16], w[17], selector); w[30] = hc_byte_perm (w[15], w[16], selector); w[29] = hc_byte_perm (w[14], w[15], selector); w[28] = hc_byte_perm (w[13], w[14], selector); w[27] = hc_byte_perm (w[12], w[13], selector); w[26] = hc_byte_perm (w[11], w[12], selector); w[25] = hc_byte_perm (w[10], w[11], selector); w[24] = hc_byte_perm (w[ 9], w[10], selector); w[23] = hc_byte_perm (w[ 8], w[ 9], selector); w[22] = hc_byte_perm (w[ 7], w[ 8], selector); w[21] = hc_byte_perm (w[ 6], w[ 7], selector); w[20] = hc_byte_perm (w[ 5], w[ 6], selector); w[19] = hc_byte_perm (w[ 4], w[ 5], selector); w[18] = hc_byte_perm (w[ 3], w[ 4], selector); w[17] = hc_byte_perm (w[ 2], w[ 3], selector); w[16] = hc_byte_perm (w[ 1], w[ 2], selector); w[15] = hc_byte_perm (w[ 0], w[ 1], selector); w[14] = hc_byte_perm ( 0, w[ 0], selector); w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 15: w[63] = hc_byte_perm (w[47], w[48], selector); w[62] = hc_byte_perm (w[46], w[47], selector); w[61] = hc_byte_perm (w[45], w[46], selector); w[60] = hc_byte_perm (w[44], w[45], selector); w[59] = hc_byte_perm (w[43], w[44], selector); w[58] = hc_byte_perm (w[42], w[43], selector); w[57] = hc_byte_perm (w[41], w[42], selector); w[56] = hc_byte_perm (w[40], w[41], selector); w[55] = hc_byte_perm (w[39], w[40], selector); w[54] = hc_byte_perm (w[38], w[39], selector); w[53] = hc_byte_perm (w[37], w[38], selector); w[52] = hc_byte_perm (w[36], w[37], selector); w[51] = hc_byte_perm (w[35], w[36], selector); w[50] = hc_byte_perm (w[34], w[35], selector); w[49] = hc_byte_perm (w[33], w[34], selector); w[48] = hc_byte_perm (w[32], w[33], selector); w[47] = hc_byte_perm (w[31], w[32], selector); w[46] = hc_byte_perm (w[30], w[31], selector); w[45] = hc_byte_perm (w[29], w[30], selector); w[44] = hc_byte_perm (w[28], w[29], selector); w[43] = hc_byte_perm (w[27], w[28], selector); w[42] = hc_byte_perm (w[26], w[27], selector); w[41] = hc_byte_perm (w[25], w[26], selector); w[40] = hc_byte_perm (w[24], w[25], selector); w[39] = hc_byte_perm (w[23], w[24], selector); w[38] = hc_byte_perm (w[22], w[23], selector); w[37] = hc_byte_perm (w[21], w[22], selector); w[36] = hc_byte_perm (w[20], w[21], selector); w[35] = hc_byte_perm (w[19], w[20], selector); w[34] = hc_byte_perm (w[18], w[19], selector); w[33] = hc_byte_perm (w[17], w[18], selector); w[32] = hc_byte_perm (w[16], w[17], selector); w[31] = hc_byte_perm (w[15], w[16], selector); w[30] = hc_byte_perm (w[14], w[15], selector); w[29] = hc_byte_perm (w[13], w[14], selector); w[28] = hc_byte_perm (w[12], w[13], selector); w[27] = hc_byte_perm (w[11], w[12], selector); w[26] = hc_byte_perm (w[10], w[11], selector); w[25] = hc_byte_perm (w[ 9], w[10], selector); w[24] = hc_byte_perm (w[ 8], w[ 9], selector); w[23] = hc_byte_perm (w[ 7], w[ 8], selector); w[22] = hc_byte_perm (w[ 6], w[ 7], selector); w[21] = hc_byte_perm (w[ 5], w[ 6], selector); w[20] = hc_byte_perm (w[ 4], w[ 5], selector); w[19] = hc_byte_perm (w[ 3], w[ 4], selector); w[18] = hc_byte_perm (w[ 2], w[ 3], selector); w[17] = hc_byte_perm (w[ 1], w[ 2], selector); w[16] = hc_byte_perm (w[ 0], w[ 1], selector); w[15] = hc_byte_perm ( 0, w[ 0], selector); w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 16: w[63] = hc_byte_perm (w[46], w[47], selector); w[62] = hc_byte_perm (w[45], w[46], selector); w[61] = hc_byte_perm (w[44], w[45], selector); w[60] = hc_byte_perm (w[43], w[44], selector); w[59] = hc_byte_perm (w[42], w[43], selector); w[58] = hc_byte_perm (w[41], w[42], selector); w[57] = hc_byte_perm (w[40], w[41], selector); w[56] = hc_byte_perm (w[39], w[40], selector); w[55] = hc_byte_perm (w[38], w[39], selector); w[54] = hc_byte_perm (w[37], w[38], selector); w[53] = hc_byte_perm (w[36], w[37], selector); w[52] = hc_byte_perm (w[35], w[36], selector); w[51] = hc_byte_perm (w[34], w[35], selector); w[50] = hc_byte_perm (w[33], w[34], selector); w[49] = hc_byte_perm (w[32], w[33], selector); w[48] = hc_byte_perm (w[31], w[32], selector); w[47] = hc_byte_perm (w[30], w[31], selector); w[46] = hc_byte_perm (w[29], w[30], selector); w[45] = hc_byte_perm (w[28], w[29], selector); w[44] = hc_byte_perm (w[27], w[28], selector); w[43] = hc_byte_perm (w[26], w[27], selector); w[42] = hc_byte_perm (w[25], w[26], selector); w[41] = hc_byte_perm (w[24], w[25], selector); w[40] = hc_byte_perm (w[23], w[24], selector); w[39] = hc_byte_perm (w[22], w[23], selector); w[38] = hc_byte_perm (w[21], w[22], selector); w[37] = hc_byte_perm (w[20], w[21], selector); w[36] = hc_byte_perm (w[19], w[20], selector); w[35] = hc_byte_perm (w[18], w[19], selector); w[34] = hc_byte_perm (w[17], w[18], selector); w[33] = hc_byte_perm (w[16], w[17], selector); w[32] = hc_byte_perm (w[15], w[16], selector); w[31] = hc_byte_perm (w[14], w[15], selector); w[30] = hc_byte_perm (w[13], w[14], selector); w[29] = hc_byte_perm (w[12], w[13], selector); w[28] = hc_byte_perm (w[11], w[12], selector); w[27] = hc_byte_perm (w[10], w[11], selector); w[26] = hc_byte_perm (w[ 9], w[10], selector); w[25] = hc_byte_perm (w[ 8], w[ 9], selector); w[24] = hc_byte_perm (w[ 7], w[ 8], selector); w[23] = hc_byte_perm (w[ 6], w[ 7], selector); w[22] = hc_byte_perm (w[ 5], w[ 6], selector); w[21] = hc_byte_perm (w[ 4], w[ 5], selector); w[20] = hc_byte_perm (w[ 3], w[ 4], selector); w[19] = hc_byte_perm (w[ 2], w[ 3], selector); w[18] = hc_byte_perm (w[ 1], w[ 2], selector); w[17] = hc_byte_perm (w[ 0], w[ 1], selector); w[16] = hc_byte_perm ( 0, w[ 0], selector); w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 17: w[63] = hc_byte_perm (w[45], w[46], selector); w[62] = hc_byte_perm (w[44], w[45], selector); w[61] = hc_byte_perm (w[43], w[44], selector); w[60] = hc_byte_perm (w[42], w[43], selector); w[59] = hc_byte_perm (w[41], w[42], selector); w[58] = hc_byte_perm (w[40], w[41], selector); w[57] = hc_byte_perm (w[39], w[40], selector); w[56] = hc_byte_perm (w[38], w[39], selector); w[55] = hc_byte_perm (w[37], w[38], selector); w[54] = hc_byte_perm (w[36], w[37], selector); w[53] = hc_byte_perm (w[35], w[36], selector); w[52] = hc_byte_perm (w[34], w[35], selector); w[51] = hc_byte_perm (w[33], w[34], selector); w[50] = hc_byte_perm (w[32], w[33], selector); w[49] = hc_byte_perm (w[31], w[32], selector); w[48] = hc_byte_perm (w[30], w[31], selector); w[47] = hc_byte_perm (w[29], w[30], selector); w[46] = hc_byte_perm (w[28], w[29], selector); w[45] = hc_byte_perm (w[27], w[28], selector); w[44] = hc_byte_perm (w[26], w[27], selector); w[43] = hc_byte_perm (w[25], w[26], selector); w[42] = hc_byte_perm (w[24], w[25], selector); w[41] = hc_byte_perm (w[23], w[24], selector); w[40] = hc_byte_perm (w[22], w[23], selector); w[39] = hc_byte_perm (w[21], w[22], selector); w[38] = hc_byte_perm (w[20], w[21], selector); w[37] = hc_byte_perm (w[19], w[20], selector); w[36] = hc_byte_perm (w[18], w[19], selector); w[35] = hc_byte_perm (w[17], w[18], selector); w[34] = hc_byte_perm (w[16], w[17], selector); w[33] = hc_byte_perm (w[15], w[16], selector); w[32] = hc_byte_perm (w[14], w[15], selector); w[31] = hc_byte_perm (w[13], w[14], selector); w[30] = hc_byte_perm (w[12], w[13], selector); w[29] = hc_byte_perm (w[11], w[12], selector); w[28] = hc_byte_perm (w[10], w[11], selector); w[27] = hc_byte_perm (w[ 9], w[10], selector); w[26] = hc_byte_perm (w[ 8], w[ 9], selector); w[25] = hc_byte_perm (w[ 7], w[ 8], selector); w[24] = hc_byte_perm (w[ 6], w[ 7], selector); w[23] = hc_byte_perm (w[ 5], w[ 6], selector); w[22] = hc_byte_perm (w[ 4], w[ 5], selector); w[21] = hc_byte_perm (w[ 3], w[ 4], selector); w[20] = hc_byte_perm (w[ 2], w[ 3], selector); w[19] = hc_byte_perm (w[ 1], w[ 2], selector); w[18] = hc_byte_perm (w[ 0], w[ 1], selector); w[17] = hc_byte_perm ( 0, w[ 0], selector); w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 18: w[63] = hc_byte_perm (w[44], w[45], selector); w[62] = hc_byte_perm (w[43], w[44], selector); w[61] = hc_byte_perm (w[42], w[43], selector); w[60] = hc_byte_perm (w[41], w[42], selector); w[59] = hc_byte_perm (w[40], w[41], selector); w[58] = hc_byte_perm (w[39], w[40], selector); w[57] = hc_byte_perm (w[38], w[39], selector); w[56] = hc_byte_perm (w[37], w[38], selector); w[55] = hc_byte_perm (w[36], w[37], selector); w[54] = hc_byte_perm (w[35], w[36], selector); w[53] = hc_byte_perm (w[34], w[35], selector); w[52] = hc_byte_perm (w[33], w[34], selector); w[51] = hc_byte_perm (w[32], w[33], selector); w[50] = hc_byte_perm (w[31], w[32], selector); w[49] = hc_byte_perm (w[30], w[31], selector); w[48] = hc_byte_perm (w[29], w[30], selector); w[47] = hc_byte_perm (w[28], w[29], selector); w[46] = hc_byte_perm (w[27], w[28], selector); w[45] = hc_byte_perm (w[26], w[27], selector); w[44] = hc_byte_perm (w[25], w[26], selector); w[43] = hc_byte_perm (w[24], w[25], selector); w[42] = hc_byte_perm (w[23], w[24], selector); w[41] = hc_byte_perm (w[22], w[23], selector); w[40] = hc_byte_perm (w[21], w[22], selector); w[39] = hc_byte_perm (w[20], w[21], selector); w[38] = hc_byte_perm (w[19], w[20], selector); w[37] = hc_byte_perm (w[18], w[19], selector); w[36] = hc_byte_perm (w[17], w[18], selector); w[35] = hc_byte_perm (w[16], w[17], selector); w[34] = hc_byte_perm (w[15], w[16], selector); w[33] = hc_byte_perm (w[14], w[15], selector); w[32] = hc_byte_perm (w[13], w[14], selector); w[31] = hc_byte_perm (w[12], w[13], selector); w[30] = hc_byte_perm (w[11], w[12], selector); w[29] = hc_byte_perm (w[10], w[11], selector); w[28] = hc_byte_perm (w[ 9], w[10], selector); w[27] = hc_byte_perm (w[ 8], w[ 9], selector); w[26] = hc_byte_perm (w[ 7], w[ 8], selector); w[25] = hc_byte_perm (w[ 6], w[ 7], selector); w[24] = hc_byte_perm (w[ 5], w[ 6], selector); w[23] = hc_byte_perm (w[ 4], w[ 5], selector); w[22] = hc_byte_perm (w[ 3], w[ 4], selector); w[21] = hc_byte_perm (w[ 2], w[ 3], selector); w[20] = hc_byte_perm (w[ 1], w[ 2], selector); w[19] = hc_byte_perm (w[ 0], w[ 1], selector); w[18] = hc_byte_perm ( 0, w[ 0], selector); w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 19: w[63] = hc_byte_perm (w[43], w[44], selector); w[62] = hc_byte_perm (w[42], w[43], selector); w[61] = hc_byte_perm (w[41], w[42], selector); w[60] = hc_byte_perm (w[40], w[41], selector); w[59] = hc_byte_perm (w[39], w[40], selector); w[58] = hc_byte_perm (w[38], w[39], selector); w[57] = hc_byte_perm (w[37], w[38], selector); w[56] = hc_byte_perm (w[36], w[37], selector); w[55] = hc_byte_perm (w[35], w[36], selector); w[54] = hc_byte_perm (w[34], w[35], selector); w[53] = hc_byte_perm (w[33], w[34], selector); w[52] = hc_byte_perm (w[32], w[33], selector); w[51] = hc_byte_perm (w[31], w[32], selector); w[50] = hc_byte_perm (w[30], w[31], selector); w[49] = hc_byte_perm (w[29], w[30], selector); w[48] = hc_byte_perm (w[28], w[29], selector); w[47] = hc_byte_perm (w[27], w[28], selector); w[46] = hc_byte_perm (w[26], w[27], selector); w[45] = hc_byte_perm (w[25], w[26], selector); w[44] = hc_byte_perm (w[24], w[25], selector); w[43] = hc_byte_perm (w[23], w[24], selector); w[42] = hc_byte_perm (w[22], w[23], selector); w[41] = hc_byte_perm (w[21], w[22], selector); w[40] = hc_byte_perm (w[20], w[21], selector); w[39] = hc_byte_perm (w[19], w[20], selector); w[38] = hc_byte_perm (w[18], w[19], selector); w[37] = hc_byte_perm (w[17], w[18], selector); w[36] = hc_byte_perm (w[16], w[17], selector); w[35] = hc_byte_perm (w[15], w[16], selector); w[34] = hc_byte_perm (w[14], w[15], selector); w[33] = hc_byte_perm (w[13], w[14], selector); w[32] = hc_byte_perm (w[12], w[13], selector); w[31] = hc_byte_perm (w[11], w[12], selector); w[30] = hc_byte_perm (w[10], w[11], selector); w[29] = hc_byte_perm (w[ 9], w[10], selector); w[28] = hc_byte_perm (w[ 8], w[ 9], selector); w[27] = hc_byte_perm (w[ 7], w[ 8], selector); w[26] = hc_byte_perm (w[ 6], w[ 7], selector); w[25] = hc_byte_perm (w[ 5], w[ 6], selector); w[24] = hc_byte_perm (w[ 4], w[ 5], selector); w[23] = hc_byte_perm (w[ 3], w[ 4], selector); w[22] = hc_byte_perm (w[ 2], w[ 3], selector); w[21] = hc_byte_perm (w[ 1], w[ 2], selector); w[20] = hc_byte_perm (w[ 0], w[ 1], selector); w[19] = hc_byte_perm ( 0, w[ 0], selector); w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 20: w[63] = hc_byte_perm (w[42], w[43], selector); w[62] = hc_byte_perm (w[41], w[42], selector); w[61] = hc_byte_perm (w[40], w[41], selector); w[60] = hc_byte_perm (w[39], w[40], selector); w[59] = hc_byte_perm (w[38], w[39], selector); w[58] = hc_byte_perm (w[37], w[38], selector); w[57] = hc_byte_perm (w[36], w[37], selector); w[56] = hc_byte_perm (w[35], w[36], selector); w[55] = hc_byte_perm (w[34], w[35], selector); w[54] = hc_byte_perm (w[33], w[34], selector); w[53] = hc_byte_perm (w[32], w[33], selector); w[52] = hc_byte_perm (w[31], w[32], selector); w[51] = hc_byte_perm (w[30], w[31], selector); w[50] = hc_byte_perm (w[29], w[30], selector); w[49] = hc_byte_perm (w[28], w[29], selector); w[48] = hc_byte_perm (w[27], w[28], selector); w[47] = hc_byte_perm (w[26], w[27], selector); w[46] = hc_byte_perm (w[25], w[26], selector); w[45] = hc_byte_perm (w[24], w[25], selector); w[44] = hc_byte_perm (w[23], w[24], selector); w[43] = hc_byte_perm (w[22], w[23], selector); w[42] = hc_byte_perm (w[21], w[22], selector); w[41] = hc_byte_perm (w[20], w[21], selector); w[40] = hc_byte_perm (w[19], w[20], selector); w[39] = hc_byte_perm (w[18], w[19], selector); w[38] = hc_byte_perm (w[17], w[18], selector); w[37] = hc_byte_perm (w[16], w[17], selector); w[36] = hc_byte_perm (w[15], w[16], selector); w[35] = hc_byte_perm (w[14], w[15], selector); w[34] = hc_byte_perm (w[13], w[14], selector); w[33] = hc_byte_perm (w[12], w[13], selector); w[32] = hc_byte_perm (w[11], w[12], selector); w[31] = hc_byte_perm (w[10], w[11], selector); w[30] = hc_byte_perm (w[ 9], w[10], selector); w[29] = hc_byte_perm (w[ 8], w[ 9], selector); w[28] = hc_byte_perm (w[ 7], w[ 8], selector); w[27] = hc_byte_perm (w[ 6], w[ 7], selector); w[26] = hc_byte_perm (w[ 5], w[ 6], selector); w[25] = hc_byte_perm (w[ 4], w[ 5], selector); w[24] = hc_byte_perm (w[ 3], w[ 4], selector); w[23] = hc_byte_perm (w[ 2], w[ 3], selector); w[22] = hc_byte_perm (w[ 1], w[ 2], selector); w[21] = hc_byte_perm (w[ 0], w[ 1], selector); w[20] = hc_byte_perm ( 0, w[ 0], selector); w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 21: w[63] = hc_byte_perm (w[41], w[42], selector); w[62] = hc_byte_perm (w[40], w[41], selector); w[61] = hc_byte_perm (w[39], w[40], selector); w[60] = hc_byte_perm (w[38], w[39], selector); w[59] = hc_byte_perm (w[37], w[38], selector); w[58] = hc_byte_perm (w[36], w[37], selector); w[57] = hc_byte_perm (w[35], w[36], selector); w[56] = hc_byte_perm (w[34], w[35], selector); w[55] = hc_byte_perm (w[33], w[34], selector); w[54] = hc_byte_perm (w[32], w[33], selector); w[53] = hc_byte_perm (w[31], w[32], selector); w[52] = hc_byte_perm (w[30], w[31], selector); w[51] = hc_byte_perm (w[29], w[30], selector); w[50] = hc_byte_perm (w[28], w[29], selector); w[49] = hc_byte_perm (w[27], w[28], selector); w[48] = hc_byte_perm (w[26], w[27], selector); w[47] = hc_byte_perm (w[25], w[26], selector); w[46] = hc_byte_perm (w[24], w[25], selector); w[45] = hc_byte_perm (w[23], w[24], selector); w[44] = hc_byte_perm (w[22], w[23], selector); w[43] = hc_byte_perm (w[21], w[22], selector); w[42] = hc_byte_perm (w[20], w[21], selector); w[41] = hc_byte_perm (w[19], w[20], selector); w[40] = hc_byte_perm (w[18], w[19], selector); w[39] = hc_byte_perm (w[17], w[18], selector); w[38] = hc_byte_perm (w[16], w[17], selector); w[37] = hc_byte_perm (w[15], w[16], selector); w[36] = hc_byte_perm (w[14], w[15], selector); w[35] = hc_byte_perm (w[13], w[14], selector); w[34] = hc_byte_perm (w[12], w[13], selector); w[33] = hc_byte_perm (w[11], w[12], selector); w[32] = hc_byte_perm (w[10], w[11], selector); w[31] = hc_byte_perm (w[ 9], w[10], selector); w[30] = hc_byte_perm (w[ 8], w[ 9], selector); w[29] = hc_byte_perm (w[ 7], w[ 8], selector); w[28] = hc_byte_perm (w[ 6], w[ 7], selector); w[27] = hc_byte_perm (w[ 5], w[ 6], selector); w[26] = hc_byte_perm (w[ 4], w[ 5], selector); w[25] = hc_byte_perm (w[ 3], w[ 4], selector); w[24] = hc_byte_perm (w[ 2], w[ 3], selector); w[23] = hc_byte_perm (w[ 1], w[ 2], selector); w[22] = hc_byte_perm (w[ 0], w[ 1], selector); w[21] = hc_byte_perm ( 0, w[ 0], selector); w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 22: w[63] = hc_byte_perm (w[40], w[41], selector); w[62] = hc_byte_perm (w[39], w[40], selector); w[61] = hc_byte_perm (w[38], w[39], selector); w[60] = hc_byte_perm (w[37], w[38], selector); w[59] = hc_byte_perm (w[36], w[37], selector); w[58] = hc_byte_perm (w[35], w[36], selector); w[57] = hc_byte_perm (w[34], w[35], selector); w[56] = hc_byte_perm (w[33], w[34], selector); w[55] = hc_byte_perm (w[32], w[33], selector); w[54] = hc_byte_perm (w[31], w[32], selector); w[53] = hc_byte_perm (w[30], w[31], selector); w[52] = hc_byte_perm (w[29], w[30], selector); w[51] = hc_byte_perm (w[28], w[29], selector); w[50] = hc_byte_perm (w[27], w[28], selector); w[49] = hc_byte_perm (w[26], w[27], selector); w[48] = hc_byte_perm (w[25], w[26], selector); w[47] = hc_byte_perm (w[24], w[25], selector); w[46] = hc_byte_perm (w[23], w[24], selector); w[45] = hc_byte_perm (w[22], w[23], selector); w[44] = hc_byte_perm (w[21], w[22], selector); w[43] = hc_byte_perm (w[20], w[21], selector); w[42] = hc_byte_perm (w[19], w[20], selector); w[41] = hc_byte_perm (w[18], w[19], selector); w[40] = hc_byte_perm (w[17], w[18], selector); w[39] = hc_byte_perm (w[16], w[17], selector); w[38] = hc_byte_perm (w[15], w[16], selector); w[37] = hc_byte_perm (w[14], w[15], selector); w[36] = hc_byte_perm (w[13], w[14], selector); w[35] = hc_byte_perm (w[12], w[13], selector); w[34] = hc_byte_perm (w[11], w[12], selector); w[33] = hc_byte_perm (w[10], w[11], selector); w[32] = hc_byte_perm (w[ 9], w[10], selector); w[31] = hc_byte_perm (w[ 8], w[ 9], selector); w[30] = hc_byte_perm (w[ 7], w[ 8], selector); w[29] = hc_byte_perm (w[ 6], w[ 7], selector); w[28] = hc_byte_perm (w[ 5], w[ 6], selector); w[27] = hc_byte_perm (w[ 4], w[ 5], selector); w[26] = hc_byte_perm (w[ 3], w[ 4], selector); w[25] = hc_byte_perm (w[ 2], w[ 3], selector); w[24] = hc_byte_perm (w[ 1], w[ 2], selector); w[23] = hc_byte_perm (w[ 0], w[ 1], selector); w[22] = hc_byte_perm ( 0, w[ 0], selector); w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 23: w[63] = hc_byte_perm (w[39], w[40], selector); w[62] = hc_byte_perm (w[38], w[39], selector); w[61] = hc_byte_perm (w[37], w[38], selector); w[60] = hc_byte_perm (w[36], w[37], selector); w[59] = hc_byte_perm (w[35], w[36], selector); w[58] = hc_byte_perm (w[34], w[35], selector); w[57] = hc_byte_perm (w[33], w[34], selector); w[56] = hc_byte_perm (w[32], w[33], selector); w[55] = hc_byte_perm (w[31], w[32], selector); w[54] = hc_byte_perm (w[30], w[31], selector); w[53] = hc_byte_perm (w[29], w[30], selector); w[52] = hc_byte_perm (w[28], w[29], selector); w[51] = hc_byte_perm (w[27], w[28], selector); w[50] = hc_byte_perm (w[26], w[27], selector); w[49] = hc_byte_perm (w[25], w[26], selector); w[48] = hc_byte_perm (w[24], w[25], selector); w[47] = hc_byte_perm (w[23], w[24], selector); w[46] = hc_byte_perm (w[22], w[23], selector); w[45] = hc_byte_perm (w[21], w[22], selector); w[44] = hc_byte_perm (w[20], w[21], selector); w[43] = hc_byte_perm (w[19], w[20], selector); w[42] = hc_byte_perm (w[18], w[19], selector); w[41] = hc_byte_perm (w[17], w[18], selector); w[40] = hc_byte_perm (w[16], w[17], selector); w[39] = hc_byte_perm (w[15], w[16], selector); w[38] = hc_byte_perm (w[14], w[15], selector); w[37] = hc_byte_perm (w[13], w[14], selector); w[36] = hc_byte_perm (w[12], w[13], selector); w[35] = hc_byte_perm (w[11], w[12], selector); w[34] = hc_byte_perm (w[10], w[11], selector); w[33] = hc_byte_perm (w[ 9], w[10], selector); w[32] = hc_byte_perm (w[ 8], w[ 9], selector); w[31] = hc_byte_perm (w[ 7], w[ 8], selector); w[30] = hc_byte_perm (w[ 6], w[ 7], selector); w[29] = hc_byte_perm (w[ 5], w[ 6], selector); w[28] = hc_byte_perm (w[ 4], w[ 5], selector); w[27] = hc_byte_perm (w[ 3], w[ 4], selector); w[26] = hc_byte_perm (w[ 2], w[ 3], selector); w[25] = hc_byte_perm (w[ 1], w[ 2], selector); w[24] = hc_byte_perm (w[ 0], w[ 1], selector); w[23] = hc_byte_perm ( 0, w[ 0], selector); w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 24: w[63] = hc_byte_perm (w[38], w[39], selector); w[62] = hc_byte_perm (w[37], w[38], selector); w[61] = hc_byte_perm (w[36], w[37], selector); w[60] = hc_byte_perm (w[35], w[36], selector); w[59] = hc_byte_perm (w[34], w[35], selector); w[58] = hc_byte_perm (w[33], w[34], selector); w[57] = hc_byte_perm (w[32], w[33], selector); w[56] = hc_byte_perm (w[31], w[32], selector); w[55] = hc_byte_perm (w[30], w[31], selector); w[54] = hc_byte_perm (w[29], w[30], selector); w[53] = hc_byte_perm (w[28], w[29], selector); w[52] = hc_byte_perm (w[27], w[28], selector); w[51] = hc_byte_perm (w[26], w[27], selector); w[50] = hc_byte_perm (w[25], w[26], selector); w[49] = hc_byte_perm (w[24], w[25], selector); w[48] = hc_byte_perm (w[23], w[24], selector); w[47] = hc_byte_perm (w[22], w[23], selector); w[46] = hc_byte_perm (w[21], w[22], selector); w[45] = hc_byte_perm (w[20], w[21], selector); w[44] = hc_byte_perm (w[19], w[20], selector); w[43] = hc_byte_perm (w[18], w[19], selector); w[42] = hc_byte_perm (w[17], w[18], selector); w[41] = hc_byte_perm (w[16], w[17], selector); w[40] = hc_byte_perm (w[15], w[16], selector); w[39] = hc_byte_perm (w[14], w[15], selector); w[38] = hc_byte_perm (w[13], w[14], selector); w[37] = hc_byte_perm (w[12], w[13], selector); w[36] = hc_byte_perm (w[11], w[12], selector); w[35] = hc_byte_perm (w[10], w[11], selector); w[34] = hc_byte_perm (w[ 9], w[10], selector); w[33] = hc_byte_perm (w[ 8], w[ 9], selector); w[32] = hc_byte_perm (w[ 7], w[ 8], selector); w[31] = hc_byte_perm (w[ 6], w[ 7], selector); w[30] = hc_byte_perm (w[ 5], w[ 6], selector); w[29] = hc_byte_perm (w[ 4], w[ 5], selector); w[28] = hc_byte_perm (w[ 3], w[ 4], selector); w[27] = hc_byte_perm (w[ 2], w[ 3], selector); w[26] = hc_byte_perm (w[ 1], w[ 2], selector); w[25] = hc_byte_perm (w[ 0], w[ 1], selector); w[24] = hc_byte_perm ( 0, w[ 0], selector); w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 25: w[63] = hc_byte_perm (w[37], w[38], selector); w[62] = hc_byte_perm (w[36], w[37], selector); w[61] = hc_byte_perm (w[35], w[36], selector); w[60] = hc_byte_perm (w[34], w[35], selector); w[59] = hc_byte_perm (w[33], w[34], selector); w[58] = hc_byte_perm (w[32], w[33], selector); w[57] = hc_byte_perm (w[31], w[32], selector); w[56] = hc_byte_perm (w[30], w[31], selector); w[55] = hc_byte_perm (w[29], w[30], selector); w[54] = hc_byte_perm (w[28], w[29], selector); w[53] = hc_byte_perm (w[27], w[28], selector); w[52] = hc_byte_perm (w[26], w[27], selector); w[51] = hc_byte_perm (w[25], w[26], selector); w[50] = hc_byte_perm (w[24], w[25], selector); w[49] = hc_byte_perm (w[23], w[24], selector); w[48] = hc_byte_perm (w[22], w[23], selector); w[47] = hc_byte_perm (w[21], w[22], selector); w[46] = hc_byte_perm (w[20], w[21], selector); w[45] = hc_byte_perm (w[19], w[20], selector); w[44] = hc_byte_perm (w[18], w[19], selector); w[43] = hc_byte_perm (w[17], w[18], selector); w[42] = hc_byte_perm (w[16], w[17], selector); w[41] = hc_byte_perm (w[15], w[16], selector); w[40] = hc_byte_perm (w[14], w[15], selector); w[39] = hc_byte_perm (w[13], w[14], selector); w[38] = hc_byte_perm (w[12], w[13], selector); w[37] = hc_byte_perm (w[11], w[12], selector); w[36] = hc_byte_perm (w[10], w[11], selector); w[35] = hc_byte_perm (w[ 9], w[10], selector); w[34] = hc_byte_perm (w[ 8], w[ 9], selector); w[33] = hc_byte_perm (w[ 7], w[ 8], selector); w[32] = hc_byte_perm (w[ 6], w[ 7], selector); w[31] = hc_byte_perm (w[ 5], w[ 6], selector); w[30] = hc_byte_perm (w[ 4], w[ 5], selector); w[29] = hc_byte_perm (w[ 3], w[ 4], selector); w[28] = hc_byte_perm (w[ 2], w[ 3], selector); w[27] = hc_byte_perm (w[ 1], w[ 2], selector); w[26] = hc_byte_perm (w[ 0], w[ 1], selector); w[25] = hc_byte_perm ( 0, w[ 0], selector); w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 26: w[63] = hc_byte_perm (w[36], w[37], selector); w[62] = hc_byte_perm (w[35], w[36], selector); w[61] = hc_byte_perm (w[34], w[35], selector); w[60] = hc_byte_perm (w[33], w[34], selector); w[59] = hc_byte_perm (w[32], w[33], selector); w[58] = hc_byte_perm (w[31], w[32], selector); w[57] = hc_byte_perm (w[30], w[31], selector); w[56] = hc_byte_perm (w[29], w[30], selector); w[55] = hc_byte_perm (w[28], w[29], selector); w[54] = hc_byte_perm (w[27], w[28], selector); w[53] = hc_byte_perm (w[26], w[27], selector); w[52] = hc_byte_perm (w[25], w[26], selector); w[51] = hc_byte_perm (w[24], w[25], selector); w[50] = hc_byte_perm (w[23], w[24], selector); w[49] = hc_byte_perm (w[22], w[23], selector); w[48] = hc_byte_perm (w[21], w[22], selector); w[47] = hc_byte_perm (w[20], w[21], selector); w[46] = hc_byte_perm (w[19], w[20], selector); w[45] = hc_byte_perm (w[18], w[19], selector); w[44] = hc_byte_perm (w[17], w[18], selector); w[43] = hc_byte_perm (w[16], w[17], selector); w[42] = hc_byte_perm (w[15], w[16], selector); w[41] = hc_byte_perm (w[14], w[15], selector); w[40] = hc_byte_perm (w[13], w[14], selector); w[39] = hc_byte_perm (w[12], w[13], selector); w[38] = hc_byte_perm (w[11], w[12], selector); w[37] = hc_byte_perm (w[10], w[11], selector); w[36] = hc_byte_perm (w[ 9], w[10], selector); w[35] = hc_byte_perm (w[ 8], w[ 9], selector); w[34] = hc_byte_perm (w[ 7], w[ 8], selector); w[33] = hc_byte_perm (w[ 6], w[ 7], selector); w[32] = hc_byte_perm (w[ 5], w[ 6], selector); w[31] = hc_byte_perm (w[ 4], w[ 5], selector); w[30] = hc_byte_perm (w[ 3], w[ 4], selector); w[29] = hc_byte_perm (w[ 2], w[ 3], selector); w[28] = hc_byte_perm (w[ 1], w[ 2], selector); w[27] = hc_byte_perm (w[ 0], w[ 1], selector); w[26] = hc_byte_perm ( 0, w[ 0], selector); w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 27: w[63] = hc_byte_perm (w[35], w[36], selector); w[62] = hc_byte_perm (w[34], w[35], selector); w[61] = hc_byte_perm (w[33], w[34], selector); w[60] = hc_byte_perm (w[32], w[33], selector); w[59] = hc_byte_perm (w[31], w[32], selector); w[58] = hc_byte_perm (w[30], w[31], selector); w[57] = hc_byte_perm (w[29], w[30], selector); w[56] = hc_byte_perm (w[28], w[29], selector); w[55] = hc_byte_perm (w[27], w[28], selector); w[54] = hc_byte_perm (w[26], w[27], selector); w[53] = hc_byte_perm (w[25], w[26], selector); w[52] = hc_byte_perm (w[24], w[25], selector); w[51] = hc_byte_perm (w[23], w[24], selector); w[50] = hc_byte_perm (w[22], w[23], selector); w[49] = hc_byte_perm (w[21], w[22], selector); w[48] = hc_byte_perm (w[20], w[21], selector); w[47] = hc_byte_perm (w[19], w[20], selector); w[46] = hc_byte_perm (w[18], w[19], selector); w[45] = hc_byte_perm (w[17], w[18], selector); w[44] = hc_byte_perm (w[16], w[17], selector); w[43] = hc_byte_perm (w[15], w[16], selector); w[42] = hc_byte_perm (w[14], w[15], selector); w[41] = hc_byte_perm (w[13], w[14], selector); w[40] = hc_byte_perm (w[12], w[13], selector); w[39] = hc_byte_perm (w[11], w[12], selector); w[38] = hc_byte_perm (w[10], w[11], selector); w[37] = hc_byte_perm (w[ 9], w[10], selector); w[36] = hc_byte_perm (w[ 8], w[ 9], selector); w[35] = hc_byte_perm (w[ 7], w[ 8], selector); w[34] = hc_byte_perm (w[ 6], w[ 7], selector); w[33] = hc_byte_perm (w[ 5], w[ 6], selector); w[32] = hc_byte_perm (w[ 4], w[ 5], selector); w[31] = hc_byte_perm (w[ 3], w[ 4], selector); w[30] = hc_byte_perm (w[ 2], w[ 3], selector); w[29] = hc_byte_perm (w[ 1], w[ 2], selector); w[28] = hc_byte_perm (w[ 0], w[ 1], selector); w[27] = hc_byte_perm ( 0, w[ 0], selector); w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 28: w[63] = hc_byte_perm (w[34], w[35], selector); w[62] = hc_byte_perm (w[33], w[34], selector); w[61] = hc_byte_perm (w[32], w[33], selector); w[60] = hc_byte_perm (w[31], w[32], selector); w[59] = hc_byte_perm (w[30], w[31], selector); w[58] = hc_byte_perm (w[29], w[30], selector); w[57] = hc_byte_perm (w[28], w[29], selector); w[56] = hc_byte_perm (w[27], w[28], selector); w[55] = hc_byte_perm (w[26], w[27], selector); w[54] = hc_byte_perm (w[25], w[26], selector); w[53] = hc_byte_perm (w[24], w[25], selector); w[52] = hc_byte_perm (w[23], w[24], selector); w[51] = hc_byte_perm (w[22], w[23], selector); w[50] = hc_byte_perm (w[21], w[22], selector); w[49] = hc_byte_perm (w[20], w[21], selector); w[48] = hc_byte_perm (w[19], w[20], selector); w[47] = hc_byte_perm (w[18], w[19], selector); w[46] = hc_byte_perm (w[17], w[18], selector); w[45] = hc_byte_perm (w[16], w[17], selector); w[44] = hc_byte_perm (w[15], w[16], selector); w[43] = hc_byte_perm (w[14], w[15], selector); w[42] = hc_byte_perm (w[13], w[14], selector); w[41] = hc_byte_perm (w[12], w[13], selector); w[40] = hc_byte_perm (w[11], w[12], selector); w[39] = hc_byte_perm (w[10], w[11], selector); w[38] = hc_byte_perm (w[ 9], w[10], selector); w[37] = hc_byte_perm (w[ 8], w[ 9], selector); w[36] = hc_byte_perm (w[ 7], w[ 8], selector); w[35] = hc_byte_perm (w[ 6], w[ 7], selector); w[34] = hc_byte_perm (w[ 5], w[ 6], selector); w[33] = hc_byte_perm (w[ 4], w[ 5], selector); w[32] = hc_byte_perm (w[ 3], w[ 4], selector); w[31] = hc_byte_perm (w[ 2], w[ 3], selector); w[30] = hc_byte_perm (w[ 1], w[ 2], selector); w[29] = hc_byte_perm (w[ 0], w[ 1], selector); w[28] = hc_byte_perm ( 0, w[ 0], selector); w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 29: w[63] = hc_byte_perm (w[33], w[34], selector); w[62] = hc_byte_perm (w[32], w[33], selector); w[61] = hc_byte_perm (w[31], w[32], selector); w[60] = hc_byte_perm (w[30], w[31], selector); w[59] = hc_byte_perm (w[29], w[30], selector); w[58] = hc_byte_perm (w[28], w[29], selector); w[57] = hc_byte_perm (w[27], w[28], selector); w[56] = hc_byte_perm (w[26], w[27], selector); w[55] = hc_byte_perm (w[25], w[26], selector); w[54] = hc_byte_perm (w[24], w[25], selector); w[53] = hc_byte_perm (w[23], w[24], selector); w[52] = hc_byte_perm (w[22], w[23], selector); w[51] = hc_byte_perm (w[21], w[22], selector); w[50] = hc_byte_perm (w[20], w[21], selector); w[49] = hc_byte_perm (w[19], w[20], selector); w[48] = hc_byte_perm (w[18], w[19], selector); w[47] = hc_byte_perm (w[17], w[18], selector); w[46] = hc_byte_perm (w[16], w[17], selector); w[45] = hc_byte_perm (w[15], w[16], selector); w[44] = hc_byte_perm (w[14], w[15], selector); w[43] = hc_byte_perm (w[13], w[14], selector); w[42] = hc_byte_perm (w[12], w[13], selector); w[41] = hc_byte_perm (w[11], w[12], selector); w[40] = hc_byte_perm (w[10], w[11], selector); w[39] = hc_byte_perm (w[ 9], w[10], selector); w[38] = hc_byte_perm (w[ 8], w[ 9], selector); w[37] = hc_byte_perm (w[ 7], w[ 8], selector); w[36] = hc_byte_perm (w[ 6], w[ 7], selector); w[35] = hc_byte_perm (w[ 5], w[ 6], selector); w[34] = hc_byte_perm (w[ 4], w[ 5], selector); w[33] = hc_byte_perm (w[ 3], w[ 4], selector); w[32] = hc_byte_perm (w[ 2], w[ 3], selector); w[31] = hc_byte_perm (w[ 1], w[ 2], selector); w[30] = hc_byte_perm (w[ 0], w[ 1], selector); w[29] = hc_byte_perm ( 0, w[ 0], selector); w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 30: w[63] = hc_byte_perm (w[32], w[33], selector); w[62] = hc_byte_perm (w[31], w[32], selector); w[61] = hc_byte_perm (w[30], w[31], selector); w[60] = hc_byte_perm (w[29], w[30], selector); w[59] = hc_byte_perm (w[28], w[29], selector); w[58] = hc_byte_perm (w[27], w[28], selector); w[57] = hc_byte_perm (w[26], w[27], selector); w[56] = hc_byte_perm (w[25], w[26], selector); w[55] = hc_byte_perm (w[24], w[25], selector); w[54] = hc_byte_perm (w[23], w[24], selector); w[53] = hc_byte_perm (w[22], w[23], selector); w[52] = hc_byte_perm (w[21], w[22], selector); w[51] = hc_byte_perm (w[20], w[21], selector); w[50] = hc_byte_perm (w[19], w[20], selector); w[49] = hc_byte_perm (w[18], w[19], selector); w[48] = hc_byte_perm (w[17], w[18], selector); w[47] = hc_byte_perm (w[16], w[17], selector); w[46] = hc_byte_perm (w[15], w[16], selector); w[45] = hc_byte_perm (w[14], w[15], selector); w[44] = hc_byte_perm (w[13], w[14], selector); w[43] = hc_byte_perm (w[12], w[13], selector); w[42] = hc_byte_perm (w[11], w[12], selector); w[41] = hc_byte_perm (w[10], w[11], selector); w[40] = hc_byte_perm (w[ 9], w[10], selector); w[39] = hc_byte_perm (w[ 8], w[ 9], selector); w[38] = hc_byte_perm (w[ 7], w[ 8], selector); w[37] = hc_byte_perm (w[ 6], w[ 7], selector); w[36] = hc_byte_perm (w[ 5], w[ 6], selector); w[35] = hc_byte_perm (w[ 4], w[ 5], selector); w[34] = hc_byte_perm (w[ 3], w[ 4], selector); w[33] = hc_byte_perm (w[ 2], w[ 3], selector); w[32] = hc_byte_perm (w[ 1], w[ 2], selector); w[31] = hc_byte_perm (w[ 0], w[ 1], selector); w[30] = hc_byte_perm ( 0, w[ 0], selector); w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 31: w[63] = hc_byte_perm (w[31], w[32], selector); w[62] = hc_byte_perm (w[30], w[31], selector); w[61] = hc_byte_perm (w[29], w[30], selector); w[60] = hc_byte_perm (w[28], w[29], selector); w[59] = hc_byte_perm (w[27], w[28], selector); w[58] = hc_byte_perm (w[26], w[27], selector); w[57] = hc_byte_perm (w[25], w[26], selector); w[56] = hc_byte_perm (w[24], w[25], selector); w[55] = hc_byte_perm (w[23], w[24], selector); w[54] = hc_byte_perm (w[22], w[23], selector); w[53] = hc_byte_perm (w[21], w[22], selector); w[52] = hc_byte_perm (w[20], w[21], selector); w[51] = hc_byte_perm (w[19], w[20], selector); w[50] = hc_byte_perm (w[18], w[19], selector); w[49] = hc_byte_perm (w[17], w[18], selector); w[48] = hc_byte_perm (w[16], w[17], selector); w[47] = hc_byte_perm (w[15], w[16], selector); w[46] = hc_byte_perm (w[14], w[15], selector); w[45] = hc_byte_perm (w[13], w[14], selector); w[44] = hc_byte_perm (w[12], w[13], selector); w[43] = hc_byte_perm (w[11], w[12], selector); w[42] = hc_byte_perm (w[10], w[11], selector); w[41] = hc_byte_perm (w[ 9], w[10], selector); w[40] = hc_byte_perm (w[ 8], w[ 9], selector); w[39] = hc_byte_perm (w[ 7], w[ 8], selector); w[38] = hc_byte_perm (w[ 6], w[ 7], selector); w[37] = hc_byte_perm (w[ 5], w[ 6], selector); w[36] = hc_byte_perm (w[ 4], w[ 5], selector); w[35] = hc_byte_perm (w[ 3], w[ 4], selector); w[34] = hc_byte_perm (w[ 2], w[ 3], selector); w[33] = hc_byte_perm (w[ 1], w[ 2], selector); w[32] = hc_byte_perm (w[ 0], w[ 1], selector); w[31] = hc_byte_perm ( 0, w[ 0], selector); w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 32: w[63] = hc_byte_perm (w[30], w[31], selector); w[62] = hc_byte_perm (w[29], w[30], selector); w[61] = hc_byte_perm (w[28], w[29], selector); w[60] = hc_byte_perm (w[27], w[28], selector); w[59] = hc_byte_perm (w[26], w[27], selector); w[58] = hc_byte_perm (w[25], w[26], selector); w[57] = hc_byte_perm (w[24], w[25], selector); w[56] = hc_byte_perm (w[23], w[24], selector); w[55] = hc_byte_perm (w[22], w[23], selector); w[54] = hc_byte_perm (w[21], w[22], selector); w[53] = hc_byte_perm (w[20], w[21], selector); w[52] = hc_byte_perm (w[19], w[20], selector); w[51] = hc_byte_perm (w[18], w[19], selector); w[50] = hc_byte_perm (w[17], w[18], selector); w[49] = hc_byte_perm (w[16], w[17], selector); w[48] = hc_byte_perm (w[15], w[16], selector); w[47] = hc_byte_perm (w[14], w[15], selector); w[46] = hc_byte_perm (w[13], w[14], selector); w[45] = hc_byte_perm (w[12], w[13], selector); w[44] = hc_byte_perm (w[11], w[12], selector); w[43] = hc_byte_perm (w[10], w[11], selector); w[42] = hc_byte_perm (w[ 9], w[10], selector); w[41] = hc_byte_perm (w[ 8], w[ 9], selector); w[40] = hc_byte_perm (w[ 7], w[ 8], selector); w[39] = hc_byte_perm (w[ 6], w[ 7], selector); w[38] = hc_byte_perm (w[ 5], w[ 6], selector); w[37] = hc_byte_perm (w[ 4], w[ 5], selector); w[36] = hc_byte_perm (w[ 3], w[ 4], selector); w[35] = hc_byte_perm (w[ 2], w[ 3], selector); w[34] = hc_byte_perm (w[ 1], w[ 2], selector); w[33] = hc_byte_perm (w[ 0], w[ 1], selector); w[32] = hc_byte_perm ( 0, w[ 0], selector); w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 33: w[63] = hc_byte_perm (w[29], w[30], selector); w[62] = hc_byte_perm (w[28], w[29], selector); w[61] = hc_byte_perm (w[27], w[28], selector); w[60] = hc_byte_perm (w[26], w[27], selector); w[59] = hc_byte_perm (w[25], w[26], selector); w[58] = hc_byte_perm (w[24], w[25], selector); w[57] = hc_byte_perm (w[23], w[24], selector); w[56] = hc_byte_perm (w[22], w[23], selector); w[55] = hc_byte_perm (w[21], w[22], selector); w[54] = hc_byte_perm (w[20], w[21], selector); w[53] = hc_byte_perm (w[19], w[20], selector); w[52] = hc_byte_perm (w[18], w[19], selector); w[51] = hc_byte_perm (w[17], w[18], selector); w[50] = hc_byte_perm (w[16], w[17], selector); w[49] = hc_byte_perm (w[15], w[16], selector); w[48] = hc_byte_perm (w[14], w[15], selector); w[47] = hc_byte_perm (w[13], w[14], selector); w[46] = hc_byte_perm (w[12], w[13], selector); w[45] = hc_byte_perm (w[11], w[12], selector); w[44] = hc_byte_perm (w[10], w[11], selector); w[43] = hc_byte_perm (w[ 9], w[10], selector); w[42] = hc_byte_perm (w[ 8], w[ 9], selector); w[41] = hc_byte_perm (w[ 7], w[ 8], selector); w[40] = hc_byte_perm (w[ 6], w[ 7], selector); w[39] = hc_byte_perm (w[ 5], w[ 6], selector); w[38] = hc_byte_perm (w[ 4], w[ 5], selector); w[37] = hc_byte_perm (w[ 3], w[ 4], selector); w[36] = hc_byte_perm (w[ 2], w[ 3], selector); w[35] = hc_byte_perm (w[ 1], w[ 2], selector); w[34] = hc_byte_perm (w[ 0], w[ 1], selector); w[33] = hc_byte_perm ( 0, w[ 0], selector); w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 34: w[63] = hc_byte_perm (w[28], w[29], selector); w[62] = hc_byte_perm (w[27], w[28], selector); w[61] = hc_byte_perm (w[26], w[27], selector); w[60] = hc_byte_perm (w[25], w[26], selector); w[59] = hc_byte_perm (w[24], w[25], selector); w[58] = hc_byte_perm (w[23], w[24], selector); w[57] = hc_byte_perm (w[22], w[23], selector); w[56] = hc_byte_perm (w[21], w[22], selector); w[55] = hc_byte_perm (w[20], w[21], selector); w[54] = hc_byte_perm (w[19], w[20], selector); w[53] = hc_byte_perm (w[18], w[19], selector); w[52] = hc_byte_perm (w[17], w[18], selector); w[51] = hc_byte_perm (w[16], w[17], selector); w[50] = hc_byte_perm (w[15], w[16], selector); w[49] = hc_byte_perm (w[14], w[15], selector); w[48] = hc_byte_perm (w[13], w[14], selector); w[47] = hc_byte_perm (w[12], w[13], selector); w[46] = hc_byte_perm (w[11], w[12], selector); w[45] = hc_byte_perm (w[10], w[11], selector); w[44] = hc_byte_perm (w[ 9], w[10], selector); w[43] = hc_byte_perm (w[ 8], w[ 9], selector); w[42] = hc_byte_perm (w[ 7], w[ 8], selector); w[41] = hc_byte_perm (w[ 6], w[ 7], selector); w[40] = hc_byte_perm (w[ 5], w[ 6], selector); w[39] = hc_byte_perm (w[ 4], w[ 5], selector); w[38] = hc_byte_perm (w[ 3], w[ 4], selector); w[37] = hc_byte_perm (w[ 2], w[ 3], selector); w[36] = hc_byte_perm (w[ 1], w[ 2], selector); w[35] = hc_byte_perm (w[ 0], w[ 1], selector); w[34] = hc_byte_perm ( 0, w[ 0], selector); w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 35: w[63] = hc_byte_perm (w[27], w[28], selector); w[62] = hc_byte_perm (w[26], w[27], selector); w[61] = hc_byte_perm (w[25], w[26], selector); w[60] = hc_byte_perm (w[24], w[25], selector); w[59] = hc_byte_perm (w[23], w[24], selector); w[58] = hc_byte_perm (w[22], w[23], selector); w[57] = hc_byte_perm (w[21], w[22], selector); w[56] = hc_byte_perm (w[20], w[21], selector); w[55] = hc_byte_perm (w[19], w[20], selector); w[54] = hc_byte_perm (w[18], w[19], selector); w[53] = hc_byte_perm (w[17], w[18], selector); w[52] = hc_byte_perm (w[16], w[17], selector); w[51] = hc_byte_perm (w[15], w[16], selector); w[50] = hc_byte_perm (w[14], w[15], selector); w[49] = hc_byte_perm (w[13], w[14], selector); w[48] = hc_byte_perm (w[12], w[13], selector); w[47] = hc_byte_perm (w[11], w[12], selector); w[46] = hc_byte_perm (w[10], w[11], selector); w[45] = hc_byte_perm (w[ 9], w[10], selector); w[44] = hc_byte_perm (w[ 8], w[ 9], selector); w[43] = hc_byte_perm (w[ 7], w[ 8], selector); w[42] = hc_byte_perm (w[ 6], w[ 7], selector); w[41] = hc_byte_perm (w[ 5], w[ 6], selector); w[40] = hc_byte_perm (w[ 4], w[ 5], selector); w[39] = hc_byte_perm (w[ 3], w[ 4], selector); w[38] = hc_byte_perm (w[ 2], w[ 3], selector); w[37] = hc_byte_perm (w[ 1], w[ 2], selector); w[36] = hc_byte_perm (w[ 0], w[ 1], selector); w[35] = hc_byte_perm ( 0, w[ 0], selector); w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 36: w[63] = hc_byte_perm (w[26], w[27], selector); w[62] = hc_byte_perm (w[25], w[26], selector); w[61] = hc_byte_perm (w[24], w[25], selector); w[60] = hc_byte_perm (w[23], w[24], selector); w[59] = hc_byte_perm (w[22], w[23], selector); w[58] = hc_byte_perm (w[21], w[22], selector); w[57] = hc_byte_perm (w[20], w[21], selector); w[56] = hc_byte_perm (w[19], w[20], selector); w[55] = hc_byte_perm (w[18], w[19], selector); w[54] = hc_byte_perm (w[17], w[18], selector); w[53] = hc_byte_perm (w[16], w[17], selector); w[52] = hc_byte_perm (w[15], w[16], selector); w[51] = hc_byte_perm (w[14], w[15], selector); w[50] = hc_byte_perm (w[13], w[14], selector); w[49] = hc_byte_perm (w[12], w[13], selector); w[48] = hc_byte_perm (w[11], w[12], selector); w[47] = hc_byte_perm (w[10], w[11], selector); w[46] = hc_byte_perm (w[ 9], w[10], selector); w[45] = hc_byte_perm (w[ 8], w[ 9], selector); w[44] = hc_byte_perm (w[ 7], w[ 8], selector); w[43] = hc_byte_perm (w[ 6], w[ 7], selector); w[42] = hc_byte_perm (w[ 5], w[ 6], selector); w[41] = hc_byte_perm (w[ 4], w[ 5], selector); w[40] = hc_byte_perm (w[ 3], w[ 4], selector); w[39] = hc_byte_perm (w[ 2], w[ 3], selector); w[38] = hc_byte_perm (w[ 1], w[ 2], selector); w[37] = hc_byte_perm (w[ 0], w[ 1], selector); w[36] = hc_byte_perm ( 0, w[ 0], selector); w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 37: w[63] = hc_byte_perm (w[25], w[26], selector); w[62] = hc_byte_perm (w[24], w[25], selector); w[61] = hc_byte_perm (w[23], w[24], selector); w[60] = hc_byte_perm (w[22], w[23], selector); w[59] = hc_byte_perm (w[21], w[22], selector); w[58] = hc_byte_perm (w[20], w[21], selector); w[57] = hc_byte_perm (w[19], w[20], selector); w[56] = hc_byte_perm (w[18], w[19], selector); w[55] = hc_byte_perm (w[17], w[18], selector); w[54] = hc_byte_perm (w[16], w[17], selector); w[53] = hc_byte_perm (w[15], w[16], selector); w[52] = hc_byte_perm (w[14], w[15], selector); w[51] = hc_byte_perm (w[13], w[14], selector); w[50] = hc_byte_perm (w[12], w[13], selector); w[49] = hc_byte_perm (w[11], w[12], selector); w[48] = hc_byte_perm (w[10], w[11], selector); w[47] = hc_byte_perm (w[ 9], w[10], selector); w[46] = hc_byte_perm (w[ 8], w[ 9], selector); w[45] = hc_byte_perm (w[ 7], w[ 8], selector); w[44] = hc_byte_perm (w[ 6], w[ 7], selector); w[43] = hc_byte_perm (w[ 5], w[ 6], selector); w[42] = hc_byte_perm (w[ 4], w[ 5], selector); w[41] = hc_byte_perm (w[ 3], w[ 4], selector); w[40] = hc_byte_perm (w[ 2], w[ 3], selector); w[39] = hc_byte_perm (w[ 1], w[ 2], selector); w[38] = hc_byte_perm (w[ 0], w[ 1], selector); w[37] = hc_byte_perm ( 0, w[ 0], selector); w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 38: w[63] = hc_byte_perm (w[24], w[25], selector); w[62] = hc_byte_perm (w[23], w[24], selector); w[61] = hc_byte_perm (w[22], w[23], selector); w[60] = hc_byte_perm (w[21], w[22], selector); w[59] = hc_byte_perm (w[20], w[21], selector); w[58] = hc_byte_perm (w[19], w[20], selector); w[57] = hc_byte_perm (w[18], w[19], selector); w[56] = hc_byte_perm (w[17], w[18], selector); w[55] = hc_byte_perm (w[16], w[17], selector); w[54] = hc_byte_perm (w[15], w[16], selector); w[53] = hc_byte_perm (w[14], w[15], selector); w[52] = hc_byte_perm (w[13], w[14], selector); w[51] = hc_byte_perm (w[12], w[13], selector); w[50] = hc_byte_perm (w[11], w[12], selector); w[49] = hc_byte_perm (w[10], w[11], selector); w[48] = hc_byte_perm (w[ 9], w[10], selector); w[47] = hc_byte_perm (w[ 8], w[ 9], selector); w[46] = hc_byte_perm (w[ 7], w[ 8], selector); w[45] = hc_byte_perm (w[ 6], w[ 7], selector); w[44] = hc_byte_perm (w[ 5], w[ 6], selector); w[43] = hc_byte_perm (w[ 4], w[ 5], selector); w[42] = hc_byte_perm (w[ 3], w[ 4], selector); w[41] = hc_byte_perm (w[ 2], w[ 3], selector); w[40] = hc_byte_perm (w[ 1], w[ 2], selector); w[39] = hc_byte_perm (w[ 0], w[ 1], selector); w[38] = hc_byte_perm ( 0, w[ 0], selector); w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 39: w[63] = hc_byte_perm (w[23], w[24], selector); w[62] = hc_byte_perm (w[22], w[23], selector); w[61] = hc_byte_perm (w[21], w[22], selector); w[60] = hc_byte_perm (w[20], w[21], selector); w[59] = hc_byte_perm (w[19], w[20], selector); w[58] = hc_byte_perm (w[18], w[19], selector); w[57] = hc_byte_perm (w[17], w[18], selector); w[56] = hc_byte_perm (w[16], w[17], selector); w[55] = hc_byte_perm (w[15], w[16], selector); w[54] = hc_byte_perm (w[14], w[15], selector); w[53] = hc_byte_perm (w[13], w[14], selector); w[52] = hc_byte_perm (w[12], w[13], selector); w[51] = hc_byte_perm (w[11], w[12], selector); w[50] = hc_byte_perm (w[10], w[11], selector); w[49] = hc_byte_perm (w[ 9], w[10], selector); w[48] = hc_byte_perm (w[ 8], w[ 9], selector); w[47] = hc_byte_perm (w[ 7], w[ 8], selector); w[46] = hc_byte_perm (w[ 6], w[ 7], selector); w[45] = hc_byte_perm (w[ 5], w[ 6], selector); w[44] = hc_byte_perm (w[ 4], w[ 5], selector); w[43] = hc_byte_perm (w[ 3], w[ 4], selector); w[42] = hc_byte_perm (w[ 2], w[ 3], selector); w[41] = hc_byte_perm (w[ 1], w[ 2], selector); w[40] = hc_byte_perm (w[ 0], w[ 1], selector); w[39] = hc_byte_perm ( 0, w[ 0], selector); w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 40: w[63] = hc_byte_perm (w[22], w[23], selector); w[62] = hc_byte_perm (w[21], w[22], selector); w[61] = hc_byte_perm (w[20], w[21], selector); w[60] = hc_byte_perm (w[19], w[20], selector); w[59] = hc_byte_perm (w[18], w[19], selector); w[58] = hc_byte_perm (w[17], w[18], selector); w[57] = hc_byte_perm (w[16], w[17], selector); w[56] = hc_byte_perm (w[15], w[16], selector); w[55] = hc_byte_perm (w[14], w[15], selector); w[54] = hc_byte_perm (w[13], w[14], selector); w[53] = hc_byte_perm (w[12], w[13], selector); w[52] = hc_byte_perm (w[11], w[12], selector); w[51] = hc_byte_perm (w[10], w[11], selector); w[50] = hc_byte_perm (w[ 9], w[10], selector); w[49] = hc_byte_perm (w[ 8], w[ 9], selector); w[48] = hc_byte_perm (w[ 7], w[ 8], selector); w[47] = hc_byte_perm (w[ 6], w[ 7], selector); w[46] = hc_byte_perm (w[ 5], w[ 6], selector); w[45] = hc_byte_perm (w[ 4], w[ 5], selector); w[44] = hc_byte_perm (w[ 3], w[ 4], selector); w[43] = hc_byte_perm (w[ 2], w[ 3], selector); w[42] = hc_byte_perm (w[ 1], w[ 2], selector); w[41] = hc_byte_perm (w[ 0], w[ 1], selector); w[40] = hc_byte_perm ( 0, w[ 0], selector); w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 41: w[63] = hc_byte_perm (w[21], w[22], selector); w[62] = hc_byte_perm (w[20], w[21], selector); w[61] = hc_byte_perm (w[19], w[20], selector); w[60] = hc_byte_perm (w[18], w[19], selector); w[59] = hc_byte_perm (w[17], w[18], selector); w[58] = hc_byte_perm (w[16], w[17], selector); w[57] = hc_byte_perm (w[15], w[16], selector); w[56] = hc_byte_perm (w[14], w[15], selector); w[55] = hc_byte_perm (w[13], w[14], selector); w[54] = hc_byte_perm (w[12], w[13], selector); w[53] = hc_byte_perm (w[11], w[12], selector); w[52] = hc_byte_perm (w[10], w[11], selector); w[51] = hc_byte_perm (w[ 9], w[10], selector); w[50] = hc_byte_perm (w[ 8], w[ 9], selector); w[49] = hc_byte_perm (w[ 7], w[ 8], selector); w[48] = hc_byte_perm (w[ 6], w[ 7], selector); w[47] = hc_byte_perm (w[ 5], w[ 6], selector); w[46] = hc_byte_perm (w[ 4], w[ 5], selector); w[45] = hc_byte_perm (w[ 3], w[ 4], selector); w[44] = hc_byte_perm (w[ 2], w[ 3], selector); w[43] = hc_byte_perm (w[ 1], w[ 2], selector); w[42] = hc_byte_perm (w[ 0], w[ 1], selector); w[41] = hc_byte_perm ( 0, w[ 0], selector); w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 42: w[63] = hc_byte_perm (w[20], w[21], selector); w[62] = hc_byte_perm (w[19], w[20], selector); w[61] = hc_byte_perm (w[18], w[19], selector); w[60] = hc_byte_perm (w[17], w[18], selector); w[59] = hc_byte_perm (w[16], w[17], selector); w[58] = hc_byte_perm (w[15], w[16], selector); w[57] = hc_byte_perm (w[14], w[15], selector); w[56] = hc_byte_perm (w[13], w[14], selector); w[55] = hc_byte_perm (w[12], w[13], selector); w[54] = hc_byte_perm (w[11], w[12], selector); w[53] = hc_byte_perm (w[10], w[11], selector); w[52] = hc_byte_perm (w[ 9], w[10], selector); w[51] = hc_byte_perm (w[ 8], w[ 9], selector); w[50] = hc_byte_perm (w[ 7], w[ 8], selector); w[49] = hc_byte_perm (w[ 6], w[ 7], selector); w[48] = hc_byte_perm (w[ 5], w[ 6], selector); w[47] = hc_byte_perm (w[ 4], w[ 5], selector); w[46] = hc_byte_perm (w[ 3], w[ 4], selector); w[45] = hc_byte_perm (w[ 2], w[ 3], selector); w[44] = hc_byte_perm (w[ 1], w[ 2], selector); w[43] = hc_byte_perm (w[ 0], w[ 1], selector); w[42] = hc_byte_perm ( 0, w[ 0], selector); w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 43: w[63] = hc_byte_perm (w[19], w[20], selector); w[62] = hc_byte_perm (w[18], w[19], selector); w[61] = hc_byte_perm (w[17], w[18], selector); w[60] = hc_byte_perm (w[16], w[17], selector); w[59] = hc_byte_perm (w[15], w[16], selector); w[58] = hc_byte_perm (w[14], w[15], selector); w[57] = hc_byte_perm (w[13], w[14], selector); w[56] = hc_byte_perm (w[12], w[13], selector); w[55] = hc_byte_perm (w[11], w[12], selector); w[54] = hc_byte_perm (w[10], w[11], selector); w[53] = hc_byte_perm (w[ 9], w[10], selector); w[52] = hc_byte_perm (w[ 8], w[ 9], selector); w[51] = hc_byte_perm (w[ 7], w[ 8], selector); w[50] = hc_byte_perm (w[ 6], w[ 7], selector); w[49] = hc_byte_perm (w[ 5], w[ 6], selector); w[48] = hc_byte_perm (w[ 4], w[ 5], selector); w[47] = hc_byte_perm (w[ 3], w[ 4], selector); w[46] = hc_byte_perm (w[ 2], w[ 3], selector); w[45] = hc_byte_perm (w[ 1], w[ 2], selector); w[44] = hc_byte_perm (w[ 0], w[ 1], selector); w[43] = hc_byte_perm ( 0, w[ 0], selector); w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 44: w[63] = hc_byte_perm (w[18], w[19], selector); w[62] = hc_byte_perm (w[17], w[18], selector); w[61] = hc_byte_perm (w[16], w[17], selector); w[60] = hc_byte_perm (w[15], w[16], selector); w[59] = hc_byte_perm (w[14], w[15], selector); w[58] = hc_byte_perm (w[13], w[14], selector); w[57] = hc_byte_perm (w[12], w[13], selector); w[56] = hc_byte_perm (w[11], w[12], selector); w[55] = hc_byte_perm (w[10], w[11], selector); w[54] = hc_byte_perm (w[ 9], w[10], selector); w[53] = hc_byte_perm (w[ 8], w[ 9], selector); w[52] = hc_byte_perm (w[ 7], w[ 8], selector); w[51] = hc_byte_perm (w[ 6], w[ 7], selector); w[50] = hc_byte_perm (w[ 5], w[ 6], selector); w[49] = hc_byte_perm (w[ 4], w[ 5], selector); w[48] = hc_byte_perm (w[ 3], w[ 4], selector); w[47] = hc_byte_perm (w[ 2], w[ 3], selector); w[46] = hc_byte_perm (w[ 1], w[ 2], selector); w[45] = hc_byte_perm (w[ 0], w[ 1], selector); w[44] = hc_byte_perm ( 0, w[ 0], selector); w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 45: w[63] = hc_byte_perm (w[17], w[18], selector); w[62] = hc_byte_perm (w[16], w[17], selector); w[61] = hc_byte_perm (w[15], w[16], selector); w[60] = hc_byte_perm (w[14], w[15], selector); w[59] = hc_byte_perm (w[13], w[14], selector); w[58] = hc_byte_perm (w[12], w[13], selector); w[57] = hc_byte_perm (w[11], w[12], selector); w[56] = hc_byte_perm (w[10], w[11], selector); w[55] = hc_byte_perm (w[ 9], w[10], selector); w[54] = hc_byte_perm (w[ 8], w[ 9], selector); w[53] = hc_byte_perm (w[ 7], w[ 8], selector); w[52] = hc_byte_perm (w[ 6], w[ 7], selector); w[51] = hc_byte_perm (w[ 5], w[ 6], selector); w[50] = hc_byte_perm (w[ 4], w[ 5], selector); w[49] = hc_byte_perm (w[ 3], w[ 4], selector); w[48] = hc_byte_perm (w[ 2], w[ 3], selector); w[47] = hc_byte_perm (w[ 1], w[ 2], selector); w[46] = hc_byte_perm (w[ 0], w[ 1], selector); w[45] = hc_byte_perm ( 0, w[ 0], selector); w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 46: w[63] = hc_byte_perm (w[16], w[17], selector); w[62] = hc_byte_perm (w[15], w[16], selector); w[61] = hc_byte_perm (w[14], w[15], selector); w[60] = hc_byte_perm (w[13], w[14], selector); w[59] = hc_byte_perm (w[12], w[13], selector); w[58] = hc_byte_perm (w[11], w[12], selector); w[57] = hc_byte_perm (w[10], w[11], selector); w[56] = hc_byte_perm (w[ 9], w[10], selector); w[55] = hc_byte_perm (w[ 8], w[ 9], selector); w[54] = hc_byte_perm (w[ 7], w[ 8], selector); w[53] = hc_byte_perm (w[ 6], w[ 7], selector); w[52] = hc_byte_perm (w[ 5], w[ 6], selector); w[51] = hc_byte_perm (w[ 4], w[ 5], selector); w[50] = hc_byte_perm (w[ 3], w[ 4], selector); w[49] = hc_byte_perm (w[ 2], w[ 3], selector); w[48] = hc_byte_perm (w[ 1], w[ 2], selector); w[47] = hc_byte_perm (w[ 0], w[ 1], selector); w[46] = hc_byte_perm ( 0, w[ 0], selector); w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 47: w[63] = hc_byte_perm (w[15], w[16], selector); w[62] = hc_byte_perm (w[14], w[15], selector); w[61] = hc_byte_perm (w[13], w[14], selector); w[60] = hc_byte_perm (w[12], w[13], selector); w[59] = hc_byte_perm (w[11], w[12], selector); w[58] = hc_byte_perm (w[10], w[11], selector); w[57] = hc_byte_perm (w[ 9], w[10], selector); w[56] = hc_byte_perm (w[ 8], w[ 9], selector); w[55] = hc_byte_perm (w[ 7], w[ 8], selector); w[54] = hc_byte_perm (w[ 6], w[ 7], selector); w[53] = hc_byte_perm (w[ 5], w[ 6], selector); w[52] = hc_byte_perm (w[ 4], w[ 5], selector); w[51] = hc_byte_perm (w[ 3], w[ 4], selector); w[50] = hc_byte_perm (w[ 2], w[ 3], selector); w[49] = hc_byte_perm (w[ 1], w[ 2], selector); w[48] = hc_byte_perm (w[ 0], w[ 1], selector); w[47] = hc_byte_perm ( 0, w[ 0], selector); w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 48: w[63] = hc_byte_perm (w[14], w[15], selector); w[62] = hc_byte_perm (w[13], w[14], selector); w[61] = hc_byte_perm (w[12], w[13], selector); w[60] = hc_byte_perm (w[11], w[12], selector); w[59] = hc_byte_perm (w[10], w[11], selector); w[58] = hc_byte_perm (w[ 9], w[10], selector); w[57] = hc_byte_perm (w[ 8], w[ 9], selector); w[56] = hc_byte_perm (w[ 7], w[ 8], selector); w[55] = hc_byte_perm (w[ 6], w[ 7], selector); w[54] = hc_byte_perm (w[ 5], w[ 6], selector); w[53] = hc_byte_perm (w[ 4], w[ 5], selector); w[52] = hc_byte_perm (w[ 3], w[ 4], selector); w[51] = hc_byte_perm (w[ 2], w[ 3], selector); w[50] = hc_byte_perm (w[ 1], w[ 2], selector); w[49] = hc_byte_perm (w[ 0], w[ 1], selector); w[48] = hc_byte_perm ( 0, w[ 0], selector); w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 49: w[63] = hc_byte_perm (w[13], w[14], selector); w[62] = hc_byte_perm (w[12], w[13], selector); w[61] = hc_byte_perm (w[11], w[12], selector); w[60] = hc_byte_perm (w[10], w[11], selector); w[59] = hc_byte_perm (w[ 9], w[10], selector); w[58] = hc_byte_perm (w[ 8], w[ 9], selector); w[57] = hc_byte_perm (w[ 7], w[ 8], selector); w[56] = hc_byte_perm (w[ 6], w[ 7], selector); w[55] = hc_byte_perm (w[ 5], w[ 6], selector); w[54] = hc_byte_perm (w[ 4], w[ 5], selector); w[53] = hc_byte_perm (w[ 3], w[ 4], selector); w[52] = hc_byte_perm (w[ 2], w[ 3], selector); w[51] = hc_byte_perm (w[ 1], w[ 2], selector); w[50] = hc_byte_perm (w[ 0], w[ 1], selector); w[49] = hc_byte_perm ( 0, w[ 0], selector); w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 50: w[63] = hc_byte_perm (w[12], w[13], selector); w[62] = hc_byte_perm (w[11], w[12], selector); w[61] = hc_byte_perm (w[10], w[11], selector); w[60] = hc_byte_perm (w[ 9], w[10], selector); w[59] = hc_byte_perm (w[ 8], w[ 9], selector); w[58] = hc_byte_perm (w[ 7], w[ 8], selector); w[57] = hc_byte_perm (w[ 6], w[ 7], selector); w[56] = hc_byte_perm (w[ 5], w[ 6], selector); w[55] = hc_byte_perm (w[ 4], w[ 5], selector); w[54] = hc_byte_perm (w[ 3], w[ 4], selector); w[53] = hc_byte_perm (w[ 2], w[ 3], selector); w[52] = hc_byte_perm (w[ 1], w[ 2], selector); w[51] = hc_byte_perm (w[ 0], w[ 1], selector); w[50] = hc_byte_perm ( 0, w[ 0], selector); w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 51: w[63] = hc_byte_perm (w[11], w[12], selector); w[62] = hc_byte_perm (w[10], w[11], selector); w[61] = hc_byte_perm (w[ 9], w[10], selector); w[60] = hc_byte_perm (w[ 8], w[ 9], selector); w[59] = hc_byte_perm (w[ 7], w[ 8], selector); w[58] = hc_byte_perm (w[ 6], w[ 7], selector); w[57] = hc_byte_perm (w[ 5], w[ 6], selector); w[56] = hc_byte_perm (w[ 4], w[ 5], selector); w[55] = hc_byte_perm (w[ 3], w[ 4], selector); w[54] = hc_byte_perm (w[ 2], w[ 3], selector); w[53] = hc_byte_perm (w[ 1], w[ 2], selector); w[52] = hc_byte_perm (w[ 0], w[ 1], selector); w[51] = hc_byte_perm ( 0, w[ 0], selector); w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 52: w[63] = hc_byte_perm (w[10], w[11], selector); w[62] = hc_byte_perm (w[ 9], w[10], selector); w[61] = hc_byte_perm (w[ 8], w[ 9], selector); w[60] = hc_byte_perm (w[ 7], w[ 8], selector); w[59] = hc_byte_perm (w[ 6], w[ 7], selector); w[58] = hc_byte_perm (w[ 5], w[ 6], selector); w[57] = hc_byte_perm (w[ 4], w[ 5], selector); w[56] = hc_byte_perm (w[ 3], w[ 4], selector); w[55] = hc_byte_perm (w[ 2], w[ 3], selector); w[54] = hc_byte_perm (w[ 1], w[ 2], selector); w[53] = hc_byte_perm (w[ 0], w[ 1], selector); w[52] = hc_byte_perm ( 0, w[ 0], selector); w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 53: w[63] = hc_byte_perm (w[ 9], w[10], selector); w[62] = hc_byte_perm (w[ 8], w[ 9], selector); w[61] = hc_byte_perm (w[ 7], w[ 8], selector); w[60] = hc_byte_perm (w[ 6], w[ 7], selector); w[59] = hc_byte_perm (w[ 5], w[ 6], selector); w[58] = hc_byte_perm (w[ 4], w[ 5], selector); w[57] = hc_byte_perm (w[ 3], w[ 4], selector); w[56] = hc_byte_perm (w[ 2], w[ 3], selector); w[55] = hc_byte_perm (w[ 1], w[ 2], selector); w[54] = hc_byte_perm (w[ 0], w[ 1], selector); w[53] = hc_byte_perm ( 0, w[ 0], selector); w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 54: w[63] = hc_byte_perm (w[ 8], w[ 9], selector); w[62] = hc_byte_perm (w[ 7], w[ 8], selector); w[61] = hc_byte_perm (w[ 6], w[ 7], selector); w[60] = hc_byte_perm (w[ 5], w[ 6], selector); w[59] = hc_byte_perm (w[ 4], w[ 5], selector); w[58] = hc_byte_perm (w[ 3], w[ 4], selector); w[57] = hc_byte_perm (w[ 2], w[ 3], selector); w[56] = hc_byte_perm (w[ 1], w[ 2], selector); w[55] = hc_byte_perm (w[ 0], w[ 1], selector); w[54] = hc_byte_perm ( 0, w[ 0], selector); w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 55: w[63] = hc_byte_perm (w[ 7], w[ 8], selector); w[62] = hc_byte_perm (w[ 6], w[ 7], selector); w[61] = hc_byte_perm (w[ 5], w[ 6], selector); w[60] = hc_byte_perm (w[ 4], w[ 5], selector); w[59] = hc_byte_perm (w[ 3], w[ 4], selector); w[58] = hc_byte_perm (w[ 2], w[ 3], selector); w[57] = hc_byte_perm (w[ 1], w[ 2], selector); w[56] = hc_byte_perm (w[ 0], w[ 1], selector); w[55] = hc_byte_perm ( 0, w[ 0], selector); w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 56: w[63] = hc_byte_perm (w[ 6], w[ 7], selector); w[62] = hc_byte_perm (w[ 5], w[ 6], selector); w[61] = hc_byte_perm (w[ 4], w[ 5], selector); w[60] = hc_byte_perm (w[ 3], w[ 4], selector); w[59] = hc_byte_perm (w[ 2], w[ 3], selector); w[58] = hc_byte_perm (w[ 1], w[ 2], selector); w[57] = hc_byte_perm (w[ 0], w[ 1], selector); w[56] = hc_byte_perm ( 0, w[ 0], selector); w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 57: w[63] = hc_byte_perm (w[ 5], w[ 6], selector); w[62] = hc_byte_perm (w[ 4], w[ 5], selector); w[61] = hc_byte_perm (w[ 3], w[ 4], selector); w[60] = hc_byte_perm (w[ 2], w[ 3], selector); w[59] = hc_byte_perm (w[ 1], w[ 2], selector); w[58] = hc_byte_perm (w[ 0], w[ 1], selector); w[57] = hc_byte_perm ( 0, w[ 0], selector); w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 58: w[63] = hc_byte_perm (w[ 4], w[ 5], selector); w[62] = hc_byte_perm (w[ 3], w[ 4], selector); w[61] = hc_byte_perm (w[ 2], w[ 3], selector); w[60] = hc_byte_perm (w[ 1], w[ 2], selector); w[59] = hc_byte_perm (w[ 0], w[ 1], selector); w[58] = hc_byte_perm ( 0, w[ 0], selector); w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 59: w[63] = hc_byte_perm (w[ 3], w[ 4], selector); w[62] = hc_byte_perm (w[ 2], w[ 3], selector); w[61] = hc_byte_perm (w[ 1], w[ 2], selector); w[60] = hc_byte_perm (w[ 0], w[ 1], selector); w[59] = hc_byte_perm ( 0, w[ 0], selector); w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 60: w[63] = hc_byte_perm (w[ 2], w[ 3], selector); w[62] = hc_byte_perm (w[ 1], w[ 2], selector); w[61] = hc_byte_perm (w[ 0], w[ 1], selector); w[60] = hc_byte_perm ( 0, w[ 0], selector); w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 61: w[63] = hc_byte_perm (w[ 1], w[ 2], selector); w[62] = hc_byte_perm (w[ 0], w[ 1], selector); w[61] = hc_byte_perm ( 0, w[ 0], selector); w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 62: w[63] = hc_byte_perm (w[ 0], w[ 1], selector); w[62] = hc_byte_perm ( 0, w[ 0], selector); w[61] = 0; w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 63: w[63] = hc_byte_perm ( 0, w[ 0], selector); w[62] = 0; w[61] = 0; w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_1x64_be (PRIVATE_AS u32x *w, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: w[63] = hc_bytealign_be (w[62], w[63], offset); w[62] = hc_bytealign_be (w[61], w[62], offset); w[61] = hc_bytealign_be (w[60], w[61], offset); w[60] = hc_bytealign_be (w[59], w[60], offset); w[59] = hc_bytealign_be (w[58], w[59], offset); w[58] = hc_bytealign_be (w[57], w[58], offset); w[57] = hc_bytealign_be (w[56], w[57], offset); w[56] = hc_bytealign_be (w[55], w[56], offset); w[55] = hc_bytealign_be (w[54], w[55], offset); w[54] = hc_bytealign_be (w[53], w[54], offset); w[53] = hc_bytealign_be (w[52], w[53], offset); w[52] = hc_bytealign_be (w[51], w[52], offset); w[51] = hc_bytealign_be (w[50], w[51], offset); w[50] = hc_bytealign_be (w[49], w[50], offset); w[49] = hc_bytealign_be (w[48], w[49], offset); w[48] = hc_bytealign_be (w[47], w[48], offset); w[47] = hc_bytealign_be (w[46], w[47], offset); w[46] = hc_bytealign_be (w[45], w[46], offset); w[45] = hc_bytealign_be (w[44], w[45], offset); w[44] = hc_bytealign_be (w[43], w[44], offset); w[43] = hc_bytealign_be (w[42], w[43], offset); w[42] = hc_bytealign_be (w[41], w[42], offset); w[41] = hc_bytealign_be (w[40], w[41], offset); w[40] = hc_bytealign_be (w[39], w[40], offset); w[39] = hc_bytealign_be (w[38], w[39], offset); w[38] = hc_bytealign_be (w[37], w[38], offset); w[37] = hc_bytealign_be (w[36], w[37], offset); w[36] = hc_bytealign_be (w[35], w[36], offset); w[35] = hc_bytealign_be (w[34], w[35], offset); w[34] = hc_bytealign_be (w[33], w[34], offset); w[33] = hc_bytealign_be (w[32], w[33], offset); w[32] = hc_bytealign_be (w[31], w[32], offset); w[31] = hc_bytealign_be (w[30], w[31], offset); w[30] = hc_bytealign_be (w[29], w[30], offset); w[29] = hc_bytealign_be (w[28], w[29], offset); w[28] = hc_bytealign_be (w[27], w[28], offset); w[27] = hc_bytealign_be (w[26], w[27], offset); w[26] = hc_bytealign_be (w[25], w[26], offset); w[25] = hc_bytealign_be (w[24], w[25], offset); w[24] = hc_bytealign_be (w[23], w[24], offset); w[23] = hc_bytealign_be (w[22], w[23], offset); w[22] = hc_bytealign_be (w[21], w[22], offset); w[21] = hc_bytealign_be (w[20], w[21], offset); w[20] = hc_bytealign_be (w[19], w[20], offset); w[19] = hc_bytealign_be (w[18], w[19], offset); w[18] = hc_bytealign_be (w[17], w[18], offset); w[17] = hc_bytealign_be (w[16], w[17], offset); w[16] = hc_bytealign_be (w[15], w[16], offset); w[15] = hc_bytealign_be (w[14], w[15], offset); w[14] = hc_bytealign_be (w[13], w[14], offset); w[13] = hc_bytealign_be (w[12], w[13], offset); w[12] = hc_bytealign_be (w[11], w[12], offset); w[11] = hc_bytealign_be (w[10], w[11], offset); w[10] = hc_bytealign_be (w[ 9], w[10], offset); w[ 9] = hc_bytealign_be (w[ 8], w[ 9], offset); w[ 8] = hc_bytealign_be (w[ 7], w[ 8], offset); w[ 7] = hc_bytealign_be (w[ 6], w[ 7], offset); w[ 6] = hc_bytealign_be (w[ 5], w[ 6], offset); w[ 5] = hc_bytealign_be (w[ 4], w[ 5], offset); w[ 4] = hc_bytealign_be (w[ 3], w[ 4], offset); w[ 3] = hc_bytealign_be (w[ 2], w[ 3], offset); w[ 2] = hc_bytealign_be (w[ 1], w[ 2], offset); w[ 1] = hc_bytealign_be (w[ 0], w[ 1], offset); w[ 0] = hc_bytealign_be ( 0, w[ 0], offset); break; case 1: w[63] = hc_bytealign_be (w[61], w[62], offset); w[62] = hc_bytealign_be (w[60], w[61], offset); w[61] = hc_bytealign_be (w[59], w[60], offset); w[60] = hc_bytealign_be (w[58], w[59], offset); w[59] = hc_bytealign_be (w[57], w[58], offset); w[58] = hc_bytealign_be (w[56], w[57], offset); w[57] = hc_bytealign_be (w[55], w[56], offset); w[56] = hc_bytealign_be (w[54], w[55], offset); w[55] = hc_bytealign_be (w[53], w[54], offset); w[54] = hc_bytealign_be (w[52], w[53], offset); w[53] = hc_bytealign_be (w[51], w[52], offset); w[52] = hc_bytealign_be (w[50], w[51], offset); w[51] = hc_bytealign_be (w[49], w[50], offset); w[50] = hc_bytealign_be (w[48], w[49], offset); w[49] = hc_bytealign_be (w[47], w[48], offset); w[48] = hc_bytealign_be (w[46], w[47], offset); w[47] = hc_bytealign_be (w[45], w[46], offset); w[46] = hc_bytealign_be (w[44], w[45], offset); w[45] = hc_bytealign_be (w[43], w[44], offset); w[44] = hc_bytealign_be (w[42], w[43], offset); w[43] = hc_bytealign_be (w[41], w[42], offset); w[42] = hc_bytealign_be (w[40], w[41], offset); w[41] = hc_bytealign_be (w[39], w[40], offset); w[40] = hc_bytealign_be (w[38], w[39], offset); w[39] = hc_bytealign_be (w[37], w[38], offset); w[38] = hc_bytealign_be (w[36], w[37], offset); w[37] = hc_bytealign_be (w[35], w[36], offset); w[36] = hc_bytealign_be (w[34], w[35], offset); w[35] = hc_bytealign_be (w[33], w[34], offset); w[34] = hc_bytealign_be (w[32], w[33], offset); w[33] = hc_bytealign_be (w[31], w[32], offset); w[32] = hc_bytealign_be (w[30], w[31], offset); w[31] = hc_bytealign_be (w[29], w[30], offset); w[30] = hc_bytealign_be (w[28], w[29], offset); w[29] = hc_bytealign_be (w[27], w[28], offset); w[28] = hc_bytealign_be (w[26], w[27], offset); w[27] = hc_bytealign_be (w[25], w[26], offset); w[26] = hc_bytealign_be (w[24], w[25], offset); w[25] = hc_bytealign_be (w[23], w[24], offset); w[24] = hc_bytealign_be (w[22], w[23], offset); w[23] = hc_bytealign_be (w[21], w[22], offset); w[22] = hc_bytealign_be (w[20], w[21], offset); w[21] = hc_bytealign_be (w[19], w[20], offset); w[20] = hc_bytealign_be (w[18], w[19], offset); w[19] = hc_bytealign_be (w[17], w[18], offset); w[18] = hc_bytealign_be (w[16], w[17], offset); w[17] = hc_bytealign_be (w[15], w[16], offset); w[16] = hc_bytealign_be (w[14], w[15], offset); w[15] = hc_bytealign_be (w[13], w[14], offset); w[14] = hc_bytealign_be (w[12], w[13], offset); w[13] = hc_bytealign_be (w[11], w[12], offset); w[12] = hc_bytealign_be (w[10], w[11], offset); w[11] = hc_bytealign_be (w[ 9], w[10], offset); w[10] = hc_bytealign_be (w[ 8], w[ 9], offset); w[ 9] = hc_bytealign_be (w[ 7], w[ 8], offset); w[ 8] = hc_bytealign_be (w[ 6], w[ 7], offset); w[ 7] = hc_bytealign_be (w[ 5], w[ 6], offset); w[ 6] = hc_bytealign_be (w[ 4], w[ 5], offset); w[ 5] = hc_bytealign_be (w[ 3], w[ 4], offset); w[ 4] = hc_bytealign_be (w[ 2], w[ 3], offset); w[ 3] = hc_bytealign_be (w[ 1], w[ 2], offset); w[ 2] = hc_bytealign_be (w[ 0], w[ 1], offset); w[ 1] = hc_bytealign_be ( 0, w[ 0], offset); w[ 0] = 0; break; case 2: w[63] = hc_bytealign_be (w[60], w[61], offset); w[62] = hc_bytealign_be (w[59], w[60], offset); w[61] = hc_bytealign_be (w[58], w[59], offset); w[60] = hc_bytealign_be (w[57], w[58], offset); w[59] = hc_bytealign_be (w[56], w[57], offset); w[58] = hc_bytealign_be (w[55], w[56], offset); w[57] = hc_bytealign_be (w[54], w[55], offset); w[56] = hc_bytealign_be (w[53], w[54], offset); w[55] = hc_bytealign_be (w[52], w[53], offset); w[54] = hc_bytealign_be (w[51], w[52], offset); w[53] = hc_bytealign_be (w[50], w[51], offset); w[52] = hc_bytealign_be (w[49], w[50], offset); w[51] = hc_bytealign_be (w[48], w[49], offset); w[50] = hc_bytealign_be (w[47], w[48], offset); w[49] = hc_bytealign_be (w[46], w[47], offset); w[48] = hc_bytealign_be (w[45], w[46], offset); w[47] = hc_bytealign_be (w[44], w[45], offset); w[46] = hc_bytealign_be (w[43], w[44], offset); w[45] = hc_bytealign_be (w[42], w[43], offset); w[44] = hc_bytealign_be (w[41], w[42], offset); w[43] = hc_bytealign_be (w[40], w[41], offset); w[42] = hc_bytealign_be (w[39], w[40], offset); w[41] = hc_bytealign_be (w[38], w[39], offset); w[40] = hc_bytealign_be (w[37], w[38], offset); w[39] = hc_bytealign_be (w[36], w[37], offset); w[38] = hc_bytealign_be (w[35], w[36], offset); w[37] = hc_bytealign_be (w[34], w[35], offset); w[36] = hc_bytealign_be (w[33], w[34], offset); w[35] = hc_bytealign_be (w[32], w[33], offset); w[34] = hc_bytealign_be (w[31], w[32], offset); w[33] = hc_bytealign_be (w[30], w[31], offset); w[32] = hc_bytealign_be (w[29], w[30], offset); w[31] = hc_bytealign_be (w[28], w[29], offset); w[30] = hc_bytealign_be (w[27], w[28], offset); w[29] = hc_bytealign_be (w[26], w[27], offset); w[28] = hc_bytealign_be (w[25], w[26], offset); w[27] = hc_bytealign_be (w[24], w[25], offset); w[26] = hc_bytealign_be (w[23], w[24], offset); w[25] = hc_bytealign_be (w[22], w[23], offset); w[24] = hc_bytealign_be (w[21], w[22], offset); w[23] = hc_bytealign_be (w[20], w[21], offset); w[22] = hc_bytealign_be (w[19], w[20], offset); w[21] = hc_bytealign_be (w[18], w[19], offset); w[20] = hc_bytealign_be (w[17], w[18], offset); w[19] = hc_bytealign_be (w[16], w[17], offset); w[18] = hc_bytealign_be (w[15], w[16], offset); w[17] = hc_bytealign_be (w[14], w[15], offset); w[16] = hc_bytealign_be (w[13], w[14], offset); w[15] = hc_bytealign_be (w[12], w[13], offset); w[14] = hc_bytealign_be (w[11], w[12], offset); w[13] = hc_bytealign_be (w[10], w[11], offset); w[12] = hc_bytealign_be (w[ 9], w[10], offset); w[11] = hc_bytealign_be (w[ 8], w[ 9], offset); w[10] = hc_bytealign_be (w[ 7], w[ 8], offset); w[ 9] = hc_bytealign_be (w[ 6], w[ 7], offset); w[ 8] = hc_bytealign_be (w[ 5], w[ 6], offset); w[ 7] = hc_bytealign_be (w[ 4], w[ 5], offset); w[ 6] = hc_bytealign_be (w[ 3], w[ 4], offset); w[ 5] = hc_bytealign_be (w[ 2], w[ 3], offset); w[ 4] = hc_bytealign_be (w[ 1], w[ 2], offset); w[ 3] = hc_bytealign_be (w[ 0], w[ 1], offset); w[ 2] = hc_bytealign_be ( 0, w[ 0], offset); w[ 1] = 0; w[ 0] = 0; break; case 3: w[63] = hc_bytealign_be (w[59], w[60], offset); w[62] = hc_bytealign_be (w[58], w[59], offset); w[61] = hc_bytealign_be (w[57], w[58], offset); w[60] = hc_bytealign_be (w[56], w[57], offset); w[59] = hc_bytealign_be (w[55], w[56], offset); w[58] = hc_bytealign_be (w[54], w[55], offset); w[57] = hc_bytealign_be (w[53], w[54], offset); w[56] = hc_bytealign_be (w[52], w[53], offset); w[55] = hc_bytealign_be (w[51], w[52], offset); w[54] = hc_bytealign_be (w[50], w[51], offset); w[53] = hc_bytealign_be (w[49], w[50], offset); w[52] = hc_bytealign_be (w[48], w[49], offset); w[51] = hc_bytealign_be (w[47], w[48], offset); w[50] = hc_bytealign_be (w[46], w[47], offset); w[49] = hc_bytealign_be (w[45], w[46], offset); w[48] = hc_bytealign_be (w[44], w[45], offset); w[47] = hc_bytealign_be (w[43], w[44], offset); w[46] = hc_bytealign_be (w[42], w[43], offset); w[45] = hc_bytealign_be (w[41], w[42], offset); w[44] = hc_bytealign_be (w[40], w[41], offset); w[43] = hc_bytealign_be (w[39], w[40], offset); w[42] = hc_bytealign_be (w[38], w[39], offset); w[41] = hc_bytealign_be (w[37], w[38], offset); w[40] = hc_bytealign_be (w[36], w[37], offset); w[39] = hc_bytealign_be (w[35], w[36], offset); w[38] = hc_bytealign_be (w[34], w[35], offset); w[37] = hc_bytealign_be (w[33], w[34], offset); w[36] = hc_bytealign_be (w[32], w[33], offset); w[35] = hc_bytealign_be (w[31], w[32], offset); w[34] = hc_bytealign_be (w[30], w[31], offset); w[33] = hc_bytealign_be (w[29], w[30], offset); w[32] = hc_bytealign_be (w[28], w[29], offset); w[31] = hc_bytealign_be (w[27], w[28], offset); w[30] = hc_bytealign_be (w[26], w[27], offset); w[29] = hc_bytealign_be (w[25], w[26], offset); w[28] = hc_bytealign_be (w[24], w[25], offset); w[27] = hc_bytealign_be (w[23], w[24], offset); w[26] = hc_bytealign_be (w[22], w[23], offset); w[25] = hc_bytealign_be (w[21], w[22], offset); w[24] = hc_bytealign_be (w[20], w[21], offset); w[23] = hc_bytealign_be (w[19], w[20], offset); w[22] = hc_bytealign_be (w[18], w[19], offset); w[21] = hc_bytealign_be (w[17], w[18], offset); w[20] = hc_bytealign_be (w[16], w[17], offset); w[19] = hc_bytealign_be (w[15], w[16], offset); w[18] = hc_bytealign_be (w[14], w[15], offset); w[17] = hc_bytealign_be (w[13], w[14], offset); w[16] = hc_bytealign_be (w[12], w[13], offset); w[15] = hc_bytealign_be (w[11], w[12], offset); w[14] = hc_bytealign_be (w[10], w[11], offset); w[13] = hc_bytealign_be (w[ 9], w[10], offset); w[12] = hc_bytealign_be (w[ 8], w[ 9], offset); w[11] = hc_bytealign_be (w[ 7], w[ 8], offset); w[10] = hc_bytealign_be (w[ 6], w[ 7], offset); w[ 9] = hc_bytealign_be (w[ 5], w[ 6], offset); w[ 8] = hc_bytealign_be (w[ 4], w[ 5], offset); w[ 7] = hc_bytealign_be (w[ 3], w[ 4], offset); w[ 6] = hc_bytealign_be (w[ 2], w[ 3], offset); w[ 5] = hc_bytealign_be (w[ 1], w[ 2], offset); w[ 4] = hc_bytealign_be (w[ 0], w[ 1], offset); w[ 3] = hc_bytealign_be ( 0, w[ 0], offset); w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 4: w[63] = hc_bytealign_be (w[58], w[59], offset); w[62] = hc_bytealign_be (w[57], w[58], offset); w[61] = hc_bytealign_be (w[56], w[57], offset); w[60] = hc_bytealign_be (w[55], w[56], offset); w[59] = hc_bytealign_be (w[54], w[55], offset); w[58] = hc_bytealign_be (w[53], w[54], offset); w[57] = hc_bytealign_be (w[52], w[53], offset); w[56] = hc_bytealign_be (w[51], w[52], offset); w[55] = hc_bytealign_be (w[50], w[51], offset); w[54] = hc_bytealign_be (w[49], w[50], offset); w[53] = hc_bytealign_be (w[48], w[49], offset); w[52] = hc_bytealign_be (w[47], w[48], offset); w[51] = hc_bytealign_be (w[46], w[47], offset); w[50] = hc_bytealign_be (w[45], w[46], offset); w[49] = hc_bytealign_be (w[44], w[45], offset); w[48] = hc_bytealign_be (w[43], w[44], offset); w[47] = hc_bytealign_be (w[42], w[43], offset); w[46] = hc_bytealign_be (w[41], w[42], offset); w[45] = hc_bytealign_be (w[40], w[41], offset); w[44] = hc_bytealign_be (w[39], w[40], offset); w[43] = hc_bytealign_be (w[38], w[39], offset); w[42] = hc_bytealign_be (w[37], w[38], offset); w[41] = hc_bytealign_be (w[36], w[37], offset); w[40] = hc_bytealign_be (w[35], w[36], offset); w[39] = hc_bytealign_be (w[34], w[35], offset); w[38] = hc_bytealign_be (w[33], w[34], offset); w[37] = hc_bytealign_be (w[32], w[33], offset); w[36] = hc_bytealign_be (w[31], w[32], offset); w[35] = hc_bytealign_be (w[30], w[31], offset); w[34] = hc_bytealign_be (w[29], w[30], offset); w[33] = hc_bytealign_be (w[28], w[29], offset); w[32] = hc_bytealign_be (w[27], w[28], offset); w[31] = hc_bytealign_be (w[26], w[27], offset); w[30] = hc_bytealign_be (w[25], w[26], offset); w[29] = hc_bytealign_be (w[24], w[25], offset); w[28] = hc_bytealign_be (w[23], w[24], offset); w[27] = hc_bytealign_be (w[22], w[23], offset); w[26] = hc_bytealign_be (w[21], w[22], offset); w[25] = hc_bytealign_be (w[20], w[21], offset); w[24] = hc_bytealign_be (w[19], w[20], offset); w[23] = hc_bytealign_be (w[18], w[19], offset); w[22] = hc_bytealign_be (w[17], w[18], offset); w[21] = hc_bytealign_be (w[16], w[17], offset); w[20] = hc_bytealign_be (w[15], w[16], offset); w[19] = hc_bytealign_be (w[14], w[15], offset); w[18] = hc_bytealign_be (w[13], w[14], offset); w[17] = hc_bytealign_be (w[12], w[13], offset); w[16] = hc_bytealign_be (w[11], w[12], offset); w[15] = hc_bytealign_be (w[10], w[11], offset); w[14] = hc_bytealign_be (w[ 9], w[10], offset); w[13] = hc_bytealign_be (w[ 8], w[ 9], offset); w[12] = hc_bytealign_be (w[ 7], w[ 8], offset); w[11] = hc_bytealign_be (w[ 6], w[ 7], offset); w[10] = hc_bytealign_be (w[ 5], w[ 6], offset); w[ 9] = hc_bytealign_be (w[ 4], w[ 5], offset); w[ 8] = hc_bytealign_be (w[ 3], w[ 4], offset); w[ 7] = hc_bytealign_be (w[ 2], w[ 3], offset); w[ 6] = hc_bytealign_be (w[ 1], w[ 2], offset); w[ 5] = hc_bytealign_be (w[ 0], w[ 1], offset); w[ 4] = hc_bytealign_be ( 0, w[ 0], offset); w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 5: w[63] = hc_bytealign_be (w[57], w[58], offset); w[62] = hc_bytealign_be (w[56], w[57], offset); w[61] = hc_bytealign_be (w[55], w[56], offset); w[60] = hc_bytealign_be (w[54], w[55], offset); w[59] = hc_bytealign_be (w[53], w[54], offset); w[58] = hc_bytealign_be (w[52], w[53], offset); w[57] = hc_bytealign_be (w[51], w[52], offset); w[56] = hc_bytealign_be (w[50], w[51], offset); w[55] = hc_bytealign_be (w[49], w[50], offset); w[54] = hc_bytealign_be (w[48], w[49], offset); w[53] = hc_bytealign_be (w[47], w[48], offset); w[52] = hc_bytealign_be (w[46], w[47], offset); w[51] = hc_bytealign_be (w[45], w[46], offset); w[50] = hc_bytealign_be (w[44], w[45], offset); w[49] = hc_bytealign_be (w[43], w[44], offset); w[48] = hc_bytealign_be (w[42], w[43], offset); w[47] = hc_bytealign_be (w[41], w[42], offset); w[46] = hc_bytealign_be (w[40], w[41], offset); w[45] = hc_bytealign_be (w[39], w[40], offset); w[44] = hc_bytealign_be (w[38], w[39], offset); w[43] = hc_bytealign_be (w[37], w[38], offset); w[42] = hc_bytealign_be (w[36], w[37], offset); w[41] = hc_bytealign_be (w[35], w[36], offset); w[40] = hc_bytealign_be (w[34], w[35], offset); w[39] = hc_bytealign_be (w[33], w[34], offset); w[38] = hc_bytealign_be (w[32], w[33], offset); w[37] = hc_bytealign_be (w[31], w[32], offset); w[36] = hc_bytealign_be (w[30], w[31], offset); w[35] = hc_bytealign_be (w[29], w[30], offset); w[34] = hc_bytealign_be (w[28], w[29], offset); w[33] = hc_bytealign_be (w[27], w[28], offset); w[32] = hc_bytealign_be (w[26], w[27], offset); w[31] = hc_bytealign_be (w[25], w[26], offset); w[30] = hc_bytealign_be (w[24], w[25], offset); w[29] = hc_bytealign_be (w[23], w[24], offset); w[28] = hc_bytealign_be (w[22], w[23], offset); w[27] = hc_bytealign_be (w[21], w[22], offset); w[26] = hc_bytealign_be (w[20], w[21], offset); w[25] = hc_bytealign_be (w[19], w[20], offset); w[24] = hc_bytealign_be (w[18], w[19], offset); w[23] = hc_bytealign_be (w[17], w[18], offset); w[22] = hc_bytealign_be (w[16], w[17], offset); w[21] = hc_bytealign_be (w[15], w[16], offset); w[20] = hc_bytealign_be (w[14], w[15], offset); w[19] = hc_bytealign_be (w[13], w[14], offset); w[18] = hc_bytealign_be (w[12], w[13], offset); w[17] = hc_bytealign_be (w[11], w[12], offset); w[16] = hc_bytealign_be (w[10], w[11], offset); w[15] = hc_bytealign_be (w[ 9], w[10], offset); w[14] = hc_bytealign_be (w[ 8], w[ 9], offset); w[13] = hc_bytealign_be (w[ 7], w[ 8], offset); w[12] = hc_bytealign_be (w[ 6], w[ 7], offset); w[11] = hc_bytealign_be (w[ 5], w[ 6], offset); w[10] = hc_bytealign_be (w[ 4], w[ 5], offset); w[ 9] = hc_bytealign_be (w[ 3], w[ 4], offset); w[ 8] = hc_bytealign_be (w[ 2], w[ 3], offset); w[ 7] = hc_bytealign_be (w[ 1], w[ 2], offset); w[ 6] = hc_bytealign_be (w[ 0], w[ 1], offset); w[ 5] = hc_bytealign_be ( 0, w[ 0], offset); w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 6: w[63] = hc_bytealign_be (w[56], w[57], offset); w[62] = hc_bytealign_be (w[55], w[56], offset); w[61] = hc_bytealign_be (w[54], w[55], offset); w[60] = hc_bytealign_be (w[53], w[54], offset); w[59] = hc_bytealign_be (w[52], w[53], offset); w[58] = hc_bytealign_be (w[51], w[52], offset); w[57] = hc_bytealign_be (w[50], w[51], offset); w[56] = hc_bytealign_be (w[49], w[50], offset); w[55] = hc_bytealign_be (w[48], w[49], offset); w[54] = hc_bytealign_be (w[47], w[48], offset); w[53] = hc_bytealign_be (w[46], w[47], offset); w[52] = hc_bytealign_be (w[45], w[46], offset); w[51] = hc_bytealign_be (w[44], w[45], offset); w[50] = hc_bytealign_be (w[43], w[44], offset); w[49] = hc_bytealign_be (w[42], w[43], offset); w[48] = hc_bytealign_be (w[41], w[42], offset); w[47] = hc_bytealign_be (w[40], w[41], offset); w[46] = hc_bytealign_be (w[39], w[40], offset); w[45] = hc_bytealign_be (w[38], w[39], offset); w[44] = hc_bytealign_be (w[37], w[38], offset); w[43] = hc_bytealign_be (w[36], w[37], offset); w[42] = hc_bytealign_be (w[35], w[36], offset); w[41] = hc_bytealign_be (w[34], w[35], offset); w[40] = hc_bytealign_be (w[33], w[34], offset); w[39] = hc_bytealign_be (w[32], w[33], offset); w[38] = hc_bytealign_be (w[31], w[32], offset); w[37] = hc_bytealign_be (w[30], w[31], offset); w[36] = hc_bytealign_be (w[29], w[30], offset); w[35] = hc_bytealign_be (w[28], w[29], offset); w[34] = hc_bytealign_be (w[27], w[28], offset); w[33] = hc_bytealign_be (w[26], w[27], offset); w[32] = hc_bytealign_be (w[25], w[26], offset); w[31] = hc_bytealign_be (w[24], w[25], offset); w[30] = hc_bytealign_be (w[23], w[24], offset); w[29] = hc_bytealign_be (w[22], w[23], offset); w[28] = hc_bytealign_be (w[21], w[22], offset); w[27] = hc_bytealign_be (w[20], w[21], offset); w[26] = hc_bytealign_be (w[19], w[20], offset); w[25] = hc_bytealign_be (w[18], w[19], offset); w[24] = hc_bytealign_be (w[17], w[18], offset); w[23] = hc_bytealign_be (w[16], w[17], offset); w[22] = hc_bytealign_be (w[15], w[16], offset); w[21] = hc_bytealign_be (w[14], w[15], offset); w[20] = hc_bytealign_be (w[13], w[14], offset); w[19] = hc_bytealign_be (w[12], w[13], offset); w[18] = hc_bytealign_be (w[11], w[12], offset); w[17] = hc_bytealign_be (w[10], w[11], offset); w[16] = hc_bytealign_be (w[ 9], w[10], offset); w[15] = hc_bytealign_be (w[ 8], w[ 9], offset); w[14] = hc_bytealign_be (w[ 7], w[ 8], offset); w[13] = hc_bytealign_be (w[ 6], w[ 7], offset); w[12] = hc_bytealign_be (w[ 5], w[ 6], offset); w[11] = hc_bytealign_be (w[ 4], w[ 5], offset); w[10] = hc_bytealign_be (w[ 3], w[ 4], offset); w[ 9] = hc_bytealign_be (w[ 2], w[ 3], offset); w[ 8] = hc_bytealign_be (w[ 1], w[ 2], offset); w[ 7] = hc_bytealign_be (w[ 0], w[ 1], offset); w[ 6] = hc_bytealign_be ( 0, w[ 0], offset); w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 7: w[63] = hc_bytealign_be (w[55], w[56], offset); w[62] = hc_bytealign_be (w[54], w[55], offset); w[61] = hc_bytealign_be (w[53], w[54], offset); w[60] = hc_bytealign_be (w[52], w[53], offset); w[59] = hc_bytealign_be (w[51], w[52], offset); w[58] = hc_bytealign_be (w[50], w[51], offset); w[57] = hc_bytealign_be (w[49], w[50], offset); w[56] = hc_bytealign_be (w[48], w[49], offset); w[55] = hc_bytealign_be (w[47], w[48], offset); w[54] = hc_bytealign_be (w[46], w[47], offset); w[53] = hc_bytealign_be (w[45], w[46], offset); w[52] = hc_bytealign_be (w[44], w[45], offset); w[51] = hc_bytealign_be (w[43], w[44], offset); w[50] = hc_bytealign_be (w[42], w[43], offset); w[49] = hc_bytealign_be (w[41], w[42], offset); w[48] = hc_bytealign_be (w[40], w[41], offset); w[47] = hc_bytealign_be (w[39], w[40], offset); w[46] = hc_bytealign_be (w[38], w[39], offset); w[45] = hc_bytealign_be (w[37], w[38], offset); w[44] = hc_bytealign_be (w[36], w[37], offset); w[43] = hc_bytealign_be (w[35], w[36], offset); w[42] = hc_bytealign_be (w[34], w[35], offset); w[41] = hc_bytealign_be (w[33], w[34], offset); w[40] = hc_bytealign_be (w[32], w[33], offset); w[39] = hc_bytealign_be (w[31], w[32], offset); w[38] = hc_bytealign_be (w[30], w[31], offset); w[37] = hc_bytealign_be (w[29], w[30], offset); w[36] = hc_bytealign_be (w[28], w[29], offset); w[35] = hc_bytealign_be (w[27], w[28], offset); w[34] = hc_bytealign_be (w[26], w[27], offset); w[33] = hc_bytealign_be (w[25], w[26], offset); w[32] = hc_bytealign_be (w[24], w[25], offset); w[31] = hc_bytealign_be (w[23], w[24], offset); w[30] = hc_bytealign_be (w[22], w[23], offset); w[29] = hc_bytealign_be (w[21], w[22], offset); w[28] = hc_bytealign_be (w[20], w[21], offset); w[27] = hc_bytealign_be (w[19], w[20], offset); w[26] = hc_bytealign_be (w[18], w[19], offset); w[25] = hc_bytealign_be (w[17], w[18], offset); w[24] = hc_bytealign_be (w[16], w[17], offset); w[23] = hc_bytealign_be (w[15], w[16], offset); w[22] = hc_bytealign_be (w[14], w[15], offset); w[21] = hc_bytealign_be (w[13], w[14], offset); w[20] = hc_bytealign_be (w[12], w[13], offset); w[19] = hc_bytealign_be (w[11], w[12], offset); w[18] = hc_bytealign_be (w[10], w[11], offset); w[17] = hc_bytealign_be (w[ 9], w[10], offset); w[16] = hc_bytealign_be (w[ 8], w[ 9], offset); w[15] = hc_bytealign_be (w[ 7], w[ 8], offset); w[14] = hc_bytealign_be (w[ 6], w[ 7], offset); w[13] = hc_bytealign_be (w[ 5], w[ 6], offset); w[12] = hc_bytealign_be (w[ 4], w[ 5], offset); w[11] = hc_bytealign_be (w[ 3], w[ 4], offset); w[10] = hc_bytealign_be (w[ 2], w[ 3], offset); w[ 9] = hc_bytealign_be (w[ 1], w[ 2], offset); w[ 8] = hc_bytealign_be (w[ 0], w[ 1], offset); w[ 7] = hc_bytealign_be ( 0, w[ 0], offset); w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 8: w[63] = hc_bytealign_be (w[54], w[55], offset); w[62] = hc_bytealign_be (w[53], w[54], offset); w[61] = hc_bytealign_be (w[52], w[53], offset); w[60] = hc_bytealign_be (w[51], w[52], offset); w[59] = hc_bytealign_be (w[50], w[51], offset); w[58] = hc_bytealign_be (w[49], w[50], offset); w[57] = hc_bytealign_be (w[48], w[49], offset); w[56] = hc_bytealign_be (w[47], w[48], offset); w[55] = hc_bytealign_be (w[46], w[47], offset); w[54] = hc_bytealign_be (w[45], w[46], offset); w[53] = hc_bytealign_be (w[44], w[45], offset); w[52] = hc_bytealign_be (w[43], w[44], offset); w[51] = hc_bytealign_be (w[42], w[43], offset); w[50] = hc_bytealign_be (w[41], w[42], offset); w[49] = hc_bytealign_be (w[40], w[41], offset); w[48] = hc_bytealign_be (w[39], w[40], offset); w[47] = hc_bytealign_be (w[38], w[39], offset); w[46] = hc_bytealign_be (w[37], w[38], offset); w[45] = hc_bytealign_be (w[36], w[37], offset); w[44] = hc_bytealign_be (w[35], w[36], offset); w[43] = hc_bytealign_be (w[34], w[35], offset); w[42] = hc_bytealign_be (w[33], w[34], offset); w[41] = hc_bytealign_be (w[32], w[33], offset); w[40] = hc_bytealign_be (w[31], w[32], offset); w[39] = hc_bytealign_be (w[30], w[31], offset); w[38] = hc_bytealign_be (w[29], w[30], offset); w[37] = hc_bytealign_be (w[28], w[29], offset); w[36] = hc_bytealign_be (w[27], w[28], offset); w[35] = hc_bytealign_be (w[26], w[27], offset); w[34] = hc_bytealign_be (w[25], w[26], offset); w[33] = hc_bytealign_be (w[24], w[25], offset); w[32] = hc_bytealign_be (w[23], w[24], offset); w[31] = hc_bytealign_be (w[22], w[23], offset); w[30] = hc_bytealign_be (w[21], w[22], offset); w[29] = hc_bytealign_be (w[20], w[21], offset); w[28] = hc_bytealign_be (w[19], w[20], offset); w[27] = hc_bytealign_be (w[18], w[19], offset); w[26] = hc_bytealign_be (w[17], w[18], offset); w[25] = hc_bytealign_be (w[16], w[17], offset); w[24] = hc_bytealign_be (w[15], w[16], offset); w[23] = hc_bytealign_be (w[14], w[15], offset); w[22] = hc_bytealign_be (w[13], w[14], offset); w[21] = hc_bytealign_be (w[12], w[13], offset); w[20] = hc_bytealign_be (w[11], w[12], offset); w[19] = hc_bytealign_be (w[10], w[11], offset); w[18] = hc_bytealign_be (w[ 9], w[10], offset); w[17] = hc_bytealign_be (w[ 8], w[ 9], offset); w[16] = hc_bytealign_be (w[ 7], w[ 8], offset); w[15] = hc_bytealign_be (w[ 6], w[ 7], offset); w[14] = hc_bytealign_be (w[ 5], w[ 6], offset); w[13] = hc_bytealign_be (w[ 4], w[ 5], offset); w[12] = hc_bytealign_be (w[ 3], w[ 4], offset); w[11] = hc_bytealign_be (w[ 2], w[ 3], offset); w[10] = hc_bytealign_be (w[ 1], w[ 2], offset); w[ 9] = hc_bytealign_be (w[ 0], w[ 1], offset); w[ 8] = hc_bytealign_be ( 0, w[ 0], offset); w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 9: w[63] = hc_bytealign_be (w[53], w[54], offset); w[62] = hc_bytealign_be (w[52], w[53], offset); w[61] = hc_bytealign_be (w[51], w[52], offset); w[60] = hc_bytealign_be (w[50], w[51], offset); w[59] = hc_bytealign_be (w[49], w[50], offset); w[58] = hc_bytealign_be (w[48], w[49], offset); w[57] = hc_bytealign_be (w[47], w[48], offset); w[56] = hc_bytealign_be (w[46], w[47], offset); w[55] = hc_bytealign_be (w[45], w[46], offset); w[54] = hc_bytealign_be (w[44], w[45], offset); w[53] = hc_bytealign_be (w[43], w[44], offset); w[52] = hc_bytealign_be (w[42], w[43], offset); w[51] = hc_bytealign_be (w[41], w[42], offset); w[50] = hc_bytealign_be (w[40], w[41], offset); w[49] = hc_bytealign_be (w[39], w[40], offset); w[48] = hc_bytealign_be (w[38], w[39], offset); w[47] = hc_bytealign_be (w[37], w[38], offset); w[46] = hc_bytealign_be (w[36], w[37], offset); w[45] = hc_bytealign_be (w[35], w[36], offset); w[44] = hc_bytealign_be (w[34], w[35], offset); w[43] = hc_bytealign_be (w[33], w[34], offset); w[42] = hc_bytealign_be (w[32], w[33], offset); w[41] = hc_bytealign_be (w[31], w[32], offset); w[40] = hc_bytealign_be (w[30], w[31], offset); w[39] = hc_bytealign_be (w[29], w[30], offset); w[38] = hc_bytealign_be (w[28], w[29], offset); w[37] = hc_bytealign_be (w[27], w[28], offset); w[36] = hc_bytealign_be (w[26], w[27], offset); w[35] = hc_bytealign_be (w[25], w[26], offset); w[34] = hc_bytealign_be (w[24], w[25], offset); w[33] = hc_bytealign_be (w[23], w[24], offset); w[32] = hc_bytealign_be (w[22], w[23], offset); w[31] = hc_bytealign_be (w[21], w[22], offset); w[30] = hc_bytealign_be (w[20], w[21], offset); w[29] = hc_bytealign_be (w[19], w[20], offset); w[28] = hc_bytealign_be (w[18], w[19], offset); w[27] = hc_bytealign_be (w[17], w[18], offset); w[26] = hc_bytealign_be (w[16], w[17], offset); w[25] = hc_bytealign_be (w[15], w[16], offset); w[24] = hc_bytealign_be (w[14], w[15], offset); w[23] = hc_bytealign_be (w[13], w[14], offset); w[22] = hc_bytealign_be (w[12], w[13], offset); w[21] = hc_bytealign_be (w[11], w[12], offset); w[20] = hc_bytealign_be (w[10], w[11], offset); w[19] = hc_bytealign_be (w[ 9], w[10], offset); w[18] = hc_bytealign_be (w[ 8], w[ 9], offset); w[17] = hc_bytealign_be (w[ 7], w[ 8], offset); w[16] = hc_bytealign_be (w[ 6], w[ 7], offset); w[15] = hc_bytealign_be (w[ 5], w[ 6], offset); w[14] = hc_bytealign_be (w[ 4], w[ 5], offset); w[13] = hc_bytealign_be (w[ 3], w[ 4], offset); w[12] = hc_bytealign_be (w[ 2], w[ 3], offset); w[11] = hc_bytealign_be (w[ 1], w[ 2], offset); w[10] = hc_bytealign_be (w[ 0], w[ 1], offset); w[ 9] = hc_bytealign_be ( 0, w[ 0], offset); w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 10: w[63] = hc_bytealign_be (w[52], w[53], offset); w[62] = hc_bytealign_be (w[51], w[52], offset); w[61] = hc_bytealign_be (w[50], w[51], offset); w[60] = hc_bytealign_be (w[49], w[50], offset); w[59] = hc_bytealign_be (w[48], w[49], offset); w[58] = hc_bytealign_be (w[47], w[48], offset); w[57] = hc_bytealign_be (w[46], w[47], offset); w[56] = hc_bytealign_be (w[45], w[46], offset); w[55] = hc_bytealign_be (w[44], w[45], offset); w[54] = hc_bytealign_be (w[43], w[44], offset); w[53] = hc_bytealign_be (w[42], w[43], offset); w[52] = hc_bytealign_be (w[41], w[42], offset); w[51] = hc_bytealign_be (w[40], w[41], offset); w[50] = hc_bytealign_be (w[39], w[40], offset); w[49] = hc_bytealign_be (w[38], w[39], offset); w[48] = hc_bytealign_be (w[37], w[38], offset); w[47] = hc_bytealign_be (w[36], w[37], offset); w[46] = hc_bytealign_be (w[35], w[36], offset); w[45] = hc_bytealign_be (w[34], w[35], offset); w[44] = hc_bytealign_be (w[33], w[34], offset); w[43] = hc_bytealign_be (w[32], w[33], offset); w[42] = hc_bytealign_be (w[31], w[32], offset); w[41] = hc_bytealign_be (w[30], w[31], offset); w[40] = hc_bytealign_be (w[29], w[30], offset); w[39] = hc_bytealign_be (w[28], w[29], offset); w[38] = hc_bytealign_be (w[27], w[28], offset); w[37] = hc_bytealign_be (w[26], w[27], offset); w[36] = hc_bytealign_be (w[25], w[26], offset); w[35] = hc_bytealign_be (w[24], w[25], offset); w[34] = hc_bytealign_be (w[23], w[24], offset); w[33] = hc_bytealign_be (w[22], w[23], offset); w[32] = hc_bytealign_be (w[21], w[22], offset); w[31] = hc_bytealign_be (w[20], w[21], offset); w[30] = hc_bytealign_be (w[19], w[20], offset); w[29] = hc_bytealign_be (w[18], w[19], offset); w[28] = hc_bytealign_be (w[17], w[18], offset); w[27] = hc_bytealign_be (w[16], w[17], offset); w[26] = hc_bytealign_be (w[15], w[16], offset); w[25] = hc_bytealign_be (w[14], w[15], offset); w[24] = hc_bytealign_be (w[13], w[14], offset); w[23] = hc_bytealign_be (w[12], w[13], offset); w[22] = hc_bytealign_be (w[11], w[12], offset); w[21] = hc_bytealign_be (w[10], w[11], offset); w[20] = hc_bytealign_be (w[ 9], w[10], offset); w[19] = hc_bytealign_be (w[ 8], w[ 9], offset); w[18] = hc_bytealign_be (w[ 7], w[ 8], offset); w[17] = hc_bytealign_be (w[ 6], w[ 7], offset); w[16] = hc_bytealign_be (w[ 5], w[ 6], offset); w[15] = hc_bytealign_be (w[ 4], w[ 5], offset); w[14] = hc_bytealign_be (w[ 3], w[ 4], offset); w[13] = hc_bytealign_be (w[ 2], w[ 3], offset); w[12] = hc_bytealign_be (w[ 1], w[ 2], offset); w[11] = hc_bytealign_be (w[ 0], w[ 1], offset); w[10] = hc_bytealign_be ( 0, w[ 0], offset); w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 11: w[63] = hc_bytealign_be (w[51], w[52], offset); w[62] = hc_bytealign_be (w[50], w[51], offset); w[61] = hc_bytealign_be (w[49], w[50], offset); w[60] = hc_bytealign_be (w[48], w[49], offset); w[59] = hc_bytealign_be (w[47], w[48], offset); w[58] = hc_bytealign_be (w[46], w[47], offset); w[57] = hc_bytealign_be (w[45], w[46], offset); w[56] = hc_bytealign_be (w[44], w[45], offset); w[55] = hc_bytealign_be (w[43], w[44], offset); w[54] = hc_bytealign_be (w[42], w[43], offset); w[53] = hc_bytealign_be (w[41], w[42], offset); w[52] = hc_bytealign_be (w[40], w[41], offset); w[51] = hc_bytealign_be (w[39], w[40], offset); w[50] = hc_bytealign_be (w[38], w[39], offset); w[49] = hc_bytealign_be (w[37], w[38], offset); w[48] = hc_bytealign_be (w[36], w[37], offset); w[47] = hc_bytealign_be (w[35], w[36], offset); w[46] = hc_bytealign_be (w[34], w[35], offset); w[45] = hc_bytealign_be (w[33], w[34], offset); w[44] = hc_bytealign_be (w[32], w[33], offset); w[43] = hc_bytealign_be (w[31], w[32], offset); w[42] = hc_bytealign_be (w[30], w[31], offset); w[41] = hc_bytealign_be (w[29], w[30], offset); w[40] = hc_bytealign_be (w[28], w[29], offset); w[39] = hc_bytealign_be (w[27], w[28], offset); w[38] = hc_bytealign_be (w[26], w[27], offset); w[37] = hc_bytealign_be (w[25], w[26], offset); w[36] = hc_bytealign_be (w[24], w[25], offset); w[35] = hc_bytealign_be (w[23], w[24], offset); w[34] = hc_bytealign_be (w[22], w[23], offset); w[33] = hc_bytealign_be (w[21], w[22], offset); w[32] = hc_bytealign_be (w[20], w[21], offset); w[31] = hc_bytealign_be (w[19], w[20], offset); w[30] = hc_bytealign_be (w[18], w[19], offset); w[29] = hc_bytealign_be (w[17], w[18], offset); w[28] = hc_bytealign_be (w[16], w[17], offset); w[27] = hc_bytealign_be (w[15], w[16], offset); w[26] = hc_bytealign_be (w[14], w[15], offset); w[25] = hc_bytealign_be (w[13], w[14], offset); w[24] = hc_bytealign_be (w[12], w[13], offset); w[23] = hc_bytealign_be (w[11], w[12], offset); w[22] = hc_bytealign_be (w[10], w[11], offset); w[21] = hc_bytealign_be (w[ 9], w[10], offset); w[20] = hc_bytealign_be (w[ 8], w[ 9], offset); w[19] = hc_bytealign_be (w[ 7], w[ 8], offset); w[18] = hc_bytealign_be (w[ 6], w[ 7], offset); w[17] = hc_bytealign_be (w[ 5], w[ 6], offset); w[16] = hc_bytealign_be (w[ 4], w[ 5], offset); w[15] = hc_bytealign_be (w[ 3], w[ 4], offset); w[14] = hc_bytealign_be (w[ 2], w[ 3], offset); w[13] = hc_bytealign_be (w[ 1], w[ 2], offset); w[12] = hc_bytealign_be (w[ 0], w[ 1], offset); w[11] = hc_bytealign_be ( 0, w[ 0], offset); w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 12: w[63] = hc_bytealign_be (w[50], w[51], offset); w[62] = hc_bytealign_be (w[49], w[50], offset); w[61] = hc_bytealign_be (w[48], w[49], offset); w[60] = hc_bytealign_be (w[47], w[48], offset); w[59] = hc_bytealign_be (w[46], w[47], offset); w[58] = hc_bytealign_be (w[45], w[46], offset); w[57] = hc_bytealign_be (w[44], w[45], offset); w[56] = hc_bytealign_be (w[43], w[44], offset); w[55] = hc_bytealign_be (w[42], w[43], offset); w[54] = hc_bytealign_be (w[41], w[42], offset); w[53] = hc_bytealign_be (w[40], w[41], offset); w[52] = hc_bytealign_be (w[39], w[40], offset); w[51] = hc_bytealign_be (w[38], w[39], offset); w[50] = hc_bytealign_be (w[37], w[38], offset); w[49] = hc_bytealign_be (w[36], w[37], offset); w[48] = hc_bytealign_be (w[35], w[36], offset); w[47] = hc_bytealign_be (w[34], w[35], offset); w[46] = hc_bytealign_be (w[33], w[34], offset); w[45] = hc_bytealign_be (w[32], w[33], offset); w[44] = hc_bytealign_be (w[31], w[32], offset); w[43] = hc_bytealign_be (w[30], w[31], offset); w[42] = hc_bytealign_be (w[29], w[30], offset); w[41] = hc_bytealign_be (w[28], w[29], offset); w[40] = hc_bytealign_be (w[27], w[28], offset); w[39] = hc_bytealign_be (w[26], w[27], offset); w[38] = hc_bytealign_be (w[25], w[26], offset); w[37] = hc_bytealign_be (w[24], w[25], offset); w[36] = hc_bytealign_be (w[23], w[24], offset); w[35] = hc_bytealign_be (w[22], w[23], offset); w[34] = hc_bytealign_be (w[21], w[22], offset); w[33] = hc_bytealign_be (w[20], w[21], offset); w[32] = hc_bytealign_be (w[19], w[20], offset); w[31] = hc_bytealign_be (w[18], w[19], offset); w[30] = hc_bytealign_be (w[17], w[18], offset); w[29] = hc_bytealign_be (w[16], w[17], offset); w[28] = hc_bytealign_be (w[15], w[16], offset); w[27] = hc_bytealign_be (w[14], w[15], offset); w[26] = hc_bytealign_be (w[13], w[14], offset); w[25] = hc_bytealign_be (w[12], w[13], offset); w[24] = hc_bytealign_be (w[11], w[12], offset); w[23] = hc_bytealign_be (w[10], w[11], offset); w[22] = hc_bytealign_be (w[ 9], w[10], offset); w[21] = hc_bytealign_be (w[ 8], w[ 9], offset); w[20] = hc_bytealign_be (w[ 7], w[ 8], offset); w[19] = hc_bytealign_be (w[ 6], w[ 7], offset); w[18] = hc_bytealign_be (w[ 5], w[ 6], offset); w[17] = hc_bytealign_be (w[ 4], w[ 5], offset); w[16] = hc_bytealign_be (w[ 3], w[ 4], offset); w[15] = hc_bytealign_be (w[ 2], w[ 3], offset); w[14] = hc_bytealign_be (w[ 1], w[ 2], offset); w[13] = hc_bytealign_be (w[ 0], w[ 1], offset); w[12] = hc_bytealign_be ( 0, w[ 0], offset); w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 13: w[63] = hc_bytealign_be (w[49], w[50], offset); w[62] = hc_bytealign_be (w[48], w[49], offset); w[61] = hc_bytealign_be (w[47], w[48], offset); w[60] = hc_bytealign_be (w[46], w[47], offset); w[59] = hc_bytealign_be (w[45], w[46], offset); w[58] = hc_bytealign_be (w[44], w[45], offset); w[57] = hc_bytealign_be (w[43], w[44], offset); w[56] = hc_bytealign_be (w[42], w[43], offset); w[55] = hc_bytealign_be (w[41], w[42], offset); w[54] = hc_bytealign_be (w[40], w[41], offset); w[53] = hc_bytealign_be (w[39], w[40], offset); w[52] = hc_bytealign_be (w[38], w[39], offset); w[51] = hc_bytealign_be (w[37], w[38], offset); w[50] = hc_bytealign_be (w[36], w[37], offset); w[49] = hc_bytealign_be (w[35], w[36], offset); w[48] = hc_bytealign_be (w[34], w[35], offset); w[47] = hc_bytealign_be (w[33], w[34], offset); w[46] = hc_bytealign_be (w[32], w[33], offset); w[45] = hc_bytealign_be (w[31], w[32], offset); w[44] = hc_bytealign_be (w[30], w[31], offset); w[43] = hc_bytealign_be (w[29], w[30], offset); w[42] = hc_bytealign_be (w[28], w[29], offset); w[41] = hc_bytealign_be (w[27], w[28], offset); w[40] = hc_bytealign_be (w[26], w[27], offset); w[39] = hc_bytealign_be (w[25], w[26], offset); w[38] = hc_bytealign_be (w[24], w[25], offset); w[37] = hc_bytealign_be (w[23], w[24], offset); w[36] = hc_bytealign_be (w[22], w[23], offset); w[35] = hc_bytealign_be (w[21], w[22], offset); w[34] = hc_bytealign_be (w[20], w[21], offset); w[33] = hc_bytealign_be (w[19], w[20], offset); w[32] = hc_bytealign_be (w[18], w[19], offset); w[31] = hc_bytealign_be (w[17], w[18], offset); w[30] = hc_bytealign_be (w[16], w[17], offset); w[29] = hc_bytealign_be (w[15], w[16], offset); w[28] = hc_bytealign_be (w[14], w[15], offset); w[27] = hc_bytealign_be (w[13], w[14], offset); w[26] = hc_bytealign_be (w[12], w[13], offset); w[25] = hc_bytealign_be (w[11], w[12], offset); w[24] = hc_bytealign_be (w[10], w[11], offset); w[23] = hc_bytealign_be (w[ 9], w[10], offset); w[22] = hc_bytealign_be (w[ 8], w[ 9], offset); w[21] = hc_bytealign_be (w[ 7], w[ 8], offset); w[20] = hc_bytealign_be (w[ 6], w[ 7], offset); w[19] = hc_bytealign_be (w[ 5], w[ 6], offset); w[18] = hc_bytealign_be (w[ 4], w[ 5], offset); w[17] = hc_bytealign_be (w[ 3], w[ 4], offset); w[16] = hc_bytealign_be (w[ 2], w[ 3], offset); w[15] = hc_bytealign_be (w[ 1], w[ 2], offset); w[14] = hc_bytealign_be (w[ 0], w[ 1], offset); w[13] = hc_bytealign_be ( 0, w[ 0], offset); w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 14: w[63] = hc_bytealign_be (w[48], w[49], offset); w[62] = hc_bytealign_be (w[47], w[48], offset); w[61] = hc_bytealign_be (w[46], w[47], offset); w[60] = hc_bytealign_be (w[45], w[46], offset); w[59] = hc_bytealign_be (w[44], w[45], offset); w[58] = hc_bytealign_be (w[43], w[44], offset); w[57] = hc_bytealign_be (w[42], w[43], offset); w[56] = hc_bytealign_be (w[41], w[42], offset); w[55] = hc_bytealign_be (w[40], w[41], offset); w[54] = hc_bytealign_be (w[39], w[40], offset); w[53] = hc_bytealign_be (w[38], w[39], offset); w[52] = hc_bytealign_be (w[37], w[38], offset); w[51] = hc_bytealign_be (w[36], w[37], offset); w[50] = hc_bytealign_be (w[35], w[36], offset); w[49] = hc_bytealign_be (w[34], w[35], offset); w[48] = hc_bytealign_be (w[33], w[34], offset); w[47] = hc_bytealign_be (w[32], w[33], offset); w[46] = hc_bytealign_be (w[31], w[32], offset); w[45] = hc_bytealign_be (w[30], w[31], offset); w[44] = hc_bytealign_be (w[29], w[30], offset); w[43] = hc_bytealign_be (w[28], w[29], offset); w[42] = hc_bytealign_be (w[27], w[28], offset); w[41] = hc_bytealign_be (w[26], w[27], offset); w[40] = hc_bytealign_be (w[25], w[26], offset); w[39] = hc_bytealign_be (w[24], w[25], offset); w[38] = hc_bytealign_be (w[23], w[24], offset); w[37] = hc_bytealign_be (w[22], w[23], offset); w[36] = hc_bytealign_be (w[21], w[22], offset); w[35] = hc_bytealign_be (w[20], w[21], offset); w[34] = hc_bytealign_be (w[19], w[20], offset); w[33] = hc_bytealign_be (w[18], w[19], offset); w[32] = hc_bytealign_be (w[17], w[18], offset); w[31] = hc_bytealign_be (w[16], w[17], offset); w[30] = hc_bytealign_be (w[15], w[16], offset); w[29] = hc_bytealign_be (w[14], w[15], offset); w[28] = hc_bytealign_be (w[13], w[14], offset); w[27] = hc_bytealign_be (w[12], w[13], offset); w[26] = hc_bytealign_be (w[11], w[12], offset); w[25] = hc_bytealign_be (w[10], w[11], offset); w[24] = hc_bytealign_be (w[ 9], w[10], offset); w[23] = hc_bytealign_be (w[ 8], w[ 9], offset); w[22] = hc_bytealign_be (w[ 7], w[ 8], offset); w[21] = hc_bytealign_be (w[ 6], w[ 7], offset); w[20] = hc_bytealign_be (w[ 5], w[ 6], offset); w[19] = hc_bytealign_be (w[ 4], w[ 5], offset); w[18] = hc_bytealign_be (w[ 3], w[ 4], offset); w[17] = hc_bytealign_be (w[ 2], w[ 3], offset); w[16] = hc_bytealign_be (w[ 1], w[ 2], offset); w[15] = hc_bytealign_be (w[ 0], w[ 1], offset); w[14] = hc_bytealign_be ( 0, w[ 0], offset); w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 15: w[63] = hc_bytealign_be (w[47], w[48], offset); w[62] = hc_bytealign_be (w[46], w[47], offset); w[61] = hc_bytealign_be (w[45], w[46], offset); w[60] = hc_bytealign_be (w[44], w[45], offset); w[59] = hc_bytealign_be (w[43], w[44], offset); w[58] = hc_bytealign_be (w[42], w[43], offset); w[57] = hc_bytealign_be (w[41], w[42], offset); w[56] = hc_bytealign_be (w[40], w[41], offset); w[55] = hc_bytealign_be (w[39], w[40], offset); w[54] = hc_bytealign_be (w[38], w[39], offset); w[53] = hc_bytealign_be (w[37], w[38], offset); w[52] = hc_bytealign_be (w[36], w[37], offset); w[51] = hc_bytealign_be (w[35], w[36], offset); w[50] = hc_bytealign_be (w[34], w[35], offset); w[49] = hc_bytealign_be (w[33], w[34], offset); w[48] = hc_bytealign_be (w[32], w[33], offset); w[47] = hc_bytealign_be (w[31], w[32], offset); w[46] = hc_bytealign_be (w[30], w[31], offset); w[45] = hc_bytealign_be (w[29], w[30], offset); w[44] = hc_bytealign_be (w[28], w[29], offset); w[43] = hc_bytealign_be (w[27], w[28], offset); w[42] = hc_bytealign_be (w[26], w[27], offset); w[41] = hc_bytealign_be (w[25], w[26], offset); w[40] = hc_bytealign_be (w[24], w[25], offset); w[39] = hc_bytealign_be (w[23], w[24], offset); w[38] = hc_bytealign_be (w[22], w[23], offset); w[37] = hc_bytealign_be (w[21], w[22], offset); w[36] = hc_bytealign_be (w[20], w[21], offset); w[35] = hc_bytealign_be (w[19], w[20], offset); w[34] = hc_bytealign_be (w[18], w[19], offset); w[33] = hc_bytealign_be (w[17], w[18], offset); w[32] = hc_bytealign_be (w[16], w[17], offset); w[31] = hc_bytealign_be (w[15], w[16], offset); w[30] = hc_bytealign_be (w[14], w[15], offset); w[29] = hc_bytealign_be (w[13], w[14], offset); w[28] = hc_bytealign_be (w[12], w[13], offset); w[27] = hc_bytealign_be (w[11], w[12], offset); w[26] = hc_bytealign_be (w[10], w[11], offset); w[25] = hc_bytealign_be (w[ 9], w[10], offset); w[24] = hc_bytealign_be (w[ 8], w[ 9], offset); w[23] = hc_bytealign_be (w[ 7], w[ 8], offset); w[22] = hc_bytealign_be (w[ 6], w[ 7], offset); w[21] = hc_bytealign_be (w[ 5], w[ 6], offset); w[20] = hc_bytealign_be (w[ 4], w[ 5], offset); w[19] = hc_bytealign_be (w[ 3], w[ 4], offset); w[18] = hc_bytealign_be (w[ 2], w[ 3], offset); w[17] = hc_bytealign_be (w[ 1], w[ 2], offset); w[16] = hc_bytealign_be (w[ 0], w[ 1], offset); w[15] = hc_bytealign_be ( 0, w[ 0], offset); w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 16: w[63] = hc_bytealign_be (w[46], w[47], offset); w[62] = hc_bytealign_be (w[45], w[46], offset); w[61] = hc_bytealign_be (w[44], w[45], offset); w[60] = hc_bytealign_be (w[43], w[44], offset); w[59] = hc_bytealign_be (w[42], w[43], offset); w[58] = hc_bytealign_be (w[41], w[42], offset); w[57] = hc_bytealign_be (w[40], w[41], offset); w[56] = hc_bytealign_be (w[39], w[40], offset); w[55] = hc_bytealign_be (w[38], w[39], offset); w[54] = hc_bytealign_be (w[37], w[38], offset); w[53] = hc_bytealign_be (w[36], w[37], offset); w[52] = hc_bytealign_be (w[35], w[36], offset); w[51] = hc_bytealign_be (w[34], w[35], offset); w[50] = hc_bytealign_be (w[33], w[34], offset); w[49] = hc_bytealign_be (w[32], w[33], offset); w[48] = hc_bytealign_be (w[31], w[32], offset); w[47] = hc_bytealign_be (w[30], w[31], offset); w[46] = hc_bytealign_be (w[29], w[30], offset); w[45] = hc_bytealign_be (w[28], w[29], offset); w[44] = hc_bytealign_be (w[27], w[28], offset); w[43] = hc_bytealign_be (w[26], w[27], offset); w[42] = hc_bytealign_be (w[25], w[26], offset); w[41] = hc_bytealign_be (w[24], w[25], offset); w[40] = hc_bytealign_be (w[23], w[24], offset); w[39] = hc_bytealign_be (w[22], w[23], offset); w[38] = hc_bytealign_be (w[21], w[22], offset); w[37] = hc_bytealign_be (w[20], w[21], offset); w[36] = hc_bytealign_be (w[19], w[20], offset); w[35] = hc_bytealign_be (w[18], w[19], offset); w[34] = hc_bytealign_be (w[17], w[18], offset); w[33] = hc_bytealign_be (w[16], w[17], offset); w[32] = hc_bytealign_be (w[15], w[16], offset); w[31] = hc_bytealign_be (w[14], w[15], offset); w[30] = hc_bytealign_be (w[13], w[14], offset); w[29] = hc_bytealign_be (w[12], w[13], offset); w[28] = hc_bytealign_be (w[11], w[12], offset); w[27] = hc_bytealign_be (w[10], w[11], offset); w[26] = hc_bytealign_be (w[ 9], w[10], offset); w[25] = hc_bytealign_be (w[ 8], w[ 9], offset); w[24] = hc_bytealign_be (w[ 7], w[ 8], offset); w[23] = hc_bytealign_be (w[ 6], w[ 7], offset); w[22] = hc_bytealign_be (w[ 5], w[ 6], offset); w[21] = hc_bytealign_be (w[ 4], w[ 5], offset); w[20] = hc_bytealign_be (w[ 3], w[ 4], offset); w[19] = hc_bytealign_be (w[ 2], w[ 3], offset); w[18] = hc_bytealign_be (w[ 1], w[ 2], offset); w[17] = hc_bytealign_be (w[ 0], w[ 1], offset); w[16] = hc_bytealign_be ( 0, w[ 0], offset); w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 17: w[63] = hc_bytealign_be (w[45], w[46], offset); w[62] = hc_bytealign_be (w[44], w[45], offset); w[61] = hc_bytealign_be (w[43], w[44], offset); w[60] = hc_bytealign_be (w[42], w[43], offset); w[59] = hc_bytealign_be (w[41], w[42], offset); w[58] = hc_bytealign_be (w[40], w[41], offset); w[57] = hc_bytealign_be (w[39], w[40], offset); w[56] = hc_bytealign_be (w[38], w[39], offset); w[55] = hc_bytealign_be (w[37], w[38], offset); w[54] = hc_bytealign_be (w[36], w[37], offset); w[53] = hc_bytealign_be (w[35], w[36], offset); w[52] = hc_bytealign_be (w[34], w[35], offset); w[51] = hc_bytealign_be (w[33], w[34], offset); w[50] = hc_bytealign_be (w[32], w[33], offset); w[49] = hc_bytealign_be (w[31], w[32], offset); w[48] = hc_bytealign_be (w[30], w[31], offset); w[47] = hc_bytealign_be (w[29], w[30], offset); w[46] = hc_bytealign_be (w[28], w[29], offset); w[45] = hc_bytealign_be (w[27], w[28], offset); w[44] = hc_bytealign_be (w[26], w[27], offset); w[43] = hc_bytealign_be (w[25], w[26], offset); w[42] = hc_bytealign_be (w[24], w[25], offset); w[41] = hc_bytealign_be (w[23], w[24], offset); w[40] = hc_bytealign_be (w[22], w[23], offset); w[39] = hc_bytealign_be (w[21], w[22], offset); w[38] = hc_bytealign_be (w[20], w[21], offset); w[37] = hc_bytealign_be (w[19], w[20], offset); w[36] = hc_bytealign_be (w[18], w[19], offset); w[35] = hc_bytealign_be (w[17], w[18], offset); w[34] = hc_bytealign_be (w[16], w[17], offset); w[33] = hc_bytealign_be (w[15], w[16], offset); w[32] = hc_bytealign_be (w[14], w[15], offset); w[31] = hc_bytealign_be (w[13], w[14], offset); w[30] = hc_bytealign_be (w[12], w[13], offset); w[29] = hc_bytealign_be (w[11], w[12], offset); w[28] = hc_bytealign_be (w[10], w[11], offset); w[27] = hc_bytealign_be (w[ 9], w[10], offset); w[26] = hc_bytealign_be (w[ 8], w[ 9], offset); w[25] = hc_bytealign_be (w[ 7], w[ 8], offset); w[24] = hc_bytealign_be (w[ 6], w[ 7], offset); w[23] = hc_bytealign_be (w[ 5], w[ 6], offset); w[22] = hc_bytealign_be (w[ 4], w[ 5], offset); w[21] = hc_bytealign_be (w[ 3], w[ 4], offset); w[20] = hc_bytealign_be (w[ 2], w[ 3], offset); w[19] = hc_bytealign_be (w[ 1], w[ 2], offset); w[18] = hc_bytealign_be (w[ 0], w[ 1], offset); w[17] = hc_bytealign_be ( 0, w[ 0], offset); w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 18: w[63] = hc_bytealign_be (w[44], w[45], offset); w[62] = hc_bytealign_be (w[43], w[44], offset); w[61] = hc_bytealign_be (w[42], w[43], offset); w[60] = hc_bytealign_be (w[41], w[42], offset); w[59] = hc_bytealign_be (w[40], w[41], offset); w[58] = hc_bytealign_be (w[39], w[40], offset); w[57] = hc_bytealign_be (w[38], w[39], offset); w[56] = hc_bytealign_be (w[37], w[38], offset); w[55] = hc_bytealign_be (w[36], w[37], offset); w[54] = hc_bytealign_be (w[35], w[36], offset); w[53] = hc_bytealign_be (w[34], w[35], offset); w[52] = hc_bytealign_be (w[33], w[34], offset); w[51] = hc_bytealign_be (w[32], w[33], offset); w[50] = hc_bytealign_be (w[31], w[32], offset); w[49] = hc_bytealign_be (w[30], w[31], offset); w[48] = hc_bytealign_be (w[29], w[30], offset); w[47] = hc_bytealign_be (w[28], w[29], offset); w[46] = hc_bytealign_be (w[27], w[28], offset); w[45] = hc_bytealign_be (w[26], w[27], offset); w[44] = hc_bytealign_be (w[25], w[26], offset); w[43] = hc_bytealign_be (w[24], w[25], offset); w[42] = hc_bytealign_be (w[23], w[24], offset); w[41] = hc_bytealign_be (w[22], w[23], offset); w[40] = hc_bytealign_be (w[21], w[22], offset); w[39] = hc_bytealign_be (w[20], w[21], offset); w[38] = hc_bytealign_be (w[19], w[20], offset); w[37] = hc_bytealign_be (w[18], w[19], offset); w[36] = hc_bytealign_be (w[17], w[18], offset); w[35] = hc_bytealign_be (w[16], w[17], offset); w[34] = hc_bytealign_be (w[15], w[16], offset); w[33] = hc_bytealign_be (w[14], w[15], offset); w[32] = hc_bytealign_be (w[13], w[14], offset); w[31] = hc_bytealign_be (w[12], w[13], offset); w[30] = hc_bytealign_be (w[11], w[12], offset); w[29] = hc_bytealign_be (w[10], w[11], offset); w[28] = hc_bytealign_be (w[ 9], w[10], offset); w[27] = hc_bytealign_be (w[ 8], w[ 9], offset); w[26] = hc_bytealign_be (w[ 7], w[ 8], offset); w[25] = hc_bytealign_be (w[ 6], w[ 7], offset); w[24] = hc_bytealign_be (w[ 5], w[ 6], offset); w[23] = hc_bytealign_be (w[ 4], w[ 5], offset); w[22] = hc_bytealign_be (w[ 3], w[ 4], offset); w[21] = hc_bytealign_be (w[ 2], w[ 3], offset); w[20] = hc_bytealign_be (w[ 1], w[ 2], offset); w[19] = hc_bytealign_be (w[ 0], w[ 1], offset); w[18] = hc_bytealign_be ( 0, w[ 0], offset); w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 19: w[63] = hc_bytealign_be (w[43], w[44], offset); w[62] = hc_bytealign_be (w[42], w[43], offset); w[61] = hc_bytealign_be (w[41], w[42], offset); w[60] = hc_bytealign_be (w[40], w[41], offset); w[59] = hc_bytealign_be (w[39], w[40], offset); w[58] = hc_bytealign_be (w[38], w[39], offset); w[57] = hc_bytealign_be (w[37], w[38], offset); w[56] = hc_bytealign_be (w[36], w[37], offset); w[55] = hc_bytealign_be (w[35], w[36], offset); w[54] = hc_bytealign_be (w[34], w[35], offset); w[53] = hc_bytealign_be (w[33], w[34], offset); w[52] = hc_bytealign_be (w[32], w[33], offset); w[51] = hc_bytealign_be (w[31], w[32], offset); w[50] = hc_bytealign_be (w[30], w[31], offset); w[49] = hc_bytealign_be (w[29], w[30], offset); w[48] = hc_bytealign_be (w[28], w[29], offset); w[47] = hc_bytealign_be (w[27], w[28], offset); w[46] = hc_bytealign_be (w[26], w[27], offset); w[45] = hc_bytealign_be (w[25], w[26], offset); w[44] = hc_bytealign_be (w[24], w[25], offset); w[43] = hc_bytealign_be (w[23], w[24], offset); w[42] = hc_bytealign_be (w[22], w[23], offset); w[41] = hc_bytealign_be (w[21], w[22], offset); w[40] = hc_bytealign_be (w[20], w[21], offset); w[39] = hc_bytealign_be (w[19], w[20], offset); w[38] = hc_bytealign_be (w[18], w[19], offset); w[37] = hc_bytealign_be (w[17], w[18], offset); w[36] = hc_bytealign_be (w[16], w[17], offset); w[35] = hc_bytealign_be (w[15], w[16], offset); w[34] = hc_bytealign_be (w[14], w[15], offset); w[33] = hc_bytealign_be (w[13], w[14], offset); w[32] = hc_bytealign_be (w[12], w[13], offset); w[31] = hc_bytealign_be (w[11], w[12], offset); w[30] = hc_bytealign_be (w[10], w[11], offset); w[29] = hc_bytealign_be (w[ 9], w[10], offset); w[28] = hc_bytealign_be (w[ 8], w[ 9], offset); w[27] = hc_bytealign_be (w[ 7], w[ 8], offset); w[26] = hc_bytealign_be (w[ 6], w[ 7], offset); w[25] = hc_bytealign_be (w[ 5], w[ 6], offset); w[24] = hc_bytealign_be (w[ 4], w[ 5], offset); w[23] = hc_bytealign_be (w[ 3], w[ 4], offset); w[22] = hc_bytealign_be (w[ 2], w[ 3], offset); w[21] = hc_bytealign_be (w[ 1], w[ 2], offset); w[20] = hc_bytealign_be (w[ 0], w[ 1], offset); w[19] = hc_bytealign_be ( 0, w[ 0], offset); w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 20: w[63] = hc_bytealign_be (w[42], w[43], offset); w[62] = hc_bytealign_be (w[41], w[42], offset); w[61] = hc_bytealign_be (w[40], w[41], offset); w[60] = hc_bytealign_be (w[39], w[40], offset); w[59] = hc_bytealign_be (w[38], w[39], offset); w[58] = hc_bytealign_be (w[37], w[38], offset); w[57] = hc_bytealign_be (w[36], w[37], offset); w[56] = hc_bytealign_be (w[35], w[36], offset); w[55] = hc_bytealign_be (w[34], w[35], offset); w[54] = hc_bytealign_be (w[33], w[34], offset); w[53] = hc_bytealign_be (w[32], w[33], offset); w[52] = hc_bytealign_be (w[31], w[32], offset); w[51] = hc_bytealign_be (w[30], w[31], offset); w[50] = hc_bytealign_be (w[29], w[30], offset); w[49] = hc_bytealign_be (w[28], w[29], offset); w[48] = hc_bytealign_be (w[27], w[28], offset); w[47] = hc_bytealign_be (w[26], w[27], offset); w[46] = hc_bytealign_be (w[25], w[26], offset); w[45] = hc_bytealign_be (w[24], w[25], offset); w[44] = hc_bytealign_be (w[23], w[24], offset); w[43] = hc_bytealign_be (w[22], w[23], offset); w[42] = hc_bytealign_be (w[21], w[22], offset); w[41] = hc_bytealign_be (w[20], w[21], offset); w[40] = hc_bytealign_be (w[19], w[20], offset); w[39] = hc_bytealign_be (w[18], w[19], offset); w[38] = hc_bytealign_be (w[17], w[18], offset); w[37] = hc_bytealign_be (w[16], w[17], offset); w[36] = hc_bytealign_be (w[15], w[16], offset); w[35] = hc_bytealign_be (w[14], w[15], offset); w[34] = hc_bytealign_be (w[13], w[14], offset); w[33] = hc_bytealign_be (w[12], w[13], offset); w[32] = hc_bytealign_be (w[11], w[12], offset); w[31] = hc_bytealign_be (w[10], w[11], offset); w[30] = hc_bytealign_be (w[ 9], w[10], offset); w[29] = hc_bytealign_be (w[ 8], w[ 9], offset); w[28] = hc_bytealign_be (w[ 7], w[ 8], offset); w[27] = hc_bytealign_be (w[ 6], w[ 7], offset); w[26] = hc_bytealign_be (w[ 5], w[ 6], offset); w[25] = hc_bytealign_be (w[ 4], w[ 5], offset); w[24] = hc_bytealign_be (w[ 3], w[ 4], offset); w[23] = hc_bytealign_be (w[ 2], w[ 3], offset); w[22] = hc_bytealign_be (w[ 1], w[ 2], offset); w[21] = hc_bytealign_be (w[ 0], w[ 1], offset); w[20] = hc_bytealign_be ( 0, w[ 0], offset); w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 21: w[63] = hc_bytealign_be (w[41], w[42], offset); w[62] = hc_bytealign_be (w[40], w[41], offset); w[61] = hc_bytealign_be (w[39], w[40], offset); w[60] = hc_bytealign_be (w[38], w[39], offset); w[59] = hc_bytealign_be (w[37], w[38], offset); w[58] = hc_bytealign_be (w[36], w[37], offset); w[57] = hc_bytealign_be (w[35], w[36], offset); w[56] = hc_bytealign_be (w[34], w[35], offset); w[55] = hc_bytealign_be (w[33], w[34], offset); w[54] = hc_bytealign_be (w[32], w[33], offset); w[53] = hc_bytealign_be (w[31], w[32], offset); w[52] = hc_bytealign_be (w[30], w[31], offset); w[51] = hc_bytealign_be (w[29], w[30], offset); w[50] = hc_bytealign_be (w[28], w[29], offset); w[49] = hc_bytealign_be (w[27], w[28], offset); w[48] = hc_bytealign_be (w[26], w[27], offset); w[47] = hc_bytealign_be (w[25], w[26], offset); w[46] = hc_bytealign_be (w[24], w[25], offset); w[45] = hc_bytealign_be (w[23], w[24], offset); w[44] = hc_bytealign_be (w[22], w[23], offset); w[43] = hc_bytealign_be (w[21], w[22], offset); w[42] = hc_bytealign_be (w[20], w[21], offset); w[41] = hc_bytealign_be (w[19], w[20], offset); w[40] = hc_bytealign_be (w[18], w[19], offset); w[39] = hc_bytealign_be (w[17], w[18], offset); w[38] = hc_bytealign_be (w[16], w[17], offset); w[37] = hc_bytealign_be (w[15], w[16], offset); w[36] = hc_bytealign_be (w[14], w[15], offset); w[35] = hc_bytealign_be (w[13], w[14], offset); w[34] = hc_bytealign_be (w[12], w[13], offset); w[33] = hc_bytealign_be (w[11], w[12], offset); w[32] = hc_bytealign_be (w[10], w[11], offset); w[31] = hc_bytealign_be (w[ 9], w[10], offset); w[30] = hc_bytealign_be (w[ 8], w[ 9], offset); w[29] = hc_bytealign_be (w[ 7], w[ 8], offset); w[28] = hc_bytealign_be (w[ 6], w[ 7], offset); w[27] = hc_bytealign_be (w[ 5], w[ 6], offset); w[26] = hc_bytealign_be (w[ 4], w[ 5], offset); w[25] = hc_bytealign_be (w[ 3], w[ 4], offset); w[24] = hc_bytealign_be (w[ 2], w[ 3], offset); w[23] = hc_bytealign_be (w[ 1], w[ 2], offset); w[22] = hc_bytealign_be (w[ 0], w[ 1], offset); w[21] = hc_bytealign_be ( 0, w[ 0], offset); w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 22: w[63] = hc_bytealign_be (w[40], w[41], offset); w[62] = hc_bytealign_be (w[39], w[40], offset); w[61] = hc_bytealign_be (w[38], w[39], offset); w[60] = hc_bytealign_be (w[37], w[38], offset); w[59] = hc_bytealign_be (w[36], w[37], offset); w[58] = hc_bytealign_be (w[35], w[36], offset); w[57] = hc_bytealign_be (w[34], w[35], offset); w[56] = hc_bytealign_be (w[33], w[34], offset); w[55] = hc_bytealign_be (w[32], w[33], offset); w[54] = hc_bytealign_be (w[31], w[32], offset); w[53] = hc_bytealign_be (w[30], w[31], offset); w[52] = hc_bytealign_be (w[29], w[30], offset); w[51] = hc_bytealign_be (w[28], w[29], offset); w[50] = hc_bytealign_be (w[27], w[28], offset); w[49] = hc_bytealign_be (w[26], w[27], offset); w[48] = hc_bytealign_be (w[25], w[26], offset); w[47] = hc_bytealign_be (w[24], w[25], offset); w[46] = hc_bytealign_be (w[23], w[24], offset); w[45] = hc_bytealign_be (w[22], w[23], offset); w[44] = hc_bytealign_be (w[21], w[22], offset); w[43] = hc_bytealign_be (w[20], w[21], offset); w[42] = hc_bytealign_be (w[19], w[20], offset); w[41] = hc_bytealign_be (w[18], w[19], offset); w[40] = hc_bytealign_be (w[17], w[18], offset); w[39] = hc_bytealign_be (w[16], w[17], offset); w[38] = hc_bytealign_be (w[15], w[16], offset); w[37] = hc_bytealign_be (w[14], w[15], offset); w[36] = hc_bytealign_be (w[13], w[14], offset); w[35] = hc_bytealign_be (w[12], w[13], offset); w[34] = hc_bytealign_be (w[11], w[12], offset); w[33] = hc_bytealign_be (w[10], w[11], offset); w[32] = hc_bytealign_be (w[ 9], w[10], offset); w[31] = hc_bytealign_be (w[ 8], w[ 9], offset); w[30] = hc_bytealign_be (w[ 7], w[ 8], offset); w[29] = hc_bytealign_be (w[ 6], w[ 7], offset); w[28] = hc_bytealign_be (w[ 5], w[ 6], offset); w[27] = hc_bytealign_be (w[ 4], w[ 5], offset); w[26] = hc_bytealign_be (w[ 3], w[ 4], offset); w[25] = hc_bytealign_be (w[ 2], w[ 3], offset); w[24] = hc_bytealign_be (w[ 1], w[ 2], offset); w[23] = hc_bytealign_be (w[ 0], w[ 1], offset); w[22] = hc_bytealign_be ( 0, w[ 0], offset); w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 23: w[63] = hc_bytealign_be (w[39], w[40], offset); w[62] = hc_bytealign_be (w[38], w[39], offset); w[61] = hc_bytealign_be (w[37], w[38], offset); w[60] = hc_bytealign_be (w[36], w[37], offset); w[59] = hc_bytealign_be (w[35], w[36], offset); w[58] = hc_bytealign_be (w[34], w[35], offset); w[57] = hc_bytealign_be (w[33], w[34], offset); w[56] = hc_bytealign_be (w[32], w[33], offset); w[55] = hc_bytealign_be (w[31], w[32], offset); w[54] = hc_bytealign_be (w[30], w[31], offset); w[53] = hc_bytealign_be (w[29], w[30], offset); w[52] = hc_bytealign_be (w[28], w[29], offset); w[51] = hc_bytealign_be (w[27], w[28], offset); w[50] = hc_bytealign_be (w[26], w[27], offset); w[49] = hc_bytealign_be (w[25], w[26], offset); w[48] = hc_bytealign_be (w[24], w[25], offset); w[47] = hc_bytealign_be (w[23], w[24], offset); w[46] = hc_bytealign_be (w[22], w[23], offset); w[45] = hc_bytealign_be (w[21], w[22], offset); w[44] = hc_bytealign_be (w[20], w[21], offset); w[43] = hc_bytealign_be (w[19], w[20], offset); w[42] = hc_bytealign_be (w[18], w[19], offset); w[41] = hc_bytealign_be (w[17], w[18], offset); w[40] = hc_bytealign_be (w[16], w[17], offset); w[39] = hc_bytealign_be (w[15], w[16], offset); w[38] = hc_bytealign_be (w[14], w[15], offset); w[37] = hc_bytealign_be (w[13], w[14], offset); w[36] = hc_bytealign_be (w[12], w[13], offset); w[35] = hc_bytealign_be (w[11], w[12], offset); w[34] = hc_bytealign_be (w[10], w[11], offset); w[33] = hc_bytealign_be (w[ 9], w[10], offset); w[32] = hc_bytealign_be (w[ 8], w[ 9], offset); w[31] = hc_bytealign_be (w[ 7], w[ 8], offset); w[30] = hc_bytealign_be (w[ 6], w[ 7], offset); w[29] = hc_bytealign_be (w[ 5], w[ 6], offset); w[28] = hc_bytealign_be (w[ 4], w[ 5], offset); w[27] = hc_bytealign_be (w[ 3], w[ 4], offset); w[26] = hc_bytealign_be (w[ 2], w[ 3], offset); w[25] = hc_bytealign_be (w[ 1], w[ 2], offset); w[24] = hc_bytealign_be (w[ 0], w[ 1], offset); w[23] = hc_bytealign_be ( 0, w[ 0], offset); w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 24: w[63] = hc_bytealign_be (w[38], w[39], offset); w[62] = hc_bytealign_be (w[37], w[38], offset); w[61] = hc_bytealign_be (w[36], w[37], offset); w[60] = hc_bytealign_be (w[35], w[36], offset); w[59] = hc_bytealign_be (w[34], w[35], offset); w[58] = hc_bytealign_be (w[33], w[34], offset); w[57] = hc_bytealign_be (w[32], w[33], offset); w[56] = hc_bytealign_be (w[31], w[32], offset); w[55] = hc_bytealign_be (w[30], w[31], offset); w[54] = hc_bytealign_be (w[29], w[30], offset); w[53] = hc_bytealign_be (w[28], w[29], offset); w[52] = hc_bytealign_be (w[27], w[28], offset); w[51] = hc_bytealign_be (w[26], w[27], offset); w[50] = hc_bytealign_be (w[25], w[26], offset); w[49] = hc_bytealign_be (w[24], w[25], offset); w[48] = hc_bytealign_be (w[23], w[24], offset); w[47] = hc_bytealign_be (w[22], w[23], offset); w[46] = hc_bytealign_be (w[21], w[22], offset); w[45] = hc_bytealign_be (w[20], w[21], offset); w[44] = hc_bytealign_be (w[19], w[20], offset); w[43] = hc_bytealign_be (w[18], w[19], offset); w[42] = hc_bytealign_be (w[17], w[18], offset); w[41] = hc_bytealign_be (w[16], w[17], offset); w[40] = hc_bytealign_be (w[15], w[16], offset); w[39] = hc_bytealign_be (w[14], w[15], offset); w[38] = hc_bytealign_be (w[13], w[14], offset); w[37] = hc_bytealign_be (w[12], w[13], offset); w[36] = hc_bytealign_be (w[11], w[12], offset); w[35] = hc_bytealign_be (w[10], w[11], offset); w[34] = hc_bytealign_be (w[ 9], w[10], offset); w[33] = hc_bytealign_be (w[ 8], w[ 9], offset); w[32] = hc_bytealign_be (w[ 7], w[ 8], offset); w[31] = hc_bytealign_be (w[ 6], w[ 7], offset); w[30] = hc_bytealign_be (w[ 5], w[ 6], offset); w[29] = hc_bytealign_be (w[ 4], w[ 5], offset); w[28] = hc_bytealign_be (w[ 3], w[ 4], offset); w[27] = hc_bytealign_be (w[ 2], w[ 3], offset); w[26] = hc_bytealign_be (w[ 1], w[ 2], offset); w[25] = hc_bytealign_be (w[ 0], w[ 1], offset); w[24] = hc_bytealign_be ( 0, w[ 0], offset); w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 25: w[63] = hc_bytealign_be (w[37], w[38], offset); w[62] = hc_bytealign_be (w[36], w[37], offset); w[61] = hc_bytealign_be (w[35], w[36], offset); w[60] = hc_bytealign_be (w[34], w[35], offset); w[59] = hc_bytealign_be (w[33], w[34], offset); w[58] = hc_bytealign_be (w[32], w[33], offset); w[57] = hc_bytealign_be (w[31], w[32], offset); w[56] = hc_bytealign_be (w[30], w[31], offset); w[55] = hc_bytealign_be (w[29], w[30], offset); w[54] = hc_bytealign_be (w[28], w[29], offset); w[53] = hc_bytealign_be (w[27], w[28], offset); w[52] = hc_bytealign_be (w[26], w[27], offset); w[51] = hc_bytealign_be (w[25], w[26], offset); w[50] = hc_bytealign_be (w[24], w[25], offset); w[49] = hc_bytealign_be (w[23], w[24], offset); w[48] = hc_bytealign_be (w[22], w[23], offset); w[47] = hc_bytealign_be (w[21], w[22], offset); w[46] = hc_bytealign_be (w[20], w[21], offset); w[45] = hc_bytealign_be (w[19], w[20], offset); w[44] = hc_bytealign_be (w[18], w[19], offset); w[43] = hc_bytealign_be (w[17], w[18], offset); w[42] = hc_bytealign_be (w[16], w[17], offset); w[41] = hc_bytealign_be (w[15], w[16], offset); w[40] = hc_bytealign_be (w[14], w[15], offset); w[39] = hc_bytealign_be (w[13], w[14], offset); w[38] = hc_bytealign_be (w[12], w[13], offset); w[37] = hc_bytealign_be (w[11], w[12], offset); w[36] = hc_bytealign_be (w[10], w[11], offset); w[35] = hc_bytealign_be (w[ 9], w[10], offset); w[34] = hc_bytealign_be (w[ 8], w[ 9], offset); w[33] = hc_bytealign_be (w[ 7], w[ 8], offset); w[32] = hc_bytealign_be (w[ 6], w[ 7], offset); w[31] = hc_bytealign_be (w[ 5], w[ 6], offset); w[30] = hc_bytealign_be (w[ 4], w[ 5], offset); w[29] = hc_bytealign_be (w[ 3], w[ 4], offset); w[28] = hc_bytealign_be (w[ 2], w[ 3], offset); w[27] = hc_bytealign_be (w[ 1], w[ 2], offset); w[26] = hc_bytealign_be (w[ 0], w[ 1], offset); w[25] = hc_bytealign_be ( 0, w[ 0], offset); w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 26: w[63] = hc_bytealign_be (w[36], w[37], offset); w[62] = hc_bytealign_be (w[35], w[36], offset); w[61] = hc_bytealign_be (w[34], w[35], offset); w[60] = hc_bytealign_be (w[33], w[34], offset); w[59] = hc_bytealign_be (w[32], w[33], offset); w[58] = hc_bytealign_be (w[31], w[32], offset); w[57] = hc_bytealign_be (w[30], w[31], offset); w[56] = hc_bytealign_be (w[29], w[30], offset); w[55] = hc_bytealign_be (w[28], w[29], offset); w[54] = hc_bytealign_be (w[27], w[28], offset); w[53] = hc_bytealign_be (w[26], w[27], offset); w[52] = hc_bytealign_be (w[25], w[26], offset); w[51] = hc_bytealign_be (w[24], w[25], offset); w[50] = hc_bytealign_be (w[23], w[24], offset); w[49] = hc_bytealign_be (w[22], w[23], offset); w[48] = hc_bytealign_be (w[21], w[22], offset); w[47] = hc_bytealign_be (w[20], w[21], offset); w[46] = hc_bytealign_be (w[19], w[20], offset); w[45] = hc_bytealign_be (w[18], w[19], offset); w[44] = hc_bytealign_be (w[17], w[18], offset); w[43] = hc_bytealign_be (w[16], w[17], offset); w[42] = hc_bytealign_be (w[15], w[16], offset); w[41] = hc_bytealign_be (w[14], w[15], offset); w[40] = hc_bytealign_be (w[13], w[14], offset); w[39] = hc_bytealign_be (w[12], w[13], offset); w[38] = hc_bytealign_be (w[11], w[12], offset); w[37] = hc_bytealign_be (w[10], w[11], offset); w[36] = hc_bytealign_be (w[ 9], w[10], offset); w[35] = hc_bytealign_be (w[ 8], w[ 9], offset); w[34] = hc_bytealign_be (w[ 7], w[ 8], offset); w[33] = hc_bytealign_be (w[ 6], w[ 7], offset); w[32] = hc_bytealign_be (w[ 5], w[ 6], offset); w[31] = hc_bytealign_be (w[ 4], w[ 5], offset); w[30] = hc_bytealign_be (w[ 3], w[ 4], offset); w[29] = hc_bytealign_be (w[ 2], w[ 3], offset); w[28] = hc_bytealign_be (w[ 1], w[ 2], offset); w[27] = hc_bytealign_be (w[ 0], w[ 1], offset); w[26] = hc_bytealign_be ( 0, w[ 0], offset); w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 27: w[63] = hc_bytealign_be (w[35], w[36], offset); w[62] = hc_bytealign_be (w[34], w[35], offset); w[61] = hc_bytealign_be (w[33], w[34], offset); w[60] = hc_bytealign_be (w[32], w[33], offset); w[59] = hc_bytealign_be (w[31], w[32], offset); w[58] = hc_bytealign_be (w[30], w[31], offset); w[57] = hc_bytealign_be (w[29], w[30], offset); w[56] = hc_bytealign_be (w[28], w[29], offset); w[55] = hc_bytealign_be (w[27], w[28], offset); w[54] = hc_bytealign_be (w[26], w[27], offset); w[53] = hc_bytealign_be (w[25], w[26], offset); w[52] = hc_bytealign_be (w[24], w[25], offset); w[51] = hc_bytealign_be (w[23], w[24], offset); w[50] = hc_bytealign_be (w[22], w[23], offset); w[49] = hc_bytealign_be (w[21], w[22], offset); w[48] = hc_bytealign_be (w[20], w[21], offset); w[47] = hc_bytealign_be (w[19], w[20], offset); w[46] = hc_bytealign_be (w[18], w[19], offset); w[45] = hc_bytealign_be (w[17], w[18], offset); w[44] = hc_bytealign_be (w[16], w[17], offset); w[43] = hc_bytealign_be (w[15], w[16], offset); w[42] = hc_bytealign_be (w[14], w[15], offset); w[41] = hc_bytealign_be (w[13], w[14], offset); w[40] = hc_bytealign_be (w[12], w[13], offset); w[39] = hc_bytealign_be (w[11], w[12], offset); w[38] = hc_bytealign_be (w[10], w[11], offset); w[37] = hc_bytealign_be (w[ 9], w[10], offset); w[36] = hc_bytealign_be (w[ 8], w[ 9], offset); w[35] = hc_bytealign_be (w[ 7], w[ 8], offset); w[34] = hc_bytealign_be (w[ 6], w[ 7], offset); w[33] = hc_bytealign_be (w[ 5], w[ 6], offset); w[32] = hc_bytealign_be (w[ 4], w[ 5], offset); w[31] = hc_bytealign_be (w[ 3], w[ 4], offset); w[30] = hc_bytealign_be (w[ 2], w[ 3], offset); w[29] = hc_bytealign_be (w[ 1], w[ 2], offset); w[28] = hc_bytealign_be (w[ 0], w[ 1], offset); w[27] = hc_bytealign_be ( 0, w[ 0], offset); w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 28: w[63] = hc_bytealign_be (w[34], w[35], offset); w[62] = hc_bytealign_be (w[33], w[34], offset); w[61] = hc_bytealign_be (w[32], w[33], offset); w[60] = hc_bytealign_be (w[31], w[32], offset); w[59] = hc_bytealign_be (w[30], w[31], offset); w[58] = hc_bytealign_be (w[29], w[30], offset); w[57] = hc_bytealign_be (w[28], w[29], offset); w[56] = hc_bytealign_be (w[27], w[28], offset); w[55] = hc_bytealign_be (w[26], w[27], offset); w[54] = hc_bytealign_be (w[25], w[26], offset); w[53] = hc_bytealign_be (w[24], w[25], offset); w[52] = hc_bytealign_be (w[23], w[24], offset); w[51] = hc_bytealign_be (w[22], w[23], offset); w[50] = hc_bytealign_be (w[21], w[22], offset); w[49] = hc_bytealign_be (w[20], w[21], offset); w[48] = hc_bytealign_be (w[19], w[20], offset); w[47] = hc_bytealign_be (w[18], w[19], offset); w[46] = hc_bytealign_be (w[17], w[18], offset); w[45] = hc_bytealign_be (w[16], w[17], offset); w[44] = hc_bytealign_be (w[15], w[16], offset); w[43] = hc_bytealign_be (w[14], w[15], offset); w[42] = hc_bytealign_be (w[13], w[14], offset); w[41] = hc_bytealign_be (w[12], w[13], offset); w[40] = hc_bytealign_be (w[11], w[12], offset); w[39] = hc_bytealign_be (w[10], w[11], offset); w[38] = hc_bytealign_be (w[ 9], w[10], offset); w[37] = hc_bytealign_be (w[ 8], w[ 9], offset); w[36] = hc_bytealign_be (w[ 7], w[ 8], offset); w[35] = hc_bytealign_be (w[ 6], w[ 7], offset); w[34] = hc_bytealign_be (w[ 5], w[ 6], offset); w[33] = hc_bytealign_be (w[ 4], w[ 5], offset); w[32] = hc_bytealign_be (w[ 3], w[ 4], offset); w[31] = hc_bytealign_be (w[ 2], w[ 3], offset); w[30] = hc_bytealign_be (w[ 1], w[ 2], offset); w[29] = hc_bytealign_be (w[ 0], w[ 1], offset); w[28] = hc_bytealign_be ( 0, w[ 0], offset); w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 29: w[63] = hc_bytealign_be (w[33], w[34], offset); w[62] = hc_bytealign_be (w[32], w[33], offset); w[61] = hc_bytealign_be (w[31], w[32], offset); w[60] = hc_bytealign_be (w[30], w[31], offset); w[59] = hc_bytealign_be (w[29], w[30], offset); w[58] = hc_bytealign_be (w[28], w[29], offset); w[57] = hc_bytealign_be (w[27], w[28], offset); w[56] = hc_bytealign_be (w[26], w[27], offset); w[55] = hc_bytealign_be (w[25], w[26], offset); w[54] = hc_bytealign_be (w[24], w[25], offset); w[53] = hc_bytealign_be (w[23], w[24], offset); w[52] = hc_bytealign_be (w[22], w[23], offset); w[51] = hc_bytealign_be (w[21], w[22], offset); w[50] = hc_bytealign_be (w[20], w[21], offset); w[49] = hc_bytealign_be (w[19], w[20], offset); w[48] = hc_bytealign_be (w[18], w[19], offset); w[47] = hc_bytealign_be (w[17], w[18], offset); w[46] = hc_bytealign_be (w[16], w[17], offset); w[45] = hc_bytealign_be (w[15], w[16], offset); w[44] = hc_bytealign_be (w[14], w[15], offset); w[43] = hc_bytealign_be (w[13], w[14], offset); w[42] = hc_bytealign_be (w[12], w[13], offset); w[41] = hc_bytealign_be (w[11], w[12], offset); w[40] = hc_bytealign_be (w[10], w[11], offset); w[39] = hc_bytealign_be (w[ 9], w[10], offset); w[38] = hc_bytealign_be (w[ 8], w[ 9], offset); w[37] = hc_bytealign_be (w[ 7], w[ 8], offset); w[36] = hc_bytealign_be (w[ 6], w[ 7], offset); w[35] = hc_bytealign_be (w[ 5], w[ 6], offset); w[34] = hc_bytealign_be (w[ 4], w[ 5], offset); w[33] = hc_bytealign_be (w[ 3], w[ 4], offset); w[32] = hc_bytealign_be (w[ 2], w[ 3], offset); w[31] = hc_bytealign_be (w[ 1], w[ 2], offset); w[30] = hc_bytealign_be (w[ 0], w[ 1], offset); w[29] = hc_bytealign_be ( 0, w[ 0], offset); w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 30: w[63] = hc_bytealign_be (w[32], w[33], offset); w[62] = hc_bytealign_be (w[31], w[32], offset); w[61] = hc_bytealign_be (w[30], w[31], offset); w[60] = hc_bytealign_be (w[29], w[30], offset); w[59] = hc_bytealign_be (w[28], w[29], offset); w[58] = hc_bytealign_be (w[27], w[28], offset); w[57] = hc_bytealign_be (w[26], w[27], offset); w[56] = hc_bytealign_be (w[25], w[26], offset); w[55] = hc_bytealign_be (w[24], w[25], offset); w[54] = hc_bytealign_be (w[23], w[24], offset); w[53] = hc_bytealign_be (w[22], w[23], offset); w[52] = hc_bytealign_be (w[21], w[22], offset); w[51] = hc_bytealign_be (w[20], w[21], offset); w[50] = hc_bytealign_be (w[19], w[20], offset); w[49] = hc_bytealign_be (w[18], w[19], offset); w[48] = hc_bytealign_be (w[17], w[18], offset); w[47] = hc_bytealign_be (w[16], w[17], offset); w[46] = hc_bytealign_be (w[15], w[16], offset); w[45] = hc_bytealign_be (w[14], w[15], offset); w[44] = hc_bytealign_be (w[13], w[14], offset); w[43] = hc_bytealign_be (w[12], w[13], offset); w[42] = hc_bytealign_be (w[11], w[12], offset); w[41] = hc_bytealign_be (w[10], w[11], offset); w[40] = hc_bytealign_be (w[ 9], w[10], offset); w[39] = hc_bytealign_be (w[ 8], w[ 9], offset); w[38] = hc_bytealign_be (w[ 7], w[ 8], offset); w[37] = hc_bytealign_be (w[ 6], w[ 7], offset); w[36] = hc_bytealign_be (w[ 5], w[ 6], offset); w[35] = hc_bytealign_be (w[ 4], w[ 5], offset); w[34] = hc_bytealign_be (w[ 3], w[ 4], offset); w[33] = hc_bytealign_be (w[ 2], w[ 3], offset); w[32] = hc_bytealign_be (w[ 1], w[ 2], offset); w[31] = hc_bytealign_be (w[ 0], w[ 1], offset); w[30] = hc_bytealign_be ( 0, w[ 0], offset); w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 31: w[63] = hc_bytealign_be (w[31], w[32], offset); w[62] = hc_bytealign_be (w[30], w[31], offset); w[61] = hc_bytealign_be (w[29], w[30], offset); w[60] = hc_bytealign_be (w[28], w[29], offset); w[59] = hc_bytealign_be (w[27], w[28], offset); w[58] = hc_bytealign_be (w[26], w[27], offset); w[57] = hc_bytealign_be (w[25], w[26], offset); w[56] = hc_bytealign_be (w[24], w[25], offset); w[55] = hc_bytealign_be (w[23], w[24], offset); w[54] = hc_bytealign_be (w[22], w[23], offset); w[53] = hc_bytealign_be (w[21], w[22], offset); w[52] = hc_bytealign_be (w[20], w[21], offset); w[51] = hc_bytealign_be (w[19], w[20], offset); w[50] = hc_bytealign_be (w[18], w[19], offset); w[49] = hc_bytealign_be (w[17], w[18], offset); w[48] = hc_bytealign_be (w[16], w[17], offset); w[47] = hc_bytealign_be (w[15], w[16], offset); w[46] = hc_bytealign_be (w[14], w[15], offset); w[45] = hc_bytealign_be (w[13], w[14], offset); w[44] = hc_bytealign_be (w[12], w[13], offset); w[43] = hc_bytealign_be (w[11], w[12], offset); w[42] = hc_bytealign_be (w[10], w[11], offset); w[41] = hc_bytealign_be (w[ 9], w[10], offset); w[40] = hc_bytealign_be (w[ 8], w[ 9], offset); w[39] = hc_bytealign_be (w[ 7], w[ 8], offset); w[38] = hc_bytealign_be (w[ 6], w[ 7], offset); w[37] = hc_bytealign_be (w[ 5], w[ 6], offset); w[36] = hc_bytealign_be (w[ 4], w[ 5], offset); w[35] = hc_bytealign_be (w[ 3], w[ 4], offset); w[34] = hc_bytealign_be (w[ 2], w[ 3], offset); w[33] = hc_bytealign_be (w[ 1], w[ 2], offset); w[32] = hc_bytealign_be (w[ 0], w[ 1], offset); w[31] = hc_bytealign_be ( 0, w[ 0], offset); w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 32: w[63] = hc_bytealign_be (w[30], w[31], offset); w[62] = hc_bytealign_be (w[29], w[30], offset); w[61] = hc_bytealign_be (w[28], w[29], offset); w[60] = hc_bytealign_be (w[27], w[28], offset); w[59] = hc_bytealign_be (w[26], w[27], offset); w[58] = hc_bytealign_be (w[25], w[26], offset); w[57] = hc_bytealign_be (w[24], w[25], offset); w[56] = hc_bytealign_be (w[23], w[24], offset); w[55] = hc_bytealign_be (w[22], w[23], offset); w[54] = hc_bytealign_be (w[21], w[22], offset); w[53] = hc_bytealign_be (w[20], w[21], offset); w[52] = hc_bytealign_be (w[19], w[20], offset); w[51] = hc_bytealign_be (w[18], w[19], offset); w[50] = hc_bytealign_be (w[17], w[18], offset); w[49] = hc_bytealign_be (w[16], w[17], offset); w[48] = hc_bytealign_be (w[15], w[16], offset); w[47] = hc_bytealign_be (w[14], w[15], offset); w[46] = hc_bytealign_be (w[13], w[14], offset); w[45] = hc_bytealign_be (w[12], w[13], offset); w[44] = hc_bytealign_be (w[11], w[12], offset); w[43] = hc_bytealign_be (w[10], w[11], offset); w[42] = hc_bytealign_be (w[ 9], w[10], offset); w[41] = hc_bytealign_be (w[ 8], w[ 9], offset); w[40] = hc_bytealign_be (w[ 7], w[ 8], offset); w[39] = hc_bytealign_be (w[ 6], w[ 7], offset); w[38] = hc_bytealign_be (w[ 5], w[ 6], offset); w[37] = hc_bytealign_be (w[ 4], w[ 5], offset); w[36] = hc_bytealign_be (w[ 3], w[ 4], offset); w[35] = hc_bytealign_be (w[ 2], w[ 3], offset); w[34] = hc_bytealign_be (w[ 1], w[ 2], offset); w[33] = hc_bytealign_be (w[ 0], w[ 1], offset); w[32] = hc_bytealign_be ( 0, w[ 0], offset); w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 33: w[63] = hc_bytealign_be (w[29], w[30], offset); w[62] = hc_bytealign_be (w[28], w[29], offset); w[61] = hc_bytealign_be (w[27], w[28], offset); w[60] = hc_bytealign_be (w[26], w[27], offset); w[59] = hc_bytealign_be (w[25], w[26], offset); w[58] = hc_bytealign_be (w[24], w[25], offset); w[57] = hc_bytealign_be (w[23], w[24], offset); w[56] = hc_bytealign_be (w[22], w[23], offset); w[55] = hc_bytealign_be (w[21], w[22], offset); w[54] = hc_bytealign_be (w[20], w[21], offset); w[53] = hc_bytealign_be (w[19], w[20], offset); w[52] = hc_bytealign_be (w[18], w[19], offset); w[51] = hc_bytealign_be (w[17], w[18], offset); w[50] = hc_bytealign_be (w[16], w[17], offset); w[49] = hc_bytealign_be (w[15], w[16], offset); w[48] = hc_bytealign_be (w[14], w[15], offset); w[47] = hc_bytealign_be (w[13], w[14], offset); w[46] = hc_bytealign_be (w[12], w[13], offset); w[45] = hc_bytealign_be (w[11], w[12], offset); w[44] = hc_bytealign_be (w[10], w[11], offset); w[43] = hc_bytealign_be (w[ 9], w[10], offset); w[42] = hc_bytealign_be (w[ 8], w[ 9], offset); w[41] = hc_bytealign_be (w[ 7], w[ 8], offset); w[40] = hc_bytealign_be (w[ 6], w[ 7], offset); w[39] = hc_bytealign_be (w[ 5], w[ 6], offset); w[38] = hc_bytealign_be (w[ 4], w[ 5], offset); w[37] = hc_bytealign_be (w[ 3], w[ 4], offset); w[36] = hc_bytealign_be (w[ 2], w[ 3], offset); w[35] = hc_bytealign_be (w[ 1], w[ 2], offset); w[34] = hc_bytealign_be (w[ 0], w[ 1], offset); w[33] = hc_bytealign_be ( 0, w[ 0], offset); w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 34: w[63] = hc_bytealign_be (w[28], w[29], offset); w[62] = hc_bytealign_be (w[27], w[28], offset); w[61] = hc_bytealign_be (w[26], w[27], offset); w[60] = hc_bytealign_be (w[25], w[26], offset); w[59] = hc_bytealign_be (w[24], w[25], offset); w[58] = hc_bytealign_be (w[23], w[24], offset); w[57] = hc_bytealign_be (w[22], w[23], offset); w[56] = hc_bytealign_be (w[21], w[22], offset); w[55] = hc_bytealign_be (w[20], w[21], offset); w[54] = hc_bytealign_be (w[19], w[20], offset); w[53] = hc_bytealign_be (w[18], w[19], offset); w[52] = hc_bytealign_be (w[17], w[18], offset); w[51] = hc_bytealign_be (w[16], w[17], offset); w[50] = hc_bytealign_be (w[15], w[16], offset); w[49] = hc_bytealign_be (w[14], w[15], offset); w[48] = hc_bytealign_be (w[13], w[14], offset); w[47] = hc_bytealign_be (w[12], w[13], offset); w[46] = hc_bytealign_be (w[11], w[12], offset); w[45] = hc_bytealign_be (w[10], w[11], offset); w[44] = hc_bytealign_be (w[ 9], w[10], offset); w[43] = hc_bytealign_be (w[ 8], w[ 9], offset); w[42] = hc_bytealign_be (w[ 7], w[ 8], offset); w[41] = hc_bytealign_be (w[ 6], w[ 7], offset); w[40] = hc_bytealign_be (w[ 5], w[ 6], offset); w[39] = hc_bytealign_be (w[ 4], w[ 5], offset); w[38] = hc_bytealign_be (w[ 3], w[ 4], offset); w[37] = hc_bytealign_be (w[ 2], w[ 3], offset); w[36] = hc_bytealign_be (w[ 1], w[ 2], offset); w[35] = hc_bytealign_be (w[ 0], w[ 1], offset); w[34] = hc_bytealign_be ( 0, w[ 0], offset); w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 35: w[63] = hc_bytealign_be (w[27], w[28], offset); w[62] = hc_bytealign_be (w[26], w[27], offset); w[61] = hc_bytealign_be (w[25], w[26], offset); w[60] = hc_bytealign_be (w[24], w[25], offset); w[59] = hc_bytealign_be (w[23], w[24], offset); w[58] = hc_bytealign_be (w[22], w[23], offset); w[57] = hc_bytealign_be (w[21], w[22], offset); w[56] = hc_bytealign_be (w[20], w[21], offset); w[55] = hc_bytealign_be (w[19], w[20], offset); w[54] = hc_bytealign_be (w[18], w[19], offset); w[53] = hc_bytealign_be (w[17], w[18], offset); w[52] = hc_bytealign_be (w[16], w[17], offset); w[51] = hc_bytealign_be (w[15], w[16], offset); w[50] = hc_bytealign_be (w[14], w[15], offset); w[49] = hc_bytealign_be (w[13], w[14], offset); w[48] = hc_bytealign_be (w[12], w[13], offset); w[47] = hc_bytealign_be (w[11], w[12], offset); w[46] = hc_bytealign_be (w[10], w[11], offset); w[45] = hc_bytealign_be (w[ 9], w[10], offset); w[44] = hc_bytealign_be (w[ 8], w[ 9], offset); w[43] = hc_bytealign_be (w[ 7], w[ 8], offset); w[42] = hc_bytealign_be (w[ 6], w[ 7], offset); w[41] = hc_bytealign_be (w[ 5], w[ 6], offset); w[40] = hc_bytealign_be (w[ 4], w[ 5], offset); w[39] = hc_bytealign_be (w[ 3], w[ 4], offset); w[38] = hc_bytealign_be (w[ 2], w[ 3], offset); w[37] = hc_bytealign_be (w[ 1], w[ 2], offset); w[36] = hc_bytealign_be (w[ 0], w[ 1], offset); w[35] = hc_bytealign_be ( 0, w[ 0], offset); w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 36: w[63] = hc_bytealign_be (w[26], w[27], offset); w[62] = hc_bytealign_be (w[25], w[26], offset); w[61] = hc_bytealign_be (w[24], w[25], offset); w[60] = hc_bytealign_be (w[23], w[24], offset); w[59] = hc_bytealign_be (w[22], w[23], offset); w[58] = hc_bytealign_be (w[21], w[22], offset); w[57] = hc_bytealign_be (w[20], w[21], offset); w[56] = hc_bytealign_be (w[19], w[20], offset); w[55] = hc_bytealign_be (w[18], w[19], offset); w[54] = hc_bytealign_be (w[17], w[18], offset); w[53] = hc_bytealign_be (w[16], w[17], offset); w[52] = hc_bytealign_be (w[15], w[16], offset); w[51] = hc_bytealign_be (w[14], w[15], offset); w[50] = hc_bytealign_be (w[13], w[14], offset); w[49] = hc_bytealign_be (w[12], w[13], offset); w[48] = hc_bytealign_be (w[11], w[12], offset); w[47] = hc_bytealign_be (w[10], w[11], offset); w[46] = hc_bytealign_be (w[ 9], w[10], offset); w[45] = hc_bytealign_be (w[ 8], w[ 9], offset); w[44] = hc_bytealign_be (w[ 7], w[ 8], offset); w[43] = hc_bytealign_be (w[ 6], w[ 7], offset); w[42] = hc_bytealign_be (w[ 5], w[ 6], offset); w[41] = hc_bytealign_be (w[ 4], w[ 5], offset); w[40] = hc_bytealign_be (w[ 3], w[ 4], offset); w[39] = hc_bytealign_be (w[ 2], w[ 3], offset); w[38] = hc_bytealign_be (w[ 1], w[ 2], offset); w[37] = hc_bytealign_be (w[ 0], w[ 1], offset); w[36] = hc_bytealign_be ( 0, w[ 0], offset); w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 37: w[63] = hc_bytealign_be (w[25], w[26], offset); w[62] = hc_bytealign_be (w[24], w[25], offset); w[61] = hc_bytealign_be (w[23], w[24], offset); w[60] = hc_bytealign_be (w[22], w[23], offset); w[59] = hc_bytealign_be (w[21], w[22], offset); w[58] = hc_bytealign_be (w[20], w[21], offset); w[57] = hc_bytealign_be (w[19], w[20], offset); w[56] = hc_bytealign_be (w[18], w[19], offset); w[55] = hc_bytealign_be (w[17], w[18], offset); w[54] = hc_bytealign_be (w[16], w[17], offset); w[53] = hc_bytealign_be (w[15], w[16], offset); w[52] = hc_bytealign_be (w[14], w[15], offset); w[51] = hc_bytealign_be (w[13], w[14], offset); w[50] = hc_bytealign_be (w[12], w[13], offset); w[49] = hc_bytealign_be (w[11], w[12], offset); w[48] = hc_bytealign_be (w[10], w[11], offset); w[47] = hc_bytealign_be (w[ 9], w[10], offset); w[46] = hc_bytealign_be (w[ 8], w[ 9], offset); w[45] = hc_bytealign_be (w[ 7], w[ 8], offset); w[44] = hc_bytealign_be (w[ 6], w[ 7], offset); w[43] = hc_bytealign_be (w[ 5], w[ 6], offset); w[42] = hc_bytealign_be (w[ 4], w[ 5], offset); w[41] = hc_bytealign_be (w[ 3], w[ 4], offset); w[40] = hc_bytealign_be (w[ 2], w[ 3], offset); w[39] = hc_bytealign_be (w[ 1], w[ 2], offset); w[38] = hc_bytealign_be (w[ 0], w[ 1], offset); w[37] = hc_bytealign_be ( 0, w[ 0], offset); w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 38: w[63] = hc_bytealign_be (w[24], w[25], offset); w[62] = hc_bytealign_be (w[23], w[24], offset); w[61] = hc_bytealign_be (w[22], w[23], offset); w[60] = hc_bytealign_be (w[21], w[22], offset); w[59] = hc_bytealign_be (w[20], w[21], offset); w[58] = hc_bytealign_be (w[19], w[20], offset); w[57] = hc_bytealign_be (w[18], w[19], offset); w[56] = hc_bytealign_be (w[17], w[18], offset); w[55] = hc_bytealign_be (w[16], w[17], offset); w[54] = hc_bytealign_be (w[15], w[16], offset); w[53] = hc_bytealign_be (w[14], w[15], offset); w[52] = hc_bytealign_be (w[13], w[14], offset); w[51] = hc_bytealign_be (w[12], w[13], offset); w[50] = hc_bytealign_be (w[11], w[12], offset); w[49] = hc_bytealign_be (w[10], w[11], offset); w[48] = hc_bytealign_be (w[ 9], w[10], offset); w[47] = hc_bytealign_be (w[ 8], w[ 9], offset); w[46] = hc_bytealign_be (w[ 7], w[ 8], offset); w[45] = hc_bytealign_be (w[ 6], w[ 7], offset); w[44] = hc_bytealign_be (w[ 5], w[ 6], offset); w[43] = hc_bytealign_be (w[ 4], w[ 5], offset); w[42] = hc_bytealign_be (w[ 3], w[ 4], offset); w[41] = hc_bytealign_be (w[ 2], w[ 3], offset); w[40] = hc_bytealign_be (w[ 1], w[ 2], offset); w[39] = hc_bytealign_be (w[ 0], w[ 1], offset); w[38] = hc_bytealign_be ( 0, w[ 0], offset); w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 39: w[63] = hc_bytealign_be (w[23], w[24], offset); w[62] = hc_bytealign_be (w[22], w[23], offset); w[61] = hc_bytealign_be (w[21], w[22], offset); w[60] = hc_bytealign_be (w[20], w[21], offset); w[59] = hc_bytealign_be (w[19], w[20], offset); w[58] = hc_bytealign_be (w[18], w[19], offset); w[57] = hc_bytealign_be (w[17], w[18], offset); w[56] = hc_bytealign_be (w[16], w[17], offset); w[55] = hc_bytealign_be (w[15], w[16], offset); w[54] = hc_bytealign_be (w[14], w[15], offset); w[53] = hc_bytealign_be (w[13], w[14], offset); w[52] = hc_bytealign_be (w[12], w[13], offset); w[51] = hc_bytealign_be (w[11], w[12], offset); w[50] = hc_bytealign_be (w[10], w[11], offset); w[49] = hc_bytealign_be (w[ 9], w[10], offset); w[48] = hc_bytealign_be (w[ 8], w[ 9], offset); w[47] = hc_bytealign_be (w[ 7], w[ 8], offset); w[46] = hc_bytealign_be (w[ 6], w[ 7], offset); w[45] = hc_bytealign_be (w[ 5], w[ 6], offset); w[44] = hc_bytealign_be (w[ 4], w[ 5], offset); w[43] = hc_bytealign_be (w[ 3], w[ 4], offset); w[42] = hc_bytealign_be (w[ 2], w[ 3], offset); w[41] = hc_bytealign_be (w[ 1], w[ 2], offset); w[40] = hc_bytealign_be (w[ 0], w[ 1], offset); w[39] = hc_bytealign_be ( 0, w[ 0], offset); w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 40: w[63] = hc_bytealign_be (w[22], w[23], offset); w[62] = hc_bytealign_be (w[21], w[22], offset); w[61] = hc_bytealign_be (w[20], w[21], offset); w[60] = hc_bytealign_be (w[19], w[20], offset); w[59] = hc_bytealign_be (w[18], w[19], offset); w[58] = hc_bytealign_be (w[17], w[18], offset); w[57] = hc_bytealign_be (w[16], w[17], offset); w[56] = hc_bytealign_be (w[15], w[16], offset); w[55] = hc_bytealign_be (w[14], w[15], offset); w[54] = hc_bytealign_be (w[13], w[14], offset); w[53] = hc_bytealign_be (w[12], w[13], offset); w[52] = hc_bytealign_be (w[11], w[12], offset); w[51] = hc_bytealign_be (w[10], w[11], offset); w[50] = hc_bytealign_be (w[ 9], w[10], offset); w[49] = hc_bytealign_be (w[ 8], w[ 9], offset); w[48] = hc_bytealign_be (w[ 7], w[ 8], offset); w[47] = hc_bytealign_be (w[ 6], w[ 7], offset); w[46] = hc_bytealign_be (w[ 5], w[ 6], offset); w[45] = hc_bytealign_be (w[ 4], w[ 5], offset); w[44] = hc_bytealign_be (w[ 3], w[ 4], offset); w[43] = hc_bytealign_be (w[ 2], w[ 3], offset); w[42] = hc_bytealign_be (w[ 1], w[ 2], offset); w[41] = hc_bytealign_be (w[ 0], w[ 1], offset); w[40] = hc_bytealign_be ( 0, w[ 0], offset); w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 41: w[63] = hc_bytealign_be (w[21], w[22], offset); w[62] = hc_bytealign_be (w[20], w[21], offset); w[61] = hc_bytealign_be (w[19], w[20], offset); w[60] = hc_bytealign_be (w[18], w[19], offset); w[59] = hc_bytealign_be (w[17], w[18], offset); w[58] = hc_bytealign_be (w[16], w[17], offset); w[57] = hc_bytealign_be (w[15], w[16], offset); w[56] = hc_bytealign_be (w[14], w[15], offset); w[55] = hc_bytealign_be (w[13], w[14], offset); w[54] = hc_bytealign_be (w[12], w[13], offset); w[53] = hc_bytealign_be (w[11], w[12], offset); w[52] = hc_bytealign_be (w[10], w[11], offset); w[51] = hc_bytealign_be (w[ 9], w[10], offset); w[50] = hc_bytealign_be (w[ 8], w[ 9], offset); w[49] = hc_bytealign_be (w[ 7], w[ 8], offset); w[48] = hc_bytealign_be (w[ 6], w[ 7], offset); w[47] = hc_bytealign_be (w[ 5], w[ 6], offset); w[46] = hc_bytealign_be (w[ 4], w[ 5], offset); w[45] = hc_bytealign_be (w[ 3], w[ 4], offset); w[44] = hc_bytealign_be (w[ 2], w[ 3], offset); w[43] = hc_bytealign_be (w[ 1], w[ 2], offset); w[42] = hc_bytealign_be (w[ 0], w[ 1], offset); w[41] = hc_bytealign_be ( 0, w[ 0], offset); w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 42: w[63] = hc_bytealign_be (w[20], w[21], offset); w[62] = hc_bytealign_be (w[19], w[20], offset); w[61] = hc_bytealign_be (w[18], w[19], offset); w[60] = hc_bytealign_be (w[17], w[18], offset); w[59] = hc_bytealign_be (w[16], w[17], offset); w[58] = hc_bytealign_be (w[15], w[16], offset); w[57] = hc_bytealign_be (w[14], w[15], offset); w[56] = hc_bytealign_be (w[13], w[14], offset); w[55] = hc_bytealign_be (w[12], w[13], offset); w[54] = hc_bytealign_be (w[11], w[12], offset); w[53] = hc_bytealign_be (w[10], w[11], offset); w[52] = hc_bytealign_be (w[ 9], w[10], offset); w[51] = hc_bytealign_be (w[ 8], w[ 9], offset); w[50] = hc_bytealign_be (w[ 7], w[ 8], offset); w[49] = hc_bytealign_be (w[ 6], w[ 7], offset); w[48] = hc_bytealign_be (w[ 5], w[ 6], offset); w[47] = hc_bytealign_be (w[ 4], w[ 5], offset); w[46] = hc_bytealign_be (w[ 3], w[ 4], offset); w[45] = hc_bytealign_be (w[ 2], w[ 3], offset); w[44] = hc_bytealign_be (w[ 1], w[ 2], offset); w[43] = hc_bytealign_be (w[ 0], w[ 1], offset); w[42] = hc_bytealign_be ( 0, w[ 0], offset); w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 43: w[63] = hc_bytealign_be (w[19], w[20], offset); w[62] = hc_bytealign_be (w[18], w[19], offset); w[61] = hc_bytealign_be (w[17], w[18], offset); w[60] = hc_bytealign_be (w[16], w[17], offset); w[59] = hc_bytealign_be (w[15], w[16], offset); w[58] = hc_bytealign_be (w[14], w[15], offset); w[57] = hc_bytealign_be (w[13], w[14], offset); w[56] = hc_bytealign_be (w[12], w[13], offset); w[55] = hc_bytealign_be (w[11], w[12], offset); w[54] = hc_bytealign_be (w[10], w[11], offset); w[53] = hc_bytealign_be (w[ 9], w[10], offset); w[52] = hc_bytealign_be (w[ 8], w[ 9], offset); w[51] = hc_bytealign_be (w[ 7], w[ 8], offset); w[50] = hc_bytealign_be (w[ 6], w[ 7], offset); w[49] = hc_bytealign_be (w[ 5], w[ 6], offset); w[48] = hc_bytealign_be (w[ 4], w[ 5], offset); w[47] = hc_bytealign_be (w[ 3], w[ 4], offset); w[46] = hc_bytealign_be (w[ 2], w[ 3], offset); w[45] = hc_bytealign_be (w[ 1], w[ 2], offset); w[44] = hc_bytealign_be (w[ 0], w[ 1], offset); w[43] = hc_bytealign_be ( 0, w[ 0], offset); w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 44: w[63] = hc_bytealign_be (w[18], w[19], offset); w[62] = hc_bytealign_be (w[17], w[18], offset); w[61] = hc_bytealign_be (w[16], w[17], offset); w[60] = hc_bytealign_be (w[15], w[16], offset); w[59] = hc_bytealign_be (w[14], w[15], offset); w[58] = hc_bytealign_be (w[13], w[14], offset); w[57] = hc_bytealign_be (w[12], w[13], offset); w[56] = hc_bytealign_be (w[11], w[12], offset); w[55] = hc_bytealign_be (w[10], w[11], offset); w[54] = hc_bytealign_be (w[ 9], w[10], offset); w[53] = hc_bytealign_be (w[ 8], w[ 9], offset); w[52] = hc_bytealign_be (w[ 7], w[ 8], offset); w[51] = hc_bytealign_be (w[ 6], w[ 7], offset); w[50] = hc_bytealign_be (w[ 5], w[ 6], offset); w[49] = hc_bytealign_be (w[ 4], w[ 5], offset); w[48] = hc_bytealign_be (w[ 3], w[ 4], offset); w[47] = hc_bytealign_be (w[ 2], w[ 3], offset); w[46] = hc_bytealign_be (w[ 1], w[ 2], offset); w[45] = hc_bytealign_be (w[ 0], w[ 1], offset); w[44] = hc_bytealign_be ( 0, w[ 0], offset); w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 45: w[63] = hc_bytealign_be (w[17], w[18], offset); w[62] = hc_bytealign_be (w[16], w[17], offset); w[61] = hc_bytealign_be (w[15], w[16], offset); w[60] = hc_bytealign_be (w[14], w[15], offset); w[59] = hc_bytealign_be (w[13], w[14], offset); w[58] = hc_bytealign_be (w[12], w[13], offset); w[57] = hc_bytealign_be (w[11], w[12], offset); w[56] = hc_bytealign_be (w[10], w[11], offset); w[55] = hc_bytealign_be (w[ 9], w[10], offset); w[54] = hc_bytealign_be (w[ 8], w[ 9], offset); w[53] = hc_bytealign_be (w[ 7], w[ 8], offset); w[52] = hc_bytealign_be (w[ 6], w[ 7], offset); w[51] = hc_bytealign_be (w[ 5], w[ 6], offset); w[50] = hc_bytealign_be (w[ 4], w[ 5], offset); w[49] = hc_bytealign_be (w[ 3], w[ 4], offset); w[48] = hc_bytealign_be (w[ 2], w[ 3], offset); w[47] = hc_bytealign_be (w[ 1], w[ 2], offset); w[46] = hc_bytealign_be (w[ 0], w[ 1], offset); w[45] = hc_bytealign_be ( 0, w[ 0], offset); w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 46: w[63] = hc_bytealign_be (w[16], w[17], offset); w[62] = hc_bytealign_be (w[15], w[16], offset); w[61] = hc_bytealign_be (w[14], w[15], offset); w[60] = hc_bytealign_be (w[13], w[14], offset); w[59] = hc_bytealign_be (w[12], w[13], offset); w[58] = hc_bytealign_be (w[11], w[12], offset); w[57] = hc_bytealign_be (w[10], w[11], offset); w[56] = hc_bytealign_be (w[ 9], w[10], offset); w[55] = hc_bytealign_be (w[ 8], w[ 9], offset); w[54] = hc_bytealign_be (w[ 7], w[ 8], offset); w[53] = hc_bytealign_be (w[ 6], w[ 7], offset); w[52] = hc_bytealign_be (w[ 5], w[ 6], offset); w[51] = hc_bytealign_be (w[ 4], w[ 5], offset); w[50] = hc_bytealign_be (w[ 3], w[ 4], offset); w[49] = hc_bytealign_be (w[ 2], w[ 3], offset); w[48] = hc_bytealign_be (w[ 1], w[ 2], offset); w[47] = hc_bytealign_be (w[ 0], w[ 1], offset); w[46] = hc_bytealign_be ( 0, w[ 0], offset); w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 47: w[63] = hc_bytealign_be (w[15], w[16], offset); w[62] = hc_bytealign_be (w[14], w[15], offset); w[61] = hc_bytealign_be (w[13], w[14], offset); w[60] = hc_bytealign_be (w[12], w[13], offset); w[59] = hc_bytealign_be (w[11], w[12], offset); w[58] = hc_bytealign_be (w[10], w[11], offset); w[57] = hc_bytealign_be (w[ 9], w[10], offset); w[56] = hc_bytealign_be (w[ 8], w[ 9], offset); w[55] = hc_bytealign_be (w[ 7], w[ 8], offset); w[54] = hc_bytealign_be (w[ 6], w[ 7], offset); w[53] = hc_bytealign_be (w[ 5], w[ 6], offset); w[52] = hc_bytealign_be (w[ 4], w[ 5], offset); w[51] = hc_bytealign_be (w[ 3], w[ 4], offset); w[50] = hc_bytealign_be (w[ 2], w[ 3], offset); w[49] = hc_bytealign_be (w[ 1], w[ 2], offset); w[48] = hc_bytealign_be (w[ 0], w[ 1], offset); w[47] = hc_bytealign_be ( 0, w[ 0], offset); w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 48: w[63] = hc_bytealign_be (w[14], w[15], offset); w[62] = hc_bytealign_be (w[13], w[14], offset); w[61] = hc_bytealign_be (w[12], w[13], offset); w[60] = hc_bytealign_be (w[11], w[12], offset); w[59] = hc_bytealign_be (w[10], w[11], offset); w[58] = hc_bytealign_be (w[ 9], w[10], offset); w[57] = hc_bytealign_be (w[ 8], w[ 9], offset); w[56] = hc_bytealign_be (w[ 7], w[ 8], offset); w[55] = hc_bytealign_be (w[ 6], w[ 7], offset); w[54] = hc_bytealign_be (w[ 5], w[ 6], offset); w[53] = hc_bytealign_be (w[ 4], w[ 5], offset); w[52] = hc_bytealign_be (w[ 3], w[ 4], offset); w[51] = hc_bytealign_be (w[ 2], w[ 3], offset); w[50] = hc_bytealign_be (w[ 1], w[ 2], offset); w[49] = hc_bytealign_be (w[ 0], w[ 1], offset); w[48] = hc_bytealign_be ( 0, w[ 0], offset); w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 49: w[63] = hc_bytealign_be (w[13], w[14], offset); w[62] = hc_bytealign_be (w[12], w[13], offset); w[61] = hc_bytealign_be (w[11], w[12], offset); w[60] = hc_bytealign_be (w[10], w[11], offset); w[59] = hc_bytealign_be (w[ 9], w[10], offset); w[58] = hc_bytealign_be (w[ 8], w[ 9], offset); w[57] = hc_bytealign_be (w[ 7], w[ 8], offset); w[56] = hc_bytealign_be (w[ 6], w[ 7], offset); w[55] = hc_bytealign_be (w[ 5], w[ 6], offset); w[54] = hc_bytealign_be (w[ 4], w[ 5], offset); w[53] = hc_bytealign_be (w[ 3], w[ 4], offset); w[52] = hc_bytealign_be (w[ 2], w[ 3], offset); w[51] = hc_bytealign_be (w[ 1], w[ 2], offset); w[50] = hc_bytealign_be (w[ 0], w[ 1], offset); w[49] = hc_bytealign_be ( 0, w[ 0], offset); w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 50: w[63] = hc_bytealign_be (w[12], w[13], offset); w[62] = hc_bytealign_be (w[11], w[12], offset); w[61] = hc_bytealign_be (w[10], w[11], offset); w[60] = hc_bytealign_be (w[ 9], w[10], offset); w[59] = hc_bytealign_be (w[ 8], w[ 9], offset); w[58] = hc_bytealign_be (w[ 7], w[ 8], offset); w[57] = hc_bytealign_be (w[ 6], w[ 7], offset); w[56] = hc_bytealign_be (w[ 5], w[ 6], offset); w[55] = hc_bytealign_be (w[ 4], w[ 5], offset); w[54] = hc_bytealign_be (w[ 3], w[ 4], offset); w[53] = hc_bytealign_be (w[ 2], w[ 3], offset); w[52] = hc_bytealign_be (w[ 1], w[ 2], offset); w[51] = hc_bytealign_be (w[ 0], w[ 1], offset); w[50] = hc_bytealign_be ( 0, w[ 0], offset); w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 51: w[63] = hc_bytealign_be (w[11], w[12], offset); w[62] = hc_bytealign_be (w[10], w[11], offset); w[61] = hc_bytealign_be (w[ 9], w[10], offset); w[60] = hc_bytealign_be (w[ 8], w[ 9], offset); w[59] = hc_bytealign_be (w[ 7], w[ 8], offset); w[58] = hc_bytealign_be (w[ 6], w[ 7], offset); w[57] = hc_bytealign_be (w[ 5], w[ 6], offset); w[56] = hc_bytealign_be (w[ 4], w[ 5], offset); w[55] = hc_bytealign_be (w[ 3], w[ 4], offset); w[54] = hc_bytealign_be (w[ 2], w[ 3], offset); w[53] = hc_bytealign_be (w[ 1], w[ 2], offset); w[52] = hc_bytealign_be (w[ 0], w[ 1], offset); w[51] = hc_bytealign_be ( 0, w[ 0], offset); w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 52: w[63] = hc_bytealign_be (w[10], w[11], offset); w[62] = hc_bytealign_be (w[ 9], w[10], offset); w[61] = hc_bytealign_be (w[ 8], w[ 9], offset); w[60] = hc_bytealign_be (w[ 7], w[ 8], offset); w[59] = hc_bytealign_be (w[ 6], w[ 7], offset); w[58] = hc_bytealign_be (w[ 5], w[ 6], offset); w[57] = hc_bytealign_be (w[ 4], w[ 5], offset); w[56] = hc_bytealign_be (w[ 3], w[ 4], offset); w[55] = hc_bytealign_be (w[ 2], w[ 3], offset); w[54] = hc_bytealign_be (w[ 1], w[ 2], offset); w[53] = hc_bytealign_be (w[ 0], w[ 1], offset); w[52] = hc_bytealign_be ( 0, w[ 0], offset); w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 53: w[63] = hc_bytealign_be (w[ 9], w[10], offset); w[62] = hc_bytealign_be (w[ 8], w[ 9], offset); w[61] = hc_bytealign_be (w[ 7], w[ 8], offset); w[60] = hc_bytealign_be (w[ 6], w[ 7], offset); w[59] = hc_bytealign_be (w[ 5], w[ 6], offset); w[58] = hc_bytealign_be (w[ 4], w[ 5], offset); w[57] = hc_bytealign_be (w[ 3], w[ 4], offset); w[56] = hc_bytealign_be (w[ 2], w[ 3], offset); w[55] = hc_bytealign_be (w[ 1], w[ 2], offset); w[54] = hc_bytealign_be (w[ 0], w[ 1], offset); w[53] = hc_bytealign_be ( 0, w[ 0], offset); w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 54: w[63] = hc_bytealign_be (w[ 8], w[ 9], offset); w[62] = hc_bytealign_be (w[ 7], w[ 8], offset); w[61] = hc_bytealign_be (w[ 6], w[ 7], offset); w[60] = hc_bytealign_be (w[ 5], w[ 6], offset); w[59] = hc_bytealign_be (w[ 4], w[ 5], offset); w[58] = hc_bytealign_be (w[ 3], w[ 4], offset); w[57] = hc_bytealign_be (w[ 2], w[ 3], offset); w[56] = hc_bytealign_be (w[ 1], w[ 2], offset); w[55] = hc_bytealign_be (w[ 0], w[ 1], offset); w[54] = hc_bytealign_be ( 0, w[ 0], offset); w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 55: w[63] = hc_bytealign_be (w[ 7], w[ 8], offset); w[62] = hc_bytealign_be (w[ 6], w[ 7], offset); w[61] = hc_bytealign_be (w[ 5], w[ 6], offset); w[60] = hc_bytealign_be (w[ 4], w[ 5], offset); w[59] = hc_bytealign_be (w[ 3], w[ 4], offset); w[58] = hc_bytealign_be (w[ 2], w[ 3], offset); w[57] = hc_bytealign_be (w[ 1], w[ 2], offset); w[56] = hc_bytealign_be (w[ 0], w[ 1], offset); w[55] = hc_bytealign_be ( 0, w[ 0], offset); w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 56: w[63] = hc_bytealign_be (w[ 6], w[ 7], offset); w[62] = hc_bytealign_be (w[ 5], w[ 6], offset); w[61] = hc_bytealign_be (w[ 4], w[ 5], offset); w[60] = hc_bytealign_be (w[ 3], w[ 4], offset); w[59] = hc_bytealign_be (w[ 2], w[ 3], offset); w[58] = hc_bytealign_be (w[ 1], w[ 2], offset); w[57] = hc_bytealign_be (w[ 0], w[ 1], offset); w[56] = hc_bytealign_be ( 0, w[ 0], offset); w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 57: w[63] = hc_bytealign_be (w[ 5], w[ 6], offset); w[62] = hc_bytealign_be (w[ 4], w[ 5], offset); w[61] = hc_bytealign_be (w[ 3], w[ 4], offset); w[60] = hc_bytealign_be (w[ 2], w[ 3], offset); w[59] = hc_bytealign_be (w[ 1], w[ 2], offset); w[58] = hc_bytealign_be (w[ 0], w[ 1], offset); w[57] = hc_bytealign_be ( 0, w[ 0], offset); w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 58: w[63] = hc_bytealign_be (w[ 4], w[ 5], offset); w[62] = hc_bytealign_be (w[ 3], w[ 4], offset); w[61] = hc_bytealign_be (w[ 2], w[ 3], offset); w[60] = hc_bytealign_be (w[ 1], w[ 2], offset); w[59] = hc_bytealign_be (w[ 0], w[ 1], offset); w[58] = hc_bytealign_be ( 0, w[ 0], offset); w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 59: w[63] = hc_bytealign_be (w[ 3], w[ 4], offset); w[62] = hc_bytealign_be (w[ 2], w[ 3], offset); w[61] = hc_bytealign_be (w[ 1], w[ 2], offset); w[60] = hc_bytealign_be (w[ 0], w[ 1], offset); w[59] = hc_bytealign_be ( 0, w[ 0], offset); w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 60: w[63] = hc_bytealign_be (w[ 2], w[ 3], offset); w[62] = hc_bytealign_be (w[ 1], w[ 2], offset); w[61] = hc_bytealign_be (w[ 0], w[ 1], offset); w[60] = hc_bytealign_be ( 0, w[ 0], offset); w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 61: w[63] = hc_bytealign_be (w[ 1], w[ 2], offset); w[62] = hc_bytealign_be (w[ 0], w[ 1], offset); w[61] = hc_bytealign_be ( 0, w[ 0], offset); w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 62: w[63] = hc_bytealign_be (w[ 0], w[ 1], offset); w[62] = hc_bytealign_be ( 0, w[ 0], offset); w[61] = 0; w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 63: w[63] = hc_bytealign_be ( 0, w[ 0], offset); w[62] = 0; w[61] = 0; w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV #if defined IS_NV const int selector = (0x76543210 >> ((offset & 3) * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> ((offset & 3) * 8)); #endif switch (offset_switch) { case 0: w[63] = hc_byte_perm (w[63], w[62], selector); w[62] = hc_byte_perm (w[62], w[61], selector); w[61] = hc_byte_perm (w[61], w[60], selector); w[60] = hc_byte_perm (w[60], w[59], selector); w[59] = hc_byte_perm (w[59], w[58], selector); w[58] = hc_byte_perm (w[58], w[57], selector); w[57] = hc_byte_perm (w[57], w[56], selector); w[56] = hc_byte_perm (w[56], w[55], selector); w[55] = hc_byte_perm (w[55], w[54], selector); w[54] = hc_byte_perm (w[54], w[53], selector); w[53] = hc_byte_perm (w[53], w[52], selector); w[52] = hc_byte_perm (w[52], w[51], selector); w[51] = hc_byte_perm (w[51], w[50], selector); w[50] = hc_byte_perm (w[50], w[49], selector); w[49] = hc_byte_perm (w[49], w[48], selector); w[48] = hc_byte_perm (w[48], w[47], selector); w[47] = hc_byte_perm (w[47], w[46], selector); w[46] = hc_byte_perm (w[46], w[45], selector); w[45] = hc_byte_perm (w[45], w[44], selector); w[44] = hc_byte_perm (w[44], w[43], selector); w[43] = hc_byte_perm (w[43], w[42], selector); w[42] = hc_byte_perm (w[42], w[41], selector); w[41] = hc_byte_perm (w[41], w[40], selector); w[40] = hc_byte_perm (w[40], w[39], selector); w[39] = hc_byte_perm (w[39], w[38], selector); w[38] = hc_byte_perm (w[38], w[37], selector); w[37] = hc_byte_perm (w[37], w[36], selector); w[36] = hc_byte_perm (w[36], w[35], selector); w[35] = hc_byte_perm (w[35], w[34], selector); w[34] = hc_byte_perm (w[34], w[33], selector); w[33] = hc_byte_perm (w[33], w[32], selector); w[32] = hc_byte_perm (w[32], w[31], selector); w[31] = hc_byte_perm (w[31], w[30], selector); w[30] = hc_byte_perm (w[30], w[29], selector); w[29] = hc_byte_perm (w[29], w[28], selector); w[28] = hc_byte_perm (w[28], w[27], selector); w[27] = hc_byte_perm (w[27], w[26], selector); w[26] = hc_byte_perm (w[26], w[25], selector); w[25] = hc_byte_perm (w[25], w[24], selector); w[24] = hc_byte_perm (w[24], w[23], selector); w[23] = hc_byte_perm (w[23], w[22], selector); w[22] = hc_byte_perm (w[22], w[21], selector); w[21] = hc_byte_perm (w[21], w[20], selector); w[20] = hc_byte_perm (w[20], w[19], selector); w[19] = hc_byte_perm (w[19], w[18], selector); w[18] = hc_byte_perm (w[18], w[17], selector); w[17] = hc_byte_perm (w[17], w[16], selector); w[16] = hc_byte_perm (w[16], w[15], selector); w[15] = hc_byte_perm (w[15], w[14], selector); w[14] = hc_byte_perm (w[14], w[13], selector); w[13] = hc_byte_perm (w[13], w[12], selector); w[12] = hc_byte_perm (w[12], w[11], selector); w[11] = hc_byte_perm (w[11], w[10], selector); w[10] = hc_byte_perm (w[10], w[ 9], selector); w[ 9] = hc_byte_perm (w[ 9], w[ 8], selector); w[ 8] = hc_byte_perm (w[ 8], w[ 7], selector); w[ 7] = hc_byte_perm (w[ 7], w[ 6], selector); w[ 6] = hc_byte_perm (w[ 6], w[ 5], selector); w[ 5] = hc_byte_perm (w[ 5], w[ 4], selector); w[ 4] = hc_byte_perm (w[ 4], w[ 3], selector); w[ 3] = hc_byte_perm (w[ 3], w[ 2], selector); w[ 2] = hc_byte_perm (w[ 2], w[ 1], selector); w[ 1] = hc_byte_perm (w[ 1], w[ 0], selector); w[ 0] = hc_byte_perm (w[ 0], 0, selector); break; case 1: w[63] = hc_byte_perm (w[62], w[61], selector); w[62] = hc_byte_perm (w[61], w[60], selector); w[61] = hc_byte_perm (w[60], w[59], selector); w[60] = hc_byte_perm (w[59], w[58], selector); w[59] = hc_byte_perm (w[58], w[57], selector); w[58] = hc_byte_perm (w[57], w[56], selector); w[57] = hc_byte_perm (w[56], w[55], selector); w[56] = hc_byte_perm (w[55], w[54], selector); w[55] = hc_byte_perm (w[54], w[53], selector); w[54] = hc_byte_perm (w[53], w[52], selector); w[53] = hc_byte_perm (w[52], w[51], selector); w[52] = hc_byte_perm (w[51], w[50], selector); w[51] = hc_byte_perm (w[50], w[49], selector); w[50] = hc_byte_perm (w[49], w[48], selector); w[49] = hc_byte_perm (w[48], w[47], selector); w[48] = hc_byte_perm (w[47], w[46], selector); w[47] = hc_byte_perm (w[46], w[45], selector); w[46] = hc_byte_perm (w[45], w[44], selector); w[45] = hc_byte_perm (w[44], w[43], selector); w[44] = hc_byte_perm (w[43], w[42], selector); w[43] = hc_byte_perm (w[42], w[41], selector); w[42] = hc_byte_perm (w[41], w[40], selector); w[41] = hc_byte_perm (w[40], w[39], selector); w[40] = hc_byte_perm (w[39], w[38], selector); w[39] = hc_byte_perm (w[38], w[37], selector); w[38] = hc_byte_perm (w[37], w[36], selector); w[37] = hc_byte_perm (w[36], w[35], selector); w[36] = hc_byte_perm (w[35], w[34], selector); w[35] = hc_byte_perm (w[34], w[33], selector); w[34] = hc_byte_perm (w[33], w[32], selector); w[33] = hc_byte_perm (w[32], w[31], selector); w[32] = hc_byte_perm (w[31], w[30], selector); w[31] = hc_byte_perm (w[30], w[29], selector); w[30] = hc_byte_perm (w[29], w[28], selector); w[29] = hc_byte_perm (w[28], w[27], selector); w[28] = hc_byte_perm (w[27], w[26], selector); w[27] = hc_byte_perm (w[26], w[25], selector); w[26] = hc_byte_perm (w[25], w[24], selector); w[25] = hc_byte_perm (w[24], w[23], selector); w[24] = hc_byte_perm (w[23], w[22], selector); w[23] = hc_byte_perm (w[22], w[21], selector); w[22] = hc_byte_perm (w[21], w[20], selector); w[21] = hc_byte_perm (w[20], w[19], selector); w[20] = hc_byte_perm (w[19], w[18], selector); w[19] = hc_byte_perm (w[18], w[17], selector); w[18] = hc_byte_perm (w[17], w[16], selector); w[17] = hc_byte_perm (w[16], w[15], selector); w[16] = hc_byte_perm (w[15], w[14], selector); w[15] = hc_byte_perm (w[14], w[13], selector); w[14] = hc_byte_perm (w[13], w[12], selector); w[13] = hc_byte_perm (w[12], w[11], selector); w[12] = hc_byte_perm (w[11], w[10], selector); w[11] = hc_byte_perm (w[10], w[ 9], selector); w[10] = hc_byte_perm (w[ 9], w[ 8], selector); w[ 9] = hc_byte_perm (w[ 8], w[ 7], selector); w[ 8] = hc_byte_perm (w[ 7], w[ 6], selector); w[ 7] = hc_byte_perm (w[ 6], w[ 5], selector); w[ 6] = hc_byte_perm (w[ 5], w[ 4], selector); w[ 5] = hc_byte_perm (w[ 4], w[ 3], selector); w[ 4] = hc_byte_perm (w[ 3], w[ 2], selector); w[ 3] = hc_byte_perm (w[ 2], w[ 1], selector); w[ 2] = hc_byte_perm (w[ 1], w[ 0], selector); w[ 1] = hc_byte_perm (w[ 0], 0, selector); w[ 0] = 0; break; case 2: w[63] = hc_byte_perm (w[61], w[60], selector); w[62] = hc_byte_perm (w[60], w[59], selector); w[61] = hc_byte_perm (w[59], w[58], selector); w[60] = hc_byte_perm (w[58], w[57], selector); w[59] = hc_byte_perm (w[57], w[56], selector); w[58] = hc_byte_perm (w[56], w[55], selector); w[57] = hc_byte_perm (w[55], w[54], selector); w[56] = hc_byte_perm (w[54], w[53], selector); w[55] = hc_byte_perm (w[53], w[52], selector); w[54] = hc_byte_perm (w[52], w[51], selector); w[53] = hc_byte_perm (w[51], w[50], selector); w[52] = hc_byte_perm (w[50], w[49], selector); w[51] = hc_byte_perm (w[49], w[48], selector); w[50] = hc_byte_perm (w[48], w[47], selector); w[49] = hc_byte_perm (w[47], w[46], selector); w[48] = hc_byte_perm (w[46], w[45], selector); w[47] = hc_byte_perm (w[45], w[44], selector); w[46] = hc_byte_perm (w[44], w[43], selector); w[45] = hc_byte_perm (w[43], w[42], selector); w[44] = hc_byte_perm (w[42], w[41], selector); w[43] = hc_byte_perm (w[41], w[40], selector); w[42] = hc_byte_perm (w[40], w[39], selector); w[41] = hc_byte_perm (w[39], w[38], selector); w[40] = hc_byte_perm (w[38], w[37], selector); w[39] = hc_byte_perm (w[37], w[36], selector); w[38] = hc_byte_perm (w[36], w[35], selector); w[37] = hc_byte_perm (w[35], w[34], selector); w[36] = hc_byte_perm (w[34], w[33], selector); w[35] = hc_byte_perm (w[33], w[32], selector); w[34] = hc_byte_perm (w[32], w[31], selector); w[33] = hc_byte_perm (w[31], w[30], selector); w[32] = hc_byte_perm (w[30], w[29], selector); w[31] = hc_byte_perm (w[29], w[28], selector); w[30] = hc_byte_perm (w[28], w[27], selector); w[29] = hc_byte_perm (w[27], w[26], selector); w[28] = hc_byte_perm (w[26], w[25], selector); w[27] = hc_byte_perm (w[25], w[24], selector); w[26] = hc_byte_perm (w[24], w[23], selector); w[25] = hc_byte_perm (w[23], w[22], selector); w[24] = hc_byte_perm (w[22], w[21], selector); w[23] = hc_byte_perm (w[21], w[20], selector); w[22] = hc_byte_perm (w[20], w[19], selector); w[21] = hc_byte_perm (w[19], w[18], selector); w[20] = hc_byte_perm (w[18], w[17], selector); w[19] = hc_byte_perm (w[17], w[16], selector); w[18] = hc_byte_perm (w[16], w[15], selector); w[17] = hc_byte_perm (w[15], w[14], selector); w[16] = hc_byte_perm (w[14], w[13], selector); w[15] = hc_byte_perm (w[13], w[12], selector); w[14] = hc_byte_perm (w[12], w[11], selector); w[13] = hc_byte_perm (w[11], w[10], selector); w[12] = hc_byte_perm (w[10], w[ 9], selector); w[11] = hc_byte_perm (w[ 9], w[ 8], selector); w[10] = hc_byte_perm (w[ 8], w[ 7], selector); w[ 9] = hc_byte_perm (w[ 7], w[ 6], selector); w[ 8] = hc_byte_perm (w[ 6], w[ 5], selector); w[ 7] = hc_byte_perm (w[ 5], w[ 4], selector); w[ 6] = hc_byte_perm (w[ 4], w[ 3], selector); w[ 5] = hc_byte_perm (w[ 3], w[ 2], selector); w[ 4] = hc_byte_perm (w[ 2], w[ 1], selector); w[ 3] = hc_byte_perm (w[ 1], w[ 0], selector); w[ 2] = hc_byte_perm (w[ 0], 0, selector); w[ 1] = 0; w[ 0] = 0; break; case 3: w[63] = hc_byte_perm (w[60], w[59], selector); w[62] = hc_byte_perm (w[59], w[58], selector); w[61] = hc_byte_perm (w[58], w[57], selector); w[60] = hc_byte_perm (w[57], w[56], selector); w[59] = hc_byte_perm (w[56], w[55], selector); w[58] = hc_byte_perm (w[55], w[54], selector); w[57] = hc_byte_perm (w[54], w[53], selector); w[56] = hc_byte_perm (w[53], w[52], selector); w[55] = hc_byte_perm (w[52], w[51], selector); w[54] = hc_byte_perm (w[51], w[50], selector); w[53] = hc_byte_perm (w[50], w[49], selector); w[52] = hc_byte_perm (w[49], w[48], selector); w[51] = hc_byte_perm (w[48], w[47], selector); w[50] = hc_byte_perm (w[47], w[46], selector); w[49] = hc_byte_perm (w[46], w[45], selector); w[48] = hc_byte_perm (w[45], w[44], selector); w[47] = hc_byte_perm (w[44], w[43], selector); w[46] = hc_byte_perm (w[43], w[42], selector); w[45] = hc_byte_perm (w[42], w[41], selector); w[44] = hc_byte_perm (w[41], w[40], selector); w[43] = hc_byte_perm (w[40], w[39], selector); w[42] = hc_byte_perm (w[39], w[38], selector); w[41] = hc_byte_perm (w[38], w[37], selector); w[40] = hc_byte_perm (w[37], w[36], selector); w[39] = hc_byte_perm (w[36], w[35], selector); w[38] = hc_byte_perm (w[35], w[34], selector); w[37] = hc_byte_perm (w[34], w[33], selector); w[36] = hc_byte_perm (w[33], w[32], selector); w[35] = hc_byte_perm (w[32], w[31], selector); w[34] = hc_byte_perm (w[31], w[30], selector); w[33] = hc_byte_perm (w[30], w[29], selector); w[32] = hc_byte_perm (w[29], w[28], selector); w[31] = hc_byte_perm (w[28], w[27], selector); w[30] = hc_byte_perm (w[27], w[26], selector); w[29] = hc_byte_perm (w[26], w[25], selector); w[28] = hc_byte_perm (w[25], w[24], selector); w[27] = hc_byte_perm (w[24], w[23], selector); w[26] = hc_byte_perm (w[23], w[22], selector); w[25] = hc_byte_perm (w[22], w[21], selector); w[24] = hc_byte_perm (w[21], w[20], selector); w[23] = hc_byte_perm (w[20], w[19], selector); w[22] = hc_byte_perm (w[19], w[18], selector); w[21] = hc_byte_perm (w[18], w[17], selector); w[20] = hc_byte_perm (w[17], w[16], selector); w[19] = hc_byte_perm (w[16], w[15], selector); w[18] = hc_byte_perm (w[15], w[14], selector); w[17] = hc_byte_perm (w[14], w[13], selector); w[16] = hc_byte_perm (w[13], w[12], selector); w[15] = hc_byte_perm (w[12], w[11], selector); w[14] = hc_byte_perm (w[11], w[10], selector); w[13] = hc_byte_perm (w[10], w[ 9], selector); w[12] = hc_byte_perm (w[ 9], w[ 8], selector); w[11] = hc_byte_perm (w[ 8], w[ 7], selector); w[10] = hc_byte_perm (w[ 7], w[ 6], selector); w[ 9] = hc_byte_perm (w[ 6], w[ 5], selector); w[ 8] = hc_byte_perm (w[ 5], w[ 4], selector); w[ 7] = hc_byte_perm (w[ 4], w[ 3], selector); w[ 6] = hc_byte_perm (w[ 3], w[ 2], selector); w[ 5] = hc_byte_perm (w[ 2], w[ 1], selector); w[ 4] = hc_byte_perm (w[ 1], w[ 0], selector); w[ 3] = hc_byte_perm (w[ 0], 0, selector); w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 4: w[63] = hc_byte_perm (w[59], w[58], selector); w[62] = hc_byte_perm (w[58], w[57], selector); w[61] = hc_byte_perm (w[57], w[56], selector); w[60] = hc_byte_perm (w[56], w[55], selector); w[59] = hc_byte_perm (w[55], w[54], selector); w[58] = hc_byte_perm (w[54], w[53], selector); w[57] = hc_byte_perm (w[53], w[52], selector); w[56] = hc_byte_perm (w[52], w[51], selector); w[55] = hc_byte_perm (w[51], w[50], selector); w[54] = hc_byte_perm (w[50], w[49], selector); w[53] = hc_byte_perm (w[49], w[48], selector); w[52] = hc_byte_perm (w[48], w[47], selector); w[51] = hc_byte_perm (w[47], w[46], selector); w[50] = hc_byte_perm (w[46], w[45], selector); w[49] = hc_byte_perm (w[45], w[44], selector); w[48] = hc_byte_perm (w[44], w[43], selector); w[47] = hc_byte_perm (w[43], w[42], selector); w[46] = hc_byte_perm (w[42], w[41], selector); w[45] = hc_byte_perm (w[41], w[40], selector); w[44] = hc_byte_perm (w[40], w[39], selector); w[43] = hc_byte_perm (w[39], w[38], selector); w[42] = hc_byte_perm (w[38], w[37], selector); w[41] = hc_byte_perm (w[37], w[36], selector); w[40] = hc_byte_perm (w[36], w[35], selector); w[39] = hc_byte_perm (w[35], w[34], selector); w[38] = hc_byte_perm (w[34], w[33], selector); w[37] = hc_byte_perm (w[33], w[32], selector); w[36] = hc_byte_perm (w[32], w[31], selector); w[35] = hc_byte_perm (w[31], w[30], selector); w[34] = hc_byte_perm (w[30], w[29], selector); w[33] = hc_byte_perm (w[29], w[28], selector); w[32] = hc_byte_perm (w[28], w[27], selector); w[31] = hc_byte_perm (w[27], w[26], selector); w[30] = hc_byte_perm (w[26], w[25], selector); w[29] = hc_byte_perm (w[25], w[24], selector); w[28] = hc_byte_perm (w[24], w[23], selector); w[27] = hc_byte_perm (w[23], w[22], selector); w[26] = hc_byte_perm (w[22], w[21], selector); w[25] = hc_byte_perm (w[21], w[20], selector); w[24] = hc_byte_perm (w[20], w[19], selector); w[23] = hc_byte_perm (w[19], w[18], selector); w[22] = hc_byte_perm (w[18], w[17], selector); w[21] = hc_byte_perm (w[17], w[16], selector); w[20] = hc_byte_perm (w[16], w[15], selector); w[19] = hc_byte_perm (w[15], w[14], selector); w[18] = hc_byte_perm (w[14], w[13], selector); w[17] = hc_byte_perm (w[13], w[12], selector); w[16] = hc_byte_perm (w[12], w[11], selector); w[15] = hc_byte_perm (w[11], w[10], selector); w[14] = hc_byte_perm (w[10], w[ 9], selector); w[13] = hc_byte_perm (w[ 9], w[ 8], selector); w[12] = hc_byte_perm (w[ 8], w[ 7], selector); w[11] = hc_byte_perm (w[ 7], w[ 6], selector); w[10] = hc_byte_perm (w[ 6], w[ 5], selector); w[ 9] = hc_byte_perm (w[ 5], w[ 4], selector); w[ 8] = hc_byte_perm (w[ 4], w[ 3], selector); w[ 7] = hc_byte_perm (w[ 3], w[ 2], selector); w[ 6] = hc_byte_perm (w[ 2], w[ 1], selector); w[ 5] = hc_byte_perm (w[ 1], w[ 0], selector); w[ 4] = hc_byte_perm (w[ 0], 0, selector); w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 5: w[63] = hc_byte_perm (w[58], w[57], selector); w[62] = hc_byte_perm (w[57], w[56], selector); w[61] = hc_byte_perm (w[56], w[55], selector); w[60] = hc_byte_perm (w[55], w[54], selector); w[59] = hc_byte_perm (w[54], w[53], selector); w[58] = hc_byte_perm (w[53], w[52], selector); w[57] = hc_byte_perm (w[52], w[51], selector); w[56] = hc_byte_perm (w[51], w[50], selector); w[55] = hc_byte_perm (w[50], w[49], selector); w[54] = hc_byte_perm (w[49], w[48], selector); w[53] = hc_byte_perm (w[48], w[47], selector); w[52] = hc_byte_perm (w[47], w[46], selector); w[51] = hc_byte_perm (w[46], w[45], selector); w[50] = hc_byte_perm (w[45], w[44], selector); w[49] = hc_byte_perm (w[44], w[43], selector); w[48] = hc_byte_perm (w[43], w[42], selector); w[47] = hc_byte_perm (w[42], w[41], selector); w[46] = hc_byte_perm (w[41], w[40], selector); w[45] = hc_byte_perm (w[40], w[39], selector); w[44] = hc_byte_perm (w[39], w[38], selector); w[43] = hc_byte_perm (w[38], w[37], selector); w[42] = hc_byte_perm (w[37], w[36], selector); w[41] = hc_byte_perm (w[36], w[35], selector); w[40] = hc_byte_perm (w[35], w[34], selector); w[39] = hc_byte_perm (w[34], w[33], selector); w[38] = hc_byte_perm (w[33], w[32], selector); w[37] = hc_byte_perm (w[32], w[31], selector); w[36] = hc_byte_perm (w[31], w[30], selector); w[35] = hc_byte_perm (w[30], w[29], selector); w[34] = hc_byte_perm (w[29], w[28], selector); w[33] = hc_byte_perm (w[28], w[27], selector); w[32] = hc_byte_perm (w[27], w[26], selector); w[31] = hc_byte_perm (w[26], w[25], selector); w[30] = hc_byte_perm (w[25], w[24], selector); w[29] = hc_byte_perm (w[24], w[23], selector); w[28] = hc_byte_perm (w[23], w[22], selector); w[27] = hc_byte_perm (w[22], w[21], selector); w[26] = hc_byte_perm (w[21], w[20], selector); w[25] = hc_byte_perm (w[20], w[19], selector); w[24] = hc_byte_perm (w[19], w[18], selector); w[23] = hc_byte_perm (w[18], w[17], selector); w[22] = hc_byte_perm (w[17], w[16], selector); w[21] = hc_byte_perm (w[16], w[15], selector); w[20] = hc_byte_perm (w[15], w[14], selector); w[19] = hc_byte_perm (w[14], w[13], selector); w[18] = hc_byte_perm (w[13], w[12], selector); w[17] = hc_byte_perm (w[12], w[11], selector); w[16] = hc_byte_perm (w[11], w[10], selector); w[15] = hc_byte_perm (w[10], w[ 9], selector); w[14] = hc_byte_perm (w[ 9], w[ 8], selector); w[13] = hc_byte_perm (w[ 8], w[ 7], selector); w[12] = hc_byte_perm (w[ 7], w[ 6], selector); w[11] = hc_byte_perm (w[ 6], w[ 5], selector); w[10] = hc_byte_perm (w[ 5], w[ 4], selector); w[ 9] = hc_byte_perm (w[ 4], w[ 3], selector); w[ 8] = hc_byte_perm (w[ 3], w[ 2], selector); w[ 7] = hc_byte_perm (w[ 2], w[ 1], selector); w[ 6] = hc_byte_perm (w[ 1], w[ 0], selector); w[ 5] = hc_byte_perm (w[ 0], 0, selector); w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 6: w[63] = hc_byte_perm (w[57], w[56], selector); w[62] = hc_byte_perm (w[56], w[55], selector); w[61] = hc_byte_perm (w[55], w[54], selector); w[60] = hc_byte_perm (w[54], w[53], selector); w[59] = hc_byte_perm (w[53], w[52], selector); w[58] = hc_byte_perm (w[52], w[51], selector); w[57] = hc_byte_perm (w[51], w[50], selector); w[56] = hc_byte_perm (w[50], w[49], selector); w[55] = hc_byte_perm (w[49], w[48], selector); w[54] = hc_byte_perm (w[48], w[47], selector); w[53] = hc_byte_perm (w[47], w[46], selector); w[52] = hc_byte_perm (w[46], w[45], selector); w[51] = hc_byte_perm (w[45], w[44], selector); w[50] = hc_byte_perm (w[44], w[43], selector); w[49] = hc_byte_perm (w[43], w[42], selector); w[48] = hc_byte_perm (w[42], w[41], selector); w[47] = hc_byte_perm (w[41], w[40], selector); w[46] = hc_byte_perm (w[40], w[39], selector); w[45] = hc_byte_perm (w[39], w[38], selector); w[44] = hc_byte_perm (w[38], w[37], selector); w[43] = hc_byte_perm (w[37], w[36], selector); w[42] = hc_byte_perm (w[36], w[35], selector); w[41] = hc_byte_perm (w[35], w[34], selector); w[40] = hc_byte_perm (w[34], w[33], selector); w[39] = hc_byte_perm (w[33], w[32], selector); w[38] = hc_byte_perm (w[32], w[31], selector); w[37] = hc_byte_perm (w[31], w[30], selector); w[36] = hc_byte_perm (w[30], w[29], selector); w[35] = hc_byte_perm (w[29], w[28], selector); w[34] = hc_byte_perm (w[28], w[27], selector); w[33] = hc_byte_perm (w[27], w[26], selector); w[32] = hc_byte_perm (w[26], w[25], selector); w[31] = hc_byte_perm (w[25], w[24], selector); w[30] = hc_byte_perm (w[24], w[23], selector); w[29] = hc_byte_perm (w[23], w[22], selector); w[28] = hc_byte_perm (w[22], w[21], selector); w[27] = hc_byte_perm (w[21], w[20], selector); w[26] = hc_byte_perm (w[20], w[19], selector); w[25] = hc_byte_perm (w[19], w[18], selector); w[24] = hc_byte_perm (w[18], w[17], selector); w[23] = hc_byte_perm (w[17], w[16], selector); w[22] = hc_byte_perm (w[16], w[15], selector); w[21] = hc_byte_perm (w[15], w[14], selector); w[20] = hc_byte_perm (w[14], w[13], selector); w[19] = hc_byte_perm (w[13], w[12], selector); w[18] = hc_byte_perm (w[12], w[11], selector); w[17] = hc_byte_perm (w[11], w[10], selector); w[16] = hc_byte_perm (w[10], w[ 9], selector); w[15] = hc_byte_perm (w[ 9], w[ 8], selector); w[14] = hc_byte_perm (w[ 8], w[ 7], selector); w[13] = hc_byte_perm (w[ 7], w[ 6], selector); w[12] = hc_byte_perm (w[ 6], w[ 5], selector); w[11] = hc_byte_perm (w[ 5], w[ 4], selector); w[10] = hc_byte_perm (w[ 4], w[ 3], selector); w[ 9] = hc_byte_perm (w[ 3], w[ 2], selector); w[ 8] = hc_byte_perm (w[ 2], w[ 1], selector); w[ 7] = hc_byte_perm (w[ 1], w[ 0], selector); w[ 6] = hc_byte_perm (w[ 0], 0, selector); w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 7: w[63] = hc_byte_perm (w[56], w[55], selector); w[62] = hc_byte_perm (w[55], w[54], selector); w[61] = hc_byte_perm (w[54], w[53], selector); w[60] = hc_byte_perm (w[53], w[52], selector); w[59] = hc_byte_perm (w[52], w[51], selector); w[58] = hc_byte_perm (w[51], w[50], selector); w[57] = hc_byte_perm (w[50], w[49], selector); w[56] = hc_byte_perm (w[49], w[48], selector); w[55] = hc_byte_perm (w[48], w[47], selector); w[54] = hc_byte_perm (w[47], w[46], selector); w[53] = hc_byte_perm (w[46], w[45], selector); w[52] = hc_byte_perm (w[45], w[44], selector); w[51] = hc_byte_perm (w[44], w[43], selector); w[50] = hc_byte_perm (w[43], w[42], selector); w[49] = hc_byte_perm (w[42], w[41], selector); w[48] = hc_byte_perm (w[41], w[40], selector); w[47] = hc_byte_perm (w[40], w[39], selector); w[46] = hc_byte_perm (w[39], w[38], selector); w[45] = hc_byte_perm (w[38], w[37], selector); w[44] = hc_byte_perm (w[37], w[36], selector); w[43] = hc_byte_perm (w[36], w[35], selector); w[42] = hc_byte_perm (w[35], w[34], selector); w[41] = hc_byte_perm (w[34], w[33], selector); w[40] = hc_byte_perm (w[33], w[32], selector); w[39] = hc_byte_perm (w[32], w[31], selector); w[38] = hc_byte_perm (w[31], w[30], selector); w[37] = hc_byte_perm (w[30], w[29], selector); w[36] = hc_byte_perm (w[29], w[28], selector); w[35] = hc_byte_perm (w[28], w[27], selector); w[34] = hc_byte_perm (w[27], w[26], selector); w[33] = hc_byte_perm (w[26], w[25], selector); w[32] = hc_byte_perm (w[25], w[24], selector); w[31] = hc_byte_perm (w[24], w[23], selector); w[30] = hc_byte_perm (w[23], w[22], selector); w[29] = hc_byte_perm (w[22], w[21], selector); w[28] = hc_byte_perm (w[21], w[20], selector); w[27] = hc_byte_perm (w[20], w[19], selector); w[26] = hc_byte_perm (w[19], w[18], selector); w[25] = hc_byte_perm (w[18], w[17], selector); w[24] = hc_byte_perm (w[17], w[16], selector); w[23] = hc_byte_perm (w[16], w[15], selector); w[22] = hc_byte_perm (w[15], w[14], selector); w[21] = hc_byte_perm (w[14], w[13], selector); w[20] = hc_byte_perm (w[13], w[12], selector); w[19] = hc_byte_perm (w[12], w[11], selector); w[18] = hc_byte_perm (w[11], w[10], selector); w[17] = hc_byte_perm (w[10], w[ 9], selector); w[16] = hc_byte_perm (w[ 9], w[ 8], selector); w[15] = hc_byte_perm (w[ 8], w[ 7], selector); w[14] = hc_byte_perm (w[ 7], w[ 6], selector); w[13] = hc_byte_perm (w[ 6], w[ 5], selector); w[12] = hc_byte_perm (w[ 5], w[ 4], selector); w[11] = hc_byte_perm (w[ 4], w[ 3], selector); w[10] = hc_byte_perm (w[ 3], w[ 2], selector); w[ 9] = hc_byte_perm (w[ 2], w[ 1], selector); w[ 8] = hc_byte_perm (w[ 1], w[ 0], selector); w[ 7] = hc_byte_perm (w[ 0], 0, selector); w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 8: w[63] = hc_byte_perm (w[55], w[54], selector); w[62] = hc_byte_perm (w[54], w[53], selector); w[61] = hc_byte_perm (w[53], w[52], selector); w[60] = hc_byte_perm (w[52], w[51], selector); w[59] = hc_byte_perm (w[51], w[50], selector); w[58] = hc_byte_perm (w[50], w[49], selector); w[57] = hc_byte_perm (w[49], w[48], selector); w[56] = hc_byte_perm (w[48], w[47], selector); w[55] = hc_byte_perm (w[47], w[46], selector); w[54] = hc_byte_perm (w[46], w[45], selector); w[53] = hc_byte_perm (w[45], w[44], selector); w[52] = hc_byte_perm (w[44], w[43], selector); w[51] = hc_byte_perm (w[43], w[42], selector); w[50] = hc_byte_perm (w[42], w[41], selector); w[49] = hc_byte_perm (w[41], w[40], selector); w[48] = hc_byte_perm (w[40], w[39], selector); w[47] = hc_byte_perm (w[39], w[38], selector); w[46] = hc_byte_perm (w[38], w[37], selector); w[45] = hc_byte_perm (w[37], w[36], selector); w[44] = hc_byte_perm (w[36], w[35], selector); w[43] = hc_byte_perm (w[35], w[34], selector); w[42] = hc_byte_perm (w[34], w[33], selector); w[41] = hc_byte_perm (w[33], w[32], selector); w[40] = hc_byte_perm (w[32], w[31], selector); w[39] = hc_byte_perm (w[31], w[30], selector); w[38] = hc_byte_perm (w[30], w[29], selector); w[37] = hc_byte_perm (w[29], w[28], selector); w[36] = hc_byte_perm (w[28], w[27], selector); w[35] = hc_byte_perm (w[27], w[26], selector); w[34] = hc_byte_perm (w[26], w[25], selector); w[33] = hc_byte_perm (w[25], w[24], selector); w[32] = hc_byte_perm (w[24], w[23], selector); w[31] = hc_byte_perm (w[23], w[22], selector); w[30] = hc_byte_perm (w[22], w[21], selector); w[29] = hc_byte_perm (w[21], w[20], selector); w[28] = hc_byte_perm (w[20], w[19], selector); w[27] = hc_byte_perm (w[19], w[18], selector); w[26] = hc_byte_perm (w[18], w[17], selector); w[25] = hc_byte_perm (w[17], w[16], selector); w[24] = hc_byte_perm (w[16], w[15], selector); w[23] = hc_byte_perm (w[15], w[14], selector); w[22] = hc_byte_perm (w[14], w[13], selector); w[21] = hc_byte_perm (w[13], w[12], selector); w[20] = hc_byte_perm (w[12], w[11], selector); w[19] = hc_byte_perm (w[11], w[10], selector); w[18] = hc_byte_perm (w[10], w[ 9], selector); w[17] = hc_byte_perm (w[ 9], w[ 8], selector); w[16] = hc_byte_perm (w[ 8], w[ 7], selector); w[15] = hc_byte_perm (w[ 7], w[ 6], selector); w[14] = hc_byte_perm (w[ 6], w[ 5], selector); w[13] = hc_byte_perm (w[ 5], w[ 4], selector); w[12] = hc_byte_perm (w[ 4], w[ 3], selector); w[11] = hc_byte_perm (w[ 3], w[ 2], selector); w[10] = hc_byte_perm (w[ 2], w[ 1], selector); w[ 9] = hc_byte_perm (w[ 1], w[ 0], selector); w[ 8] = hc_byte_perm (w[ 0], 0, selector); w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 9: w[63] = hc_byte_perm (w[54], w[53], selector); w[62] = hc_byte_perm (w[53], w[52], selector); w[61] = hc_byte_perm (w[52], w[51], selector); w[60] = hc_byte_perm (w[51], w[50], selector); w[59] = hc_byte_perm (w[50], w[49], selector); w[58] = hc_byte_perm (w[49], w[48], selector); w[57] = hc_byte_perm (w[48], w[47], selector); w[56] = hc_byte_perm (w[47], w[46], selector); w[55] = hc_byte_perm (w[46], w[45], selector); w[54] = hc_byte_perm (w[45], w[44], selector); w[53] = hc_byte_perm (w[44], w[43], selector); w[52] = hc_byte_perm (w[43], w[42], selector); w[51] = hc_byte_perm (w[42], w[41], selector); w[50] = hc_byte_perm (w[41], w[40], selector); w[49] = hc_byte_perm (w[40], w[39], selector); w[48] = hc_byte_perm (w[39], w[38], selector); w[47] = hc_byte_perm (w[38], w[37], selector); w[46] = hc_byte_perm (w[37], w[36], selector); w[45] = hc_byte_perm (w[36], w[35], selector); w[44] = hc_byte_perm (w[35], w[34], selector); w[43] = hc_byte_perm (w[34], w[33], selector); w[42] = hc_byte_perm (w[33], w[32], selector); w[41] = hc_byte_perm (w[32], w[31], selector); w[40] = hc_byte_perm (w[31], w[30], selector); w[39] = hc_byte_perm (w[30], w[29], selector); w[38] = hc_byte_perm (w[29], w[28], selector); w[37] = hc_byte_perm (w[28], w[27], selector); w[36] = hc_byte_perm (w[27], w[26], selector); w[35] = hc_byte_perm (w[26], w[25], selector); w[34] = hc_byte_perm (w[25], w[24], selector); w[33] = hc_byte_perm (w[24], w[23], selector); w[32] = hc_byte_perm (w[23], w[22], selector); w[31] = hc_byte_perm (w[22], w[21], selector); w[30] = hc_byte_perm (w[21], w[20], selector); w[29] = hc_byte_perm (w[20], w[19], selector); w[28] = hc_byte_perm (w[19], w[18], selector); w[27] = hc_byte_perm (w[18], w[17], selector); w[26] = hc_byte_perm (w[17], w[16], selector); w[25] = hc_byte_perm (w[16], w[15], selector); w[24] = hc_byte_perm (w[15], w[14], selector); w[23] = hc_byte_perm (w[14], w[13], selector); w[22] = hc_byte_perm (w[13], w[12], selector); w[21] = hc_byte_perm (w[12], w[11], selector); w[20] = hc_byte_perm (w[11], w[10], selector); w[19] = hc_byte_perm (w[10], w[ 9], selector); w[18] = hc_byte_perm (w[ 9], w[ 8], selector); w[17] = hc_byte_perm (w[ 8], w[ 7], selector); w[16] = hc_byte_perm (w[ 7], w[ 6], selector); w[15] = hc_byte_perm (w[ 6], w[ 5], selector); w[14] = hc_byte_perm (w[ 5], w[ 4], selector); w[13] = hc_byte_perm (w[ 4], w[ 3], selector); w[12] = hc_byte_perm (w[ 3], w[ 2], selector); w[11] = hc_byte_perm (w[ 2], w[ 1], selector); w[10] = hc_byte_perm (w[ 1], w[ 0], selector); w[ 9] = hc_byte_perm (w[ 0], 0, selector); w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 10: w[63] = hc_byte_perm (w[53], w[52], selector); w[62] = hc_byte_perm (w[52], w[51], selector); w[61] = hc_byte_perm (w[51], w[50], selector); w[60] = hc_byte_perm (w[50], w[49], selector); w[59] = hc_byte_perm (w[49], w[48], selector); w[58] = hc_byte_perm (w[48], w[47], selector); w[57] = hc_byte_perm (w[47], w[46], selector); w[56] = hc_byte_perm (w[46], w[45], selector); w[55] = hc_byte_perm (w[45], w[44], selector); w[54] = hc_byte_perm (w[44], w[43], selector); w[53] = hc_byte_perm (w[43], w[42], selector); w[52] = hc_byte_perm (w[42], w[41], selector); w[51] = hc_byte_perm (w[41], w[40], selector); w[50] = hc_byte_perm (w[40], w[39], selector); w[49] = hc_byte_perm (w[39], w[38], selector); w[48] = hc_byte_perm (w[38], w[37], selector); w[47] = hc_byte_perm (w[37], w[36], selector); w[46] = hc_byte_perm (w[36], w[35], selector); w[45] = hc_byte_perm (w[35], w[34], selector); w[44] = hc_byte_perm (w[34], w[33], selector); w[43] = hc_byte_perm (w[33], w[32], selector); w[42] = hc_byte_perm (w[32], w[31], selector); w[41] = hc_byte_perm (w[31], w[30], selector); w[40] = hc_byte_perm (w[30], w[29], selector); w[39] = hc_byte_perm (w[29], w[28], selector); w[38] = hc_byte_perm (w[28], w[27], selector); w[37] = hc_byte_perm (w[27], w[26], selector); w[36] = hc_byte_perm (w[26], w[25], selector); w[35] = hc_byte_perm (w[25], w[24], selector); w[34] = hc_byte_perm (w[24], w[23], selector); w[33] = hc_byte_perm (w[23], w[22], selector); w[32] = hc_byte_perm (w[22], w[21], selector); w[31] = hc_byte_perm (w[21], w[20], selector); w[30] = hc_byte_perm (w[20], w[19], selector); w[29] = hc_byte_perm (w[19], w[18], selector); w[28] = hc_byte_perm (w[18], w[17], selector); w[27] = hc_byte_perm (w[17], w[16], selector); w[26] = hc_byte_perm (w[16], w[15], selector); w[25] = hc_byte_perm (w[15], w[14], selector); w[24] = hc_byte_perm (w[14], w[13], selector); w[23] = hc_byte_perm (w[13], w[12], selector); w[22] = hc_byte_perm (w[12], w[11], selector); w[21] = hc_byte_perm (w[11], w[10], selector); w[20] = hc_byte_perm (w[10], w[ 9], selector); w[19] = hc_byte_perm (w[ 9], w[ 8], selector); w[18] = hc_byte_perm (w[ 8], w[ 7], selector); w[17] = hc_byte_perm (w[ 7], w[ 6], selector); w[16] = hc_byte_perm (w[ 6], w[ 5], selector); w[15] = hc_byte_perm (w[ 5], w[ 4], selector); w[14] = hc_byte_perm (w[ 4], w[ 3], selector); w[13] = hc_byte_perm (w[ 3], w[ 2], selector); w[12] = hc_byte_perm (w[ 2], w[ 1], selector); w[11] = hc_byte_perm (w[ 1], w[ 0], selector); w[10] = hc_byte_perm (w[ 0], 0, selector); w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 11: w[63] = hc_byte_perm (w[52], w[51], selector); w[62] = hc_byte_perm (w[51], w[50], selector); w[61] = hc_byte_perm (w[50], w[49], selector); w[60] = hc_byte_perm (w[49], w[48], selector); w[59] = hc_byte_perm (w[48], w[47], selector); w[58] = hc_byte_perm (w[47], w[46], selector); w[57] = hc_byte_perm (w[46], w[45], selector); w[56] = hc_byte_perm (w[45], w[44], selector); w[55] = hc_byte_perm (w[44], w[43], selector); w[54] = hc_byte_perm (w[43], w[42], selector); w[53] = hc_byte_perm (w[42], w[41], selector); w[52] = hc_byte_perm (w[41], w[40], selector); w[51] = hc_byte_perm (w[40], w[39], selector); w[50] = hc_byte_perm (w[39], w[38], selector); w[49] = hc_byte_perm (w[38], w[37], selector); w[48] = hc_byte_perm (w[37], w[36], selector); w[47] = hc_byte_perm (w[36], w[35], selector); w[46] = hc_byte_perm (w[35], w[34], selector); w[45] = hc_byte_perm (w[34], w[33], selector); w[44] = hc_byte_perm (w[33], w[32], selector); w[43] = hc_byte_perm (w[32], w[31], selector); w[42] = hc_byte_perm (w[31], w[30], selector); w[41] = hc_byte_perm (w[30], w[29], selector); w[40] = hc_byte_perm (w[29], w[28], selector); w[39] = hc_byte_perm (w[28], w[27], selector); w[38] = hc_byte_perm (w[27], w[26], selector); w[37] = hc_byte_perm (w[26], w[25], selector); w[36] = hc_byte_perm (w[25], w[24], selector); w[35] = hc_byte_perm (w[24], w[23], selector); w[34] = hc_byte_perm (w[23], w[22], selector); w[33] = hc_byte_perm (w[22], w[21], selector); w[32] = hc_byte_perm (w[21], w[20], selector); w[31] = hc_byte_perm (w[20], w[19], selector); w[30] = hc_byte_perm (w[19], w[18], selector); w[29] = hc_byte_perm (w[18], w[17], selector); w[28] = hc_byte_perm (w[17], w[16], selector); w[27] = hc_byte_perm (w[16], w[15], selector); w[26] = hc_byte_perm (w[15], w[14], selector); w[25] = hc_byte_perm (w[14], w[13], selector); w[24] = hc_byte_perm (w[13], w[12], selector); w[23] = hc_byte_perm (w[12], w[11], selector); w[22] = hc_byte_perm (w[11], w[10], selector); w[21] = hc_byte_perm (w[10], w[ 9], selector); w[20] = hc_byte_perm (w[ 9], w[ 8], selector); w[19] = hc_byte_perm (w[ 8], w[ 7], selector); w[18] = hc_byte_perm (w[ 7], w[ 6], selector); w[17] = hc_byte_perm (w[ 6], w[ 5], selector); w[16] = hc_byte_perm (w[ 5], w[ 4], selector); w[15] = hc_byte_perm (w[ 4], w[ 3], selector); w[14] = hc_byte_perm (w[ 3], w[ 2], selector); w[13] = hc_byte_perm (w[ 2], w[ 1], selector); w[12] = hc_byte_perm (w[ 1], w[ 0], selector); w[11] = hc_byte_perm (w[ 0], 0, selector); w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 12: w[63] = hc_byte_perm (w[51], w[50], selector); w[62] = hc_byte_perm (w[50], w[49], selector); w[61] = hc_byte_perm (w[49], w[48], selector); w[60] = hc_byte_perm (w[48], w[47], selector); w[59] = hc_byte_perm (w[47], w[46], selector); w[58] = hc_byte_perm (w[46], w[45], selector); w[57] = hc_byte_perm (w[45], w[44], selector); w[56] = hc_byte_perm (w[44], w[43], selector); w[55] = hc_byte_perm (w[43], w[42], selector); w[54] = hc_byte_perm (w[42], w[41], selector); w[53] = hc_byte_perm (w[41], w[40], selector); w[52] = hc_byte_perm (w[40], w[39], selector); w[51] = hc_byte_perm (w[39], w[38], selector); w[50] = hc_byte_perm (w[38], w[37], selector); w[49] = hc_byte_perm (w[37], w[36], selector); w[48] = hc_byte_perm (w[36], w[35], selector); w[47] = hc_byte_perm (w[35], w[34], selector); w[46] = hc_byte_perm (w[34], w[33], selector); w[45] = hc_byte_perm (w[33], w[32], selector); w[44] = hc_byte_perm (w[32], w[31], selector); w[43] = hc_byte_perm (w[31], w[30], selector); w[42] = hc_byte_perm (w[30], w[29], selector); w[41] = hc_byte_perm (w[29], w[28], selector); w[40] = hc_byte_perm (w[28], w[27], selector); w[39] = hc_byte_perm (w[27], w[26], selector); w[38] = hc_byte_perm (w[26], w[25], selector); w[37] = hc_byte_perm (w[25], w[24], selector); w[36] = hc_byte_perm (w[24], w[23], selector); w[35] = hc_byte_perm (w[23], w[22], selector); w[34] = hc_byte_perm (w[22], w[21], selector); w[33] = hc_byte_perm (w[21], w[20], selector); w[32] = hc_byte_perm (w[20], w[19], selector); w[31] = hc_byte_perm (w[19], w[18], selector); w[30] = hc_byte_perm (w[18], w[17], selector); w[29] = hc_byte_perm (w[17], w[16], selector); w[28] = hc_byte_perm (w[16], w[15], selector); w[27] = hc_byte_perm (w[15], w[14], selector); w[26] = hc_byte_perm (w[14], w[13], selector); w[25] = hc_byte_perm (w[13], w[12], selector); w[24] = hc_byte_perm (w[12], w[11], selector); w[23] = hc_byte_perm (w[11], w[10], selector); w[22] = hc_byte_perm (w[10], w[ 9], selector); w[21] = hc_byte_perm (w[ 9], w[ 8], selector); w[20] = hc_byte_perm (w[ 8], w[ 7], selector); w[19] = hc_byte_perm (w[ 7], w[ 6], selector); w[18] = hc_byte_perm (w[ 6], w[ 5], selector); w[17] = hc_byte_perm (w[ 5], w[ 4], selector); w[16] = hc_byte_perm (w[ 4], w[ 3], selector); w[15] = hc_byte_perm (w[ 3], w[ 2], selector); w[14] = hc_byte_perm (w[ 2], w[ 1], selector); w[13] = hc_byte_perm (w[ 1], w[ 0], selector); w[12] = hc_byte_perm (w[ 0], 0, selector); w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 13: w[63] = hc_byte_perm (w[50], w[49], selector); w[62] = hc_byte_perm (w[49], w[48], selector); w[61] = hc_byte_perm (w[48], w[47], selector); w[60] = hc_byte_perm (w[47], w[46], selector); w[59] = hc_byte_perm (w[46], w[45], selector); w[58] = hc_byte_perm (w[45], w[44], selector); w[57] = hc_byte_perm (w[44], w[43], selector); w[56] = hc_byte_perm (w[43], w[42], selector); w[55] = hc_byte_perm (w[42], w[41], selector); w[54] = hc_byte_perm (w[41], w[40], selector); w[53] = hc_byte_perm (w[40], w[39], selector); w[52] = hc_byte_perm (w[39], w[38], selector); w[51] = hc_byte_perm (w[38], w[37], selector); w[50] = hc_byte_perm (w[37], w[36], selector); w[49] = hc_byte_perm (w[36], w[35], selector); w[48] = hc_byte_perm (w[35], w[34], selector); w[47] = hc_byte_perm (w[34], w[33], selector); w[46] = hc_byte_perm (w[33], w[32], selector); w[45] = hc_byte_perm (w[32], w[31], selector); w[44] = hc_byte_perm (w[31], w[30], selector); w[43] = hc_byte_perm (w[30], w[29], selector); w[42] = hc_byte_perm (w[29], w[28], selector); w[41] = hc_byte_perm (w[28], w[27], selector); w[40] = hc_byte_perm (w[27], w[26], selector); w[39] = hc_byte_perm (w[26], w[25], selector); w[38] = hc_byte_perm (w[25], w[24], selector); w[37] = hc_byte_perm (w[24], w[23], selector); w[36] = hc_byte_perm (w[23], w[22], selector); w[35] = hc_byte_perm (w[22], w[21], selector); w[34] = hc_byte_perm (w[21], w[20], selector); w[33] = hc_byte_perm (w[20], w[19], selector); w[32] = hc_byte_perm (w[19], w[18], selector); w[31] = hc_byte_perm (w[18], w[17], selector); w[30] = hc_byte_perm (w[17], w[16], selector); w[29] = hc_byte_perm (w[16], w[15], selector); w[28] = hc_byte_perm (w[15], w[14], selector); w[27] = hc_byte_perm (w[14], w[13], selector); w[26] = hc_byte_perm (w[13], w[12], selector); w[25] = hc_byte_perm (w[12], w[11], selector); w[24] = hc_byte_perm (w[11], w[10], selector); w[23] = hc_byte_perm (w[10], w[ 9], selector); w[22] = hc_byte_perm (w[ 9], w[ 8], selector); w[21] = hc_byte_perm (w[ 8], w[ 7], selector); w[20] = hc_byte_perm (w[ 7], w[ 6], selector); w[19] = hc_byte_perm (w[ 6], w[ 5], selector); w[18] = hc_byte_perm (w[ 5], w[ 4], selector); w[17] = hc_byte_perm (w[ 4], w[ 3], selector); w[16] = hc_byte_perm (w[ 3], w[ 2], selector); w[15] = hc_byte_perm (w[ 2], w[ 1], selector); w[14] = hc_byte_perm (w[ 1], w[ 0], selector); w[13] = hc_byte_perm (w[ 0], 0, selector); w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 14: w[63] = hc_byte_perm (w[49], w[48], selector); w[62] = hc_byte_perm (w[48], w[47], selector); w[61] = hc_byte_perm (w[47], w[46], selector); w[60] = hc_byte_perm (w[46], w[45], selector); w[59] = hc_byte_perm (w[45], w[44], selector); w[58] = hc_byte_perm (w[44], w[43], selector); w[57] = hc_byte_perm (w[43], w[42], selector); w[56] = hc_byte_perm (w[42], w[41], selector); w[55] = hc_byte_perm (w[41], w[40], selector); w[54] = hc_byte_perm (w[40], w[39], selector); w[53] = hc_byte_perm (w[39], w[38], selector); w[52] = hc_byte_perm (w[38], w[37], selector); w[51] = hc_byte_perm (w[37], w[36], selector); w[50] = hc_byte_perm (w[36], w[35], selector); w[49] = hc_byte_perm (w[35], w[34], selector); w[48] = hc_byte_perm (w[34], w[33], selector); w[47] = hc_byte_perm (w[33], w[32], selector); w[46] = hc_byte_perm (w[32], w[31], selector); w[45] = hc_byte_perm (w[31], w[30], selector); w[44] = hc_byte_perm (w[30], w[29], selector); w[43] = hc_byte_perm (w[29], w[28], selector); w[42] = hc_byte_perm (w[28], w[27], selector); w[41] = hc_byte_perm (w[27], w[26], selector); w[40] = hc_byte_perm (w[26], w[25], selector); w[39] = hc_byte_perm (w[25], w[24], selector); w[38] = hc_byte_perm (w[24], w[23], selector); w[37] = hc_byte_perm (w[23], w[22], selector); w[36] = hc_byte_perm (w[22], w[21], selector); w[35] = hc_byte_perm (w[21], w[20], selector); w[34] = hc_byte_perm (w[20], w[19], selector); w[33] = hc_byte_perm (w[19], w[18], selector); w[32] = hc_byte_perm (w[18], w[17], selector); w[31] = hc_byte_perm (w[17], w[16], selector); w[30] = hc_byte_perm (w[16], w[15], selector); w[29] = hc_byte_perm (w[15], w[14], selector); w[28] = hc_byte_perm (w[14], w[13], selector); w[27] = hc_byte_perm (w[13], w[12], selector); w[26] = hc_byte_perm (w[12], w[11], selector); w[25] = hc_byte_perm (w[11], w[10], selector); w[24] = hc_byte_perm (w[10], w[ 9], selector); w[23] = hc_byte_perm (w[ 9], w[ 8], selector); w[22] = hc_byte_perm (w[ 8], w[ 7], selector); w[21] = hc_byte_perm (w[ 7], w[ 6], selector); w[20] = hc_byte_perm (w[ 6], w[ 5], selector); w[19] = hc_byte_perm (w[ 5], w[ 4], selector); w[18] = hc_byte_perm (w[ 4], w[ 3], selector); w[17] = hc_byte_perm (w[ 3], w[ 2], selector); w[16] = hc_byte_perm (w[ 2], w[ 1], selector); w[15] = hc_byte_perm (w[ 1], w[ 0], selector); w[14] = hc_byte_perm (w[ 0], 0, selector); w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 15: w[63] = hc_byte_perm (w[48], w[47], selector); w[62] = hc_byte_perm (w[47], w[46], selector); w[61] = hc_byte_perm (w[46], w[45], selector); w[60] = hc_byte_perm (w[45], w[44], selector); w[59] = hc_byte_perm (w[44], w[43], selector); w[58] = hc_byte_perm (w[43], w[42], selector); w[57] = hc_byte_perm (w[42], w[41], selector); w[56] = hc_byte_perm (w[41], w[40], selector); w[55] = hc_byte_perm (w[40], w[39], selector); w[54] = hc_byte_perm (w[39], w[38], selector); w[53] = hc_byte_perm (w[38], w[37], selector); w[52] = hc_byte_perm (w[37], w[36], selector); w[51] = hc_byte_perm (w[36], w[35], selector); w[50] = hc_byte_perm (w[35], w[34], selector); w[49] = hc_byte_perm (w[34], w[33], selector); w[48] = hc_byte_perm (w[33], w[32], selector); w[47] = hc_byte_perm (w[32], w[31], selector); w[46] = hc_byte_perm (w[31], w[30], selector); w[45] = hc_byte_perm (w[30], w[29], selector); w[44] = hc_byte_perm (w[29], w[28], selector); w[43] = hc_byte_perm (w[28], w[27], selector); w[42] = hc_byte_perm (w[27], w[26], selector); w[41] = hc_byte_perm (w[26], w[25], selector); w[40] = hc_byte_perm (w[25], w[24], selector); w[39] = hc_byte_perm (w[24], w[23], selector); w[38] = hc_byte_perm (w[23], w[22], selector); w[37] = hc_byte_perm (w[22], w[21], selector); w[36] = hc_byte_perm (w[21], w[20], selector); w[35] = hc_byte_perm (w[20], w[19], selector); w[34] = hc_byte_perm (w[19], w[18], selector); w[33] = hc_byte_perm (w[18], w[17], selector); w[32] = hc_byte_perm (w[17], w[16], selector); w[31] = hc_byte_perm (w[16], w[15], selector); w[30] = hc_byte_perm (w[15], w[14], selector); w[29] = hc_byte_perm (w[14], w[13], selector); w[28] = hc_byte_perm (w[13], w[12], selector); w[27] = hc_byte_perm (w[12], w[11], selector); w[26] = hc_byte_perm (w[11], w[10], selector); w[25] = hc_byte_perm (w[10], w[ 9], selector); w[24] = hc_byte_perm (w[ 9], w[ 8], selector); w[23] = hc_byte_perm (w[ 8], w[ 7], selector); w[22] = hc_byte_perm (w[ 7], w[ 6], selector); w[21] = hc_byte_perm (w[ 6], w[ 5], selector); w[20] = hc_byte_perm (w[ 5], w[ 4], selector); w[19] = hc_byte_perm (w[ 4], w[ 3], selector); w[18] = hc_byte_perm (w[ 3], w[ 2], selector); w[17] = hc_byte_perm (w[ 2], w[ 1], selector); w[16] = hc_byte_perm (w[ 1], w[ 0], selector); w[15] = hc_byte_perm (w[ 0], 0, selector); w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 16: w[63] = hc_byte_perm (w[47], w[46], selector); w[62] = hc_byte_perm (w[46], w[45], selector); w[61] = hc_byte_perm (w[45], w[44], selector); w[60] = hc_byte_perm (w[44], w[43], selector); w[59] = hc_byte_perm (w[43], w[42], selector); w[58] = hc_byte_perm (w[42], w[41], selector); w[57] = hc_byte_perm (w[41], w[40], selector); w[56] = hc_byte_perm (w[40], w[39], selector); w[55] = hc_byte_perm (w[39], w[38], selector); w[54] = hc_byte_perm (w[38], w[37], selector); w[53] = hc_byte_perm (w[37], w[36], selector); w[52] = hc_byte_perm (w[36], w[35], selector); w[51] = hc_byte_perm (w[35], w[34], selector); w[50] = hc_byte_perm (w[34], w[33], selector); w[49] = hc_byte_perm (w[33], w[32], selector); w[48] = hc_byte_perm (w[32], w[31], selector); w[47] = hc_byte_perm (w[31], w[30], selector); w[46] = hc_byte_perm (w[30], w[29], selector); w[45] = hc_byte_perm (w[29], w[28], selector); w[44] = hc_byte_perm (w[28], w[27], selector); w[43] = hc_byte_perm (w[27], w[26], selector); w[42] = hc_byte_perm (w[26], w[25], selector); w[41] = hc_byte_perm (w[25], w[24], selector); w[40] = hc_byte_perm (w[24], w[23], selector); w[39] = hc_byte_perm (w[23], w[22], selector); w[38] = hc_byte_perm (w[22], w[21], selector); w[37] = hc_byte_perm (w[21], w[20], selector); w[36] = hc_byte_perm (w[20], w[19], selector); w[35] = hc_byte_perm (w[19], w[18], selector); w[34] = hc_byte_perm (w[18], w[17], selector); w[33] = hc_byte_perm (w[17], w[16], selector); w[32] = hc_byte_perm (w[16], w[15], selector); w[31] = hc_byte_perm (w[15], w[14], selector); w[30] = hc_byte_perm (w[14], w[13], selector); w[29] = hc_byte_perm (w[13], w[12], selector); w[28] = hc_byte_perm (w[12], w[11], selector); w[27] = hc_byte_perm (w[11], w[10], selector); w[26] = hc_byte_perm (w[10], w[ 9], selector); w[25] = hc_byte_perm (w[ 9], w[ 8], selector); w[24] = hc_byte_perm (w[ 8], w[ 7], selector); w[23] = hc_byte_perm (w[ 7], w[ 6], selector); w[22] = hc_byte_perm (w[ 6], w[ 5], selector); w[21] = hc_byte_perm (w[ 5], w[ 4], selector); w[20] = hc_byte_perm (w[ 4], w[ 3], selector); w[19] = hc_byte_perm (w[ 3], w[ 2], selector); w[18] = hc_byte_perm (w[ 2], w[ 1], selector); w[17] = hc_byte_perm (w[ 1], w[ 0], selector); w[16] = hc_byte_perm (w[ 0], 0, selector); w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 17: w[63] = hc_byte_perm (w[46], w[45], selector); w[62] = hc_byte_perm (w[45], w[44], selector); w[61] = hc_byte_perm (w[44], w[43], selector); w[60] = hc_byte_perm (w[43], w[42], selector); w[59] = hc_byte_perm (w[42], w[41], selector); w[58] = hc_byte_perm (w[41], w[40], selector); w[57] = hc_byte_perm (w[40], w[39], selector); w[56] = hc_byte_perm (w[39], w[38], selector); w[55] = hc_byte_perm (w[38], w[37], selector); w[54] = hc_byte_perm (w[37], w[36], selector); w[53] = hc_byte_perm (w[36], w[35], selector); w[52] = hc_byte_perm (w[35], w[34], selector); w[51] = hc_byte_perm (w[34], w[33], selector); w[50] = hc_byte_perm (w[33], w[32], selector); w[49] = hc_byte_perm (w[32], w[31], selector); w[48] = hc_byte_perm (w[31], w[30], selector); w[47] = hc_byte_perm (w[30], w[29], selector); w[46] = hc_byte_perm (w[29], w[28], selector); w[45] = hc_byte_perm (w[28], w[27], selector); w[44] = hc_byte_perm (w[27], w[26], selector); w[43] = hc_byte_perm (w[26], w[25], selector); w[42] = hc_byte_perm (w[25], w[24], selector); w[41] = hc_byte_perm (w[24], w[23], selector); w[40] = hc_byte_perm (w[23], w[22], selector); w[39] = hc_byte_perm (w[22], w[21], selector); w[38] = hc_byte_perm (w[21], w[20], selector); w[37] = hc_byte_perm (w[20], w[19], selector); w[36] = hc_byte_perm (w[19], w[18], selector); w[35] = hc_byte_perm (w[18], w[17], selector); w[34] = hc_byte_perm (w[17], w[16], selector); w[33] = hc_byte_perm (w[16], w[15], selector); w[32] = hc_byte_perm (w[15], w[14], selector); w[31] = hc_byte_perm (w[14], w[13], selector); w[30] = hc_byte_perm (w[13], w[12], selector); w[29] = hc_byte_perm (w[12], w[11], selector); w[28] = hc_byte_perm (w[11], w[10], selector); w[27] = hc_byte_perm (w[10], w[ 9], selector); w[26] = hc_byte_perm (w[ 9], w[ 8], selector); w[25] = hc_byte_perm (w[ 8], w[ 7], selector); w[24] = hc_byte_perm (w[ 7], w[ 6], selector); w[23] = hc_byte_perm (w[ 6], w[ 5], selector); w[22] = hc_byte_perm (w[ 5], w[ 4], selector); w[21] = hc_byte_perm (w[ 4], w[ 3], selector); w[20] = hc_byte_perm (w[ 3], w[ 2], selector); w[19] = hc_byte_perm (w[ 2], w[ 1], selector); w[18] = hc_byte_perm (w[ 1], w[ 0], selector); w[17] = hc_byte_perm (w[ 0], 0, selector); w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 18: w[63] = hc_byte_perm (w[45], w[44], selector); w[62] = hc_byte_perm (w[44], w[43], selector); w[61] = hc_byte_perm (w[43], w[42], selector); w[60] = hc_byte_perm (w[42], w[41], selector); w[59] = hc_byte_perm (w[41], w[40], selector); w[58] = hc_byte_perm (w[40], w[39], selector); w[57] = hc_byte_perm (w[39], w[38], selector); w[56] = hc_byte_perm (w[38], w[37], selector); w[55] = hc_byte_perm (w[37], w[36], selector); w[54] = hc_byte_perm (w[36], w[35], selector); w[53] = hc_byte_perm (w[35], w[34], selector); w[52] = hc_byte_perm (w[34], w[33], selector); w[51] = hc_byte_perm (w[33], w[32], selector); w[50] = hc_byte_perm (w[32], w[31], selector); w[49] = hc_byte_perm (w[31], w[30], selector); w[48] = hc_byte_perm (w[30], w[29], selector); w[47] = hc_byte_perm (w[29], w[28], selector); w[46] = hc_byte_perm (w[28], w[27], selector); w[45] = hc_byte_perm (w[27], w[26], selector); w[44] = hc_byte_perm (w[26], w[25], selector); w[43] = hc_byte_perm (w[25], w[24], selector); w[42] = hc_byte_perm (w[24], w[23], selector); w[41] = hc_byte_perm (w[23], w[22], selector); w[40] = hc_byte_perm (w[22], w[21], selector); w[39] = hc_byte_perm (w[21], w[20], selector); w[38] = hc_byte_perm (w[20], w[19], selector); w[37] = hc_byte_perm (w[19], w[18], selector); w[36] = hc_byte_perm (w[18], w[17], selector); w[35] = hc_byte_perm (w[17], w[16], selector); w[34] = hc_byte_perm (w[16], w[15], selector); w[33] = hc_byte_perm (w[15], w[14], selector); w[32] = hc_byte_perm (w[14], w[13], selector); w[31] = hc_byte_perm (w[13], w[12], selector); w[30] = hc_byte_perm (w[12], w[11], selector); w[29] = hc_byte_perm (w[11], w[10], selector); w[28] = hc_byte_perm (w[10], w[ 9], selector); w[27] = hc_byte_perm (w[ 9], w[ 8], selector); w[26] = hc_byte_perm (w[ 8], w[ 7], selector); w[25] = hc_byte_perm (w[ 7], w[ 6], selector); w[24] = hc_byte_perm (w[ 6], w[ 5], selector); w[23] = hc_byte_perm (w[ 5], w[ 4], selector); w[22] = hc_byte_perm (w[ 4], w[ 3], selector); w[21] = hc_byte_perm (w[ 3], w[ 2], selector); w[20] = hc_byte_perm (w[ 2], w[ 1], selector); w[19] = hc_byte_perm (w[ 1], w[ 0], selector); w[18] = hc_byte_perm (w[ 0], 0, selector); w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 19: w[63] = hc_byte_perm (w[44], w[43], selector); w[62] = hc_byte_perm (w[43], w[42], selector); w[61] = hc_byte_perm (w[42], w[41], selector); w[60] = hc_byte_perm (w[41], w[40], selector); w[59] = hc_byte_perm (w[40], w[39], selector); w[58] = hc_byte_perm (w[39], w[38], selector); w[57] = hc_byte_perm (w[38], w[37], selector); w[56] = hc_byte_perm (w[37], w[36], selector); w[55] = hc_byte_perm (w[36], w[35], selector); w[54] = hc_byte_perm (w[35], w[34], selector); w[53] = hc_byte_perm (w[34], w[33], selector); w[52] = hc_byte_perm (w[33], w[32], selector); w[51] = hc_byte_perm (w[32], w[31], selector); w[50] = hc_byte_perm (w[31], w[30], selector); w[49] = hc_byte_perm (w[30], w[29], selector); w[48] = hc_byte_perm (w[29], w[28], selector); w[47] = hc_byte_perm (w[28], w[27], selector); w[46] = hc_byte_perm (w[27], w[26], selector); w[45] = hc_byte_perm (w[26], w[25], selector); w[44] = hc_byte_perm (w[25], w[24], selector); w[43] = hc_byte_perm (w[24], w[23], selector); w[42] = hc_byte_perm (w[23], w[22], selector); w[41] = hc_byte_perm (w[22], w[21], selector); w[40] = hc_byte_perm (w[21], w[20], selector); w[39] = hc_byte_perm (w[20], w[19], selector); w[38] = hc_byte_perm (w[19], w[18], selector); w[37] = hc_byte_perm (w[18], w[17], selector); w[36] = hc_byte_perm (w[17], w[16], selector); w[35] = hc_byte_perm (w[16], w[15], selector); w[34] = hc_byte_perm (w[15], w[14], selector); w[33] = hc_byte_perm (w[14], w[13], selector); w[32] = hc_byte_perm (w[13], w[12], selector); w[31] = hc_byte_perm (w[12], w[11], selector); w[30] = hc_byte_perm (w[11], w[10], selector); w[29] = hc_byte_perm (w[10], w[ 9], selector); w[28] = hc_byte_perm (w[ 9], w[ 8], selector); w[27] = hc_byte_perm (w[ 8], w[ 7], selector); w[26] = hc_byte_perm (w[ 7], w[ 6], selector); w[25] = hc_byte_perm (w[ 6], w[ 5], selector); w[24] = hc_byte_perm (w[ 5], w[ 4], selector); w[23] = hc_byte_perm (w[ 4], w[ 3], selector); w[22] = hc_byte_perm (w[ 3], w[ 2], selector); w[21] = hc_byte_perm (w[ 2], w[ 1], selector); w[20] = hc_byte_perm (w[ 1], w[ 0], selector); w[19] = hc_byte_perm (w[ 0], 0, selector); w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 20: w[63] = hc_byte_perm (w[43], w[42], selector); w[62] = hc_byte_perm (w[42], w[41], selector); w[61] = hc_byte_perm (w[41], w[40], selector); w[60] = hc_byte_perm (w[40], w[39], selector); w[59] = hc_byte_perm (w[39], w[38], selector); w[58] = hc_byte_perm (w[38], w[37], selector); w[57] = hc_byte_perm (w[37], w[36], selector); w[56] = hc_byte_perm (w[36], w[35], selector); w[55] = hc_byte_perm (w[35], w[34], selector); w[54] = hc_byte_perm (w[34], w[33], selector); w[53] = hc_byte_perm (w[33], w[32], selector); w[52] = hc_byte_perm (w[32], w[31], selector); w[51] = hc_byte_perm (w[31], w[30], selector); w[50] = hc_byte_perm (w[30], w[29], selector); w[49] = hc_byte_perm (w[29], w[28], selector); w[48] = hc_byte_perm (w[28], w[27], selector); w[47] = hc_byte_perm (w[27], w[26], selector); w[46] = hc_byte_perm (w[26], w[25], selector); w[45] = hc_byte_perm (w[25], w[24], selector); w[44] = hc_byte_perm (w[24], w[23], selector); w[43] = hc_byte_perm (w[23], w[22], selector); w[42] = hc_byte_perm (w[22], w[21], selector); w[41] = hc_byte_perm (w[21], w[20], selector); w[40] = hc_byte_perm (w[20], w[19], selector); w[39] = hc_byte_perm (w[19], w[18], selector); w[38] = hc_byte_perm (w[18], w[17], selector); w[37] = hc_byte_perm (w[17], w[16], selector); w[36] = hc_byte_perm (w[16], w[15], selector); w[35] = hc_byte_perm (w[15], w[14], selector); w[34] = hc_byte_perm (w[14], w[13], selector); w[33] = hc_byte_perm (w[13], w[12], selector); w[32] = hc_byte_perm (w[12], w[11], selector); w[31] = hc_byte_perm (w[11], w[10], selector); w[30] = hc_byte_perm (w[10], w[ 9], selector); w[29] = hc_byte_perm (w[ 9], w[ 8], selector); w[28] = hc_byte_perm (w[ 8], w[ 7], selector); w[27] = hc_byte_perm (w[ 7], w[ 6], selector); w[26] = hc_byte_perm (w[ 6], w[ 5], selector); w[25] = hc_byte_perm (w[ 5], w[ 4], selector); w[24] = hc_byte_perm (w[ 4], w[ 3], selector); w[23] = hc_byte_perm (w[ 3], w[ 2], selector); w[22] = hc_byte_perm (w[ 2], w[ 1], selector); w[21] = hc_byte_perm (w[ 1], w[ 0], selector); w[20] = hc_byte_perm (w[ 0], 0, selector); w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 21: w[63] = hc_byte_perm (w[42], w[41], selector); w[62] = hc_byte_perm (w[41], w[40], selector); w[61] = hc_byte_perm (w[40], w[39], selector); w[60] = hc_byte_perm (w[39], w[38], selector); w[59] = hc_byte_perm (w[38], w[37], selector); w[58] = hc_byte_perm (w[37], w[36], selector); w[57] = hc_byte_perm (w[36], w[35], selector); w[56] = hc_byte_perm (w[35], w[34], selector); w[55] = hc_byte_perm (w[34], w[33], selector); w[54] = hc_byte_perm (w[33], w[32], selector); w[53] = hc_byte_perm (w[32], w[31], selector); w[52] = hc_byte_perm (w[31], w[30], selector); w[51] = hc_byte_perm (w[30], w[29], selector); w[50] = hc_byte_perm (w[29], w[28], selector); w[49] = hc_byte_perm (w[28], w[27], selector); w[48] = hc_byte_perm (w[27], w[26], selector); w[47] = hc_byte_perm (w[26], w[25], selector); w[46] = hc_byte_perm (w[25], w[24], selector); w[45] = hc_byte_perm (w[24], w[23], selector); w[44] = hc_byte_perm (w[23], w[22], selector); w[43] = hc_byte_perm (w[22], w[21], selector); w[42] = hc_byte_perm (w[21], w[20], selector); w[41] = hc_byte_perm (w[20], w[19], selector); w[40] = hc_byte_perm (w[19], w[18], selector); w[39] = hc_byte_perm (w[18], w[17], selector); w[38] = hc_byte_perm (w[17], w[16], selector); w[37] = hc_byte_perm (w[16], w[15], selector); w[36] = hc_byte_perm (w[15], w[14], selector); w[35] = hc_byte_perm (w[14], w[13], selector); w[34] = hc_byte_perm (w[13], w[12], selector); w[33] = hc_byte_perm (w[12], w[11], selector); w[32] = hc_byte_perm (w[11], w[10], selector); w[31] = hc_byte_perm (w[10], w[ 9], selector); w[30] = hc_byte_perm (w[ 9], w[ 8], selector); w[29] = hc_byte_perm (w[ 8], w[ 7], selector); w[28] = hc_byte_perm (w[ 7], w[ 6], selector); w[27] = hc_byte_perm (w[ 6], w[ 5], selector); w[26] = hc_byte_perm (w[ 5], w[ 4], selector); w[25] = hc_byte_perm (w[ 4], w[ 3], selector); w[24] = hc_byte_perm (w[ 3], w[ 2], selector); w[23] = hc_byte_perm (w[ 2], w[ 1], selector); w[22] = hc_byte_perm (w[ 1], w[ 0], selector); w[21] = hc_byte_perm (w[ 0], 0, selector); w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 22: w[63] = hc_byte_perm (w[41], w[40], selector); w[62] = hc_byte_perm (w[40], w[39], selector); w[61] = hc_byte_perm (w[39], w[38], selector); w[60] = hc_byte_perm (w[38], w[37], selector); w[59] = hc_byte_perm (w[37], w[36], selector); w[58] = hc_byte_perm (w[36], w[35], selector); w[57] = hc_byte_perm (w[35], w[34], selector); w[56] = hc_byte_perm (w[34], w[33], selector); w[55] = hc_byte_perm (w[33], w[32], selector); w[54] = hc_byte_perm (w[32], w[31], selector); w[53] = hc_byte_perm (w[31], w[30], selector); w[52] = hc_byte_perm (w[30], w[29], selector); w[51] = hc_byte_perm (w[29], w[28], selector); w[50] = hc_byte_perm (w[28], w[27], selector); w[49] = hc_byte_perm (w[27], w[26], selector); w[48] = hc_byte_perm (w[26], w[25], selector); w[47] = hc_byte_perm (w[25], w[24], selector); w[46] = hc_byte_perm (w[24], w[23], selector); w[45] = hc_byte_perm (w[23], w[22], selector); w[44] = hc_byte_perm (w[22], w[21], selector); w[43] = hc_byte_perm (w[21], w[20], selector); w[42] = hc_byte_perm (w[20], w[19], selector); w[41] = hc_byte_perm (w[19], w[18], selector); w[40] = hc_byte_perm (w[18], w[17], selector); w[39] = hc_byte_perm (w[17], w[16], selector); w[38] = hc_byte_perm (w[16], w[15], selector); w[37] = hc_byte_perm (w[15], w[14], selector); w[36] = hc_byte_perm (w[14], w[13], selector); w[35] = hc_byte_perm (w[13], w[12], selector); w[34] = hc_byte_perm (w[12], w[11], selector); w[33] = hc_byte_perm (w[11], w[10], selector); w[32] = hc_byte_perm (w[10], w[ 9], selector); w[31] = hc_byte_perm (w[ 9], w[ 8], selector); w[30] = hc_byte_perm (w[ 8], w[ 7], selector); w[29] = hc_byte_perm (w[ 7], w[ 6], selector); w[28] = hc_byte_perm (w[ 6], w[ 5], selector); w[27] = hc_byte_perm (w[ 5], w[ 4], selector); w[26] = hc_byte_perm (w[ 4], w[ 3], selector); w[25] = hc_byte_perm (w[ 3], w[ 2], selector); w[24] = hc_byte_perm (w[ 2], w[ 1], selector); w[23] = hc_byte_perm (w[ 1], w[ 0], selector); w[22] = hc_byte_perm (w[ 0], 0, selector); w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 23: w[63] = hc_byte_perm (w[40], w[39], selector); w[62] = hc_byte_perm (w[39], w[38], selector); w[61] = hc_byte_perm (w[38], w[37], selector); w[60] = hc_byte_perm (w[37], w[36], selector); w[59] = hc_byte_perm (w[36], w[35], selector); w[58] = hc_byte_perm (w[35], w[34], selector); w[57] = hc_byte_perm (w[34], w[33], selector); w[56] = hc_byte_perm (w[33], w[32], selector); w[55] = hc_byte_perm (w[32], w[31], selector); w[54] = hc_byte_perm (w[31], w[30], selector); w[53] = hc_byte_perm (w[30], w[29], selector); w[52] = hc_byte_perm (w[29], w[28], selector); w[51] = hc_byte_perm (w[28], w[27], selector); w[50] = hc_byte_perm (w[27], w[26], selector); w[49] = hc_byte_perm (w[26], w[25], selector); w[48] = hc_byte_perm (w[25], w[24], selector); w[47] = hc_byte_perm (w[24], w[23], selector); w[46] = hc_byte_perm (w[23], w[22], selector); w[45] = hc_byte_perm (w[22], w[21], selector); w[44] = hc_byte_perm (w[21], w[20], selector); w[43] = hc_byte_perm (w[20], w[19], selector); w[42] = hc_byte_perm (w[19], w[18], selector); w[41] = hc_byte_perm (w[18], w[17], selector); w[40] = hc_byte_perm (w[17], w[16], selector); w[39] = hc_byte_perm (w[16], w[15], selector); w[38] = hc_byte_perm (w[15], w[14], selector); w[37] = hc_byte_perm (w[14], w[13], selector); w[36] = hc_byte_perm (w[13], w[12], selector); w[35] = hc_byte_perm (w[12], w[11], selector); w[34] = hc_byte_perm (w[11], w[10], selector); w[33] = hc_byte_perm (w[10], w[ 9], selector); w[32] = hc_byte_perm (w[ 9], w[ 8], selector); w[31] = hc_byte_perm (w[ 8], w[ 7], selector); w[30] = hc_byte_perm (w[ 7], w[ 6], selector); w[29] = hc_byte_perm (w[ 6], w[ 5], selector); w[28] = hc_byte_perm (w[ 5], w[ 4], selector); w[27] = hc_byte_perm (w[ 4], w[ 3], selector); w[26] = hc_byte_perm (w[ 3], w[ 2], selector); w[25] = hc_byte_perm (w[ 2], w[ 1], selector); w[24] = hc_byte_perm (w[ 1], w[ 0], selector); w[23] = hc_byte_perm (w[ 0], 0, selector); w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 24: w[63] = hc_byte_perm (w[39], w[38], selector); w[62] = hc_byte_perm (w[38], w[37], selector); w[61] = hc_byte_perm (w[37], w[36], selector); w[60] = hc_byte_perm (w[36], w[35], selector); w[59] = hc_byte_perm (w[35], w[34], selector); w[58] = hc_byte_perm (w[34], w[33], selector); w[57] = hc_byte_perm (w[33], w[32], selector); w[56] = hc_byte_perm (w[32], w[31], selector); w[55] = hc_byte_perm (w[31], w[30], selector); w[54] = hc_byte_perm (w[30], w[29], selector); w[53] = hc_byte_perm (w[29], w[28], selector); w[52] = hc_byte_perm (w[28], w[27], selector); w[51] = hc_byte_perm (w[27], w[26], selector); w[50] = hc_byte_perm (w[26], w[25], selector); w[49] = hc_byte_perm (w[25], w[24], selector); w[48] = hc_byte_perm (w[24], w[23], selector); w[47] = hc_byte_perm (w[23], w[22], selector); w[46] = hc_byte_perm (w[22], w[21], selector); w[45] = hc_byte_perm (w[21], w[20], selector); w[44] = hc_byte_perm (w[20], w[19], selector); w[43] = hc_byte_perm (w[19], w[18], selector); w[42] = hc_byte_perm (w[18], w[17], selector); w[41] = hc_byte_perm (w[17], w[16], selector); w[40] = hc_byte_perm (w[16], w[15], selector); w[39] = hc_byte_perm (w[15], w[14], selector); w[38] = hc_byte_perm (w[14], w[13], selector); w[37] = hc_byte_perm (w[13], w[12], selector); w[36] = hc_byte_perm (w[12], w[11], selector); w[35] = hc_byte_perm (w[11], w[10], selector); w[34] = hc_byte_perm (w[10], w[ 9], selector); w[33] = hc_byte_perm (w[ 9], w[ 8], selector); w[32] = hc_byte_perm (w[ 8], w[ 7], selector); w[31] = hc_byte_perm (w[ 7], w[ 6], selector); w[30] = hc_byte_perm (w[ 6], w[ 5], selector); w[29] = hc_byte_perm (w[ 5], w[ 4], selector); w[28] = hc_byte_perm (w[ 4], w[ 3], selector); w[27] = hc_byte_perm (w[ 3], w[ 2], selector); w[26] = hc_byte_perm (w[ 2], w[ 1], selector); w[25] = hc_byte_perm (w[ 1], w[ 0], selector); w[24] = hc_byte_perm (w[ 0], 0, selector); w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 25: w[63] = hc_byte_perm (w[38], w[37], selector); w[62] = hc_byte_perm (w[37], w[36], selector); w[61] = hc_byte_perm (w[36], w[35], selector); w[60] = hc_byte_perm (w[35], w[34], selector); w[59] = hc_byte_perm (w[34], w[33], selector); w[58] = hc_byte_perm (w[33], w[32], selector); w[57] = hc_byte_perm (w[32], w[31], selector); w[56] = hc_byte_perm (w[31], w[30], selector); w[55] = hc_byte_perm (w[30], w[29], selector); w[54] = hc_byte_perm (w[29], w[28], selector); w[53] = hc_byte_perm (w[28], w[27], selector); w[52] = hc_byte_perm (w[27], w[26], selector); w[51] = hc_byte_perm (w[26], w[25], selector); w[50] = hc_byte_perm (w[25], w[24], selector); w[49] = hc_byte_perm (w[24], w[23], selector); w[48] = hc_byte_perm (w[23], w[22], selector); w[47] = hc_byte_perm (w[22], w[21], selector); w[46] = hc_byte_perm (w[21], w[20], selector); w[45] = hc_byte_perm (w[20], w[19], selector); w[44] = hc_byte_perm (w[19], w[18], selector); w[43] = hc_byte_perm (w[18], w[17], selector); w[42] = hc_byte_perm (w[17], w[16], selector); w[41] = hc_byte_perm (w[16], w[15], selector); w[40] = hc_byte_perm (w[15], w[14], selector); w[39] = hc_byte_perm (w[14], w[13], selector); w[38] = hc_byte_perm (w[13], w[12], selector); w[37] = hc_byte_perm (w[12], w[11], selector); w[36] = hc_byte_perm (w[11], w[10], selector); w[35] = hc_byte_perm (w[10], w[ 9], selector); w[34] = hc_byte_perm (w[ 9], w[ 8], selector); w[33] = hc_byte_perm (w[ 8], w[ 7], selector); w[32] = hc_byte_perm (w[ 7], w[ 6], selector); w[31] = hc_byte_perm (w[ 6], w[ 5], selector); w[30] = hc_byte_perm (w[ 5], w[ 4], selector); w[29] = hc_byte_perm (w[ 4], w[ 3], selector); w[28] = hc_byte_perm (w[ 3], w[ 2], selector); w[27] = hc_byte_perm (w[ 2], w[ 1], selector); w[26] = hc_byte_perm (w[ 1], w[ 0], selector); w[25] = hc_byte_perm (w[ 0], 0, selector); w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 26: w[63] = hc_byte_perm (w[37], w[36], selector); w[62] = hc_byte_perm (w[36], w[35], selector); w[61] = hc_byte_perm (w[35], w[34], selector); w[60] = hc_byte_perm (w[34], w[33], selector); w[59] = hc_byte_perm (w[33], w[32], selector); w[58] = hc_byte_perm (w[32], w[31], selector); w[57] = hc_byte_perm (w[31], w[30], selector); w[56] = hc_byte_perm (w[30], w[29], selector); w[55] = hc_byte_perm (w[29], w[28], selector); w[54] = hc_byte_perm (w[28], w[27], selector); w[53] = hc_byte_perm (w[27], w[26], selector); w[52] = hc_byte_perm (w[26], w[25], selector); w[51] = hc_byte_perm (w[25], w[24], selector); w[50] = hc_byte_perm (w[24], w[23], selector); w[49] = hc_byte_perm (w[23], w[22], selector); w[48] = hc_byte_perm (w[22], w[21], selector); w[47] = hc_byte_perm (w[21], w[20], selector); w[46] = hc_byte_perm (w[20], w[19], selector); w[45] = hc_byte_perm (w[19], w[18], selector); w[44] = hc_byte_perm (w[18], w[17], selector); w[43] = hc_byte_perm (w[17], w[16], selector); w[42] = hc_byte_perm (w[16], w[15], selector); w[41] = hc_byte_perm (w[15], w[14], selector); w[40] = hc_byte_perm (w[14], w[13], selector); w[39] = hc_byte_perm (w[13], w[12], selector); w[38] = hc_byte_perm (w[12], w[11], selector); w[37] = hc_byte_perm (w[11], w[10], selector); w[36] = hc_byte_perm (w[10], w[ 9], selector); w[35] = hc_byte_perm (w[ 9], w[ 8], selector); w[34] = hc_byte_perm (w[ 8], w[ 7], selector); w[33] = hc_byte_perm (w[ 7], w[ 6], selector); w[32] = hc_byte_perm (w[ 6], w[ 5], selector); w[31] = hc_byte_perm (w[ 5], w[ 4], selector); w[30] = hc_byte_perm (w[ 4], w[ 3], selector); w[29] = hc_byte_perm (w[ 3], w[ 2], selector); w[28] = hc_byte_perm (w[ 2], w[ 1], selector); w[27] = hc_byte_perm (w[ 1], w[ 0], selector); w[26] = hc_byte_perm (w[ 0], 0, selector); w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 27: w[63] = hc_byte_perm (w[36], w[35], selector); w[62] = hc_byte_perm (w[35], w[34], selector); w[61] = hc_byte_perm (w[34], w[33], selector); w[60] = hc_byte_perm (w[33], w[32], selector); w[59] = hc_byte_perm (w[32], w[31], selector); w[58] = hc_byte_perm (w[31], w[30], selector); w[57] = hc_byte_perm (w[30], w[29], selector); w[56] = hc_byte_perm (w[29], w[28], selector); w[55] = hc_byte_perm (w[28], w[27], selector); w[54] = hc_byte_perm (w[27], w[26], selector); w[53] = hc_byte_perm (w[26], w[25], selector); w[52] = hc_byte_perm (w[25], w[24], selector); w[51] = hc_byte_perm (w[24], w[23], selector); w[50] = hc_byte_perm (w[23], w[22], selector); w[49] = hc_byte_perm (w[22], w[21], selector); w[48] = hc_byte_perm (w[21], w[20], selector); w[47] = hc_byte_perm (w[20], w[19], selector); w[46] = hc_byte_perm (w[19], w[18], selector); w[45] = hc_byte_perm (w[18], w[17], selector); w[44] = hc_byte_perm (w[17], w[16], selector); w[43] = hc_byte_perm (w[16], w[15], selector); w[42] = hc_byte_perm (w[15], w[14], selector); w[41] = hc_byte_perm (w[14], w[13], selector); w[40] = hc_byte_perm (w[13], w[12], selector); w[39] = hc_byte_perm (w[12], w[11], selector); w[38] = hc_byte_perm (w[11], w[10], selector); w[37] = hc_byte_perm (w[10], w[ 9], selector); w[36] = hc_byte_perm (w[ 9], w[ 8], selector); w[35] = hc_byte_perm (w[ 8], w[ 7], selector); w[34] = hc_byte_perm (w[ 7], w[ 6], selector); w[33] = hc_byte_perm (w[ 6], w[ 5], selector); w[32] = hc_byte_perm (w[ 5], w[ 4], selector); w[31] = hc_byte_perm (w[ 4], w[ 3], selector); w[30] = hc_byte_perm (w[ 3], w[ 2], selector); w[29] = hc_byte_perm (w[ 2], w[ 1], selector); w[28] = hc_byte_perm (w[ 1], w[ 0], selector); w[27] = hc_byte_perm (w[ 0], 0, selector); w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 28: w[63] = hc_byte_perm (w[35], w[34], selector); w[62] = hc_byte_perm (w[34], w[33], selector); w[61] = hc_byte_perm (w[33], w[32], selector); w[60] = hc_byte_perm (w[32], w[31], selector); w[59] = hc_byte_perm (w[31], w[30], selector); w[58] = hc_byte_perm (w[30], w[29], selector); w[57] = hc_byte_perm (w[29], w[28], selector); w[56] = hc_byte_perm (w[28], w[27], selector); w[55] = hc_byte_perm (w[27], w[26], selector); w[54] = hc_byte_perm (w[26], w[25], selector); w[53] = hc_byte_perm (w[25], w[24], selector); w[52] = hc_byte_perm (w[24], w[23], selector); w[51] = hc_byte_perm (w[23], w[22], selector); w[50] = hc_byte_perm (w[22], w[21], selector); w[49] = hc_byte_perm (w[21], w[20], selector); w[48] = hc_byte_perm (w[20], w[19], selector); w[47] = hc_byte_perm (w[19], w[18], selector); w[46] = hc_byte_perm (w[18], w[17], selector); w[45] = hc_byte_perm (w[17], w[16], selector); w[44] = hc_byte_perm (w[16], w[15], selector); w[43] = hc_byte_perm (w[15], w[14], selector); w[42] = hc_byte_perm (w[14], w[13], selector); w[41] = hc_byte_perm (w[13], w[12], selector); w[40] = hc_byte_perm (w[12], w[11], selector); w[39] = hc_byte_perm (w[11], w[10], selector); w[38] = hc_byte_perm (w[10], w[ 9], selector); w[37] = hc_byte_perm (w[ 9], w[ 8], selector); w[36] = hc_byte_perm (w[ 8], w[ 7], selector); w[35] = hc_byte_perm (w[ 7], w[ 6], selector); w[34] = hc_byte_perm (w[ 6], w[ 5], selector); w[33] = hc_byte_perm (w[ 5], w[ 4], selector); w[32] = hc_byte_perm (w[ 4], w[ 3], selector); w[31] = hc_byte_perm (w[ 3], w[ 2], selector); w[30] = hc_byte_perm (w[ 2], w[ 1], selector); w[29] = hc_byte_perm (w[ 1], w[ 0], selector); w[28] = hc_byte_perm (w[ 0], 0, selector); w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 29: w[63] = hc_byte_perm (w[34], w[33], selector); w[62] = hc_byte_perm (w[33], w[32], selector); w[61] = hc_byte_perm (w[32], w[31], selector); w[60] = hc_byte_perm (w[31], w[30], selector); w[59] = hc_byte_perm (w[30], w[29], selector); w[58] = hc_byte_perm (w[29], w[28], selector); w[57] = hc_byte_perm (w[28], w[27], selector); w[56] = hc_byte_perm (w[27], w[26], selector); w[55] = hc_byte_perm (w[26], w[25], selector); w[54] = hc_byte_perm (w[25], w[24], selector); w[53] = hc_byte_perm (w[24], w[23], selector); w[52] = hc_byte_perm (w[23], w[22], selector); w[51] = hc_byte_perm (w[22], w[21], selector); w[50] = hc_byte_perm (w[21], w[20], selector); w[49] = hc_byte_perm (w[20], w[19], selector); w[48] = hc_byte_perm (w[19], w[18], selector); w[47] = hc_byte_perm (w[18], w[17], selector); w[46] = hc_byte_perm (w[17], w[16], selector); w[45] = hc_byte_perm (w[16], w[15], selector); w[44] = hc_byte_perm (w[15], w[14], selector); w[43] = hc_byte_perm (w[14], w[13], selector); w[42] = hc_byte_perm (w[13], w[12], selector); w[41] = hc_byte_perm (w[12], w[11], selector); w[40] = hc_byte_perm (w[11], w[10], selector); w[39] = hc_byte_perm (w[10], w[ 9], selector); w[38] = hc_byte_perm (w[ 9], w[ 8], selector); w[37] = hc_byte_perm (w[ 8], w[ 7], selector); w[36] = hc_byte_perm (w[ 7], w[ 6], selector); w[35] = hc_byte_perm (w[ 6], w[ 5], selector); w[34] = hc_byte_perm (w[ 5], w[ 4], selector); w[33] = hc_byte_perm (w[ 4], w[ 3], selector); w[32] = hc_byte_perm (w[ 3], w[ 2], selector); w[31] = hc_byte_perm (w[ 2], w[ 1], selector); w[30] = hc_byte_perm (w[ 1], w[ 0], selector); w[29] = hc_byte_perm (w[ 0], 0, selector); w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 30: w[63] = hc_byte_perm (w[33], w[32], selector); w[62] = hc_byte_perm (w[32], w[31], selector); w[61] = hc_byte_perm (w[31], w[30], selector); w[60] = hc_byte_perm (w[30], w[29], selector); w[59] = hc_byte_perm (w[29], w[28], selector); w[58] = hc_byte_perm (w[28], w[27], selector); w[57] = hc_byte_perm (w[27], w[26], selector); w[56] = hc_byte_perm (w[26], w[25], selector); w[55] = hc_byte_perm (w[25], w[24], selector); w[54] = hc_byte_perm (w[24], w[23], selector); w[53] = hc_byte_perm (w[23], w[22], selector); w[52] = hc_byte_perm (w[22], w[21], selector); w[51] = hc_byte_perm (w[21], w[20], selector); w[50] = hc_byte_perm (w[20], w[19], selector); w[49] = hc_byte_perm (w[19], w[18], selector); w[48] = hc_byte_perm (w[18], w[17], selector); w[47] = hc_byte_perm (w[17], w[16], selector); w[46] = hc_byte_perm (w[16], w[15], selector); w[45] = hc_byte_perm (w[15], w[14], selector); w[44] = hc_byte_perm (w[14], w[13], selector); w[43] = hc_byte_perm (w[13], w[12], selector); w[42] = hc_byte_perm (w[12], w[11], selector); w[41] = hc_byte_perm (w[11], w[10], selector); w[40] = hc_byte_perm (w[10], w[ 9], selector); w[39] = hc_byte_perm (w[ 9], w[ 8], selector); w[38] = hc_byte_perm (w[ 8], w[ 7], selector); w[37] = hc_byte_perm (w[ 7], w[ 6], selector); w[36] = hc_byte_perm (w[ 6], w[ 5], selector); w[35] = hc_byte_perm (w[ 5], w[ 4], selector); w[34] = hc_byte_perm (w[ 4], w[ 3], selector); w[33] = hc_byte_perm (w[ 3], w[ 2], selector); w[32] = hc_byte_perm (w[ 2], w[ 1], selector); w[31] = hc_byte_perm (w[ 1], w[ 0], selector); w[30] = hc_byte_perm (w[ 0], 0, selector); w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 31: w[63] = hc_byte_perm (w[32], w[31], selector); w[62] = hc_byte_perm (w[31], w[30], selector); w[61] = hc_byte_perm (w[30], w[29], selector); w[60] = hc_byte_perm (w[29], w[28], selector); w[59] = hc_byte_perm (w[28], w[27], selector); w[58] = hc_byte_perm (w[27], w[26], selector); w[57] = hc_byte_perm (w[26], w[25], selector); w[56] = hc_byte_perm (w[25], w[24], selector); w[55] = hc_byte_perm (w[24], w[23], selector); w[54] = hc_byte_perm (w[23], w[22], selector); w[53] = hc_byte_perm (w[22], w[21], selector); w[52] = hc_byte_perm (w[21], w[20], selector); w[51] = hc_byte_perm (w[20], w[19], selector); w[50] = hc_byte_perm (w[19], w[18], selector); w[49] = hc_byte_perm (w[18], w[17], selector); w[48] = hc_byte_perm (w[17], w[16], selector); w[47] = hc_byte_perm (w[16], w[15], selector); w[46] = hc_byte_perm (w[15], w[14], selector); w[45] = hc_byte_perm (w[14], w[13], selector); w[44] = hc_byte_perm (w[13], w[12], selector); w[43] = hc_byte_perm (w[12], w[11], selector); w[42] = hc_byte_perm (w[11], w[10], selector); w[41] = hc_byte_perm (w[10], w[ 9], selector); w[40] = hc_byte_perm (w[ 9], w[ 8], selector); w[39] = hc_byte_perm (w[ 8], w[ 7], selector); w[38] = hc_byte_perm (w[ 7], w[ 6], selector); w[37] = hc_byte_perm (w[ 6], w[ 5], selector); w[36] = hc_byte_perm (w[ 5], w[ 4], selector); w[35] = hc_byte_perm (w[ 4], w[ 3], selector); w[34] = hc_byte_perm (w[ 3], w[ 2], selector); w[33] = hc_byte_perm (w[ 2], w[ 1], selector); w[32] = hc_byte_perm (w[ 1], w[ 0], selector); w[31] = hc_byte_perm (w[ 0], 0, selector); w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 32: w[63] = hc_byte_perm (w[31], w[30], selector); w[62] = hc_byte_perm (w[30], w[29], selector); w[61] = hc_byte_perm (w[29], w[28], selector); w[60] = hc_byte_perm (w[28], w[27], selector); w[59] = hc_byte_perm (w[27], w[26], selector); w[58] = hc_byte_perm (w[26], w[25], selector); w[57] = hc_byte_perm (w[25], w[24], selector); w[56] = hc_byte_perm (w[24], w[23], selector); w[55] = hc_byte_perm (w[23], w[22], selector); w[54] = hc_byte_perm (w[22], w[21], selector); w[53] = hc_byte_perm (w[21], w[20], selector); w[52] = hc_byte_perm (w[20], w[19], selector); w[51] = hc_byte_perm (w[19], w[18], selector); w[50] = hc_byte_perm (w[18], w[17], selector); w[49] = hc_byte_perm (w[17], w[16], selector); w[48] = hc_byte_perm (w[16], w[15], selector); w[47] = hc_byte_perm (w[15], w[14], selector); w[46] = hc_byte_perm (w[14], w[13], selector); w[45] = hc_byte_perm (w[13], w[12], selector); w[44] = hc_byte_perm (w[12], w[11], selector); w[43] = hc_byte_perm (w[11], w[10], selector); w[42] = hc_byte_perm (w[10], w[ 9], selector); w[41] = hc_byte_perm (w[ 9], w[ 8], selector); w[40] = hc_byte_perm (w[ 8], w[ 7], selector); w[39] = hc_byte_perm (w[ 7], w[ 6], selector); w[38] = hc_byte_perm (w[ 6], w[ 5], selector); w[37] = hc_byte_perm (w[ 5], w[ 4], selector); w[36] = hc_byte_perm (w[ 4], w[ 3], selector); w[35] = hc_byte_perm (w[ 3], w[ 2], selector); w[34] = hc_byte_perm (w[ 2], w[ 1], selector); w[33] = hc_byte_perm (w[ 1], w[ 0], selector); w[32] = hc_byte_perm (w[ 0], 0, selector); w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 33: w[63] = hc_byte_perm (w[30], w[29], selector); w[62] = hc_byte_perm (w[29], w[28], selector); w[61] = hc_byte_perm (w[28], w[27], selector); w[60] = hc_byte_perm (w[27], w[26], selector); w[59] = hc_byte_perm (w[26], w[25], selector); w[58] = hc_byte_perm (w[25], w[24], selector); w[57] = hc_byte_perm (w[24], w[23], selector); w[56] = hc_byte_perm (w[23], w[22], selector); w[55] = hc_byte_perm (w[22], w[21], selector); w[54] = hc_byte_perm (w[21], w[20], selector); w[53] = hc_byte_perm (w[20], w[19], selector); w[52] = hc_byte_perm (w[19], w[18], selector); w[51] = hc_byte_perm (w[18], w[17], selector); w[50] = hc_byte_perm (w[17], w[16], selector); w[49] = hc_byte_perm (w[16], w[15], selector); w[48] = hc_byte_perm (w[15], w[14], selector); w[47] = hc_byte_perm (w[14], w[13], selector); w[46] = hc_byte_perm (w[13], w[12], selector); w[45] = hc_byte_perm (w[12], w[11], selector); w[44] = hc_byte_perm (w[11], w[10], selector); w[43] = hc_byte_perm (w[10], w[ 9], selector); w[42] = hc_byte_perm (w[ 9], w[ 8], selector); w[41] = hc_byte_perm (w[ 8], w[ 7], selector); w[40] = hc_byte_perm (w[ 7], w[ 6], selector); w[39] = hc_byte_perm (w[ 6], w[ 5], selector); w[38] = hc_byte_perm (w[ 5], w[ 4], selector); w[37] = hc_byte_perm (w[ 4], w[ 3], selector); w[36] = hc_byte_perm (w[ 3], w[ 2], selector); w[35] = hc_byte_perm (w[ 2], w[ 1], selector); w[34] = hc_byte_perm (w[ 1], w[ 0], selector); w[33] = hc_byte_perm (w[ 0], 0, selector); w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 34: w[63] = hc_byte_perm (w[29], w[28], selector); w[62] = hc_byte_perm (w[28], w[27], selector); w[61] = hc_byte_perm (w[27], w[26], selector); w[60] = hc_byte_perm (w[26], w[25], selector); w[59] = hc_byte_perm (w[25], w[24], selector); w[58] = hc_byte_perm (w[24], w[23], selector); w[57] = hc_byte_perm (w[23], w[22], selector); w[56] = hc_byte_perm (w[22], w[21], selector); w[55] = hc_byte_perm (w[21], w[20], selector); w[54] = hc_byte_perm (w[20], w[19], selector); w[53] = hc_byte_perm (w[19], w[18], selector); w[52] = hc_byte_perm (w[18], w[17], selector); w[51] = hc_byte_perm (w[17], w[16], selector); w[50] = hc_byte_perm (w[16], w[15], selector); w[49] = hc_byte_perm (w[15], w[14], selector); w[48] = hc_byte_perm (w[14], w[13], selector); w[47] = hc_byte_perm (w[13], w[12], selector); w[46] = hc_byte_perm (w[12], w[11], selector); w[45] = hc_byte_perm (w[11], w[10], selector); w[44] = hc_byte_perm (w[10], w[ 9], selector); w[43] = hc_byte_perm (w[ 9], w[ 8], selector); w[42] = hc_byte_perm (w[ 8], w[ 7], selector); w[41] = hc_byte_perm (w[ 7], w[ 6], selector); w[40] = hc_byte_perm (w[ 6], w[ 5], selector); w[39] = hc_byte_perm (w[ 5], w[ 4], selector); w[38] = hc_byte_perm (w[ 4], w[ 3], selector); w[37] = hc_byte_perm (w[ 3], w[ 2], selector); w[36] = hc_byte_perm (w[ 2], w[ 1], selector); w[35] = hc_byte_perm (w[ 1], w[ 0], selector); w[34] = hc_byte_perm (w[ 0], 0, selector); w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 35: w[63] = hc_byte_perm (w[28], w[27], selector); w[62] = hc_byte_perm (w[27], w[26], selector); w[61] = hc_byte_perm (w[26], w[25], selector); w[60] = hc_byte_perm (w[25], w[24], selector); w[59] = hc_byte_perm (w[24], w[23], selector); w[58] = hc_byte_perm (w[23], w[22], selector); w[57] = hc_byte_perm (w[22], w[21], selector); w[56] = hc_byte_perm (w[21], w[20], selector); w[55] = hc_byte_perm (w[20], w[19], selector); w[54] = hc_byte_perm (w[19], w[18], selector); w[53] = hc_byte_perm (w[18], w[17], selector); w[52] = hc_byte_perm (w[17], w[16], selector); w[51] = hc_byte_perm (w[16], w[15], selector); w[50] = hc_byte_perm (w[15], w[14], selector); w[49] = hc_byte_perm (w[14], w[13], selector); w[48] = hc_byte_perm (w[13], w[12], selector); w[47] = hc_byte_perm (w[12], w[11], selector); w[46] = hc_byte_perm (w[11], w[10], selector); w[45] = hc_byte_perm (w[10], w[ 9], selector); w[44] = hc_byte_perm (w[ 9], w[ 8], selector); w[43] = hc_byte_perm (w[ 8], w[ 7], selector); w[42] = hc_byte_perm (w[ 7], w[ 6], selector); w[41] = hc_byte_perm (w[ 6], w[ 5], selector); w[40] = hc_byte_perm (w[ 5], w[ 4], selector); w[39] = hc_byte_perm (w[ 4], w[ 3], selector); w[38] = hc_byte_perm (w[ 3], w[ 2], selector); w[37] = hc_byte_perm (w[ 2], w[ 1], selector); w[36] = hc_byte_perm (w[ 1], w[ 0], selector); w[35] = hc_byte_perm (w[ 0], 0, selector); w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 36: w[63] = hc_byte_perm (w[27], w[26], selector); w[62] = hc_byte_perm (w[26], w[25], selector); w[61] = hc_byte_perm (w[25], w[24], selector); w[60] = hc_byte_perm (w[24], w[23], selector); w[59] = hc_byte_perm (w[23], w[22], selector); w[58] = hc_byte_perm (w[22], w[21], selector); w[57] = hc_byte_perm (w[21], w[20], selector); w[56] = hc_byte_perm (w[20], w[19], selector); w[55] = hc_byte_perm (w[19], w[18], selector); w[54] = hc_byte_perm (w[18], w[17], selector); w[53] = hc_byte_perm (w[17], w[16], selector); w[52] = hc_byte_perm (w[16], w[15], selector); w[51] = hc_byte_perm (w[15], w[14], selector); w[50] = hc_byte_perm (w[14], w[13], selector); w[49] = hc_byte_perm (w[13], w[12], selector); w[48] = hc_byte_perm (w[12], w[11], selector); w[47] = hc_byte_perm (w[11], w[10], selector); w[46] = hc_byte_perm (w[10], w[ 9], selector); w[45] = hc_byte_perm (w[ 9], w[ 8], selector); w[44] = hc_byte_perm (w[ 8], w[ 7], selector); w[43] = hc_byte_perm (w[ 7], w[ 6], selector); w[42] = hc_byte_perm (w[ 6], w[ 5], selector); w[41] = hc_byte_perm (w[ 5], w[ 4], selector); w[40] = hc_byte_perm (w[ 4], w[ 3], selector); w[39] = hc_byte_perm (w[ 3], w[ 2], selector); w[38] = hc_byte_perm (w[ 2], w[ 1], selector); w[37] = hc_byte_perm (w[ 1], w[ 0], selector); w[36] = hc_byte_perm (w[ 0], 0, selector); w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 37: w[63] = hc_byte_perm (w[26], w[25], selector); w[62] = hc_byte_perm (w[25], w[24], selector); w[61] = hc_byte_perm (w[24], w[23], selector); w[60] = hc_byte_perm (w[23], w[22], selector); w[59] = hc_byte_perm (w[22], w[21], selector); w[58] = hc_byte_perm (w[21], w[20], selector); w[57] = hc_byte_perm (w[20], w[19], selector); w[56] = hc_byte_perm (w[19], w[18], selector); w[55] = hc_byte_perm (w[18], w[17], selector); w[54] = hc_byte_perm (w[17], w[16], selector); w[53] = hc_byte_perm (w[16], w[15], selector); w[52] = hc_byte_perm (w[15], w[14], selector); w[51] = hc_byte_perm (w[14], w[13], selector); w[50] = hc_byte_perm (w[13], w[12], selector); w[49] = hc_byte_perm (w[12], w[11], selector); w[48] = hc_byte_perm (w[11], w[10], selector); w[47] = hc_byte_perm (w[10], w[ 9], selector); w[46] = hc_byte_perm (w[ 9], w[ 8], selector); w[45] = hc_byte_perm (w[ 8], w[ 7], selector); w[44] = hc_byte_perm (w[ 7], w[ 6], selector); w[43] = hc_byte_perm (w[ 6], w[ 5], selector); w[42] = hc_byte_perm (w[ 5], w[ 4], selector); w[41] = hc_byte_perm (w[ 4], w[ 3], selector); w[40] = hc_byte_perm (w[ 3], w[ 2], selector); w[39] = hc_byte_perm (w[ 2], w[ 1], selector); w[38] = hc_byte_perm (w[ 1], w[ 0], selector); w[37] = hc_byte_perm (w[ 0], 0, selector); w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 38: w[63] = hc_byte_perm (w[25], w[24], selector); w[62] = hc_byte_perm (w[24], w[23], selector); w[61] = hc_byte_perm (w[23], w[22], selector); w[60] = hc_byte_perm (w[22], w[21], selector); w[59] = hc_byte_perm (w[21], w[20], selector); w[58] = hc_byte_perm (w[20], w[19], selector); w[57] = hc_byte_perm (w[19], w[18], selector); w[56] = hc_byte_perm (w[18], w[17], selector); w[55] = hc_byte_perm (w[17], w[16], selector); w[54] = hc_byte_perm (w[16], w[15], selector); w[53] = hc_byte_perm (w[15], w[14], selector); w[52] = hc_byte_perm (w[14], w[13], selector); w[51] = hc_byte_perm (w[13], w[12], selector); w[50] = hc_byte_perm (w[12], w[11], selector); w[49] = hc_byte_perm (w[11], w[10], selector); w[48] = hc_byte_perm (w[10], w[ 9], selector); w[47] = hc_byte_perm (w[ 9], w[ 8], selector); w[46] = hc_byte_perm (w[ 8], w[ 7], selector); w[45] = hc_byte_perm (w[ 7], w[ 6], selector); w[44] = hc_byte_perm (w[ 6], w[ 5], selector); w[43] = hc_byte_perm (w[ 5], w[ 4], selector); w[42] = hc_byte_perm (w[ 4], w[ 3], selector); w[41] = hc_byte_perm (w[ 3], w[ 2], selector); w[40] = hc_byte_perm (w[ 2], w[ 1], selector); w[39] = hc_byte_perm (w[ 1], w[ 0], selector); w[38] = hc_byte_perm (w[ 0], 0, selector); w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 39: w[63] = hc_byte_perm (w[24], w[23], selector); w[62] = hc_byte_perm (w[23], w[22], selector); w[61] = hc_byte_perm (w[22], w[21], selector); w[60] = hc_byte_perm (w[21], w[20], selector); w[59] = hc_byte_perm (w[20], w[19], selector); w[58] = hc_byte_perm (w[19], w[18], selector); w[57] = hc_byte_perm (w[18], w[17], selector); w[56] = hc_byte_perm (w[17], w[16], selector); w[55] = hc_byte_perm (w[16], w[15], selector); w[54] = hc_byte_perm (w[15], w[14], selector); w[53] = hc_byte_perm (w[14], w[13], selector); w[52] = hc_byte_perm (w[13], w[12], selector); w[51] = hc_byte_perm (w[12], w[11], selector); w[50] = hc_byte_perm (w[11], w[10], selector); w[49] = hc_byte_perm (w[10], w[ 9], selector); w[48] = hc_byte_perm (w[ 9], w[ 8], selector); w[47] = hc_byte_perm (w[ 8], w[ 7], selector); w[46] = hc_byte_perm (w[ 7], w[ 6], selector); w[45] = hc_byte_perm (w[ 6], w[ 5], selector); w[44] = hc_byte_perm (w[ 5], w[ 4], selector); w[43] = hc_byte_perm (w[ 4], w[ 3], selector); w[42] = hc_byte_perm (w[ 3], w[ 2], selector); w[41] = hc_byte_perm (w[ 2], w[ 1], selector); w[40] = hc_byte_perm (w[ 1], w[ 0], selector); w[39] = hc_byte_perm (w[ 0], 0, selector); w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 40: w[63] = hc_byte_perm (w[23], w[22], selector); w[62] = hc_byte_perm (w[22], w[21], selector); w[61] = hc_byte_perm (w[21], w[20], selector); w[60] = hc_byte_perm (w[20], w[19], selector); w[59] = hc_byte_perm (w[19], w[18], selector); w[58] = hc_byte_perm (w[18], w[17], selector); w[57] = hc_byte_perm (w[17], w[16], selector); w[56] = hc_byte_perm (w[16], w[15], selector); w[55] = hc_byte_perm (w[15], w[14], selector); w[54] = hc_byte_perm (w[14], w[13], selector); w[53] = hc_byte_perm (w[13], w[12], selector); w[52] = hc_byte_perm (w[12], w[11], selector); w[51] = hc_byte_perm (w[11], w[10], selector); w[50] = hc_byte_perm (w[10], w[ 9], selector); w[49] = hc_byte_perm (w[ 9], w[ 8], selector); w[48] = hc_byte_perm (w[ 8], w[ 7], selector); w[47] = hc_byte_perm (w[ 7], w[ 6], selector); w[46] = hc_byte_perm (w[ 6], w[ 5], selector); w[45] = hc_byte_perm (w[ 5], w[ 4], selector); w[44] = hc_byte_perm (w[ 4], w[ 3], selector); w[43] = hc_byte_perm (w[ 3], w[ 2], selector); w[42] = hc_byte_perm (w[ 2], w[ 1], selector); w[41] = hc_byte_perm (w[ 1], w[ 0], selector); w[40] = hc_byte_perm (w[ 0], 0, selector); w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 41: w[63] = hc_byte_perm (w[22], w[21], selector); w[62] = hc_byte_perm (w[21], w[20], selector); w[61] = hc_byte_perm (w[20], w[19], selector); w[60] = hc_byte_perm (w[19], w[18], selector); w[59] = hc_byte_perm (w[18], w[17], selector); w[58] = hc_byte_perm (w[17], w[16], selector); w[57] = hc_byte_perm (w[16], w[15], selector); w[56] = hc_byte_perm (w[15], w[14], selector); w[55] = hc_byte_perm (w[14], w[13], selector); w[54] = hc_byte_perm (w[13], w[12], selector); w[53] = hc_byte_perm (w[12], w[11], selector); w[52] = hc_byte_perm (w[11], w[10], selector); w[51] = hc_byte_perm (w[10], w[ 9], selector); w[50] = hc_byte_perm (w[ 9], w[ 8], selector); w[49] = hc_byte_perm (w[ 8], w[ 7], selector); w[48] = hc_byte_perm (w[ 7], w[ 6], selector); w[47] = hc_byte_perm (w[ 6], w[ 5], selector); w[46] = hc_byte_perm (w[ 5], w[ 4], selector); w[45] = hc_byte_perm (w[ 4], w[ 3], selector); w[44] = hc_byte_perm (w[ 3], w[ 2], selector); w[43] = hc_byte_perm (w[ 2], w[ 1], selector); w[42] = hc_byte_perm (w[ 1], w[ 0], selector); w[41] = hc_byte_perm (w[ 0], 0, selector); w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 42: w[63] = hc_byte_perm (w[21], w[20], selector); w[62] = hc_byte_perm (w[20], w[19], selector); w[61] = hc_byte_perm (w[19], w[18], selector); w[60] = hc_byte_perm (w[18], w[17], selector); w[59] = hc_byte_perm (w[17], w[16], selector); w[58] = hc_byte_perm (w[16], w[15], selector); w[57] = hc_byte_perm (w[15], w[14], selector); w[56] = hc_byte_perm (w[14], w[13], selector); w[55] = hc_byte_perm (w[13], w[12], selector); w[54] = hc_byte_perm (w[12], w[11], selector); w[53] = hc_byte_perm (w[11], w[10], selector); w[52] = hc_byte_perm (w[10], w[ 9], selector); w[51] = hc_byte_perm (w[ 9], w[ 8], selector); w[50] = hc_byte_perm (w[ 8], w[ 7], selector); w[49] = hc_byte_perm (w[ 7], w[ 6], selector); w[48] = hc_byte_perm (w[ 6], w[ 5], selector); w[47] = hc_byte_perm (w[ 5], w[ 4], selector); w[46] = hc_byte_perm (w[ 4], w[ 3], selector); w[45] = hc_byte_perm (w[ 3], w[ 2], selector); w[44] = hc_byte_perm (w[ 2], w[ 1], selector); w[43] = hc_byte_perm (w[ 1], w[ 0], selector); w[42] = hc_byte_perm (w[ 0], 0, selector); w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 43: w[63] = hc_byte_perm (w[20], w[19], selector); w[62] = hc_byte_perm (w[19], w[18], selector); w[61] = hc_byte_perm (w[18], w[17], selector); w[60] = hc_byte_perm (w[17], w[16], selector); w[59] = hc_byte_perm (w[16], w[15], selector); w[58] = hc_byte_perm (w[15], w[14], selector); w[57] = hc_byte_perm (w[14], w[13], selector); w[56] = hc_byte_perm (w[13], w[12], selector); w[55] = hc_byte_perm (w[12], w[11], selector); w[54] = hc_byte_perm (w[11], w[10], selector); w[53] = hc_byte_perm (w[10], w[ 9], selector); w[52] = hc_byte_perm (w[ 9], w[ 8], selector); w[51] = hc_byte_perm (w[ 8], w[ 7], selector); w[50] = hc_byte_perm (w[ 7], w[ 6], selector); w[49] = hc_byte_perm (w[ 6], w[ 5], selector); w[48] = hc_byte_perm (w[ 5], w[ 4], selector); w[47] = hc_byte_perm (w[ 4], w[ 3], selector); w[46] = hc_byte_perm (w[ 3], w[ 2], selector); w[45] = hc_byte_perm (w[ 2], w[ 1], selector); w[44] = hc_byte_perm (w[ 1], w[ 0], selector); w[43] = hc_byte_perm (w[ 0], 0, selector); w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 44: w[63] = hc_byte_perm (w[19], w[18], selector); w[62] = hc_byte_perm (w[18], w[17], selector); w[61] = hc_byte_perm (w[17], w[16], selector); w[60] = hc_byte_perm (w[16], w[15], selector); w[59] = hc_byte_perm (w[15], w[14], selector); w[58] = hc_byte_perm (w[14], w[13], selector); w[57] = hc_byte_perm (w[13], w[12], selector); w[56] = hc_byte_perm (w[12], w[11], selector); w[55] = hc_byte_perm (w[11], w[10], selector); w[54] = hc_byte_perm (w[10], w[ 9], selector); w[53] = hc_byte_perm (w[ 9], w[ 8], selector); w[52] = hc_byte_perm (w[ 8], w[ 7], selector); w[51] = hc_byte_perm (w[ 7], w[ 6], selector); w[50] = hc_byte_perm (w[ 6], w[ 5], selector); w[49] = hc_byte_perm (w[ 5], w[ 4], selector); w[48] = hc_byte_perm (w[ 4], w[ 3], selector); w[47] = hc_byte_perm (w[ 3], w[ 2], selector); w[46] = hc_byte_perm (w[ 2], w[ 1], selector); w[45] = hc_byte_perm (w[ 1], w[ 0], selector); w[44] = hc_byte_perm (w[ 0], 0, selector); w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 45: w[63] = hc_byte_perm (w[18], w[17], selector); w[62] = hc_byte_perm (w[17], w[16], selector); w[61] = hc_byte_perm (w[16], w[15], selector); w[60] = hc_byte_perm (w[15], w[14], selector); w[59] = hc_byte_perm (w[14], w[13], selector); w[58] = hc_byte_perm (w[13], w[12], selector); w[57] = hc_byte_perm (w[12], w[11], selector); w[56] = hc_byte_perm (w[11], w[10], selector); w[55] = hc_byte_perm (w[10], w[ 9], selector); w[54] = hc_byte_perm (w[ 9], w[ 8], selector); w[53] = hc_byte_perm (w[ 8], w[ 7], selector); w[52] = hc_byte_perm (w[ 7], w[ 6], selector); w[51] = hc_byte_perm (w[ 6], w[ 5], selector); w[50] = hc_byte_perm (w[ 5], w[ 4], selector); w[49] = hc_byte_perm (w[ 4], w[ 3], selector); w[48] = hc_byte_perm (w[ 3], w[ 2], selector); w[47] = hc_byte_perm (w[ 2], w[ 1], selector); w[46] = hc_byte_perm (w[ 1], w[ 0], selector); w[45] = hc_byte_perm (w[ 0], 0, selector); w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 46: w[63] = hc_byte_perm (w[17], w[16], selector); w[62] = hc_byte_perm (w[16], w[15], selector); w[61] = hc_byte_perm (w[15], w[14], selector); w[60] = hc_byte_perm (w[14], w[13], selector); w[59] = hc_byte_perm (w[13], w[12], selector); w[58] = hc_byte_perm (w[12], w[11], selector); w[57] = hc_byte_perm (w[11], w[10], selector); w[56] = hc_byte_perm (w[10], w[ 9], selector); w[55] = hc_byte_perm (w[ 9], w[ 8], selector); w[54] = hc_byte_perm (w[ 8], w[ 7], selector); w[53] = hc_byte_perm (w[ 7], w[ 6], selector); w[52] = hc_byte_perm (w[ 6], w[ 5], selector); w[51] = hc_byte_perm (w[ 5], w[ 4], selector); w[50] = hc_byte_perm (w[ 4], w[ 3], selector); w[49] = hc_byte_perm (w[ 3], w[ 2], selector); w[48] = hc_byte_perm (w[ 2], w[ 1], selector); w[47] = hc_byte_perm (w[ 1], w[ 0], selector); w[46] = hc_byte_perm (w[ 0], 0, selector); w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 47: w[63] = hc_byte_perm (w[16], w[15], selector); w[62] = hc_byte_perm (w[15], w[14], selector); w[61] = hc_byte_perm (w[14], w[13], selector); w[60] = hc_byte_perm (w[13], w[12], selector); w[59] = hc_byte_perm (w[12], w[11], selector); w[58] = hc_byte_perm (w[11], w[10], selector); w[57] = hc_byte_perm (w[10], w[ 9], selector); w[56] = hc_byte_perm (w[ 9], w[ 8], selector); w[55] = hc_byte_perm (w[ 8], w[ 7], selector); w[54] = hc_byte_perm (w[ 7], w[ 6], selector); w[53] = hc_byte_perm (w[ 6], w[ 5], selector); w[52] = hc_byte_perm (w[ 5], w[ 4], selector); w[51] = hc_byte_perm (w[ 4], w[ 3], selector); w[50] = hc_byte_perm (w[ 3], w[ 2], selector); w[49] = hc_byte_perm (w[ 2], w[ 1], selector); w[48] = hc_byte_perm (w[ 1], w[ 0], selector); w[47] = hc_byte_perm (w[ 0], 0, selector); w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 48: w[63] = hc_byte_perm (w[15], w[14], selector); w[62] = hc_byte_perm (w[14], w[13], selector); w[61] = hc_byte_perm (w[13], w[12], selector); w[60] = hc_byte_perm (w[12], w[11], selector); w[59] = hc_byte_perm (w[11], w[10], selector); w[58] = hc_byte_perm (w[10], w[ 9], selector); w[57] = hc_byte_perm (w[ 9], w[ 8], selector); w[56] = hc_byte_perm (w[ 8], w[ 7], selector); w[55] = hc_byte_perm (w[ 7], w[ 6], selector); w[54] = hc_byte_perm (w[ 6], w[ 5], selector); w[53] = hc_byte_perm (w[ 5], w[ 4], selector); w[52] = hc_byte_perm (w[ 4], w[ 3], selector); w[51] = hc_byte_perm (w[ 3], w[ 2], selector); w[50] = hc_byte_perm (w[ 2], w[ 1], selector); w[49] = hc_byte_perm (w[ 1], w[ 0], selector); w[48] = hc_byte_perm (w[ 0], 0, selector); w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 49: w[63] = hc_byte_perm (w[14], w[13], selector); w[62] = hc_byte_perm (w[13], w[12], selector); w[61] = hc_byte_perm (w[12], w[11], selector); w[60] = hc_byte_perm (w[11], w[10], selector); w[59] = hc_byte_perm (w[10], w[ 9], selector); w[58] = hc_byte_perm (w[ 9], w[ 8], selector); w[57] = hc_byte_perm (w[ 8], w[ 7], selector); w[56] = hc_byte_perm (w[ 7], w[ 6], selector); w[55] = hc_byte_perm (w[ 6], w[ 5], selector); w[54] = hc_byte_perm (w[ 5], w[ 4], selector); w[53] = hc_byte_perm (w[ 4], w[ 3], selector); w[52] = hc_byte_perm (w[ 3], w[ 2], selector); w[51] = hc_byte_perm (w[ 2], w[ 1], selector); w[50] = hc_byte_perm (w[ 1], w[ 0], selector); w[49] = hc_byte_perm (w[ 0], 0, selector); w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 50: w[63] = hc_byte_perm (w[13], w[12], selector); w[62] = hc_byte_perm (w[12], w[11], selector); w[61] = hc_byte_perm (w[11], w[10], selector); w[60] = hc_byte_perm (w[10], w[ 9], selector); w[59] = hc_byte_perm (w[ 9], w[ 8], selector); w[58] = hc_byte_perm (w[ 8], w[ 7], selector); w[57] = hc_byte_perm (w[ 7], w[ 6], selector); w[56] = hc_byte_perm (w[ 6], w[ 5], selector); w[55] = hc_byte_perm (w[ 5], w[ 4], selector); w[54] = hc_byte_perm (w[ 4], w[ 3], selector); w[53] = hc_byte_perm (w[ 3], w[ 2], selector); w[52] = hc_byte_perm (w[ 2], w[ 1], selector); w[51] = hc_byte_perm (w[ 1], w[ 0], selector); w[50] = hc_byte_perm (w[ 0], 0, selector); w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 51: w[63] = hc_byte_perm (w[12], w[11], selector); w[62] = hc_byte_perm (w[11], w[10], selector); w[61] = hc_byte_perm (w[10], w[ 9], selector); w[60] = hc_byte_perm (w[ 9], w[ 8], selector); w[59] = hc_byte_perm (w[ 8], w[ 7], selector); w[58] = hc_byte_perm (w[ 7], w[ 6], selector); w[57] = hc_byte_perm (w[ 6], w[ 5], selector); w[56] = hc_byte_perm (w[ 5], w[ 4], selector); w[55] = hc_byte_perm (w[ 4], w[ 3], selector); w[54] = hc_byte_perm (w[ 3], w[ 2], selector); w[53] = hc_byte_perm (w[ 2], w[ 1], selector); w[52] = hc_byte_perm (w[ 1], w[ 0], selector); w[51] = hc_byte_perm (w[ 0], 0, selector); w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 52: w[63] = hc_byte_perm (w[11], w[10], selector); w[62] = hc_byte_perm (w[10], w[ 9], selector); w[61] = hc_byte_perm (w[ 9], w[ 8], selector); w[60] = hc_byte_perm (w[ 8], w[ 7], selector); w[59] = hc_byte_perm (w[ 7], w[ 6], selector); w[58] = hc_byte_perm (w[ 6], w[ 5], selector); w[57] = hc_byte_perm (w[ 5], w[ 4], selector); w[56] = hc_byte_perm (w[ 4], w[ 3], selector); w[55] = hc_byte_perm (w[ 3], w[ 2], selector); w[54] = hc_byte_perm (w[ 2], w[ 1], selector); w[53] = hc_byte_perm (w[ 1], w[ 0], selector); w[52] = hc_byte_perm (w[ 0], 0, selector); w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 53: w[63] = hc_byte_perm (w[10], w[ 9], selector); w[62] = hc_byte_perm (w[ 9], w[ 8], selector); w[61] = hc_byte_perm (w[ 8], w[ 7], selector); w[60] = hc_byte_perm (w[ 7], w[ 6], selector); w[59] = hc_byte_perm (w[ 6], w[ 5], selector); w[58] = hc_byte_perm (w[ 5], w[ 4], selector); w[57] = hc_byte_perm (w[ 4], w[ 3], selector); w[56] = hc_byte_perm (w[ 3], w[ 2], selector); w[55] = hc_byte_perm (w[ 2], w[ 1], selector); w[54] = hc_byte_perm (w[ 1], w[ 0], selector); w[53] = hc_byte_perm (w[ 0], 0, selector); w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 54: w[63] = hc_byte_perm (w[ 9], w[ 8], selector); w[62] = hc_byte_perm (w[ 8], w[ 7], selector); w[61] = hc_byte_perm (w[ 7], w[ 6], selector); w[60] = hc_byte_perm (w[ 6], w[ 5], selector); w[59] = hc_byte_perm (w[ 5], w[ 4], selector); w[58] = hc_byte_perm (w[ 4], w[ 3], selector); w[57] = hc_byte_perm (w[ 3], w[ 2], selector); w[56] = hc_byte_perm (w[ 2], w[ 1], selector); w[55] = hc_byte_perm (w[ 1], w[ 0], selector); w[54] = hc_byte_perm (w[ 0], 0, selector); w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 55: w[63] = hc_byte_perm (w[ 8], w[ 7], selector); w[62] = hc_byte_perm (w[ 7], w[ 6], selector); w[61] = hc_byte_perm (w[ 6], w[ 5], selector); w[60] = hc_byte_perm (w[ 5], w[ 4], selector); w[59] = hc_byte_perm (w[ 4], w[ 3], selector); w[58] = hc_byte_perm (w[ 3], w[ 2], selector); w[57] = hc_byte_perm (w[ 2], w[ 1], selector); w[56] = hc_byte_perm (w[ 1], w[ 0], selector); w[55] = hc_byte_perm (w[ 0], 0, selector); w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 56: w[63] = hc_byte_perm (w[ 7], w[ 6], selector); w[62] = hc_byte_perm (w[ 6], w[ 5], selector); w[61] = hc_byte_perm (w[ 5], w[ 4], selector); w[60] = hc_byte_perm (w[ 4], w[ 3], selector); w[59] = hc_byte_perm (w[ 3], w[ 2], selector); w[58] = hc_byte_perm (w[ 2], w[ 1], selector); w[57] = hc_byte_perm (w[ 1], w[ 0], selector); w[56] = hc_byte_perm (w[ 0], 0, selector); w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 57: w[63] = hc_byte_perm (w[ 6], w[ 5], selector); w[62] = hc_byte_perm (w[ 5], w[ 4], selector); w[61] = hc_byte_perm (w[ 4], w[ 3], selector); w[60] = hc_byte_perm (w[ 3], w[ 2], selector); w[59] = hc_byte_perm (w[ 2], w[ 1], selector); w[58] = hc_byte_perm (w[ 1], w[ 0], selector); w[57] = hc_byte_perm (w[ 0], 0, selector); w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 58: w[63] = hc_byte_perm (w[ 5], w[ 4], selector); w[62] = hc_byte_perm (w[ 4], w[ 3], selector); w[61] = hc_byte_perm (w[ 3], w[ 2], selector); w[60] = hc_byte_perm (w[ 2], w[ 1], selector); w[59] = hc_byte_perm (w[ 1], w[ 0], selector); w[58] = hc_byte_perm (w[ 0], 0, selector); w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 59: w[63] = hc_byte_perm (w[ 4], w[ 3], selector); w[62] = hc_byte_perm (w[ 3], w[ 2], selector); w[61] = hc_byte_perm (w[ 2], w[ 1], selector); w[60] = hc_byte_perm (w[ 1], w[ 0], selector); w[59] = hc_byte_perm (w[ 0], 0, selector); w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 60: w[63] = hc_byte_perm (w[ 3], w[ 2], selector); w[62] = hc_byte_perm (w[ 2], w[ 1], selector); w[61] = hc_byte_perm (w[ 1], w[ 0], selector); w[60] = hc_byte_perm (w[ 0], 0, selector); w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 61: w[63] = hc_byte_perm (w[ 2], w[ 1], selector); w[62] = hc_byte_perm (w[ 1], w[ 0], selector); w[61] = hc_byte_perm (w[ 0], 0, selector); w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 62: w[63] = hc_byte_perm (w[ 1], w[ 0], selector); w[62] = hc_byte_perm (w[ 0], 0, selector); w[61] = 0; w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 63: w[63] = hc_byte_perm (w[ 0], 0, selector); w[62] = 0; w[61] = 0; w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; } #endif } /** * vector functions as scalar (for outer loop usage) */ DECLSPEC void truncate_block_4x4_le_S (PRIVATE_AS u32 *w0, const u32 len) { switch (len) { case 0: w0[0] = 0; w0[1] = 0; w0[2] = 0; w0[3] = 0; break; case 1: w0[0] &= 0x000000ff; w0[1] = 0; w0[2] = 0; w0[3] = 0; break; case 2: w0[0] &= 0x0000ffff; w0[1] = 0; w0[2] = 0; w0[3] = 0; break; case 3: w0[0] &= 0x00ffffff; w0[1] = 0; w0[2] = 0; w0[3] = 0; break; case 4: w0[1] = 0; w0[2] = 0; w0[3] = 0; break; case 5: w0[1] &= 0x000000ff; w0[2] = 0; w0[3] = 0; break; case 6: w0[1] &= 0x0000ffff; w0[2] = 0; w0[3] = 0; break; case 7: w0[1] &= 0x00ffffff; w0[2] = 0; w0[3] = 0; break; case 8: w0[2] = 0; w0[3] = 0; break; case 9: w0[2] &= 0x000000ff; w0[3] = 0; break; case 10: w0[2] &= 0x0000ffff; w0[3] = 0; break; case 11: w0[2] &= 0x00ffffff; w0[3] = 0; break; case 12: w0[3] = 0; break; case 13: w0[3] &= 0x000000ff; break; case 14: w0[3] &= 0x0000ffff; break; case 15: w0[3] &= 0x00ffffff; break; } } DECLSPEC void truncate_block_4x4_be_S (PRIVATE_AS u32 *w0, const u32 len) { switch (len) { case 0: w0[0] = 0; w0[1] = 0; w0[2] = 0; w0[3] = 0; break; case 1: w0[0] &= 0xff000000; w0[1] = 0; w0[2] = 0; w0[3] = 0; break; case 2: w0[0] &= 0xffff0000; w0[1] = 0; w0[2] = 0; w0[3] = 0; break; case 3: w0[0] &= 0xffffff00; w0[1] = 0; w0[2] = 0; w0[3] = 0; break; case 4: w0[1] = 0; w0[2] = 0; w0[3] = 0; break; case 5: w0[1] &= 0xff000000; w0[2] = 0; w0[3] = 0; break; case 6: w0[1] &= 0xffff0000; w0[2] = 0; w0[3] = 0; break; case 7: w0[1] &= 0xffffff00; w0[2] = 0; w0[3] = 0; break; case 8: w0[2] = 0; w0[3] = 0; break; case 9: w0[2] &= 0xff000000; w0[3] = 0; break; case 10: w0[2] &= 0xffff0000; w0[3] = 0; break; case 11: w0[2] &= 0xffffff00; w0[3] = 0; break; case 12: w0[3] = 0; break; case 13: w0[3] &= 0xff000000; break; case 14: w0[3] &= 0xffff0000; break; case 15: w0[3] &= 0xffffff00; break; } } DECLSPEC void truncate_block_16x4_le_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 len) { switch (len) { case 0: w0[0] = 0; w0[1] = 0; w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 1: w0[0] &= 0x000000ff; w0[1] = 0; w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 2: w0[0] &= 0x0000ffff; w0[1] = 0; w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 3: w0[0] &= 0x00ffffff; w0[1] = 0; w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 4: w0[1] = 0; w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 5: w0[1] &= 0x000000ff; w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 6: w0[1] &= 0x0000ffff; w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 7: w0[1] &= 0x00ffffff; w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 8: w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 9: w0[2] &= 0x000000ff; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 10: w0[2] &= 0x0000ffff; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 11: w0[2] &= 0x00ffffff; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 12: w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 13: w0[3] &= 0x000000ff; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 14: w0[3] &= 0x0000ffff; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 15: w0[3] &= 0x00ffffff; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 16: w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 17: w1[0] &= 0x000000ff; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 18: w1[0] &= 0x0000ffff; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 19: w1[0] &= 0x00ffffff; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 20: w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 21: w1[1] &= 0x000000ff; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 22: w1[1] &= 0x0000ffff; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 23: w1[1] &= 0x00ffffff; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 24: w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 25: w1[2] &= 0x000000ff; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 26: w1[2] &= 0x0000ffff; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 27: w1[2] &= 0x00ffffff; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 28: w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 29: w1[3] &= 0x000000ff; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 30: w1[3] &= 0x0000ffff; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 31: w1[3] &= 0x00ffffff; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 32: w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 33: w2[0] &= 0x000000ff; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 34: w2[0] &= 0x0000ffff; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 35: w2[0] &= 0x00ffffff; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 36: w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 37: w2[1] &= 0x000000ff; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 38: w2[1] &= 0x0000ffff; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 39: w2[1] &= 0x00ffffff; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 40: w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 41: w2[2] &= 0x000000ff; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 42: w2[2] &= 0x0000ffff; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 43: w2[2] &= 0x00ffffff; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 44: w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 45: w2[3] &= 0x000000ff; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 46: w2[3] &= 0x0000ffff; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 47: w2[3] &= 0x00ffffff; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 48: w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 49: w3[0] &= 0x000000ff; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 50: w3[0] &= 0x0000ffff; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 51: w3[0] &= 0x00ffffff; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 52: w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 53: w3[1] &= 0x000000ff; w3[2] = 0; w3[3] = 0; break; case 54: w3[1] &= 0x0000ffff; w3[2] = 0; w3[3] = 0; break; case 55: w3[1] &= 0x00ffffff; w3[2] = 0; w3[3] = 0; break; case 56: w3[2] = 0; w3[3] = 0; break; case 57: w3[2] &= 0x000000ff; w3[3] = 0; break; case 58: w3[2] &= 0x0000ffff; w3[3] = 0; break; case 59: w3[2] &= 0x00ffffff; w3[3] = 0; break; case 60: w3[3] = 0; break; case 61: w3[3] &= 0x000000ff; break; case 62: w3[3] &= 0x0000ffff; break; case 63: w3[3] &= 0x00ffffff; break; } } DECLSPEC void truncate_block_16x4_be_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 len) { switch (len) { case 0: w0[0] = 0; w0[1] = 0; w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 1: w0[0] &= 0xff000000; w0[1] = 0; w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 2: w0[0] &= 0xffff0000; w0[1] = 0; w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 3: w0[0] &= 0xffffff00; w0[1] = 0; w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 4: w0[1] = 0; w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 5: w0[1] &= 0xff000000; w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 6: w0[1] &= 0xffff0000; w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 7: w0[1] &= 0xffffff00; w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 8: w0[2] = 0; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 9: w0[2] &= 0xff000000; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 10: w0[2] &= 0xffff0000; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 11: w0[2] &= 0xffffff00; w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 12: w0[3] = 0; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 13: w0[3] &= 0xff000000; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 14: w0[3] &= 0xffff0000; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 15: w0[3] &= 0xffffff00; w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 16: w1[0] = 0; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 17: w1[0] &= 0xff000000; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 18: w1[0] &= 0xffff0000; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 19: w1[0] &= 0xffffff00; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 20: w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 21: w1[1] &= 0xff000000; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 22: w1[1] &= 0xffff0000; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 23: w1[1] &= 0xffffff00; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 24: w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 25: w1[2] &= 0xff000000; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 26: w1[2] &= 0xffff0000; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 27: w1[2] &= 0xffffff00; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 28: w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 29: w1[3] &= 0xff000000; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 30: w1[3] &= 0xffff0000; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 31: w1[3] &= 0xffffff00; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 32: w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 33: w2[0] &= 0xff000000; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 34: w2[0] &= 0xffff0000; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 35: w2[0] &= 0xffffff00; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 36: w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 37: w2[1] &= 0xff000000; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 38: w2[1] &= 0xffff0000; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 39: w2[1] &= 0xffffff00; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 40: w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 41: w2[2] &= 0xff000000; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 42: w2[2] &= 0xffff0000; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 43: w2[2] &= 0xffffff00; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 44: w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 45: w2[3] &= 0xff000000; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 46: w2[3] &= 0xffff0000; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 47: w2[3] &= 0xffffff00; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 48: w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 49: w3[0] &= 0xff000000; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 50: w3[0] &= 0xffff0000; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 51: w3[0] &= 0xffffff00; w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 52: w3[1] = 0; w3[2] = 0; w3[3] = 0; break; case 53: w3[1] &= 0xff000000; w3[2] = 0; w3[3] = 0; break; case 54: w3[1] &= 0xffff0000; w3[2] = 0; w3[3] = 0; break; case 55: w3[1] &= 0xffffff00; w3[2] = 0; w3[3] = 0; break; case 56: w3[2] = 0; w3[3] = 0; break; case 57: w3[2] &= 0xff000000; w3[3] = 0; break; case 58: w3[2] &= 0xffff0000; w3[3] = 0; break; case 59: w3[2] &= 0xffffff00; w3[3] = 0; break; case 60: w3[3] = 0; break; case 61: w3[3] &= 0xff000000; break; case 62: w3[3] &= 0xffff0000; break; case 63: w3[3] &= 0xffffff00; break; } } DECLSPEC void set_mark_1x4_S (PRIVATE_AS u32 *v, const u32 offset) { const u32 c = (offset & 15) / 4; const u32 r = 0xff << ((offset & 3) * 8); v[0] = (c == 0) ? r : 0; v[1] = (c == 1) ? r : 0; v[2] = (c == 2) ? r : 0; v[3] = (c == 3) ? r : 0; } DECLSPEC void append_helper_1x4_S (PRIVATE_AS u32 *r, const u32 v, PRIVATE_AS const u32 *m) { r[0] |= v & m[0]; r[1] |= v & m[1]; r[2] |= v & m[2]; r[3] |= v & m[3]; } DECLSPEC void append_0x01_2x4_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, const u32 offset) { u32 v[4]; set_mark_1x4_S (v, offset); const u32 offset16 = offset / 16; append_helper_1x4_S (w0, ((offset16 == 0) ? 0x01010101 : 0), v); append_helper_1x4_S (w1, ((offset16 == 1) ? 0x01010101 : 0), v); } DECLSPEC void append_0x06_2x4_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, const u32 offset) { u32 v[4]; set_mark_1x4_S (v, offset); const u32 offset16 = offset / 16; append_helper_1x4_S (w0, ((offset16 == 0) ? 0x06060606 : 0), v); append_helper_1x4_S (w1, ((offset16 == 1) ? 0x06060606 : 0), v); } DECLSPEC void append_0x01_4x4_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 offset) { u32 v[4]; set_mark_1x4_S (v, offset); const u32 offset16 = offset / 16; append_helper_1x4_S (w0, ((offset16 == 0) ? 0x01010101 : 0), v); append_helper_1x4_S (w1, ((offset16 == 1) ? 0x01010101 : 0), v); append_helper_1x4_S (w2, ((offset16 == 2) ? 0x01010101 : 0), v); append_helper_1x4_S (w3, ((offset16 == 3) ? 0x01010101 : 0), v); } DECLSPEC void append_0x2d_4x4_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 offset) { u32 v[4]; set_mark_1x4_S (v, offset); const u32 offset16 = offset / 16; append_helper_1x4_S (w0, ((offset16 == 0) ? 0x2d2d2d2d : 0), v); append_helper_1x4_S (w1, ((offset16 == 1) ? 0x2d2d2d2d : 0), v); append_helper_1x4_S (w2, ((offset16 == 2) ? 0x2d2d2d2d : 0), v); append_helper_1x4_S (w3, ((offset16 == 3) ? 0x2d2d2d2d : 0), v); } DECLSPEC void append_0x3a_4x4_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 offset) { u32 v[4]; set_mark_1x4_S (v, offset); const u32 offset16 = offset / 16; append_helper_1x4_S (w0, ((offset16 == 0) ? 0x3a3a3a3a : 0), v); append_helper_1x4_S (w1, ((offset16 == 1) ? 0x3a3a3a3a : 0), v); append_helper_1x4_S (w2, ((offset16 == 2) ? 0x3a3a3a3a : 0), v); append_helper_1x4_S (w3, ((offset16 == 3) ? 0x3a3a3a3a : 0), v); } DECLSPEC void append_0x80_1x4_S (PRIVATE_AS u32 *w0, const u32 offset) { u32 v[4]; set_mark_1x4_S (v, offset); append_helper_1x4_S (w0, 0x80808080, v); } DECLSPEC void append_0x80_2x4_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, const u32 offset) { u32 v[4]; set_mark_1x4_S (v, offset); const u32 offset16 = offset / 16; append_helper_1x4_S (w0, ((offset16 == 0) ? 0x80808080 : 0), v); append_helper_1x4_S (w1, ((offset16 == 1) ? 0x80808080 : 0), v); } DECLSPEC void append_0x80_3x4_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, const u32 offset) { u32 v[4]; set_mark_1x4_S (v, offset); const u32 offset16 = offset / 16; append_helper_1x4_S (w0, ((offset16 == 0) ? 0x80808080 : 0), v); append_helper_1x4_S (w1, ((offset16 == 1) ? 0x80808080 : 0), v); append_helper_1x4_S (w2, ((offset16 == 2) ? 0x80808080 : 0), v); } DECLSPEC void append_0x80_4x4_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 offset) { u32 v[4]; set_mark_1x4_S (v, offset); const u32 offset16 = offset / 16; append_helper_1x4_S (w0, ((offset16 == 0) ? 0x80808080 : 0), v); append_helper_1x4_S (w1, ((offset16 == 1) ? 0x80808080 : 0), v); append_helper_1x4_S (w2, ((offset16 == 2) ? 0x80808080 : 0), v); append_helper_1x4_S (w3, ((offset16 == 3) ? 0x80808080 : 0), v); } DECLSPEC void append_0x80_8x4_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, PRIVATE_AS u32 *w4, PRIVATE_AS u32 *w5, PRIVATE_AS u32 *w6, PRIVATE_AS u32 *w7, const u32 offset) { u32 v[4]; set_mark_1x4_S (v, offset); const u32 offset16 = offset / 16; append_helper_1x4_S (w0, ((offset16 == 0) ? 0x80808080 : 0), v); append_helper_1x4_S (w1, ((offset16 == 1) ? 0x80808080 : 0), v); append_helper_1x4_S (w2, ((offset16 == 2) ? 0x80808080 : 0), v); append_helper_1x4_S (w3, ((offset16 == 3) ? 0x80808080 : 0), v); append_helper_1x4_S (w4, ((offset16 == 4) ? 0x80808080 : 0), v); append_helper_1x4_S (w5, ((offset16 == 5) ? 0x80808080 : 0), v); append_helper_1x4_S (w6, ((offset16 == 6) ? 0x80808080 : 0), v); append_helper_1x4_S (w7, ((offset16 == 7) ? 0x80808080 : 0), v); } DECLSPEC void make_utf16be_S (PRIVATE_AS const u32 *in, PRIVATE_AS u32 *out1, PRIVATE_AS u32 *out2) { #if defined IS_NV out2[3] = hc_byte_perm_S (in[3], 0, 0x3727); out2[2] = hc_byte_perm_S (in[3], 0, 0x1707); out2[1] = hc_byte_perm_S (in[2], 0, 0x3727); out2[0] = hc_byte_perm_S (in[2], 0, 0x1707); out1[3] = hc_byte_perm_S (in[1], 0, 0x3727); out1[2] = hc_byte_perm_S (in[1], 0, 0x1707); out1[1] = hc_byte_perm_S (in[0], 0, 0x3727); out1[0] = hc_byte_perm_S (in[0], 0, 0x1707); #elif (defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1 out2[3] = hc_byte_perm_S (in[3], 0, 0x03070207); out2[2] = hc_byte_perm_S (in[3], 0, 0x01070007); out2[1] = hc_byte_perm_S (in[2], 0, 0x03070207); out2[0] = hc_byte_perm_S (in[2], 0, 0x01070007); out1[3] = hc_byte_perm_S (in[1], 0, 0x03070207); out1[2] = hc_byte_perm_S (in[1], 0, 0x01070007); out1[1] = hc_byte_perm_S (in[0], 0, 0x03070207); out1[0] = hc_byte_perm_S (in[0], 0, 0x01070007); #else out2[3] = ((in[3] >> 0) & 0xFF000000) | ((in[3] >> 8) & 0x0000FF00); out2[2] = ((in[3] << 16) & 0xFF000000) | ((in[3] << 8) & 0x0000FF00); out2[1] = ((in[2] >> 0) & 0xFF000000) | ((in[2] >> 8) & 0x0000FF00); out2[0] = ((in[2] << 16) & 0xFF000000) | ((in[2] << 8) & 0x0000FF00); out1[3] = ((in[1] >> 0) & 0xFF000000) | ((in[1] >> 8) & 0x0000FF00); out1[2] = ((in[1] << 16) & 0xFF000000) | ((in[1] << 8) & 0x0000FF00); out1[1] = ((in[0] >> 0) & 0xFF000000) | ((in[0] >> 8) & 0x0000FF00); out1[0] = ((in[0] << 16) & 0xFF000000) | ((in[0] << 8) & 0x0000FF00); #endif } DECLSPEC void make_utf16beN_S (PRIVATE_AS const u32 *in, PRIVATE_AS u32 *out1, PRIVATE_AS u32 *out2) { #if defined IS_NV out2[3] = hc_byte_perm_S (in[3], 0, 0x1707); out2[2] = hc_byte_perm_S (in[3], 0, 0x3727); out2[1] = hc_byte_perm_S (in[2], 0, 0x1707); out2[0] = hc_byte_perm_S (in[2], 0, 0x3727); out1[3] = hc_byte_perm_S (in[1], 0, 0x1707); out1[2] = hc_byte_perm_S (in[1], 0, 0x3727); out1[1] = hc_byte_perm_S (in[0], 0, 0x1707); out1[0] = hc_byte_perm_S (in[0], 0, 0x3727); #elif (defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1 out2[3] = hc_byte_perm_S (in[3], 0, 0x01070007); out2[2] = hc_byte_perm_S (in[3], 0, 0x03070207); out2[1] = hc_byte_perm_S (in[2], 0, 0x01070007); out2[0] = hc_byte_perm_S (in[2], 0, 0x03070207); out1[3] = hc_byte_perm_S (in[1], 0, 0x01070007); out1[2] = hc_byte_perm_S (in[1], 0, 0x03070207); out1[1] = hc_byte_perm_S (in[0], 0, 0x01070007); out1[0] = hc_byte_perm_S (in[0], 0, 0x03070207); #else out2[3] = ((in[3] << 16) & 0xFF000000) | ((in[3] << 8) & 0x0000FF00); out2[2] = ((in[3] >> 0) & 0xFF000000) | ((in[3] >> 8) & 0x0000FF00); out2[1] = ((in[2] << 16) & 0xFF000000) | ((in[2] << 8) & 0x0000FF00); out2[0] = ((in[2] >> 0) & 0xFF000000) | ((in[2] >> 8) & 0x0000FF00); out1[3] = ((in[1] << 16) & 0xFF000000) | ((in[1] << 8) & 0x0000FF00); out1[2] = ((in[1] >> 0) & 0xFF000000) | ((in[1] >> 8) & 0x0000FF00); out1[1] = ((in[0] << 16) & 0xFF000000) | ((in[0] << 8) & 0x0000FF00); out1[0] = ((in[0] >> 0) & 0xFF000000) | ((in[0] >> 8) & 0x0000FF00); #endif } DECLSPEC void make_utf16le_S (PRIVATE_AS const u32 *in, PRIVATE_AS u32 *out1, PRIVATE_AS u32 *out2) { #if defined IS_NV out2[3] = hc_byte_perm_S (in[3], 0, 0x7372); out2[2] = hc_byte_perm_S (in[3], 0, 0x7170); out2[1] = hc_byte_perm_S (in[2], 0, 0x7372); out2[0] = hc_byte_perm_S (in[2], 0, 0x7170); out1[3] = hc_byte_perm_S (in[1], 0, 0x7372); out1[2] = hc_byte_perm_S (in[1], 0, 0x7170); out1[1] = hc_byte_perm_S (in[0], 0, 0x7372); out1[0] = hc_byte_perm_S (in[0], 0, 0x7170); #elif (defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1 out2[3] = hc_byte_perm_S (in[3], 0, 0x07030702); out2[2] = hc_byte_perm_S (in[3], 0, 0x07010700); out2[1] = hc_byte_perm_S (in[2], 0, 0x07030702); out2[0] = hc_byte_perm_S (in[2], 0, 0x07010700); out1[3] = hc_byte_perm_S (in[1], 0, 0x07030702); out1[2] = hc_byte_perm_S (in[1], 0, 0x07010700); out1[1] = hc_byte_perm_S (in[0], 0, 0x07030702); out1[0] = hc_byte_perm_S (in[0], 0, 0x07010700); #else out2[3] = ((in[3] >> 8) & 0x00FF0000) | ((in[3] >> 16) & 0x000000FF); out2[2] = ((in[3] << 8) & 0x00FF0000) | ((in[3] >> 0) & 0x000000FF); out2[1] = ((in[2] >> 8) & 0x00FF0000) | ((in[2] >> 16) & 0x000000FF); out2[0] = ((in[2] << 8) & 0x00FF0000) | ((in[2] >> 0) & 0x000000FF); out1[3] = ((in[1] >> 8) & 0x00FF0000) | ((in[1] >> 16) & 0x000000FF); out1[2] = ((in[1] << 8) & 0x00FF0000) | ((in[1] >> 0) & 0x000000FF); out1[1] = ((in[0] >> 8) & 0x00FF0000) | ((in[0] >> 16) & 0x000000FF); out1[0] = ((in[0] << 8) & 0x00FF0000) | ((in[0] >> 0) & 0x000000FF); #endif } DECLSPEC void undo_utf16be_S (PRIVATE_AS const u32 *in1, PRIVATE_AS const u32 *in2, PRIVATE_AS u32 *out) { #if defined IS_NV out[0] = hc_byte_perm_S (in1[0], in1[1], 0x4602); out[1] = hc_byte_perm_S (in1[2], in1[3], 0x4602); out[2] = hc_byte_perm_S (in2[0], in2[1], 0x4602); out[3] = hc_byte_perm_S (in2[2], in2[3], 0x4602); #elif (defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1 out[0] = hc_byte_perm_S (in1[0], in1[1], 0x04060002); out[1] = hc_byte_perm_S (in1[2], in1[3], 0x04060002); out[2] = hc_byte_perm_S (in2[0], in2[1], 0x04060002); out[3] = hc_byte_perm_S (in2[2], in2[3], 0x04060002); #else out[0] = ((in1[0] & 0x0000ff00) >> 8) | ((in1[0] & 0xff000000) >> 16) | ((in1[1] & 0x0000ff00) << 8) | ((in1[1] & 0xff000000) << 0); out[1] = ((in1[2] & 0x0000ff00) >> 8) | ((in1[2] & 0xff000000) >> 16) | ((in1[3] & 0x0000ff00) << 8) | ((in1[3] & 0xff000000) << 0); out[2] = ((in2[0] & 0x0000ff00) >> 8) | ((in2[0] & 0xff000000) >> 16) | ((in2[1] & 0x0000ff00) << 8) | ((in2[1] & 0xff000000) << 0); out[3] = ((in2[2] & 0x0000ff00) >> 8) | ((in2[2] & 0xff000000) >> 16) | ((in2[3] & 0x0000ff00) << 8) | ((in2[3] & 0xff000000) << 0); #endif } DECLSPEC void undo_utf16le_S (PRIVATE_AS const u32 *in1, PRIVATE_AS const u32 *in2, PRIVATE_AS u32 *out) { #if defined IS_NV out[0] = hc_byte_perm_S (in1[0], in1[1], 0x6420); out[1] = hc_byte_perm_S (in1[2], in1[3], 0x6420); out[2] = hc_byte_perm_S (in2[0], in2[1], 0x6420); out[3] = hc_byte_perm_S (in2[2], in2[3], 0x6420); #elif (defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1 out[0] = hc_byte_perm_S (in1[0], in1[1], 0x06040200); out[1] = hc_byte_perm_S (in1[2], in1[3], 0x06040200); out[2] = hc_byte_perm_S (in2[0], in2[1], 0x06040200); out[3] = hc_byte_perm_S (in2[2], in2[3], 0x06040200); #else out[0] = ((in1[0] & 0x000000ff) >> 0) | ((in1[0] & 0x00ff0000) >> 8) | ((in1[1] & 0x000000ff) << 16) | ((in1[1] & 0x00ff0000) << 8); out[1] = ((in1[2] & 0x000000ff) >> 0) | ((in1[2] & 0x00ff0000) >> 8) | ((in1[3] & 0x000000ff) << 16) | ((in1[3] & 0x00ff0000) << 8); out[2] = ((in2[0] & 0x000000ff) >> 0) | ((in2[0] & 0x00ff0000) >> 8) | ((in2[1] & 0x000000ff) << 16) | ((in2[1] & 0x00ff0000) << 8); out[3] = ((in2[2] & 0x000000ff) >> 0) | ((in2[2] & 0x00ff0000) >> 8) | ((in2[3] & 0x000000ff) << 16) | ((in2[3] & 0x00ff0000) << 8); #endif } DECLSPEC void switch_buffer_by_offset_le_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: w3[3] = hc_bytealign_S (w3[2], w3[3], offset); w3[2] = hc_bytealign_S (w3[1], w3[2], offset); w3[1] = hc_bytealign_S (w3[0], w3[1], offset); w3[0] = hc_bytealign_S (w2[3], w3[0], offset); w2[3] = hc_bytealign_S (w2[2], w2[3], offset); w2[2] = hc_bytealign_S (w2[1], w2[2], offset); w2[1] = hc_bytealign_S (w2[0], w2[1], offset); w2[0] = hc_bytealign_S (w1[3], w2[0], offset); w1[3] = hc_bytealign_S (w1[2], w1[3], offset); w1[2] = hc_bytealign_S (w1[1], w1[2], offset); w1[1] = hc_bytealign_S (w1[0], w1[1], offset); w1[0] = hc_bytealign_S (w0[3], w1[0], offset); w0[3] = hc_bytealign_S (w0[2], w0[3], offset); w0[2] = hc_bytealign_S (w0[1], w0[2], offset); w0[1] = hc_bytealign_S (w0[0], w0[1], offset); w0[0] = hc_bytealign_S ( 0, w0[0], offset); break; case 1: w3[3] = hc_bytealign_S (w3[1], w3[2], offset); w3[2] = hc_bytealign_S (w3[0], w3[1], offset); w3[1] = hc_bytealign_S (w2[3], w3[0], offset); w3[0] = hc_bytealign_S (w2[2], w2[3], offset); w2[3] = hc_bytealign_S (w2[1], w2[2], offset); w2[2] = hc_bytealign_S (w2[0], w2[1], offset); w2[1] = hc_bytealign_S (w1[3], w2[0], offset); w2[0] = hc_bytealign_S (w1[2], w1[3], offset); w1[3] = hc_bytealign_S (w1[1], w1[2], offset); w1[2] = hc_bytealign_S (w1[0], w1[1], offset); w1[1] = hc_bytealign_S (w0[3], w1[0], offset); w1[0] = hc_bytealign_S (w0[2], w0[3], offset); w0[3] = hc_bytealign_S (w0[1], w0[2], offset); w0[2] = hc_bytealign_S (w0[0], w0[1], offset); w0[1] = hc_bytealign_S ( 0, w0[0], offset); w0[0] = 0; break; case 2: w3[3] = hc_bytealign_S (w3[0], w3[1], offset); w3[2] = hc_bytealign_S (w2[3], w3[0], offset); w3[1] = hc_bytealign_S (w2[2], w2[3], offset); w3[0] = hc_bytealign_S (w2[1], w2[2], offset); w2[3] = hc_bytealign_S (w2[0], w2[1], offset); w2[2] = hc_bytealign_S (w1[3], w2[0], offset); w2[1] = hc_bytealign_S (w1[2], w1[3], offset); w2[0] = hc_bytealign_S (w1[1], w1[2], offset); w1[3] = hc_bytealign_S (w1[0], w1[1], offset); w1[2] = hc_bytealign_S (w0[3], w1[0], offset); w1[1] = hc_bytealign_S (w0[2], w0[3], offset); w1[0] = hc_bytealign_S (w0[1], w0[2], offset); w0[3] = hc_bytealign_S (w0[0], w0[1], offset); w0[2] = hc_bytealign_S ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: w3[3] = hc_bytealign_S (w2[3], w3[0], offset); w3[2] = hc_bytealign_S (w2[2], w2[3], offset); w3[1] = hc_bytealign_S (w2[1], w2[2], offset); w3[0] = hc_bytealign_S (w2[0], w2[1], offset); w2[3] = hc_bytealign_S (w1[3], w2[0], offset); w2[2] = hc_bytealign_S (w1[2], w1[3], offset); w2[1] = hc_bytealign_S (w1[1], w1[2], offset); w2[0] = hc_bytealign_S (w1[0], w1[1], offset); w1[3] = hc_bytealign_S (w0[3], w1[0], offset); w1[2] = hc_bytealign_S (w0[2], w0[3], offset); w1[1] = hc_bytealign_S (w0[1], w0[2], offset); w1[0] = hc_bytealign_S (w0[0], w0[1], offset); w0[3] = hc_bytealign_S ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: w3[3] = hc_bytealign_S (w2[2], w2[3], offset); w3[2] = hc_bytealign_S (w2[1], w2[2], offset); w3[1] = hc_bytealign_S (w2[0], w2[1], offset); w3[0] = hc_bytealign_S (w1[3], w2[0], offset); w2[3] = hc_bytealign_S (w1[2], w1[3], offset); w2[2] = hc_bytealign_S (w1[1], w1[2], offset); w2[1] = hc_bytealign_S (w1[0], w1[1], offset); w2[0] = hc_bytealign_S (w0[3], w1[0], offset); w1[3] = hc_bytealign_S (w0[2], w0[3], offset); w1[2] = hc_bytealign_S (w0[1], w0[2], offset); w1[1] = hc_bytealign_S (w0[0], w0[1], offset); w1[0] = hc_bytealign_S ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: w3[3] = hc_bytealign_S (w2[1], w2[2], offset); w3[2] = hc_bytealign_S (w2[0], w2[1], offset); w3[1] = hc_bytealign_S (w1[3], w2[0], offset); w3[0] = hc_bytealign_S (w1[2], w1[3], offset); w2[3] = hc_bytealign_S (w1[1], w1[2], offset); w2[2] = hc_bytealign_S (w1[0], w1[1], offset); w2[1] = hc_bytealign_S (w0[3], w1[0], offset); w2[0] = hc_bytealign_S (w0[2], w0[3], offset); w1[3] = hc_bytealign_S (w0[1], w0[2], offset); w1[2] = hc_bytealign_S (w0[0], w0[1], offset); w1[1] = hc_bytealign_S ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: w3[3] = hc_bytealign_S (w2[0], w2[1], offset); w3[2] = hc_bytealign_S (w1[3], w2[0], offset); w3[1] = hc_bytealign_S (w1[2], w1[3], offset); w3[0] = hc_bytealign_S (w1[1], w1[2], offset); w2[3] = hc_bytealign_S (w1[0], w1[1], offset); w2[2] = hc_bytealign_S (w0[3], w1[0], offset); w2[1] = hc_bytealign_S (w0[2], w0[3], offset); w2[0] = hc_bytealign_S (w0[1], w0[2], offset); w1[3] = hc_bytealign_S (w0[0], w0[1], offset); w1[2] = hc_bytealign_S ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: w3[3] = hc_bytealign_S (w1[3], w2[0], offset); w3[2] = hc_bytealign_S (w1[2], w1[3], offset); w3[1] = hc_bytealign_S (w1[1], w1[2], offset); w3[0] = hc_bytealign_S (w1[0], w1[1], offset); w2[3] = hc_bytealign_S (w0[3], w1[0], offset); w2[2] = hc_bytealign_S (w0[2], w0[3], offset); w2[1] = hc_bytealign_S (w0[1], w0[2], offset); w2[0] = hc_bytealign_S (w0[0], w0[1], offset); w1[3] = hc_bytealign_S ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: w3[3] = hc_bytealign_S (w1[2], w1[3], offset); w3[2] = hc_bytealign_S (w1[1], w1[2], offset); w3[1] = hc_bytealign_S (w1[0], w1[1], offset); w3[0] = hc_bytealign_S (w0[3], w1[0], offset); w2[3] = hc_bytealign_S (w0[2], w0[3], offset); w2[2] = hc_bytealign_S (w0[1], w0[2], offset); w2[1] = hc_bytealign_S (w0[0], w0[1], offset); w2[0] = hc_bytealign_S ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: w3[3] = hc_bytealign_S (w1[1], w1[2], offset); w3[2] = hc_bytealign_S (w1[0], w1[1], offset); w3[1] = hc_bytealign_S (w0[3], w1[0], offset); w3[0] = hc_bytealign_S (w0[2], w0[3], offset); w2[3] = hc_bytealign_S (w0[1], w0[2], offset); w2[2] = hc_bytealign_S (w0[0], w0[1], offset); w2[1] = hc_bytealign_S ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: w3[3] = hc_bytealign_S (w1[0], w1[1], offset); w3[2] = hc_bytealign_S (w0[3], w1[0], offset); w3[1] = hc_bytealign_S (w0[2], w0[3], offset); w3[0] = hc_bytealign_S (w0[1], w0[2], offset); w2[3] = hc_bytealign_S (w0[0], w0[1], offset); w2[2] = hc_bytealign_S ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: w3[3] = hc_bytealign_S (w0[3], w1[0], offset); w3[2] = hc_bytealign_S (w0[2], w0[3], offset); w3[1] = hc_bytealign_S (w0[1], w0[2], offset); w3[0] = hc_bytealign_S (w0[0], w0[1], offset); w2[3] = hc_bytealign_S ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: w3[3] = hc_bytealign_S (w0[2], w0[3], offset); w3[2] = hc_bytealign_S (w0[1], w0[2], offset); w3[1] = hc_bytealign_S (w0[0], w0[1], offset); w3[0] = hc_bytealign_S ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: w3[3] = hc_bytealign_S (w0[1], w0[2], offset); w3[2] = hc_bytealign_S (w0[0], w0[1], offset); w3[1] = hc_bytealign_S ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: w3[3] = hc_bytealign_S (w0[0], w0[1], offset); w3[2] = hc_bytealign_S ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: w3[3] = hc_bytealign_S ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV const int offset_mod_4 = offset & 3; const int offset_minus_4 = 4 - offset_mod_4; #if defined IS_NV const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> (offset_minus_4 * 8)); #endif switch (offset_switch) { case 0: w3[3] = hc_byte_perm_S (w3[2], w3[3], selector); w3[2] = hc_byte_perm_S (w3[1], w3[2], selector); w3[1] = hc_byte_perm_S (w3[0], w3[1], selector); w3[0] = hc_byte_perm_S (w2[3], w3[0], selector); w2[3] = hc_byte_perm_S (w2[2], w2[3], selector); w2[2] = hc_byte_perm_S (w2[1], w2[2], selector); w2[1] = hc_byte_perm_S (w2[0], w2[1], selector); w2[0] = hc_byte_perm_S (w1[3], w2[0], selector); w1[3] = hc_byte_perm_S (w1[2], w1[3], selector); w1[2] = hc_byte_perm_S (w1[1], w1[2], selector); w1[1] = hc_byte_perm_S (w1[0], w1[1], selector); w1[0] = hc_byte_perm_S (w0[3], w1[0], selector); w0[3] = hc_byte_perm_S (w0[2], w0[3], selector); w0[2] = hc_byte_perm_S (w0[1], w0[2], selector); w0[1] = hc_byte_perm_S (w0[0], w0[1], selector); w0[0] = hc_byte_perm_S ( 0, w0[0], selector); break; case 1: w3[3] = hc_byte_perm_S (w3[1], w3[2], selector); w3[2] = hc_byte_perm_S (w3[0], w3[1], selector); w3[1] = hc_byte_perm_S (w2[3], w3[0], selector); w3[0] = hc_byte_perm_S (w2[2], w2[3], selector); w2[3] = hc_byte_perm_S (w2[1], w2[2], selector); w2[2] = hc_byte_perm_S (w2[0], w2[1], selector); w2[1] = hc_byte_perm_S (w1[3], w2[0], selector); w2[0] = hc_byte_perm_S (w1[2], w1[3], selector); w1[3] = hc_byte_perm_S (w1[1], w1[2], selector); w1[2] = hc_byte_perm_S (w1[0], w1[1], selector); w1[1] = hc_byte_perm_S (w0[3], w1[0], selector); w1[0] = hc_byte_perm_S (w0[2], w0[3], selector); w0[3] = hc_byte_perm_S (w0[1], w0[2], selector); w0[2] = hc_byte_perm_S (w0[0], w0[1], selector); w0[1] = hc_byte_perm_S ( 0, w0[0], selector); w0[0] = 0; break; case 2: w3[3] = hc_byte_perm_S (w3[0], w3[1], selector); w3[2] = hc_byte_perm_S (w2[3], w3[0], selector); w3[1] = hc_byte_perm_S (w2[2], w2[3], selector); w3[0] = hc_byte_perm_S (w2[1], w2[2], selector); w2[3] = hc_byte_perm_S (w2[0], w2[1], selector); w2[2] = hc_byte_perm_S (w1[3], w2[0], selector); w2[1] = hc_byte_perm_S (w1[2], w1[3], selector); w2[0] = hc_byte_perm_S (w1[1], w1[2], selector); w1[3] = hc_byte_perm_S (w1[0], w1[1], selector); w1[2] = hc_byte_perm_S (w0[3], w1[0], selector); w1[1] = hc_byte_perm_S (w0[2], w0[3], selector); w1[0] = hc_byte_perm_S (w0[1], w0[2], selector); w0[3] = hc_byte_perm_S (w0[0], w0[1], selector); w0[2] = hc_byte_perm_S ( 0, w0[0], selector); w0[1] = 0; w0[0] = 0; break; case 3: w3[3] = hc_byte_perm_S (w2[3], w3[0], selector); w3[2] = hc_byte_perm_S (w2[2], w2[3], selector); w3[1] = hc_byte_perm_S (w2[1], w2[2], selector); w3[0] = hc_byte_perm_S (w2[0], w2[1], selector); w2[3] = hc_byte_perm_S (w1[3], w2[0], selector); w2[2] = hc_byte_perm_S (w1[2], w1[3], selector); w2[1] = hc_byte_perm_S (w1[1], w1[2], selector); w2[0] = hc_byte_perm_S (w1[0], w1[1], selector); w1[3] = hc_byte_perm_S (w0[3], w1[0], selector); w1[2] = hc_byte_perm_S (w0[2], w0[3], selector); w1[1] = hc_byte_perm_S (w0[1], w0[2], selector); w1[0] = hc_byte_perm_S (w0[0], w0[1], selector); w0[3] = hc_byte_perm_S ( 0, w0[0], selector); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: w3[3] = hc_byte_perm_S (w2[2], w2[3], selector); w3[2] = hc_byte_perm_S (w2[1], w2[2], selector); w3[1] = hc_byte_perm_S (w2[0], w2[1], selector); w3[0] = hc_byte_perm_S (w1[3], w2[0], selector); w2[3] = hc_byte_perm_S (w1[2], w1[3], selector); w2[2] = hc_byte_perm_S (w1[1], w1[2], selector); w2[1] = hc_byte_perm_S (w1[0], w1[1], selector); w2[0] = hc_byte_perm_S (w0[3], w1[0], selector); w1[3] = hc_byte_perm_S (w0[2], w0[3], selector); w1[2] = hc_byte_perm_S (w0[1], w0[2], selector); w1[1] = hc_byte_perm_S (w0[0], w0[1], selector); w1[0] = hc_byte_perm_S ( 0, w0[0], selector); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: w3[3] = hc_byte_perm_S (w2[1], w2[2], selector); w3[2] = hc_byte_perm_S (w2[0], w2[1], selector); w3[1] = hc_byte_perm_S (w1[3], w2[0], selector); w3[0] = hc_byte_perm_S (w1[2], w1[3], selector); w2[3] = hc_byte_perm_S (w1[1], w1[2], selector); w2[2] = hc_byte_perm_S (w1[0], w1[1], selector); w2[1] = hc_byte_perm_S (w0[3], w1[0], selector); w2[0] = hc_byte_perm_S (w0[2], w0[3], selector); w1[3] = hc_byte_perm_S (w0[1], w0[2], selector); w1[2] = hc_byte_perm_S (w0[0], w0[1], selector); w1[1] = hc_byte_perm_S ( 0, w0[0], selector); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: w3[3] = hc_byte_perm_S (w2[0], w2[1], selector); w3[2] = hc_byte_perm_S (w1[3], w2[0], selector); w3[1] = hc_byte_perm_S (w1[2], w1[3], selector); w3[0] = hc_byte_perm_S (w1[1], w1[2], selector); w2[3] = hc_byte_perm_S (w1[0], w1[1], selector); w2[2] = hc_byte_perm_S (w0[3], w1[0], selector); w2[1] = hc_byte_perm_S (w0[2], w0[3], selector); w2[0] = hc_byte_perm_S (w0[1], w0[2], selector); w1[3] = hc_byte_perm_S (w0[0], w0[1], selector); w1[2] = hc_byte_perm_S ( 0, w0[0], selector); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: w3[3] = hc_byte_perm_S (w1[3], w2[0], selector); w3[2] = hc_byte_perm_S (w1[2], w1[3], selector); w3[1] = hc_byte_perm_S (w1[1], w1[2], selector); w3[0] = hc_byte_perm_S (w1[0], w1[1], selector); w2[3] = hc_byte_perm_S (w0[3], w1[0], selector); w2[2] = hc_byte_perm_S (w0[2], w0[3], selector); w2[1] = hc_byte_perm_S (w0[1], w0[2], selector); w2[0] = hc_byte_perm_S (w0[0], w0[1], selector); w1[3] = hc_byte_perm_S ( 0, w0[0], selector); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: w3[3] = hc_byte_perm_S (w1[2], w1[3], selector); w3[2] = hc_byte_perm_S (w1[1], w1[2], selector); w3[1] = hc_byte_perm_S (w1[0], w1[1], selector); w3[0] = hc_byte_perm_S (w0[3], w1[0], selector); w2[3] = hc_byte_perm_S (w0[2], w0[3], selector); w2[2] = hc_byte_perm_S (w0[1], w0[2], selector); w2[1] = hc_byte_perm_S (w0[0], w0[1], selector); w2[0] = hc_byte_perm_S ( 0, w0[0], selector); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: w3[3] = hc_byte_perm_S (w1[1], w1[2], selector); w3[2] = hc_byte_perm_S (w1[0], w1[1], selector); w3[1] = hc_byte_perm_S (w0[3], w1[0], selector); w3[0] = hc_byte_perm_S (w0[2], w0[3], selector); w2[3] = hc_byte_perm_S (w0[1], w0[2], selector); w2[2] = hc_byte_perm_S (w0[0], w0[1], selector); w2[1] = hc_byte_perm_S ( 0, w0[0], selector); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: w3[3] = hc_byte_perm_S (w1[0], w1[1], selector); w3[2] = hc_byte_perm_S (w0[3], w1[0], selector); w3[1] = hc_byte_perm_S (w0[2], w0[3], selector); w3[0] = hc_byte_perm_S (w0[1], w0[2], selector); w2[3] = hc_byte_perm_S (w0[0], w0[1], selector); w2[2] = hc_byte_perm_S ( 0, w0[0], selector); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: w3[3] = hc_byte_perm_S (w0[3], w1[0], selector); w3[2] = hc_byte_perm_S (w0[2], w0[3], selector); w3[1] = hc_byte_perm_S (w0[1], w0[2], selector); w3[0] = hc_byte_perm_S (w0[0], w0[1], selector); w2[3] = hc_byte_perm_S ( 0, w0[0], selector); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: w3[3] = hc_byte_perm_S (w0[2], w0[3], selector); w3[2] = hc_byte_perm_S (w0[1], w0[2], selector); w3[1] = hc_byte_perm_S (w0[0], w0[1], selector); w3[0] = hc_byte_perm_S ( 0, w0[0], selector); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: w3[3] = hc_byte_perm_S (w0[1], w0[2], selector); w3[2] = hc_byte_perm_S (w0[0], w0[1], selector); w3[1] = hc_byte_perm_S ( 0, w0[0], selector); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: w3[3] = hc_byte_perm_S (w0[0], w0[1], selector); w3[2] = hc_byte_perm_S ( 0, w0[0], selector); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: w3[3] = hc_byte_perm_S ( 0, w0[0], selector); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_carry_le_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, PRIVATE_AS u32 *c0, PRIVATE_AS u32 *c1, PRIVATE_AS u32 *c2, PRIVATE_AS u32 *c3, const u32 offset) { const int offset_switch = offset / 4; #if (defined IS_AMD || defined IS_HIP) || defined IS_GENERIC switch (offset_switch) { case 0: c0[0] = hc_bytealign_S (w3[3], 0, offset); w3[3] = hc_bytealign_S (w3[2], w3[3], offset); w3[2] = hc_bytealign_S (w3[1], w3[2], offset); w3[1] = hc_bytealign_S (w3[0], w3[1], offset); w3[0] = hc_bytealign_S (w2[3], w3[0], offset); w2[3] = hc_bytealign_S (w2[2], w2[3], offset); w2[2] = hc_bytealign_S (w2[1], w2[2], offset); w2[1] = hc_bytealign_S (w2[0], w2[1], offset); w2[0] = hc_bytealign_S (w1[3], w2[0], offset); w1[3] = hc_bytealign_S (w1[2], w1[3], offset); w1[2] = hc_bytealign_S (w1[1], w1[2], offset); w1[1] = hc_bytealign_S (w1[0], w1[1], offset); w1[0] = hc_bytealign_S (w0[3], w1[0], offset); w0[3] = hc_bytealign_S (w0[2], w0[3], offset); w0[2] = hc_bytealign_S (w0[1], w0[2], offset); w0[1] = hc_bytealign_S (w0[0], w0[1], offset); w0[0] = hc_bytealign_S ( 0, w0[0], offset); break; case 1: c0[1] = hc_bytealign_S (w3[3], 0, offset); c0[0] = hc_bytealign_S (w3[2], w3[3], offset); w3[3] = hc_bytealign_S (w3[1], w3[2], offset); w3[2] = hc_bytealign_S (w3[0], w3[1], offset); w3[1] = hc_bytealign_S (w2[3], w3[0], offset); w3[0] = hc_bytealign_S (w2[2], w2[3], offset); w2[3] = hc_bytealign_S (w2[1], w2[2], offset); w2[2] = hc_bytealign_S (w2[0], w2[1], offset); w2[1] = hc_bytealign_S (w1[3], w2[0], offset); w2[0] = hc_bytealign_S (w1[2], w1[3], offset); w1[3] = hc_bytealign_S (w1[1], w1[2], offset); w1[2] = hc_bytealign_S (w1[0], w1[1], offset); w1[1] = hc_bytealign_S (w0[3], w1[0], offset); w1[0] = hc_bytealign_S (w0[2], w0[3], offset); w0[3] = hc_bytealign_S (w0[1], w0[2], offset); w0[2] = hc_bytealign_S (w0[0], w0[1], offset); w0[1] = hc_bytealign_S ( 0, w0[0], offset); w0[0] = 0; break; case 2: c0[2] = hc_bytealign_S (w3[3], 0, offset); c0[1] = hc_bytealign_S (w3[2], w3[3], offset); c0[0] = hc_bytealign_S (w3[1], w3[2], offset); w3[3] = hc_bytealign_S (w3[0], w3[1], offset); w3[2] = hc_bytealign_S (w2[3], w3[0], offset); w3[1] = hc_bytealign_S (w2[2], w2[3], offset); w3[0] = hc_bytealign_S (w2[1], w2[2], offset); w2[3] = hc_bytealign_S (w2[0], w2[1], offset); w2[2] = hc_bytealign_S (w1[3], w2[0], offset); w2[1] = hc_bytealign_S (w1[2], w1[3], offset); w2[0] = hc_bytealign_S (w1[1], w1[2], offset); w1[3] = hc_bytealign_S (w1[0], w1[1], offset); w1[2] = hc_bytealign_S (w0[3], w1[0], offset); w1[1] = hc_bytealign_S (w0[2], w0[3], offset); w1[0] = hc_bytealign_S (w0[1], w0[2], offset); w0[3] = hc_bytealign_S (w0[0], w0[1], offset); w0[2] = hc_bytealign_S ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: c0[3] = hc_bytealign_S (w3[3], 0, offset); c0[2] = hc_bytealign_S (w3[2], w3[3], offset); c0[1] = hc_bytealign_S (w3[1], w3[2], offset); c0[0] = hc_bytealign_S (w3[0], w3[1], offset); w3[3] = hc_bytealign_S (w2[3], w3[0], offset); w3[2] = hc_bytealign_S (w2[2], w2[3], offset); w3[1] = hc_bytealign_S (w2[1], w2[2], offset); w3[0] = hc_bytealign_S (w2[0], w2[1], offset); w2[3] = hc_bytealign_S (w1[3], w2[0], offset); w2[2] = hc_bytealign_S (w1[2], w1[3], offset); w2[1] = hc_bytealign_S (w1[1], w1[2], offset); w2[0] = hc_bytealign_S (w1[0], w1[1], offset); w1[3] = hc_bytealign_S (w0[3], w1[0], offset); w1[2] = hc_bytealign_S (w0[2], w0[3], offset); w1[1] = hc_bytealign_S (w0[1], w0[2], offset); w1[0] = hc_bytealign_S (w0[0], w0[1], offset); w0[3] = hc_bytealign_S ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: c1[0] = hc_bytealign_S (w3[3], 0, offset); c0[3] = hc_bytealign_S (w3[2], w3[3], offset); c0[2] = hc_bytealign_S (w3[1], w3[2], offset); c0[1] = hc_bytealign_S (w3[0], w3[1], offset); c0[0] = hc_bytealign_S (w2[3], w3[0], offset); w3[3] = hc_bytealign_S (w2[2], w2[3], offset); w3[2] = hc_bytealign_S (w2[1], w2[2], offset); w3[1] = hc_bytealign_S (w2[0], w2[1], offset); w3[0] = hc_bytealign_S (w1[3], w2[0], offset); w2[3] = hc_bytealign_S (w1[2], w1[3], offset); w2[2] = hc_bytealign_S (w1[1], w1[2], offset); w2[1] = hc_bytealign_S (w1[0], w1[1], offset); w2[0] = hc_bytealign_S (w0[3], w1[0], offset); w1[3] = hc_bytealign_S (w0[2], w0[3], offset); w1[2] = hc_bytealign_S (w0[1], w0[2], offset); w1[1] = hc_bytealign_S (w0[0], w0[1], offset); w1[0] = hc_bytealign_S ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: c1[1] = hc_bytealign_S (w3[3], 0, offset); c1[0] = hc_bytealign_S (w3[2], w3[3], offset); c0[3] = hc_bytealign_S (w3[1], w3[2], offset); c0[2] = hc_bytealign_S (w3[0], w3[1], offset); c0[1] = hc_bytealign_S (w2[3], w3[0], offset); c0[0] = hc_bytealign_S (w2[2], w2[3], offset); w3[3] = hc_bytealign_S (w2[1], w2[2], offset); w3[2] = hc_bytealign_S (w2[0], w2[1], offset); w3[1] = hc_bytealign_S (w1[3], w2[0], offset); w3[0] = hc_bytealign_S (w1[2], w1[3], offset); w2[3] = hc_bytealign_S (w1[1], w1[2], offset); w2[2] = hc_bytealign_S (w1[0], w1[1], offset); w2[1] = hc_bytealign_S (w0[3], w1[0], offset); w2[0] = hc_bytealign_S (w0[2], w0[3], offset); w1[3] = hc_bytealign_S (w0[1], w0[2], offset); w1[2] = hc_bytealign_S (w0[0], w0[1], offset); w1[1] = hc_bytealign_S ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: c1[2] = hc_bytealign_S (w3[3], 0, offset); c1[1] = hc_bytealign_S (w3[2], w3[3], offset); c1[0] = hc_bytealign_S (w3[1], w3[2], offset); c0[3] = hc_bytealign_S (w3[0], w3[1], offset); c0[2] = hc_bytealign_S (w2[3], w3[0], offset); c0[1] = hc_bytealign_S (w2[2], w2[3], offset); c0[0] = hc_bytealign_S (w2[1], w2[2], offset); w3[3] = hc_bytealign_S (w2[0], w2[1], offset); w3[2] = hc_bytealign_S (w1[3], w2[0], offset); w3[1] = hc_bytealign_S (w1[2], w1[3], offset); w3[0] = hc_bytealign_S (w1[1], w1[2], offset); w2[3] = hc_bytealign_S (w1[0], w1[1], offset); w2[2] = hc_bytealign_S (w0[3], w1[0], offset); w2[1] = hc_bytealign_S (w0[2], w0[3], offset); w2[0] = hc_bytealign_S (w0[1], w0[2], offset); w1[3] = hc_bytealign_S (w0[0], w0[1], offset); w1[2] = hc_bytealign_S ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: c1[3] = hc_bytealign_S (w3[3], 0, offset); c1[2] = hc_bytealign_S (w3[2], w3[3], offset); c1[1] = hc_bytealign_S (w3[1], w3[2], offset); c1[0] = hc_bytealign_S (w3[0], w3[1], offset); c0[3] = hc_bytealign_S (w2[3], w3[0], offset); c0[2] = hc_bytealign_S (w2[2], w2[3], offset); c0[1] = hc_bytealign_S (w2[1], w2[2], offset); c0[0] = hc_bytealign_S (w2[0], w2[1], offset); w3[3] = hc_bytealign_S (w1[3], w2[0], offset); w3[2] = hc_bytealign_S (w1[2], w1[3], offset); w3[1] = hc_bytealign_S (w1[1], w1[2], offset); w3[0] = hc_bytealign_S (w1[0], w1[1], offset); w2[3] = hc_bytealign_S (w0[3], w1[0], offset); w2[2] = hc_bytealign_S (w0[2], w0[3], offset); w2[1] = hc_bytealign_S (w0[1], w0[2], offset); w2[0] = hc_bytealign_S (w0[0], w0[1], offset); w1[3] = hc_bytealign_S ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: c2[0] = hc_bytealign_S (w3[3], 0, offset); c1[3] = hc_bytealign_S (w3[2], w3[3], offset); c1[2] = hc_bytealign_S (w3[1], w3[2], offset); c1[1] = hc_bytealign_S (w3[0], w3[1], offset); c1[0] = hc_bytealign_S (w2[3], w3[0], offset); c0[3] = hc_bytealign_S (w2[2], w2[3], offset); c0[2] = hc_bytealign_S (w2[1], w2[2], offset); c0[1] = hc_bytealign_S (w2[0], w2[1], offset); c0[0] = hc_bytealign_S (w1[3], w2[0], offset); w3[3] = hc_bytealign_S (w1[2], w1[3], offset); w3[2] = hc_bytealign_S (w1[1], w1[2], offset); w3[1] = hc_bytealign_S (w1[0], w1[1], offset); w3[0] = hc_bytealign_S (w0[3], w1[0], offset); w2[3] = hc_bytealign_S (w0[2], w0[3], offset); w2[2] = hc_bytealign_S (w0[1], w0[2], offset); w2[1] = hc_bytealign_S (w0[0], w0[1], offset); w2[0] = hc_bytealign_S ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: c2[1] = hc_bytealign_S (w3[3], 0, offset); c2[0] = hc_bytealign_S (w3[2], w3[3], offset); c1[3] = hc_bytealign_S (w3[1], w3[2], offset); c1[2] = hc_bytealign_S (w3[0], w3[1], offset); c1[1] = hc_bytealign_S (w2[3], w3[0], offset); c1[0] = hc_bytealign_S (w2[2], w2[3], offset); c0[3] = hc_bytealign_S (w2[1], w2[2], offset); c0[2] = hc_bytealign_S (w2[0], w2[1], offset); c0[1] = hc_bytealign_S (w1[3], w2[0], offset); c0[0] = hc_bytealign_S (w1[2], w1[3], offset); w3[3] = hc_bytealign_S (w1[1], w1[2], offset); w3[2] = hc_bytealign_S (w1[0], w1[1], offset); w3[1] = hc_bytealign_S (w0[3], w1[0], offset); w3[0] = hc_bytealign_S (w0[2], w0[3], offset); w2[3] = hc_bytealign_S (w0[1], w0[2], offset); w2[2] = hc_bytealign_S (w0[0], w0[1], offset); w2[1] = hc_bytealign_S ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: c2[2] = hc_bytealign_S (w3[3], 0, offset); c2[1] = hc_bytealign_S (w3[2], w3[3], offset); c2[0] = hc_bytealign_S (w3[1], w3[2], offset); c1[3] = hc_bytealign_S (w3[0], w3[1], offset); c1[2] = hc_bytealign_S (w2[3], w3[0], offset); c1[1] = hc_bytealign_S (w2[2], w2[3], offset); c1[0] = hc_bytealign_S (w2[1], w2[2], offset); c0[3] = hc_bytealign_S (w2[0], w2[1], offset); c0[2] = hc_bytealign_S (w1[3], w2[0], offset); c0[1] = hc_bytealign_S (w1[2], w1[3], offset); c0[0] = hc_bytealign_S (w1[1], w1[2], offset); w3[3] = hc_bytealign_S (w1[0], w1[1], offset); w3[2] = hc_bytealign_S (w0[3], w1[0], offset); w3[1] = hc_bytealign_S (w0[2], w0[3], offset); w3[0] = hc_bytealign_S (w0[1], w0[2], offset); w2[3] = hc_bytealign_S (w0[0], w0[1], offset); w2[2] = hc_bytealign_S ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: c2[3] = hc_bytealign_S (w3[3], 0, offset); c2[2] = hc_bytealign_S (w3[2], w3[3], offset); c2[1] = hc_bytealign_S (w3[1], w3[2], offset); c2[0] = hc_bytealign_S (w3[0], w3[1], offset); c1[3] = hc_bytealign_S (w2[3], w3[0], offset); c1[2] = hc_bytealign_S (w2[2], w2[3], offset); c1[1] = hc_bytealign_S (w2[1], w2[2], offset); c1[0] = hc_bytealign_S (w2[0], w2[1], offset); c0[3] = hc_bytealign_S (w1[3], w2[0], offset); c0[2] = hc_bytealign_S (w1[2], w1[3], offset); c0[1] = hc_bytealign_S (w1[1], w1[2], offset); c0[0] = hc_bytealign_S (w1[0], w1[1], offset); w3[3] = hc_bytealign_S (w0[3], w1[0], offset); w3[2] = hc_bytealign_S (w0[2], w0[3], offset); w3[1] = hc_bytealign_S (w0[1], w0[2], offset); w3[0] = hc_bytealign_S (w0[0], w0[1], offset); w2[3] = hc_bytealign_S ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: c3[0] = hc_bytealign_S (w3[3], 0, offset); c2[3] = hc_bytealign_S (w3[2], w3[3], offset); c2[2] = hc_bytealign_S (w3[1], w3[2], offset); c2[1] = hc_bytealign_S (w3[0], w3[1], offset); c2[0] = hc_bytealign_S (w2[3], w3[0], offset); c1[3] = hc_bytealign_S (w2[2], w2[3], offset); c1[2] = hc_bytealign_S (w2[1], w2[2], offset); c1[1] = hc_bytealign_S (w2[0], w2[1], offset); c1[0] = hc_bytealign_S (w1[3], w2[0], offset); c0[3] = hc_bytealign_S (w1[2], w1[3], offset); c0[2] = hc_bytealign_S (w1[1], w1[2], offset); c0[1] = hc_bytealign_S (w1[0], w1[1], offset); c0[0] = hc_bytealign_S (w0[3], w1[0], offset); w3[3] = hc_bytealign_S (w0[2], w0[3], offset); w3[2] = hc_bytealign_S (w0[1], w0[2], offset); w3[1] = hc_bytealign_S (w0[0], w0[1], offset); w3[0] = hc_bytealign_S ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: c3[1] = hc_bytealign_S (w3[3], 0, offset); c3[0] = hc_bytealign_S (w3[2], w3[3], offset); c2[3] = hc_bytealign_S (w3[1], w3[2], offset); c2[2] = hc_bytealign_S (w3[0], w3[1], offset); c2[1] = hc_bytealign_S (w2[3], w3[0], offset); c2[0] = hc_bytealign_S (w2[2], w2[3], offset); c1[3] = hc_bytealign_S (w2[1], w2[2], offset); c1[2] = hc_bytealign_S (w2[0], w2[1], offset); c1[1] = hc_bytealign_S (w1[3], w2[0], offset); c1[0] = hc_bytealign_S (w1[2], w1[3], offset); c0[3] = hc_bytealign_S (w1[1], w1[2], offset); c0[2] = hc_bytealign_S (w1[0], w1[1], offset); c0[1] = hc_bytealign_S (w0[3], w1[0], offset); c0[0] = hc_bytealign_S (w0[2], w0[3], offset); w3[3] = hc_bytealign_S (w0[1], w0[2], offset); w3[2] = hc_bytealign_S (w0[0], w0[1], offset); w3[1] = hc_bytealign_S ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: c3[2] = hc_bytealign_S (w3[3], 0, offset); c3[1] = hc_bytealign_S (w3[2], w3[3], offset); c3[0] = hc_bytealign_S (w3[1], w3[2], offset); c2[3] = hc_bytealign_S (w3[0], w3[1], offset); c2[2] = hc_bytealign_S (w2[3], w3[0], offset); c2[1] = hc_bytealign_S (w2[2], w2[3], offset); c2[0] = hc_bytealign_S (w2[1], w2[2], offset); c1[3] = hc_bytealign_S (w2[0], w2[1], offset); c1[2] = hc_bytealign_S (w1[3], w2[0], offset); c1[1] = hc_bytealign_S (w1[2], w1[3], offset); c1[0] = hc_bytealign_S (w1[1], w1[2], offset); c0[3] = hc_bytealign_S (w1[0], w1[1], offset); c0[2] = hc_bytealign_S (w0[3], w1[0], offset); c0[1] = hc_bytealign_S (w0[2], w0[3], offset); c0[0] = hc_bytealign_S (w0[1], w0[2], offset); w3[3] = hc_bytealign_S (w0[0], w0[1], offset); w3[2] = hc_bytealign_S ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: c3[3] = hc_bytealign_S (w3[3], 0, offset); c3[2] = hc_bytealign_S (w3[2], w3[3], offset); c3[1] = hc_bytealign_S (w3[1], w3[2], offset); c3[0] = hc_bytealign_S (w3[0], w3[1], offset); c2[3] = hc_bytealign_S (w2[3], w3[0], offset); c2[2] = hc_bytealign_S (w2[2], w2[3], offset); c2[1] = hc_bytealign_S (w2[1], w2[2], offset); c2[0] = hc_bytealign_S (w2[0], w2[1], offset); c1[3] = hc_bytealign_S (w1[3], w2[0], offset); c1[2] = hc_bytealign_S (w1[2], w1[3], offset); c1[1] = hc_bytealign_S (w1[1], w1[2], offset); c1[0] = hc_bytealign_S (w1[0], w1[1], offset); c0[3] = hc_bytealign_S (w0[3], w1[0], offset); c0[2] = hc_bytealign_S (w0[2], w0[3], offset); c0[1] = hc_bytealign_S (w0[1], w0[2], offset); c0[0] = hc_bytealign_S (w0[0], w0[1], offset); w3[3] = hc_bytealign_S ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif #ifdef IS_NV // could be improved, too switch (offset_switch) { case 0: c0[0] = hc_bytealign_S (w3[3], 0, offset); w3[3] = hc_bytealign_S (w3[2], w3[3], offset); w3[2] = hc_bytealign_S (w3[1], w3[2], offset); w3[1] = hc_bytealign_S (w3[0], w3[1], offset); w3[0] = hc_bytealign_S (w2[3], w3[0], offset); w2[3] = hc_bytealign_S (w2[2], w2[3], offset); w2[2] = hc_bytealign_S (w2[1], w2[2], offset); w2[1] = hc_bytealign_S (w2[0], w2[1], offset); w2[0] = hc_bytealign_S (w1[3], w2[0], offset); w1[3] = hc_bytealign_S (w1[2], w1[3], offset); w1[2] = hc_bytealign_S (w1[1], w1[2], offset); w1[1] = hc_bytealign_S (w1[0], w1[1], offset); w1[0] = hc_bytealign_S (w0[3], w1[0], offset); w0[3] = hc_bytealign_S (w0[2], w0[3], offset); w0[2] = hc_bytealign_S (w0[1], w0[2], offset); w0[1] = hc_bytealign_S (w0[0], w0[1], offset); w0[0] = hc_bytealign_S ( 0, w0[0], offset); break; case 1: c0[1] = hc_bytealign_S (w3[3], 0, offset); c0[0] = hc_bytealign_S (w3[2], w3[3], offset); w3[3] = hc_bytealign_S (w3[1], w3[2], offset); w3[2] = hc_bytealign_S (w3[0], w3[1], offset); w3[1] = hc_bytealign_S (w2[3], w3[0], offset); w3[0] = hc_bytealign_S (w2[2], w2[3], offset); w2[3] = hc_bytealign_S (w2[1], w2[2], offset); w2[2] = hc_bytealign_S (w2[0], w2[1], offset); w2[1] = hc_bytealign_S (w1[3], w2[0], offset); w2[0] = hc_bytealign_S (w1[2], w1[3], offset); w1[3] = hc_bytealign_S (w1[1], w1[2], offset); w1[2] = hc_bytealign_S (w1[0], w1[1], offset); w1[1] = hc_bytealign_S (w0[3], w1[0], offset); w1[0] = hc_bytealign_S (w0[2], w0[3], offset); w0[3] = hc_bytealign_S (w0[1], w0[2], offset); w0[2] = hc_bytealign_S (w0[0], w0[1], offset); w0[1] = hc_bytealign_S ( 0, w0[0], offset); w0[0] = 0; break; case 2: c0[2] = hc_bytealign_S (w3[3], 0, offset); c0[1] = hc_bytealign_S (w3[2], w3[3], offset); c0[0] = hc_bytealign_S (w3[1], w3[2], offset); w3[3] = hc_bytealign_S (w3[0], w3[1], offset); w3[2] = hc_bytealign_S (w2[3], w3[0], offset); w3[1] = hc_bytealign_S (w2[2], w2[3], offset); w3[0] = hc_bytealign_S (w2[1], w2[2], offset); w2[3] = hc_bytealign_S (w2[0], w2[1], offset); w2[2] = hc_bytealign_S (w1[3], w2[0], offset); w2[1] = hc_bytealign_S (w1[2], w1[3], offset); w2[0] = hc_bytealign_S (w1[1], w1[2], offset); w1[3] = hc_bytealign_S (w1[0], w1[1], offset); w1[2] = hc_bytealign_S (w0[3], w1[0], offset); w1[1] = hc_bytealign_S (w0[2], w0[3], offset); w1[0] = hc_bytealign_S (w0[1], w0[2], offset); w0[3] = hc_bytealign_S (w0[0], w0[1], offset); w0[2] = hc_bytealign_S ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: c0[3] = hc_bytealign_S (w3[3], 0, offset); c0[2] = hc_bytealign_S (w3[2], w3[3], offset); c0[1] = hc_bytealign_S (w3[1], w3[2], offset); c0[0] = hc_bytealign_S (w3[0], w3[1], offset); w3[3] = hc_bytealign_S (w2[3], w3[0], offset); w3[2] = hc_bytealign_S (w2[2], w2[3], offset); w3[1] = hc_bytealign_S (w2[1], w2[2], offset); w3[0] = hc_bytealign_S (w2[0], w2[1], offset); w2[3] = hc_bytealign_S (w1[3], w2[0], offset); w2[2] = hc_bytealign_S (w1[2], w1[3], offset); w2[1] = hc_bytealign_S (w1[1], w1[2], offset); w2[0] = hc_bytealign_S (w1[0], w1[1], offset); w1[3] = hc_bytealign_S (w0[3], w1[0], offset); w1[2] = hc_bytealign_S (w0[2], w0[3], offset); w1[1] = hc_bytealign_S (w0[1], w0[2], offset); w1[0] = hc_bytealign_S (w0[0], w0[1], offset); w0[3] = hc_bytealign_S ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: c1[0] = hc_bytealign_S (w3[3], 0, offset); c0[3] = hc_bytealign_S (w3[2], w3[3], offset); c0[2] = hc_bytealign_S (w3[1], w3[2], offset); c0[1] = hc_bytealign_S (w3[0], w3[1], offset); c0[0] = hc_bytealign_S (w2[3], w3[0], offset); w3[3] = hc_bytealign_S (w2[2], w2[3], offset); w3[2] = hc_bytealign_S (w2[1], w2[2], offset); w3[1] = hc_bytealign_S (w2[0], w2[1], offset); w3[0] = hc_bytealign_S (w1[3], w2[0], offset); w2[3] = hc_bytealign_S (w1[2], w1[3], offset); w2[2] = hc_bytealign_S (w1[1], w1[2], offset); w2[1] = hc_bytealign_S (w1[0], w1[1], offset); w2[0] = hc_bytealign_S (w0[3], w1[0], offset); w1[3] = hc_bytealign_S (w0[2], w0[3], offset); w1[2] = hc_bytealign_S (w0[1], w0[2], offset); w1[1] = hc_bytealign_S (w0[0], w0[1], offset); w1[0] = hc_bytealign_S ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: c1[1] = hc_bytealign_S (w3[3], 0, offset); c1[0] = hc_bytealign_S (w3[2], w3[3], offset); c0[3] = hc_bytealign_S (w3[1], w3[2], offset); c0[2] = hc_bytealign_S (w3[0], w3[1], offset); c0[1] = hc_bytealign_S (w2[3], w3[0], offset); c0[0] = hc_bytealign_S (w2[2], w2[3], offset); w3[3] = hc_bytealign_S (w2[1], w2[2], offset); w3[2] = hc_bytealign_S (w2[0], w2[1], offset); w3[1] = hc_bytealign_S (w1[3], w2[0], offset); w3[0] = hc_bytealign_S (w1[2], w1[3], offset); w2[3] = hc_bytealign_S (w1[1], w1[2], offset); w2[2] = hc_bytealign_S (w1[0], w1[1], offset); w2[1] = hc_bytealign_S (w0[3], w1[0], offset); w2[0] = hc_bytealign_S (w0[2], w0[3], offset); w1[3] = hc_bytealign_S (w0[1], w0[2], offset); w1[2] = hc_bytealign_S (w0[0], w0[1], offset); w1[1] = hc_bytealign_S ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: c1[2] = hc_bytealign_S (w3[3], 0, offset); c1[1] = hc_bytealign_S (w3[2], w3[3], offset); c1[0] = hc_bytealign_S (w3[1], w3[2], offset); c0[3] = hc_bytealign_S (w3[0], w3[1], offset); c0[2] = hc_bytealign_S (w2[3], w3[0], offset); c0[1] = hc_bytealign_S (w2[2], w2[3], offset); c0[0] = hc_bytealign_S (w2[1], w2[2], offset); w3[3] = hc_bytealign_S (w2[0], w2[1], offset); w3[2] = hc_bytealign_S (w1[3], w2[0], offset); w3[1] = hc_bytealign_S (w1[2], w1[3], offset); w3[0] = hc_bytealign_S (w1[1], w1[2], offset); w2[3] = hc_bytealign_S (w1[0], w1[1], offset); w2[2] = hc_bytealign_S (w0[3], w1[0], offset); w2[1] = hc_bytealign_S (w0[2], w0[3], offset); w2[0] = hc_bytealign_S (w0[1], w0[2], offset); w1[3] = hc_bytealign_S (w0[0], w0[1], offset); w1[2] = hc_bytealign_S ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: c1[3] = hc_bytealign_S (w3[3], 0, offset); c1[2] = hc_bytealign_S (w3[2], w3[3], offset); c1[1] = hc_bytealign_S (w3[1], w3[2], offset); c1[0] = hc_bytealign_S (w3[0], w3[1], offset); c0[3] = hc_bytealign_S (w2[3], w3[0], offset); c0[2] = hc_bytealign_S (w2[2], w2[3], offset); c0[1] = hc_bytealign_S (w2[1], w2[2], offset); c0[0] = hc_bytealign_S (w2[0], w2[1], offset); w3[3] = hc_bytealign_S (w1[3], w2[0], offset); w3[2] = hc_bytealign_S (w1[2], w1[3], offset); w3[1] = hc_bytealign_S (w1[1], w1[2], offset); w3[0] = hc_bytealign_S (w1[0], w1[1], offset); w2[3] = hc_bytealign_S (w0[3], w1[0], offset); w2[2] = hc_bytealign_S (w0[2], w0[3], offset); w2[1] = hc_bytealign_S (w0[1], w0[2], offset); w2[0] = hc_bytealign_S (w0[0], w0[1], offset); w1[3] = hc_bytealign_S ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: c2[0] = hc_bytealign_S (w3[3], 0, offset); c1[3] = hc_bytealign_S (w3[2], w3[3], offset); c1[2] = hc_bytealign_S (w3[1], w3[2], offset); c1[1] = hc_bytealign_S (w3[0], w3[1], offset); c1[0] = hc_bytealign_S (w2[3], w3[0], offset); c0[3] = hc_bytealign_S (w2[2], w2[3], offset); c0[2] = hc_bytealign_S (w2[1], w2[2], offset); c0[1] = hc_bytealign_S (w2[0], w2[1], offset); c0[0] = hc_bytealign_S (w1[3], w2[0], offset); w3[3] = hc_bytealign_S (w1[2], w1[3], offset); w3[2] = hc_bytealign_S (w1[1], w1[2], offset); w3[1] = hc_bytealign_S (w1[0], w1[1], offset); w3[0] = hc_bytealign_S (w0[3], w1[0], offset); w2[3] = hc_bytealign_S (w0[2], w0[3], offset); w2[2] = hc_bytealign_S (w0[1], w0[2], offset); w2[1] = hc_bytealign_S (w0[0], w0[1], offset); w2[0] = hc_bytealign_S ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: c2[1] = hc_bytealign_S (w3[3], 0, offset); c2[0] = hc_bytealign_S (w3[2], w3[3], offset); c1[3] = hc_bytealign_S (w3[1], w3[2], offset); c1[2] = hc_bytealign_S (w3[0], w3[1], offset); c1[1] = hc_bytealign_S (w2[3], w3[0], offset); c1[0] = hc_bytealign_S (w2[2], w2[3], offset); c0[3] = hc_bytealign_S (w2[1], w2[2], offset); c0[2] = hc_bytealign_S (w2[0], w2[1], offset); c0[1] = hc_bytealign_S (w1[3], w2[0], offset); c0[0] = hc_bytealign_S (w1[2], w1[3], offset); w3[3] = hc_bytealign_S (w1[1], w1[2], offset); w3[2] = hc_bytealign_S (w1[0], w1[1], offset); w3[1] = hc_bytealign_S (w0[3], w1[0], offset); w3[0] = hc_bytealign_S (w0[2], w0[3], offset); w2[3] = hc_bytealign_S (w0[1], w0[2], offset); w2[2] = hc_bytealign_S (w0[0], w0[1], offset); w2[1] = hc_bytealign_S ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: c2[2] = hc_bytealign_S (w3[3], 0, offset); c2[1] = hc_bytealign_S (w3[2], w3[3], offset); c2[0] = hc_bytealign_S (w3[1], w3[2], offset); c1[3] = hc_bytealign_S (w3[0], w3[1], offset); c1[2] = hc_bytealign_S (w2[3], w3[0], offset); c1[1] = hc_bytealign_S (w2[2], w2[3], offset); c1[0] = hc_bytealign_S (w2[1], w2[2], offset); c0[3] = hc_bytealign_S (w2[0], w2[1], offset); c0[2] = hc_bytealign_S (w1[3], w2[0], offset); c0[1] = hc_bytealign_S (w1[2], w1[3], offset); c0[0] = hc_bytealign_S (w1[1], w1[2], offset); w3[3] = hc_bytealign_S (w1[0], w1[1], offset); w3[2] = hc_bytealign_S (w0[3], w1[0], offset); w3[1] = hc_bytealign_S (w0[2], w0[3], offset); w3[0] = hc_bytealign_S (w0[1], w0[2], offset); w2[3] = hc_bytealign_S (w0[0], w0[1], offset); w2[2] = hc_bytealign_S ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: c2[3] = hc_bytealign_S (w3[3], 0, offset); c2[2] = hc_bytealign_S (w3[2], w3[3], offset); c2[1] = hc_bytealign_S (w3[1], w3[2], offset); c2[0] = hc_bytealign_S (w3[0], w3[1], offset); c1[3] = hc_bytealign_S (w2[3], w3[0], offset); c1[2] = hc_bytealign_S (w2[2], w2[3], offset); c1[1] = hc_bytealign_S (w2[1], w2[2], offset); c1[0] = hc_bytealign_S (w2[0], w2[1], offset); c0[3] = hc_bytealign_S (w1[3], w2[0], offset); c0[2] = hc_bytealign_S (w1[2], w1[3], offset); c0[1] = hc_bytealign_S (w1[1], w1[2], offset); c0[0] = hc_bytealign_S (w1[0], w1[1], offset); w3[3] = hc_bytealign_S (w0[3], w1[0], offset); w3[2] = hc_bytealign_S (w0[2], w0[3], offset); w3[1] = hc_bytealign_S (w0[1], w0[2], offset); w3[0] = hc_bytealign_S (w0[0], w0[1], offset); w2[3] = hc_bytealign_S ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: c3[0] = hc_bytealign_S (w3[3], 0, offset); c2[3] = hc_bytealign_S (w3[2], w3[3], offset); c2[2] = hc_bytealign_S (w3[1], w3[2], offset); c2[1] = hc_bytealign_S (w3[0], w3[1], offset); c2[0] = hc_bytealign_S (w2[3], w3[0], offset); c1[3] = hc_bytealign_S (w2[2], w2[3], offset); c1[2] = hc_bytealign_S (w2[1], w2[2], offset); c1[1] = hc_bytealign_S (w2[0], w2[1], offset); c1[0] = hc_bytealign_S (w1[3], w2[0], offset); c0[3] = hc_bytealign_S (w1[2], w1[3], offset); c0[2] = hc_bytealign_S (w1[1], w1[2], offset); c0[1] = hc_bytealign_S (w1[0], w1[1], offset); c0[0] = hc_bytealign_S (w0[3], w1[0], offset); w3[3] = hc_bytealign_S (w0[2], w0[3], offset); w3[2] = hc_bytealign_S (w0[1], w0[2], offset); w3[1] = hc_bytealign_S (w0[0], w0[1], offset); w3[0] = hc_bytealign_S ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: c3[1] = hc_bytealign_S (w3[3], 0, offset); c3[0] = hc_bytealign_S (w3[2], w3[3], offset); c2[3] = hc_bytealign_S (w3[1], w3[2], offset); c2[2] = hc_bytealign_S (w3[0], w3[1], offset); c2[1] = hc_bytealign_S (w2[3], w3[0], offset); c2[0] = hc_bytealign_S (w2[2], w2[3], offset); c1[3] = hc_bytealign_S (w2[1], w2[2], offset); c1[2] = hc_bytealign_S (w2[0], w2[1], offset); c1[1] = hc_bytealign_S (w1[3], w2[0], offset); c1[0] = hc_bytealign_S (w1[2], w1[3], offset); c0[3] = hc_bytealign_S (w1[1], w1[2], offset); c0[2] = hc_bytealign_S (w1[0], w1[1], offset); c0[1] = hc_bytealign_S (w0[3], w1[0], offset); c0[0] = hc_bytealign_S (w0[2], w0[3], offset); w3[3] = hc_bytealign_S (w0[1], w0[2], offset); w3[2] = hc_bytealign_S (w0[0], w0[1], offset); w3[1] = hc_bytealign_S ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: c3[2] = hc_bytealign_S (w3[3], 0, offset); c3[1] = hc_bytealign_S (w3[2], w3[3], offset); c3[0] = hc_bytealign_S (w3[1], w3[2], offset); c2[3] = hc_bytealign_S (w3[0], w3[1], offset); c2[2] = hc_bytealign_S (w2[3], w3[0], offset); c2[1] = hc_bytealign_S (w2[2], w2[3], offset); c2[0] = hc_bytealign_S (w2[1], w2[2], offset); c1[3] = hc_bytealign_S (w2[0], w2[1], offset); c1[2] = hc_bytealign_S (w1[3], w2[0], offset); c1[1] = hc_bytealign_S (w1[2], w1[3], offset); c1[0] = hc_bytealign_S (w1[1], w1[2], offset); c0[3] = hc_bytealign_S (w1[0], w1[1], offset); c0[2] = hc_bytealign_S (w0[3], w1[0], offset); c0[1] = hc_bytealign_S (w0[2], w0[3], offset); c0[0] = hc_bytealign_S (w0[1], w0[2], offset); w3[3] = hc_bytealign_S (w0[0], w0[1], offset); w3[2] = hc_bytealign_S ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: c3[3] = hc_bytealign_S (w3[3], 0, offset); c3[2] = hc_bytealign_S (w3[2], w3[3], offset); c3[1] = hc_bytealign_S (w3[1], w3[2], offset); c3[0] = hc_bytealign_S (w3[0], w3[1], offset); c2[3] = hc_bytealign_S (w2[3], w3[0], offset); c2[2] = hc_bytealign_S (w2[2], w2[3], offset); c2[1] = hc_bytealign_S (w2[1], w2[2], offset); c2[0] = hc_bytealign_S (w2[0], w2[1], offset); c1[3] = hc_bytealign_S (w1[3], w2[0], offset); c1[2] = hc_bytealign_S (w1[2], w1[3], offset); c1[1] = hc_bytealign_S (w1[1], w1[2], offset); c1[0] = hc_bytealign_S (w1[0], w1[1], offset); c0[3] = hc_bytealign_S (w0[3], w1[0], offset); c0[2] = hc_bytealign_S (w0[2], w0[3], offset); c0[1] = hc_bytealign_S (w0[1], w0[2], offset); c0[0] = hc_bytealign_S (w0[0], w0[1], offset); w3[3] = hc_bytealign_S ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_be_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: w3[3] = hc_bytealign_be_S (w3[2], w3[3], offset); w3[2] = hc_bytealign_be_S (w3[1], w3[2], offset); w3[1] = hc_bytealign_be_S (w3[0], w3[1], offset); w3[0] = hc_bytealign_be_S (w2[3], w3[0], offset); w2[3] = hc_bytealign_be_S (w2[2], w2[3], offset); w2[2] = hc_bytealign_be_S (w2[1], w2[2], offset); w2[1] = hc_bytealign_be_S (w2[0], w2[1], offset); w2[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w1[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w1[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w1[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w1[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w0[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w0[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w0[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w0[0] = hc_bytealign_be_S ( 0, w0[0], offset); break; case 1: w3[3] = hc_bytealign_be_S (w3[1], w3[2], offset); w3[2] = hc_bytealign_be_S (w3[0], w3[1], offset); w3[1] = hc_bytealign_be_S (w2[3], w3[0], offset); w3[0] = hc_bytealign_be_S (w2[2], w2[3], offset); w2[3] = hc_bytealign_be_S (w2[1], w2[2], offset); w2[2] = hc_bytealign_be_S (w2[0], w2[1], offset); w2[1] = hc_bytealign_be_S (w1[3], w2[0], offset); w2[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w1[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w1[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w1[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w1[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w0[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w0[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w0[1] = hc_bytealign_be_S ( 0, w0[0], offset); w0[0] = 0; break; case 2: w3[3] = hc_bytealign_be_S (w3[0], w3[1], offset); w3[2] = hc_bytealign_be_S (w2[3], w3[0], offset); w3[1] = hc_bytealign_be_S (w2[2], w2[3], offset); w3[0] = hc_bytealign_be_S (w2[1], w2[2], offset); w2[3] = hc_bytealign_be_S (w2[0], w2[1], offset); w2[2] = hc_bytealign_be_S (w1[3], w2[0], offset); w2[1] = hc_bytealign_be_S (w1[2], w1[3], offset); w2[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w1[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w1[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w1[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w1[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w0[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w0[2] = hc_bytealign_be_S ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: w3[3] = hc_bytealign_be_S (w2[3], w3[0], offset); w3[2] = hc_bytealign_be_S (w2[2], w2[3], offset); w3[1] = hc_bytealign_be_S (w2[1], w2[2], offset); w3[0] = hc_bytealign_be_S (w2[0], w2[1], offset); w2[3] = hc_bytealign_be_S (w1[3], w2[0], offset); w2[2] = hc_bytealign_be_S (w1[2], w1[3], offset); w2[1] = hc_bytealign_be_S (w1[1], w1[2], offset); w2[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w1[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w1[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w1[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w1[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w0[3] = hc_bytealign_be_S ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: w3[3] = hc_bytealign_be_S (w2[2], w2[3], offset); w3[2] = hc_bytealign_be_S (w2[1], w2[2], offset); w3[1] = hc_bytealign_be_S (w2[0], w2[1], offset); w3[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w2[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w2[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w2[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w2[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w1[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w1[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w1[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w1[0] = hc_bytealign_be_S ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: w3[3] = hc_bytealign_be_S (w2[1], w2[2], offset); w3[2] = hc_bytealign_be_S (w2[0], w2[1], offset); w3[1] = hc_bytealign_be_S (w1[3], w2[0], offset); w3[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w2[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w2[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w2[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w2[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w1[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w1[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w1[1] = hc_bytealign_be_S ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: w3[3] = hc_bytealign_be_S (w2[0], w2[1], offset); w3[2] = hc_bytealign_be_S (w1[3], w2[0], offset); w3[1] = hc_bytealign_be_S (w1[2], w1[3], offset); w3[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w2[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w2[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w2[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w2[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w1[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w1[2] = hc_bytealign_be_S ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: w3[3] = hc_bytealign_be_S (w1[3], w2[0], offset); w3[2] = hc_bytealign_be_S (w1[2], w1[3], offset); w3[1] = hc_bytealign_be_S (w1[1], w1[2], offset); w3[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w2[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w2[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w2[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w2[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w1[3] = hc_bytealign_be_S ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: w3[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w3[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w3[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w3[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w2[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w2[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w2[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w2[0] = hc_bytealign_be_S ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: w3[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w3[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w3[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w3[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w2[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w2[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w2[1] = hc_bytealign_be_S ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: w3[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w3[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w3[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w3[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w2[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w2[2] = hc_bytealign_be_S ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: w3[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w3[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w3[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w3[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w2[3] = hc_bytealign_be_S ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: w3[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w3[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w3[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w3[0] = hc_bytealign_be_S ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: w3[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w3[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w3[1] = hc_bytealign_be_S ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: w3[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w3[2] = hc_bytealign_be_S ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: w3[3] = hc_bytealign_be_S ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV #if defined IS_NV const int selector = (0x76543210 >> ((offset & 3) * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> ((offset & 3) * 8)); #endif switch (offset_switch) { case 0: w3[3] = hc_byte_perm_S (w3[3], w3[2], selector); w3[2] = hc_byte_perm_S (w3[2], w3[1], selector); w3[1] = hc_byte_perm_S (w3[1], w3[0], selector); w3[0] = hc_byte_perm_S (w3[0], w2[3], selector); w2[3] = hc_byte_perm_S (w2[3], w2[2], selector); w2[2] = hc_byte_perm_S (w2[2], w2[1], selector); w2[1] = hc_byte_perm_S (w2[1], w2[0], selector); w2[0] = hc_byte_perm_S (w2[0], w1[3], selector); w1[3] = hc_byte_perm_S (w1[3], w1[2], selector); w1[2] = hc_byte_perm_S (w1[2], w1[1], selector); w1[1] = hc_byte_perm_S (w1[1], w1[0], selector); w1[0] = hc_byte_perm_S (w1[0], w0[3], selector); w0[3] = hc_byte_perm_S (w0[3], w0[2], selector); w0[2] = hc_byte_perm_S (w0[2], w0[1], selector); w0[1] = hc_byte_perm_S (w0[1], w0[0], selector); w0[0] = hc_byte_perm_S (w0[0], 0, selector); break; case 1: w3[3] = hc_byte_perm_S (w3[2], w3[1], selector); w3[2] = hc_byte_perm_S (w3[1], w3[0], selector); w3[1] = hc_byte_perm_S (w3[0], w2[3], selector); w3[0] = hc_byte_perm_S (w2[3], w2[2], selector); w2[3] = hc_byte_perm_S (w2[2], w2[1], selector); w2[2] = hc_byte_perm_S (w2[1], w2[0], selector); w2[1] = hc_byte_perm_S (w2[0], w1[3], selector); w2[0] = hc_byte_perm_S (w1[3], w1[2], selector); w1[3] = hc_byte_perm_S (w1[2], w1[1], selector); w1[2] = hc_byte_perm_S (w1[1], w1[0], selector); w1[1] = hc_byte_perm_S (w1[0], w0[3], selector); w1[0] = hc_byte_perm_S (w0[3], w0[2], selector); w0[3] = hc_byte_perm_S (w0[2], w0[1], selector); w0[2] = hc_byte_perm_S (w0[1], w0[0], selector); w0[1] = hc_byte_perm_S (w0[0], 0, selector); w0[0] = 0; break; case 2: w3[3] = hc_byte_perm_S (w3[1], w3[0], selector); w3[2] = hc_byte_perm_S (w3[0], w2[3], selector); w3[1] = hc_byte_perm_S (w2[3], w2[2], selector); w3[0] = hc_byte_perm_S (w2[2], w2[1], selector); w2[3] = hc_byte_perm_S (w2[1], w2[0], selector); w2[2] = hc_byte_perm_S (w2[0], w1[3], selector); w2[1] = hc_byte_perm_S (w1[3], w1[2], selector); w2[0] = hc_byte_perm_S (w1[2], w1[1], selector); w1[3] = hc_byte_perm_S (w1[1], w1[0], selector); w1[2] = hc_byte_perm_S (w1[0], w0[3], selector); w1[1] = hc_byte_perm_S (w0[3], w0[2], selector); w1[0] = hc_byte_perm_S (w0[2], w0[1], selector); w0[3] = hc_byte_perm_S (w0[1], w0[0], selector); w0[2] = hc_byte_perm_S (w0[0], 0, selector); w0[1] = 0; w0[0] = 0; break; case 3: w3[3] = hc_byte_perm_S (w3[0], w2[3], selector); w3[2] = hc_byte_perm_S (w2[3], w2[2], selector); w3[1] = hc_byte_perm_S (w2[2], w2[1], selector); w3[0] = hc_byte_perm_S (w2[1], w2[0], selector); w2[3] = hc_byte_perm_S (w2[0], w1[3], selector); w2[2] = hc_byte_perm_S (w1[3], w1[2], selector); w2[1] = hc_byte_perm_S (w1[2], w1[1], selector); w2[0] = hc_byte_perm_S (w1[1], w1[0], selector); w1[3] = hc_byte_perm_S (w1[0], w0[3], selector); w1[2] = hc_byte_perm_S (w0[3], w0[2], selector); w1[1] = hc_byte_perm_S (w0[2], w0[1], selector); w1[0] = hc_byte_perm_S (w0[1], w0[0], selector); w0[3] = hc_byte_perm_S (w0[0], 0, selector); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: w3[3] = hc_byte_perm_S (w2[3], w2[2], selector); w3[2] = hc_byte_perm_S (w2[2], w2[1], selector); w3[1] = hc_byte_perm_S (w2[1], w2[0], selector); w3[0] = hc_byte_perm_S (w2[0], w1[3], selector); w2[3] = hc_byte_perm_S (w1[3], w1[2], selector); w2[2] = hc_byte_perm_S (w1[2], w1[1], selector); w2[1] = hc_byte_perm_S (w1[1], w1[0], selector); w2[0] = hc_byte_perm_S (w1[0], w0[3], selector); w1[3] = hc_byte_perm_S (w0[3], w0[2], selector); w1[2] = hc_byte_perm_S (w0[2], w0[1], selector); w1[1] = hc_byte_perm_S (w0[1], w0[0], selector); w1[0] = hc_byte_perm_S (w0[0], 0, selector); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: w3[3] = hc_byte_perm_S (w2[2], w2[1], selector); w3[2] = hc_byte_perm_S (w2[1], w2[0], selector); w3[1] = hc_byte_perm_S (w2[0], w1[3], selector); w3[0] = hc_byte_perm_S (w1[3], w1[2], selector); w2[3] = hc_byte_perm_S (w1[2], w1[1], selector); w2[2] = hc_byte_perm_S (w1[1], w1[0], selector); w2[1] = hc_byte_perm_S (w1[0], w0[3], selector); w2[0] = hc_byte_perm_S (w0[3], w0[2], selector); w1[3] = hc_byte_perm_S (w0[2], w0[1], selector); w1[2] = hc_byte_perm_S (w0[1], w0[0], selector); w1[1] = hc_byte_perm_S (w0[0], 0, selector); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: w3[3] = hc_byte_perm_S (w2[1], w2[0], selector); w3[2] = hc_byte_perm_S (w2[0], w1[3], selector); w3[1] = hc_byte_perm_S (w1[3], w1[2], selector); w3[0] = hc_byte_perm_S (w1[2], w1[1], selector); w2[3] = hc_byte_perm_S (w1[1], w1[0], selector); w2[2] = hc_byte_perm_S (w1[0], w0[3], selector); w2[1] = hc_byte_perm_S (w0[3], w0[2], selector); w2[0] = hc_byte_perm_S (w0[2], w0[1], selector); w1[3] = hc_byte_perm_S (w0[1], w0[0], selector); w1[2] = hc_byte_perm_S (w0[0], 0, selector); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: w3[3] = hc_byte_perm_S (w2[0], w1[3], selector); w3[2] = hc_byte_perm_S (w1[3], w1[2], selector); w3[1] = hc_byte_perm_S (w1[2], w1[1], selector); w3[0] = hc_byte_perm_S (w1[1], w1[0], selector); w2[3] = hc_byte_perm_S (w1[0], w0[3], selector); w2[2] = hc_byte_perm_S (w0[3], w0[2], selector); w2[1] = hc_byte_perm_S (w0[2], w0[1], selector); w2[0] = hc_byte_perm_S (w0[1], w0[0], selector); w1[3] = hc_byte_perm_S (w0[0], 0, selector); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: w3[3] = hc_byte_perm_S (w1[3], w1[2], selector); w3[2] = hc_byte_perm_S (w1[2], w1[1], selector); w3[1] = hc_byte_perm_S (w1[1], w1[0], selector); w3[0] = hc_byte_perm_S (w1[0], w0[3], selector); w2[3] = hc_byte_perm_S (w0[3], w0[2], selector); w2[2] = hc_byte_perm_S (w0[2], w0[1], selector); w2[1] = hc_byte_perm_S (w0[1], w0[0], selector); w2[0] = hc_byte_perm_S (w0[0], 0, selector); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: w3[3] = hc_byte_perm_S (w1[2], w1[1], selector); w3[2] = hc_byte_perm_S (w1[1], w1[0], selector); w3[1] = hc_byte_perm_S (w1[0], w0[3], selector); w3[0] = hc_byte_perm_S (w0[3], w0[2], selector); w2[3] = hc_byte_perm_S (w0[2], w0[1], selector); w2[2] = hc_byte_perm_S (w0[1], w0[0], selector); w2[1] = hc_byte_perm_S (w0[0], 0, selector); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: w3[3] = hc_byte_perm_S (w1[1], w1[0], selector); w3[2] = hc_byte_perm_S (w1[0], w0[3], selector); w3[1] = hc_byte_perm_S (w0[3], w0[2], selector); w3[0] = hc_byte_perm_S (w0[2], w0[1], selector); w2[3] = hc_byte_perm_S (w0[1], w0[0], selector); w2[2] = hc_byte_perm_S (w0[0], 0, selector); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: w3[3] = hc_byte_perm_S (w1[0], w0[3], selector); w3[2] = hc_byte_perm_S (w0[3], w0[2], selector); w3[1] = hc_byte_perm_S (w0[2], w0[1], selector); w3[0] = hc_byte_perm_S (w0[1], w0[0], selector); w2[3] = hc_byte_perm_S (w0[0], 0, selector); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: w3[3] = hc_byte_perm_S (w0[3], w0[2], selector); w3[2] = hc_byte_perm_S (w0[2], w0[1], selector); w3[1] = hc_byte_perm_S (w0[1], w0[0], selector); w3[0] = hc_byte_perm_S (w0[0], 0, selector); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: w3[3] = hc_byte_perm_S (w0[2], w0[1], selector); w3[2] = hc_byte_perm_S (w0[1], w0[0], selector); w3[1] = hc_byte_perm_S (w0[0], 0, selector); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: w3[3] = hc_byte_perm_S (w0[1], w0[0], selector); w3[2] = hc_byte_perm_S (w0[0], 0, selector); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: w3[3] = hc_byte_perm_S (w0[0], 0, selector); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_carry_be_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, PRIVATE_AS u32 *c0, PRIVATE_AS u32 *c1, PRIVATE_AS u32 *c2, PRIVATE_AS u32 *c3, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: c0[0] = hc_bytealign_be_S (w3[3], 0, offset); w3[3] = hc_bytealign_be_S (w3[2], w3[3], offset); w3[2] = hc_bytealign_be_S (w3[1], w3[2], offset); w3[1] = hc_bytealign_be_S (w3[0], w3[1], offset); w3[0] = hc_bytealign_be_S (w2[3], w3[0], offset); w2[3] = hc_bytealign_be_S (w2[2], w2[3], offset); w2[2] = hc_bytealign_be_S (w2[1], w2[2], offset); w2[1] = hc_bytealign_be_S (w2[0], w2[1], offset); w2[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w1[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w1[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w1[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w1[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w0[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w0[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w0[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w0[0] = hc_bytealign_be_S ( 0, w0[0], offset); break; case 1: c0[1] = hc_bytealign_be_S (w3[3], 0, offset); c0[0] = hc_bytealign_be_S (w3[2], w3[3], offset); w3[3] = hc_bytealign_be_S (w3[1], w3[2], offset); w3[2] = hc_bytealign_be_S (w3[0], w3[1], offset); w3[1] = hc_bytealign_be_S (w2[3], w3[0], offset); w3[0] = hc_bytealign_be_S (w2[2], w2[3], offset); w2[3] = hc_bytealign_be_S (w2[1], w2[2], offset); w2[2] = hc_bytealign_be_S (w2[0], w2[1], offset); w2[1] = hc_bytealign_be_S (w1[3], w2[0], offset); w2[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w1[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w1[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w1[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w1[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w0[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w0[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w0[1] = hc_bytealign_be_S ( 0, w0[0], offset); w0[0] = 0; break; case 2: c0[2] = hc_bytealign_be_S (w3[3], 0, offset); c0[1] = hc_bytealign_be_S (w3[2], w3[3], offset); c0[0] = hc_bytealign_be_S (w3[1], w3[2], offset); w3[3] = hc_bytealign_be_S (w3[0], w3[1], offset); w3[2] = hc_bytealign_be_S (w2[3], w3[0], offset); w3[1] = hc_bytealign_be_S (w2[2], w2[3], offset); w3[0] = hc_bytealign_be_S (w2[1], w2[2], offset); w2[3] = hc_bytealign_be_S (w2[0], w2[1], offset); w2[2] = hc_bytealign_be_S (w1[3], w2[0], offset); w2[1] = hc_bytealign_be_S (w1[2], w1[3], offset); w2[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w1[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w1[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w1[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w1[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w0[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w0[2] = hc_bytealign_be_S ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: c0[3] = hc_bytealign_be_S (w3[3], 0, offset); c0[2] = hc_bytealign_be_S (w3[2], w3[3], offset); c0[1] = hc_bytealign_be_S (w3[1], w3[2], offset); c0[0] = hc_bytealign_be_S (w3[0], w3[1], offset); w3[3] = hc_bytealign_be_S (w2[3], w3[0], offset); w3[2] = hc_bytealign_be_S (w2[2], w2[3], offset); w3[1] = hc_bytealign_be_S (w2[1], w2[2], offset); w3[0] = hc_bytealign_be_S (w2[0], w2[1], offset); w2[3] = hc_bytealign_be_S (w1[3], w2[0], offset); w2[2] = hc_bytealign_be_S (w1[2], w1[3], offset); w2[1] = hc_bytealign_be_S (w1[1], w1[2], offset); w2[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w1[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w1[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w1[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w1[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w0[3] = hc_bytealign_be_S ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: c1[0] = hc_bytealign_be_S (w3[3], 0, offset); c0[3] = hc_bytealign_be_S (w3[2], w3[3], offset); c0[2] = hc_bytealign_be_S (w3[1], w3[2], offset); c0[1] = hc_bytealign_be_S (w3[0], w3[1], offset); c0[0] = hc_bytealign_be_S (w2[3], w3[0], offset); w3[3] = hc_bytealign_be_S (w2[2], w2[3], offset); w3[2] = hc_bytealign_be_S (w2[1], w2[2], offset); w3[1] = hc_bytealign_be_S (w2[0], w2[1], offset); w3[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w2[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w2[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w2[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w2[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w1[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w1[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w1[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w1[0] = hc_bytealign_be_S ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: c1[1] = hc_bytealign_be_S (w3[3], 0, offset); c1[0] = hc_bytealign_be_S (w3[2], w3[3], offset); c0[3] = hc_bytealign_be_S (w3[1], w3[2], offset); c0[2] = hc_bytealign_be_S (w3[0], w3[1], offset); c0[1] = hc_bytealign_be_S (w2[3], w3[0], offset); c0[0] = hc_bytealign_be_S (w2[2], w2[3], offset); w3[3] = hc_bytealign_be_S (w2[1], w2[2], offset); w3[2] = hc_bytealign_be_S (w2[0], w2[1], offset); w3[1] = hc_bytealign_be_S (w1[3], w2[0], offset); w3[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w2[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w2[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w2[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w2[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w1[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w1[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w1[1] = hc_bytealign_be_S ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: c1[2] = hc_bytealign_be_S (w3[3], 0, offset); c1[1] = hc_bytealign_be_S (w3[2], w3[3], offset); c1[0] = hc_bytealign_be_S (w3[1], w3[2], offset); c0[3] = hc_bytealign_be_S (w3[0], w3[1], offset); c0[2] = hc_bytealign_be_S (w2[3], w3[0], offset); c0[1] = hc_bytealign_be_S (w2[2], w2[3], offset); c0[0] = hc_bytealign_be_S (w2[1], w2[2], offset); w3[3] = hc_bytealign_be_S (w2[0], w2[1], offset); w3[2] = hc_bytealign_be_S (w1[3], w2[0], offset); w3[1] = hc_bytealign_be_S (w1[2], w1[3], offset); w3[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w2[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w2[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w2[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w2[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w1[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w1[2] = hc_bytealign_be_S ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: c1[3] = hc_bytealign_be_S (w3[3], 0, offset); c1[2] = hc_bytealign_be_S (w3[2], w3[3], offset); c1[1] = hc_bytealign_be_S (w3[1], w3[2], offset); c1[0] = hc_bytealign_be_S (w3[0], w3[1], offset); c0[3] = hc_bytealign_be_S (w2[3], w3[0], offset); c0[2] = hc_bytealign_be_S (w2[2], w2[3], offset); c0[1] = hc_bytealign_be_S (w2[1], w2[2], offset); c0[0] = hc_bytealign_be_S (w2[0], w2[1], offset); w3[3] = hc_bytealign_be_S (w1[3], w2[0], offset); w3[2] = hc_bytealign_be_S (w1[2], w1[3], offset); w3[1] = hc_bytealign_be_S (w1[1], w1[2], offset); w3[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w2[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w2[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w2[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w2[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w1[3] = hc_bytealign_be_S ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: c2[0] = hc_bytealign_be_S (w3[3], 0, offset); c1[3] = hc_bytealign_be_S (w3[2], w3[3], offset); c1[2] = hc_bytealign_be_S (w3[1], w3[2], offset); c1[1] = hc_bytealign_be_S (w3[0], w3[1], offset); c1[0] = hc_bytealign_be_S (w2[3], w3[0], offset); c0[3] = hc_bytealign_be_S (w2[2], w2[3], offset); c0[2] = hc_bytealign_be_S (w2[1], w2[2], offset); c0[1] = hc_bytealign_be_S (w2[0], w2[1], offset); c0[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w3[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w3[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w3[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w3[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w2[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w2[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w2[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w2[0] = hc_bytealign_be_S ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: c2[1] = hc_bytealign_be_S (w3[3], 0, offset); c2[0] = hc_bytealign_be_S (w3[2], w3[3], offset); c1[3] = hc_bytealign_be_S (w3[1], w3[2], offset); c1[2] = hc_bytealign_be_S (w3[0], w3[1], offset); c1[1] = hc_bytealign_be_S (w2[3], w3[0], offset); c1[0] = hc_bytealign_be_S (w2[2], w2[3], offset); c0[3] = hc_bytealign_be_S (w2[1], w2[2], offset); c0[2] = hc_bytealign_be_S (w2[0], w2[1], offset); c0[1] = hc_bytealign_be_S (w1[3], w2[0], offset); c0[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w3[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w3[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w3[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w3[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w2[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w2[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w2[1] = hc_bytealign_be_S ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: c2[2] = hc_bytealign_be_S (w3[3], 0, offset); c2[1] = hc_bytealign_be_S (w3[2], w3[3], offset); c2[0] = hc_bytealign_be_S (w3[1], w3[2], offset); c1[3] = hc_bytealign_be_S (w3[0], w3[1], offset); c1[2] = hc_bytealign_be_S (w2[3], w3[0], offset); c1[1] = hc_bytealign_be_S (w2[2], w2[3], offset); c1[0] = hc_bytealign_be_S (w2[1], w2[2], offset); c0[3] = hc_bytealign_be_S (w2[0], w2[1], offset); c0[2] = hc_bytealign_be_S (w1[3], w2[0], offset); c0[1] = hc_bytealign_be_S (w1[2], w1[3], offset); c0[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w3[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w3[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w3[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w3[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w2[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w2[2] = hc_bytealign_be_S ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: c2[3] = hc_bytealign_be_S (w3[3], 0, offset); c2[2] = hc_bytealign_be_S (w3[2], w3[3], offset); c2[1] = hc_bytealign_be_S (w3[1], w3[2], offset); c2[0] = hc_bytealign_be_S (w3[0], w3[1], offset); c1[3] = hc_bytealign_be_S (w2[3], w3[0], offset); c1[2] = hc_bytealign_be_S (w2[2], w2[3], offset); c1[1] = hc_bytealign_be_S (w2[1], w2[2], offset); c1[0] = hc_bytealign_be_S (w2[0], w2[1], offset); c0[3] = hc_bytealign_be_S (w1[3], w2[0], offset); c0[2] = hc_bytealign_be_S (w1[2], w1[3], offset); c0[1] = hc_bytealign_be_S (w1[1], w1[2], offset); c0[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w3[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w3[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w3[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w3[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w2[3] = hc_bytealign_be_S ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: c3[0] = hc_bytealign_be_S (w3[3], 0, offset); c2[3] = hc_bytealign_be_S (w3[2], w3[3], offset); c2[2] = hc_bytealign_be_S (w3[1], w3[2], offset); c2[1] = hc_bytealign_be_S (w3[0], w3[1], offset); c2[0] = hc_bytealign_be_S (w2[3], w3[0], offset); c1[3] = hc_bytealign_be_S (w2[2], w2[3], offset); c1[2] = hc_bytealign_be_S (w2[1], w2[2], offset); c1[1] = hc_bytealign_be_S (w2[0], w2[1], offset); c1[0] = hc_bytealign_be_S (w1[3], w2[0], offset); c0[3] = hc_bytealign_be_S (w1[2], w1[3], offset); c0[2] = hc_bytealign_be_S (w1[1], w1[2], offset); c0[1] = hc_bytealign_be_S (w1[0], w1[1], offset); c0[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w3[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w3[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w3[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w3[0] = hc_bytealign_be_S ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: c3[1] = hc_bytealign_be_S (w3[3], 0, offset); c3[0] = hc_bytealign_be_S (w3[2], w3[3], offset); c2[3] = hc_bytealign_be_S (w3[1], w3[2], offset); c2[2] = hc_bytealign_be_S (w3[0], w3[1], offset); c2[1] = hc_bytealign_be_S (w2[3], w3[0], offset); c2[0] = hc_bytealign_be_S (w2[2], w2[3], offset); c1[3] = hc_bytealign_be_S (w2[1], w2[2], offset); c1[2] = hc_bytealign_be_S (w2[0], w2[1], offset); c1[1] = hc_bytealign_be_S (w1[3], w2[0], offset); c1[0] = hc_bytealign_be_S (w1[2], w1[3], offset); c0[3] = hc_bytealign_be_S (w1[1], w1[2], offset); c0[2] = hc_bytealign_be_S (w1[0], w1[1], offset); c0[1] = hc_bytealign_be_S (w0[3], w1[0], offset); c0[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w3[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w3[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w3[1] = hc_bytealign_be_S ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: c3[2] = hc_bytealign_be_S (w3[3], 0, offset); c3[1] = hc_bytealign_be_S (w3[2], w3[3], offset); c3[0] = hc_bytealign_be_S (w3[1], w3[2], offset); c2[3] = hc_bytealign_be_S (w3[0], w3[1], offset); c2[2] = hc_bytealign_be_S (w2[3], w3[0], offset); c2[1] = hc_bytealign_be_S (w2[2], w2[3], offset); c2[0] = hc_bytealign_be_S (w2[1], w2[2], offset); c1[3] = hc_bytealign_be_S (w2[0], w2[1], offset); c1[2] = hc_bytealign_be_S (w1[3], w2[0], offset); c1[1] = hc_bytealign_be_S (w1[2], w1[3], offset); c1[0] = hc_bytealign_be_S (w1[1], w1[2], offset); c0[3] = hc_bytealign_be_S (w1[0], w1[1], offset); c0[2] = hc_bytealign_be_S (w0[3], w1[0], offset); c0[1] = hc_bytealign_be_S (w0[2], w0[3], offset); c0[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w3[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w3[2] = hc_bytealign_be_S ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: c3[3] = hc_bytealign_be_S (w3[3], 0, offset); c3[2] = hc_bytealign_be_S (w3[2], w3[3], offset); c3[1] = hc_bytealign_be_S (w3[1], w3[2], offset); c3[0] = hc_bytealign_be_S (w3[0], w3[1], offset); c2[3] = hc_bytealign_be_S (w2[3], w3[0], offset); c2[2] = hc_bytealign_be_S (w2[2], w2[3], offset); c2[1] = hc_bytealign_be_S (w2[1], w2[2], offset); c2[0] = hc_bytealign_be_S (w2[0], w2[1], offset); c1[3] = hc_bytealign_be_S (w1[3], w2[0], offset); c1[2] = hc_bytealign_be_S (w1[2], w1[3], offset); c1[1] = hc_bytealign_be_S (w1[1], w1[2], offset); c1[0] = hc_bytealign_be_S (w1[0], w1[1], offset); c0[3] = hc_bytealign_be_S (w0[3], w1[0], offset); c0[2] = hc_bytealign_be_S (w0[2], w0[3], offset); c0[1] = hc_bytealign_be_S (w0[1], w0[2], offset); c0[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w3[3] = hc_bytealign_be_S ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV #if defined IS_NV const int selector = (0x76543210 >> ((offset & 3) * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> ((offset & 3) * 8)); #endif switch (offset_switch) { case 0: c0[0] = hc_byte_perm_S ( 0, w3[3], selector); w3[3] = hc_byte_perm_S (w3[3], w3[2], selector); w3[2] = hc_byte_perm_S (w3[2], w3[1], selector); w3[1] = hc_byte_perm_S (w3[1], w3[0], selector); w3[0] = hc_byte_perm_S (w3[0], w2[3], selector); w2[3] = hc_byte_perm_S (w2[3], w2[2], selector); w2[2] = hc_byte_perm_S (w2[2], w2[1], selector); w2[1] = hc_byte_perm_S (w2[1], w2[0], selector); w2[0] = hc_byte_perm_S (w2[0], w1[3], selector); w1[3] = hc_byte_perm_S (w1[3], w1[2], selector); w1[2] = hc_byte_perm_S (w1[2], w1[1], selector); w1[1] = hc_byte_perm_S (w1[1], w1[0], selector); w1[0] = hc_byte_perm_S (w1[0], w0[3], selector); w0[3] = hc_byte_perm_S (w0[3], w0[2], selector); w0[2] = hc_byte_perm_S (w0[2], w0[1], selector); w0[1] = hc_byte_perm_S (w0[1], w0[0], selector); w0[0] = hc_byte_perm_S (w0[0], 0, selector); break; case 1: c0[1] = hc_byte_perm_S ( 0, w3[3], selector); c0[0] = hc_byte_perm_S (w3[3], w3[2], selector); w3[3] = hc_byte_perm_S (w3[2], w3[1], selector); w3[2] = hc_byte_perm_S (w3[1], w3[0], selector); w3[1] = hc_byte_perm_S (w3[0], w2[3], selector); w3[0] = hc_byte_perm_S (w2[3], w2[2], selector); w2[3] = hc_byte_perm_S (w2[2], w2[1], selector); w2[2] = hc_byte_perm_S (w2[1], w2[0], selector); w2[1] = hc_byte_perm_S (w2[0], w1[3], selector); w2[0] = hc_byte_perm_S (w1[3], w1[2], selector); w1[3] = hc_byte_perm_S (w1[2], w1[1], selector); w1[2] = hc_byte_perm_S (w1[1], w1[0], selector); w1[1] = hc_byte_perm_S (w1[0], w0[3], selector); w1[0] = hc_byte_perm_S (w0[3], w0[2], selector); w0[3] = hc_byte_perm_S (w0[2], w0[1], selector); w0[2] = hc_byte_perm_S (w0[1], w0[0], selector); w0[1] = hc_byte_perm_S (w0[0], 0, selector); w0[0] = 0; break; case 2: c0[2] = hc_byte_perm_S ( 0, w3[3], selector); c0[1] = hc_byte_perm_S (w3[3], w3[2], selector); c0[0] = hc_byte_perm_S (w3[2], w3[1], selector); w3[3] = hc_byte_perm_S (w3[1], w3[0], selector); w3[2] = hc_byte_perm_S (w3[0], w2[3], selector); w3[1] = hc_byte_perm_S (w2[3], w2[2], selector); w3[0] = hc_byte_perm_S (w2[2], w2[1], selector); w2[3] = hc_byte_perm_S (w2[1], w2[0], selector); w2[2] = hc_byte_perm_S (w2[0], w1[3], selector); w2[1] = hc_byte_perm_S (w1[3], w1[2], selector); w2[0] = hc_byte_perm_S (w1[2], w1[1], selector); w1[3] = hc_byte_perm_S (w1[1], w1[0], selector); w1[2] = hc_byte_perm_S (w1[0], w0[3], selector); w1[1] = hc_byte_perm_S (w0[3], w0[2], selector); w1[0] = hc_byte_perm_S (w0[2], w0[1], selector); w0[3] = hc_byte_perm_S (w0[1], w0[0], selector); w0[2] = hc_byte_perm_S (w0[0], 0, selector); w0[1] = 0; w0[0] = 0; break; case 3: c0[3] = hc_byte_perm_S ( 0, w3[3], selector); c0[2] = hc_byte_perm_S (w3[3], w3[2], selector); c0[1] = hc_byte_perm_S (w3[2], w3[1], selector); c0[0] = hc_byte_perm_S (w3[1], w3[0], selector); w3[3] = hc_byte_perm_S (w3[0], w2[3], selector); w3[2] = hc_byte_perm_S (w2[3], w2[2], selector); w3[1] = hc_byte_perm_S (w2[2], w2[1], selector); w3[0] = hc_byte_perm_S (w2[1], w2[0], selector); w2[3] = hc_byte_perm_S (w2[0], w1[3], selector); w2[2] = hc_byte_perm_S (w1[3], w1[2], selector); w2[1] = hc_byte_perm_S (w1[2], w1[1], selector); w2[0] = hc_byte_perm_S (w1[1], w1[0], selector); w1[3] = hc_byte_perm_S (w1[0], w0[3], selector); w1[2] = hc_byte_perm_S (w0[3], w0[2], selector); w1[1] = hc_byte_perm_S (w0[2], w0[1], selector); w1[0] = hc_byte_perm_S (w0[1], w0[0], selector); w0[3] = hc_byte_perm_S (w0[0], 0, selector); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: c1[0] = hc_byte_perm_S ( 0, w3[3], selector); c0[3] = hc_byte_perm_S (w3[3], w3[2], selector); c0[2] = hc_byte_perm_S (w3[2], w3[1], selector); c0[1] = hc_byte_perm_S (w3[1], w3[0], selector); c0[0] = hc_byte_perm_S (w3[0], w2[3], selector); w3[3] = hc_byte_perm_S (w2[3], w2[2], selector); w3[2] = hc_byte_perm_S (w2[2], w2[1], selector); w3[1] = hc_byte_perm_S (w2[1], w2[0], selector); w3[0] = hc_byte_perm_S (w2[0], w1[3], selector); w2[3] = hc_byte_perm_S (w1[3], w1[2], selector); w2[2] = hc_byte_perm_S (w1[2], w1[1], selector); w2[1] = hc_byte_perm_S (w1[1], w1[0], selector); w2[0] = hc_byte_perm_S (w1[0], w0[3], selector); w1[3] = hc_byte_perm_S (w0[3], w0[2], selector); w1[2] = hc_byte_perm_S (w0[2], w0[1], selector); w1[1] = hc_byte_perm_S (w0[1], w0[0], selector); w1[0] = hc_byte_perm_S (w0[0], 0, selector); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: c1[1] = hc_byte_perm_S ( 0, w3[3], selector); c1[0] = hc_byte_perm_S (w3[3], w3[2], selector); c0[3] = hc_byte_perm_S (w3[2], w3[1], selector); c0[2] = hc_byte_perm_S (w3[1], w3[0], selector); c0[1] = hc_byte_perm_S (w3[0], w2[3], selector); c0[0] = hc_byte_perm_S (w2[3], w2[2], selector); w3[3] = hc_byte_perm_S (w2[2], w2[1], selector); w3[2] = hc_byte_perm_S (w2[1], w2[0], selector); w3[1] = hc_byte_perm_S (w2[0], w1[3], selector); w3[0] = hc_byte_perm_S (w1[3], w1[2], selector); w2[3] = hc_byte_perm_S (w1[2], w1[1], selector); w2[2] = hc_byte_perm_S (w1[1], w1[0], selector); w2[1] = hc_byte_perm_S (w1[0], w0[3], selector); w2[0] = hc_byte_perm_S (w0[3], w0[2], selector); w1[3] = hc_byte_perm_S (w0[2], w0[1], selector); w1[2] = hc_byte_perm_S (w0[1], w0[0], selector); w1[1] = hc_byte_perm_S (w0[0], 0, selector); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: c1[2] = hc_byte_perm_S ( 0, w3[3], selector); c1[1] = hc_byte_perm_S (w3[3], w3[2], selector); c1[0] = hc_byte_perm_S (w3[2], w3[1], selector); c0[3] = hc_byte_perm_S (w3[1], w3[0], selector); c0[2] = hc_byte_perm_S (w3[0], w2[3], selector); c0[1] = hc_byte_perm_S (w2[3], w2[2], selector); c0[0] = hc_byte_perm_S (w2[2], w2[1], selector); w3[3] = hc_byte_perm_S (w2[1], w2[0], selector); w3[2] = hc_byte_perm_S (w2[0], w1[3], selector); w3[1] = hc_byte_perm_S (w1[3], w1[2], selector); w3[0] = hc_byte_perm_S (w1[2], w1[1], selector); w2[3] = hc_byte_perm_S (w1[1], w1[0], selector); w2[2] = hc_byte_perm_S (w1[0], w0[3], selector); w2[1] = hc_byte_perm_S (w0[3], w0[2], selector); w2[0] = hc_byte_perm_S (w0[2], w0[1], selector); w1[3] = hc_byte_perm_S (w0[1], w0[0], selector); w1[2] = hc_byte_perm_S (w0[0], 0, selector); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: c1[3] = hc_byte_perm_S ( 0, w3[3], selector); c1[2] = hc_byte_perm_S (w3[3], w3[2], selector); c1[1] = hc_byte_perm_S (w3[2], w3[1], selector); c1[0] = hc_byte_perm_S (w3[1], w3[0], selector); c0[3] = hc_byte_perm_S (w3[0], w2[3], selector); c0[2] = hc_byte_perm_S (w2[3], w2[2], selector); c0[1] = hc_byte_perm_S (w2[2], w2[1], selector); c0[0] = hc_byte_perm_S (w2[1], w2[0], selector); w3[3] = hc_byte_perm_S (w2[0], w1[3], selector); w3[2] = hc_byte_perm_S (w1[3], w1[2], selector); w3[1] = hc_byte_perm_S (w1[2], w1[1], selector); w3[0] = hc_byte_perm_S (w1[1], w1[0], selector); w2[3] = hc_byte_perm_S (w1[0], w0[3], selector); w2[2] = hc_byte_perm_S (w0[3], w0[2], selector); w2[1] = hc_byte_perm_S (w0[2], w0[1], selector); w2[0] = hc_byte_perm_S (w0[1], w0[0], selector); w1[3] = hc_byte_perm_S (w0[0], 0, selector); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: c2[0] = hc_byte_perm_S ( 0, w3[3], selector); c1[3] = hc_byte_perm_S (w3[3], w3[2], selector); c1[2] = hc_byte_perm_S (w3[2], w3[1], selector); c1[1] = hc_byte_perm_S (w3[1], w3[0], selector); c1[0] = hc_byte_perm_S (w3[0], w2[3], selector); c0[3] = hc_byte_perm_S (w2[3], w2[2], selector); c0[2] = hc_byte_perm_S (w2[2], w2[1], selector); c0[1] = hc_byte_perm_S (w2[1], w2[0], selector); c0[0] = hc_byte_perm_S (w2[0], w1[3], selector); w3[3] = hc_byte_perm_S (w1[3], w1[2], selector); w3[2] = hc_byte_perm_S (w1[2], w1[1], selector); w3[1] = hc_byte_perm_S (w1[1], w1[0], selector); w3[0] = hc_byte_perm_S (w1[0], w0[3], selector); w2[3] = hc_byte_perm_S (w0[3], w0[2], selector); w2[2] = hc_byte_perm_S (w0[2], w0[1], selector); w2[1] = hc_byte_perm_S (w0[1], w0[0], selector); w2[0] = hc_byte_perm_S (w0[0], 0, selector); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: c2[1] = hc_byte_perm_S ( 0, w3[3], selector); c2[0] = hc_byte_perm_S (w3[3], w3[2], selector); c1[3] = hc_byte_perm_S (w3[2], w3[1], selector); c1[2] = hc_byte_perm_S (w3[1], w3[0], selector); c1[1] = hc_byte_perm_S (w3[0], w2[3], selector); c1[0] = hc_byte_perm_S (w2[3], w2[2], selector); c0[3] = hc_byte_perm_S (w2[2], w2[1], selector); c0[2] = hc_byte_perm_S (w2[1], w2[0], selector); c0[1] = hc_byte_perm_S (w2[0], w1[3], selector); c0[0] = hc_byte_perm_S (w1[3], w1[2], selector); w3[3] = hc_byte_perm_S (w1[2], w1[1], selector); w3[2] = hc_byte_perm_S (w1[1], w1[0], selector); w3[1] = hc_byte_perm_S (w1[0], w0[3], selector); w3[0] = hc_byte_perm_S (w0[3], w0[2], selector); w2[3] = hc_byte_perm_S (w0[2], w0[1], selector); w2[2] = hc_byte_perm_S (w0[1], w0[0], selector); w2[1] = hc_byte_perm_S (w0[0], 0, selector); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: c2[2] = hc_byte_perm_S ( 0, w3[3], selector); c2[1] = hc_byte_perm_S (w3[3], w3[2], selector); c2[0] = hc_byte_perm_S (w3[2], w3[1], selector); c1[3] = hc_byte_perm_S (w3[1], w3[0], selector); c1[2] = hc_byte_perm_S (w3[0], w2[3], selector); c1[1] = hc_byte_perm_S (w2[3], w2[2], selector); c1[0] = hc_byte_perm_S (w2[2], w2[1], selector); c0[3] = hc_byte_perm_S (w2[1], w2[0], selector); c0[2] = hc_byte_perm_S (w2[0], w1[3], selector); c0[1] = hc_byte_perm_S (w1[3], w1[2], selector); c0[0] = hc_byte_perm_S (w1[2], w1[1], selector); w3[3] = hc_byte_perm_S (w1[1], w1[0], selector); w3[2] = hc_byte_perm_S (w1[0], w0[3], selector); w3[1] = hc_byte_perm_S (w0[3], w0[2], selector); w3[0] = hc_byte_perm_S (w0[2], w0[1], selector); w2[3] = hc_byte_perm_S (w0[1], w0[0], selector); w2[2] = hc_byte_perm_S (w0[0], 0, selector); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: c2[3] = hc_byte_perm_S ( 0, w3[3], selector); c2[2] = hc_byte_perm_S (w3[3], w3[2], selector); c2[1] = hc_byte_perm_S (w3[2], w3[1], selector); c2[0] = hc_byte_perm_S (w3[1], w3[0], selector); c1[3] = hc_byte_perm_S (w3[0], w2[3], selector); c1[2] = hc_byte_perm_S (w2[3], w2[2], selector); c1[1] = hc_byte_perm_S (w2[2], w2[1], selector); c1[0] = hc_byte_perm_S (w2[1], w2[0], selector); c0[3] = hc_byte_perm_S (w2[0], w1[3], selector); c0[2] = hc_byte_perm_S (w1[3], w1[2], selector); c0[1] = hc_byte_perm_S (w1[2], w1[1], selector); c0[0] = hc_byte_perm_S (w1[1], w1[0], selector); w3[3] = hc_byte_perm_S (w1[0], w0[3], selector); w3[2] = hc_byte_perm_S (w0[3], w0[2], selector); w3[1] = hc_byte_perm_S (w0[2], w0[1], selector); w3[0] = hc_byte_perm_S (w0[1], w0[0], selector); w2[3] = hc_byte_perm_S (w0[0], 0, selector); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: c3[0] = hc_byte_perm_S ( 0, w3[3], selector); c2[3] = hc_byte_perm_S (w3[3], w3[2], selector); c2[2] = hc_byte_perm_S (w3[2], w3[1], selector); c2[1] = hc_byte_perm_S (w3[1], w3[0], selector); c2[0] = hc_byte_perm_S (w3[0], w2[3], selector); c1[3] = hc_byte_perm_S (w2[3], w2[2], selector); c1[2] = hc_byte_perm_S (w2[2], w2[1], selector); c1[1] = hc_byte_perm_S (w2[1], w2[0], selector); c1[0] = hc_byte_perm_S (w2[0], w1[3], selector); c0[3] = hc_byte_perm_S (w1[3], w1[2], selector); c0[2] = hc_byte_perm_S (w1[2], w1[1], selector); c0[1] = hc_byte_perm_S (w1[1], w1[0], selector); c0[0] = hc_byte_perm_S (w1[0], w0[3], selector); w3[3] = hc_byte_perm_S (w0[3], w0[2], selector); w3[2] = hc_byte_perm_S (w0[2], w0[1], selector); w3[1] = hc_byte_perm_S (w0[1], w0[0], selector); w3[0] = hc_byte_perm_S (w0[0], 0, selector); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: c3[1] = hc_byte_perm_S ( 0, w3[3], selector); c3[0] = hc_byte_perm_S (w3[3], w3[2], selector); c2[3] = hc_byte_perm_S (w3[2], w3[1], selector); c2[2] = hc_byte_perm_S (w3[1], w3[0], selector); c2[1] = hc_byte_perm_S (w3[0], w2[3], selector); c2[0] = hc_byte_perm_S (w2[3], w2[2], selector); c1[3] = hc_byte_perm_S (w2[2], w2[1], selector); c1[2] = hc_byte_perm_S (w2[1], w2[0], selector); c1[1] = hc_byte_perm_S (w2[0], w1[3], selector); c1[0] = hc_byte_perm_S (w1[3], w1[2], selector); c0[3] = hc_byte_perm_S (w1[2], w1[1], selector); c0[2] = hc_byte_perm_S (w1[1], w1[0], selector); c0[1] = hc_byte_perm_S (w1[0], w0[3], selector); c0[0] = hc_byte_perm_S (w0[3], w0[2], selector); w3[3] = hc_byte_perm_S (w0[2], w0[1], selector); w3[2] = hc_byte_perm_S (w0[1], w0[0], selector); w3[1] = hc_byte_perm_S (w0[0], 0, selector); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: c3[2] = hc_byte_perm_S ( 0, w3[3], selector); c3[1] = hc_byte_perm_S (w3[3], w3[2], selector); c3[0] = hc_byte_perm_S (w3[2], w3[1], selector); c2[3] = hc_byte_perm_S (w3[1], w3[0], selector); c2[2] = hc_byte_perm_S (w3[0], w2[3], selector); c2[1] = hc_byte_perm_S (w2[3], w2[2], selector); c2[0] = hc_byte_perm_S (w2[2], w2[1], selector); c1[3] = hc_byte_perm_S (w2[1], w2[0], selector); c1[2] = hc_byte_perm_S (w2[0], w1[3], selector); c1[1] = hc_byte_perm_S (w1[3], w1[2], selector); c1[0] = hc_byte_perm_S (w1[2], w1[1], selector); c0[3] = hc_byte_perm_S (w1[1], w1[0], selector); c0[2] = hc_byte_perm_S (w1[0], w0[3], selector); c0[1] = hc_byte_perm_S (w0[3], w0[2], selector); c0[0] = hc_byte_perm_S (w0[2], w0[1], selector); w3[3] = hc_byte_perm_S (w0[1], w0[0], selector); w3[2] = hc_byte_perm_S (w0[0], 0, selector); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: c3[3] = hc_byte_perm_S ( 0, w3[3], selector); c3[2] = hc_byte_perm_S (w3[3], w3[2], selector); c3[1] = hc_byte_perm_S (w3[2], w3[1], selector); c3[0] = hc_byte_perm_S (w3[1], w3[0], selector); c2[3] = hc_byte_perm_S (w3[0], w2[3], selector); c2[2] = hc_byte_perm_S (w2[3], w2[2], selector); c2[1] = hc_byte_perm_S (w2[2], w2[1], selector); c2[0] = hc_byte_perm_S (w2[1], w2[0], selector); c1[3] = hc_byte_perm_S (w2[0], w1[3], selector); c1[2] = hc_byte_perm_S (w1[3], w1[2], selector); c1[1] = hc_byte_perm_S (w1[2], w1[1], selector); c1[0] = hc_byte_perm_S (w1[1], w1[0], selector); c0[3] = hc_byte_perm_S (w1[0], w0[3], selector); c0[2] = hc_byte_perm_S (w0[3], w0[2], selector); c0[1] = hc_byte_perm_S (w0[2], w0[1], selector); c0[0] = hc_byte_perm_S (w0[1], w0[0], selector); w3[3] = hc_byte_perm_S (w0[0], 0, selector); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_8x4_le_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, PRIVATE_AS u32 *w4, PRIVATE_AS u32 *w5, PRIVATE_AS u32 *w6, PRIVATE_AS u32 *w7, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: w7[3] = hc_bytealign_S (w7[2], w7[3], offset); w7[2] = hc_bytealign_S (w7[1], w7[2], offset); w7[1] = hc_bytealign_S (w7[0], w7[1], offset); w7[0] = hc_bytealign_S (w6[3], w7[0], offset); w6[3] = hc_bytealign_S (w6[2], w6[3], offset); w6[2] = hc_bytealign_S (w6[1], w6[2], offset); w6[1] = hc_bytealign_S (w6[0], w6[1], offset); w6[0] = hc_bytealign_S (w5[3], w6[0], offset); w5[3] = hc_bytealign_S (w5[2], w5[3], offset); w5[2] = hc_bytealign_S (w5[1], w5[2], offset); w5[1] = hc_bytealign_S (w5[0], w5[1], offset); w5[0] = hc_bytealign_S (w4[3], w5[0], offset); w4[3] = hc_bytealign_S (w4[2], w4[3], offset); w4[2] = hc_bytealign_S (w4[1], w4[2], offset); w4[1] = hc_bytealign_S (w4[0], w4[1], offset); w4[0] = hc_bytealign_S (w3[3], w4[0], offset); w3[3] = hc_bytealign_S (w3[2], w3[3], offset); w3[2] = hc_bytealign_S (w3[1], w3[2], offset); w3[1] = hc_bytealign_S (w3[0], w3[1], offset); w3[0] = hc_bytealign_S (w2[3], w3[0], offset); w2[3] = hc_bytealign_S (w2[2], w2[3], offset); w2[2] = hc_bytealign_S (w2[1], w2[2], offset); w2[1] = hc_bytealign_S (w2[0], w2[1], offset); w2[0] = hc_bytealign_S (w1[3], w2[0], offset); w1[3] = hc_bytealign_S (w1[2], w1[3], offset); w1[2] = hc_bytealign_S (w1[1], w1[2], offset); w1[1] = hc_bytealign_S (w1[0], w1[1], offset); w1[0] = hc_bytealign_S (w0[3], w1[0], offset); w0[3] = hc_bytealign_S (w0[2], w0[3], offset); w0[2] = hc_bytealign_S (w0[1], w0[2], offset); w0[1] = hc_bytealign_S (w0[0], w0[1], offset); w0[0] = hc_bytealign_S ( 0, w0[0], offset); break; case 1: w7[3] = hc_bytealign_S (w7[1], w7[2], offset); w7[2] = hc_bytealign_S (w7[0], w7[1], offset); w7[1] = hc_bytealign_S (w6[3], w7[0], offset); w7[0] = hc_bytealign_S (w6[2], w6[3], offset); w6[3] = hc_bytealign_S (w6[1], w6[2], offset); w6[2] = hc_bytealign_S (w6[0], w6[1], offset); w6[1] = hc_bytealign_S (w5[3], w6[0], offset); w6[0] = hc_bytealign_S (w5[2], w5[3], offset); w5[3] = hc_bytealign_S (w5[1], w5[2], offset); w5[2] = hc_bytealign_S (w5[0], w5[1], offset); w5[1] = hc_bytealign_S (w4[3], w5[0], offset); w5[0] = hc_bytealign_S (w4[2], w4[3], offset); w4[3] = hc_bytealign_S (w4[1], w4[2], offset); w4[2] = hc_bytealign_S (w4[0], w4[1], offset); w4[1] = hc_bytealign_S (w3[3], w4[0], offset); w4[0] = hc_bytealign_S (w3[2], w3[3], offset); w3[3] = hc_bytealign_S (w3[1], w3[2], offset); w3[2] = hc_bytealign_S (w3[0], w3[1], offset); w3[1] = hc_bytealign_S (w2[3], w3[0], offset); w3[0] = hc_bytealign_S (w2[2], w2[3], offset); w2[3] = hc_bytealign_S (w2[1], w2[2], offset); w2[2] = hc_bytealign_S (w2[0], w2[1], offset); w2[1] = hc_bytealign_S (w1[3], w2[0], offset); w2[0] = hc_bytealign_S (w1[2], w1[3], offset); w1[3] = hc_bytealign_S (w1[1], w1[2], offset); w1[2] = hc_bytealign_S (w1[0], w1[1], offset); w1[1] = hc_bytealign_S (w0[3], w1[0], offset); w1[0] = hc_bytealign_S (w0[2], w0[3], offset); w0[3] = hc_bytealign_S (w0[1], w0[2], offset); w0[2] = hc_bytealign_S (w0[0], w0[1], offset); w0[1] = hc_bytealign_S ( 0, w0[0], offset); w0[0] = 0; break; case 2: w7[3] = hc_bytealign_S (w7[0], w7[1], offset); w7[2] = hc_bytealign_S (w6[3], w7[0], offset); w7[1] = hc_bytealign_S (w6[2], w6[3], offset); w7[0] = hc_bytealign_S (w6[1], w6[2], offset); w6[3] = hc_bytealign_S (w6[0], w6[1], offset); w6[2] = hc_bytealign_S (w5[3], w6[0], offset); w6[1] = hc_bytealign_S (w5[2], w5[3], offset); w6[0] = hc_bytealign_S (w5[1], w5[2], offset); w5[3] = hc_bytealign_S (w5[0], w5[1], offset); w5[2] = hc_bytealign_S (w4[3], w5[0], offset); w5[1] = hc_bytealign_S (w4[2], w4[3], offset); w5[0] = hc_bytealign_S (w4[1], w4[2], offset); w4[3] = hc_bytealign_S (w4[0], w4[1], offset); w4[2] = hc_bytealign_S (w3[3], w4[0], offset); w4[1] = hc_bytealign_S (w3[2], w3[3], offset); w4[0] = hc_bytealign_S (w3[1], w3[2], offset); w3[3] = hc_bytealign_S (w3[0], w3[1], offset); w3[2] = hc_bytealign_S (w2[3], w3[0], offset); w3[1] = hc_bytealign_S (w2[2], w2[3], offset); w3[0] = hc_bytealign_S (w2[1], w2[2], offset); w2[3] = hc_bytealign_S (w2[0], w2[1], offset); w2[2] = hc_bytealign_S (w1[3], w2[0], offset); w2[1] = hc_bytealign_S (w1[2], w1[3], offset); w2[0] = hc_bytealign_S (w1[1], w1[2], offset); w1[3] = hc_bytealign_S (w1[0], w1[1], offset); w1[2] = hc_bytealign_S (w0[3], w1[0], offset); w1[1] = hc_bytealign_S (w0[2], w0[3], offset); w1[0] = hc_bytealign_S (w0[1], w0[2], offset); w0[3] = hc_bytealign_S (w0[0], w0[1], offset); w0[2] = hc_bytealign_S ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: w7[3] = hc_bytealign_S (w6[3], w7[0], offset); w7[2] = hc_bytealign_S (w6[2], w6[3], offset); w7[1] = hc_bytealign_S (w6[1], w6[2], offset); w7[0] = hc_bytealign_S (w6[0], w6[1], offset); w6[3] = hc_bytealign_S (w5[3], w6[0], offset); w6[2] = hc_bytealign_S (w5[2], w5[3], offset); w6[1] = hc_bytealign_S (w5[1], w5[2], offset); w6[0] = hc_bytealign_S (w5[0], w5[1], offset); w5[3] = hc_bytealign_S (w4[3], w5[0], offset); w5[2] = hc_bytealign_S (w4[2], w4[3], offset); w5[1] = hc_bytealign_S (w4[1], w4[2], offset); w5[0] = hc_bytealign_S (w4[0], w4[1], offset); w4[3] = hc_bytealign_S (w3[3], w4[0], offset); w4[2] = hc_bytealign_S (w3[2], w3[3], offset); w4[1] = hc_bytealign_S (w3[1], w3[2], offset); w4[0] = hc_bytealign_S (w3[0], w3[1], offset); w3[3] = hc_bytealign_S (w2[3], w3[0], offset); w3[2] = hc_bytealign_S (w2[2], w2[3], offset); w3[1] = hc_bytealign_S (w2[1], w2[2], offset); w3[0] = hc_bytealign_S (w2[0], w2[1], offset); w2[3] = hc_bytealign_S (w1[3], w2[0], offset); w2[2] = hc_bytealign_S (w1[2], w1[3], offset); w2[1] = hc_bytealign_S (w1[1], w1[2], offset); w2[0] = hc_bytealign_S (w1[0], w1[1], offset); w1[3] = hc_bytealign_S (w0[3], w1[0], offset); w1[2] = hc_bytealign_S (w0[2], w0[3], offset); w1[1] = hc_bytealign_S (w0[1], w0[2], offset); w1[0] = hc_bytealign_S (w0[0], w0[1], offset); w0[3] = hc_bytealign_S ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: w7[3] = hc_bytealign_S (w6[2], w6[3], offset); w7[2] = hc_bytealign_S (w6[1], w6[2], offset); w7[1] = hc_bytealign_S (w6[0], w6[1], offset); w7[0] = hc_bytealign_S (w5[3], w6[0], offset); w6[3] = hc_bytealign_S (w5[2], w5[3], offset); w6[2] = hc_bytealign_S (w5[1], w5[2], offset); w6[1] = hc_bytealign_S (w5[0], w5[1], offset); w6[0] = hc_bytealign_S (w4[3], w5[0], offset); w5[3] = hc_bytealign_S (w4[2], w4[3], offset); w5[2] = hc_bytealign_S (w4[1], w4[2], offset); w5[1] = hc_bytealign_S (w4[0], w4[1], offset); w5[0] = hc_bytealign_S (w3[3], w4[0], offset); w4[3] = hc_bytealign_S (w3[2], w3[3], offset); w4[2] = hc_bytealign_S (w3[1], w3[2], offset); w4[1] = hc_bytealign_S (w3[0], w3[1], offset); w4[0] = hc_bytealign_S (w2[3], w3[0], offset); w3[3] = hc_bytealign_S (w2[2], w2[3], offset); w3[2] = hc_bytealign_S (w2[1], w2[2], offset); w3[1] = hc_bytealign_S (w2[0], w2[1], offset); w3[0] = hc_bytealign_S (w1[3], w2[0], offset); w2[3] = hc_bytealign_S (w1[2], w1[3], offset); w2[2] = hc_bytealign_S (w1[1], w1[2], offset); w2[1] = hc_bytealign_S (w1[0], w1[1], offset); w2[0] = hc_bytealign_S (w0[3], w1[0], offset); w1[3] = hc_bytealign_S (w0[2], w0[3], offset); w1[2] = hc_bytealign_S (w0[1], w0[2], offset); w1[1] = hc_bytealign_S (w0[0], w0[1], offset); w1[0] = hc_bytealign_S ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: w7[3] = hc_bytealign_S (w6[1], w6[2], offset); w7[2] = hc_bytealign_S (w6[0], w6[1], offset); w7[1] = hc_bytealign_S (w5[3], w6[0], offset); w7[0] = hc_bytealign_S (w5[2], w5[3], offset); w6[3] = hc_bytealign_S (w5[1], w5[2], offset); w6[2] = hc_bytealign_S (w5[0], w5[1], offset); w6[1] = hc_bytealign_S (w4[3], w5[0], offset); w6[0] = hc_bytealign_S (w4[2], w4[3], offset); w5[3] = hc_bytealign_S (w4[1], w4[2], offset); w5[2] = hc_bytealign_S (w4[0], w4[1], offset); w5[1] = hc_bytealign_S (w3[3], w4[0], offset); w5[0] = hc_bytealign_S (w3[2], w3[3], offset); w4[3] = hc_bytealign_S (w3[1], w3[2], offset); w4[2] = hc_bytealign_S (w3[0], w3[1], offset); w4[1] = hc_bytealign_S (w2[3], w3[0], offset); w4[0] = hc_bytealign_S (w2[2], w2[3], offset); w3[3] = hc_bytealign_S (w2[1], w2[2], offset); w3[2] = hc_bytealign_S (w2[0], w2[1], offset); w3[1] = hc_bytealign_S (w1[3], w2[0], offset); w3[0] = hc_bytealign_S (w1[2], w1[3], offset); w2[3] = hc_bytealign_S (w1[1], w1[2], offset); w2[2] = hc_bytealign_S (w1[0], w1[1], offset); w2[1] = hc_bytealign_S (w0[3], w1[0], offset); w2[0] = hc_bytealign_S (w0[2], w0[3], offset); w1[3] = hc_bytealign_S (w0[1], w0[2], offset); w1[2] = hc_bytealign_S (w0[0], w0[1], offset); w1[1] = hc_bytealign_S ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: w7[3] = hc_bytealign_S (w6[0], w6[1], offset); w7[2] = hc_bytealign_S (w5[3], w6[0], offset); w7[1] = hc_bytealign_S (w5[2], w5[3], offset); w7[0] = hc_bytealign_S (w5[1], w5[2], offset); w6[3] = hc_bytealign_S (w5[0], w5[1], offset); w6[2] = hc_bytealign_S (w4[3], w5[0], offset); w6[1] = hc_bytealign_S (w4[2], w4[3], offset); w6[0] = hc_bytealign_S (w4[1], w4[2], offset); w5[3] = hc_bytealign_S (w4[0], w4[1], offset); w5[2] = hc_bytealign_S (w3[3], w4[0], offset); w5[1] = hc_bytealign_S (w3[2], w3[3], offset); w5[0] = hc_bytealign_S (w3[1], w3[2], offset); w4[3] = hc_bytealign_S (w3[0], w3[1], offset); w4[2] = hc_bytealign_S (w2[3], w3[0], offset); w4[1] = hc_bytealign_S (w2[2], w2[3], offset); w4[0] = hc_bytealign_S (w2[1], w2[2], offset); w3[3] = hc_bytealign_S (w2[0], w2[1], offset); w3[2] = hc_bytealign_S (w1[3], w2[0], offset); w3[1] = hc_bytealign_S (w1[2], w1[3], offset); w3[0] = hc_bytealign_S (w1[1], w1[2], offset); w2[3] = hc_bytealign_S (w1[0], w1[1], offset); w2[2] = hc_bytealign_S (w0[3], w1[0], offset); w2[1] = hc_bytealign_S (w0[2], w0[3], offset); w2[0] = hc_bytealign_S (w0[1], w0[2], offset); w1[3] = hc_bytealign_S (w0[0], w0[1], offset); w1[2] = hc_bytealign_S ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: w7[3] = hc_bytealign_S (w5[3], w6[0], offset); w7[2] = hc_bytealign_S (w5[2], w5[3], offset); w7[1] = hc_bytealign_S (w5[1], w5[2], offset); w7[0] = hc_bytealign_S (w5[0], w5[1], offset); w6[3] = hc_bytealign_S (w4[3], w5[0], offset); w6[2] = hc_bytealign_S (w4[2], w4[3], offset); w6[1] = hc_bytealign_S (w4[1], w4[2], offset); w6[0] = hc_bytealign_S (w4[0], w4[1], offset); w5[3] = hc_bytealign_S (w3[3], w4[0], offset); w5[2] = hc_bytealign_S (w3[2], w3[3], offset); w5[1] = hc_bytealign_S (w3[1], w3[2], offset); w5[0] = hc_bytealign_S (w3[0], w3[1], offset); w4[3] = hc_bytealign_S (w2[3], w3[0], offset); w4[2] = hc_bytealign_S (w2[2], w2[3], offset); w4[1] = hc_bytealign_S (w2[1], w2[2], offset); w4[0] = hc_bytealign_S (w2[0], w2[1], offset); w3[3] = hc_bytealign_S (w1[3], w2[0], offset); w3[2] = hc_bytealign_S (w1[2], w1[3], offset); w3[1] = hc_bytealign_S (w1[1], w1[2], offset); w3[0] = hc_bytealign_S (w1[0], w1[1], offset); w2[3] = hc_bytealign_S (w0[3], w1[0], offset); w2[2] = hc_bytealign_S (w0[2], w0[3], offset); w2[1] = hc_bytealign_S (w0[1], w0[2], offset); w2[0] = hc_bytealign_S (w0[0], w0[1], offset); w1[3] = hc_bytealign_S ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: w7[3] = hc_bytealign_S (w5[2], w5[3], offset); w7[2] = hc_bytealign_S (w5[1], w5[2], offset); w7[1] = hc_bytealign_S (w5[0], w5[1], offset); w7[0] = hc_bytealign_S (w4[3], w5[0], offset); w6[3] = hc_bytealign_S (w4[2], w4[3], offset); w6[2] = hc_bytealign_S (w4[1], w4[2], offset); w6[1] = hc_bytealign_S (w4[0], w4[1], offset); w6[0] = hc_bytealign_S (w3[3], w4[0], offset); w5[3] = hc_bytealign_S (w3[2], w3[3], offset); w5[2] = hc_bytealign_S (w3[1], w3[2], offset); w5[1] = hc_bytealign_S (w3[0], w3[1], offset); w5[0] = hc_bytealign_S (w2[3], w3[0], offset); w4[3] = hc_bytealign_S (w2[2], w2[3], offset); w4[2] = hc_bytealign_S (w2[1], w2[2], offset); w4[1] = hc_bytealign_S (w2[0], w2[1], offset); w4[0] = hc_bytealign_S (w1[3], w2[0], offset); w3[3] = hc_bytealign_S (w1[2], w1[3], offset); w3[2] = hc_bytealign_S (w1[1], w1[2], offset); w3[1] = hc_bytealign_S (w1[0], w1[1], offset); w3[0] = hc_bytealign_S (w0[3], w1[0], offset); w2[3] = hc_bytealign_S (w0[2], w0[3], offset); w2[2] = hc_bytealign_S (w0[1], w0[2], offset); w2[1] = hc_bytealign_S (w0[0], w0[1], offset); w2[0] = hc_bytealign_S ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: w7[3] = hc_bytealign_S (w5[1], w5[2], offset); w7[2] = hc_bytealign_S (w5[0], w5[1], offset); w7[1] = hc_bytealign_S (w4[3], w5[0], offset); w7[0] = hc_bytealign_S (w4[2], w4[3], offset); w6[3] = hc_bytealign_S (w4[1], w4[2], offset); w6[2] = hc_bytealign_S (w4[0], w4[1], offset); w6[1] = hc_bytealign_S (w3[3], w4[0], offset); w6[0] = hc_bytealign_S (w3[2], w3[3], offset); w5[3] = hc_bytealign_S (w3[1], w3[2], offset); w5[2] = hc_bytealign_S (w3[0], w3[1], offset); w5[1] = hc_bytealign_S (w2[3], w3[0], offset); w5[0] = hc_bytealign_S (w2[2], w2[3], offset); w4[3] = hc_bytealign_S (w2[1], w2[2], offset); w4[2] = hc_bytealign_S (w2[0], w2[1], offset); w4[1] = hc_bytealign_S (w1[3], w2[0], offset); w4[0] = hc_bytealign_S (w1[2], w1[3], offset); w3[3] = hc_bytealign_S (w1[1], w1[2], offset); w3[2] = hc_bytealign_S (w1[0], w1[1], offset); w3[1] = hc_bytealign_S (w0[3], w1[0], offset); w3[0] = hc_bytealign_S (w0[2], w0[3], offset); w2[3] = hc_bytealign_S (w0[1], w0[2], offset); w2[2] = hc_bytealign_S (w0[0], w0[1], offset); w2[1] = hc_bytealign_S ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: w7[3] = hc_bytealign_S (w5[0], w5[1], offset); w7[2] = hc_bytealign_S (w4[3], w5[0], offset); w7[1] = hc_bytealign_S (w4[2], w4[3], offset); w7[0] = hc_bytealign_S (w4[1], w4[2], offset); w6[3] = hc_bytealign_S (w4[0], w4[1], offset); w6[2] = hc_bytealign_S (w3[3], w4[0], offset); w6[1] = hc_bytealign_S (w3[2], w3[3], offset); w6[0] = hc_bytealign_S (w3[1], w3[2], offset); w5[3] = hc_bytealign_S (w3[0], w3[1], offset); w5[2] = hc_bytealign_S (w2[3], w3[0], offset); w5[1] = hc_bytealign_S (w2[2], w2[3], offset); w5[0] = hc_bytealign_S (w2[1], w2[2], offset); w4[3] = hc_bytealign_S (w2[0], w2[1], offset); w4[2] = hc_bytealign_S (w1[3], w2[0], offset); w4[1] = hc_bytealign_S (w1[2], w1[3], offset); w4[0] = hc_bytealign_S (w1[1], w1[2], offset); w3[3] = hc_bytealign_S (w1[0], w1[1], offset); w3[2] = hc_bytealign_S (w0[3], w1[0], offset); w3[1] = hc_bytealign_S (w0[2], w0[3], offset); w3[0] = hc_bytealign_S (w0[1], w0[2], offset); w2[3] = hc_bytealign_S (w0[0], w0[1], offset); w2[2] = hc_bytealign_S ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: w7[3] = hc_bytealign_S (w4[3], w5[0], offset); w7[2] = hc_bytealign_S (w4[2], w4[3], offset); w7[1] = hc_bytealign_S (w4[1], w4[2], offset); w7[0] = hc_bytealign_S (w4[0], w4[1], offset); w6[3] = hc_bytealign_S (w3[3], w4[0], offset); w6[2] = hc_bytealign_S (w3[2], w3[3], offset); w6[1] = hc_bytealign_S (w3[1], w3[2], offset); w6[0] = hc_bytealign_S (w3[0], w3[1], offset); w5[3] = hc_bytealign_S (w2[3], w3[0], offset); w5[2] = hc_bytealign_S (w2[2], w2[3], offset); w5[1] = hc_bytealign_S (w2[1], w2[2], offset); w5[0] = hc_bytealign_S (w2[0], w2[1], offset); w4[3] = hc_bytealign_S (w1[3], w2[0], offset); w4[2] = hc_bytealign_S (w1[2], w1[3], offset); w4[1] = hc_bytealign_S (w1[1], w1[2], offset); w4[0] = hc_bytealign_S (w1[0], w1[1], offset); w3[3] = hc_bytealign_S (w0[3], w1[0], offset); w3[2] = hc_bytealign_S (w0[2], w0[3], offset); w3[1] = hc_bytealign_S (w0[1], w0[2], offset); w3[0] = hc_bytealign_S (w0[0], w0[1], offset); w2[3] = hc_bytealign_S ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: w7[3] = hc_bytealign_S (w4[2], w4[3], offset); w7[2] = hc_bytealign_S (w4[1], w4[2], offset); w7[1] = hc_bytealign_S (w4[0], w4[1], offset); w7[0] = hc_bytealign_S (w3[3], w4[0], offset); w6[3] = hc_bytealign_S (w3[2], w3[3], offset); w6[2] = hc_bytealign_S (w3[1], w3[2], offset); w6[1] = hc_bytealign_S (w3[0], w3[1], offset); w6[0] = hc_bytealign_S (w2[3], w3[0], offset); w5[3] = hc_bytealign_S (w2[2], w2[3], offset); w5[2] = hc_bytealign_S (w2[1], w2[2], offset); w5[1] = hc_bytealign_S (w2[0], w2[1], offset); w5[0] = hc_bytealign_S (w1[3], w2[0], offset); w4[3] = hc_bytealign_S (w1[2], w1[3], offset); w4[2] = hc_bytealign_S (w1[1], w1[2], offset); w4[1] = hc_bytealign_S (w1[0], w1[1], offset); w4[0] = hc_bytealign_S (w0[3], w1[0], offset); w3[3] = hc_bytealign_S (w0[2], w0[3], offset); w3[2] = hc_bytealign_S (w0[1], w0[2], offset); w3[1] = hc_bytealign_S (w0[0], w0[1], offset); w3[0] = hc_bytealign_S ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: w7[3] = hc_bytealign_S (w4[1], w4[2], offset); w7[2] = hc_bytealign_S (w4[0], w4[1], offset); w7[1] = hc_bytealign_S (w3[3], w4[0], offset); w7[0] = hc_bytealign_S (w3[2], w3[3], offset); w6[3] = hc_bytealign_S (w3[1], w3[2], offset); w6[2] = hc_bytealign_S (w3[0], w3[1], offset); w6[1] = hc_bytealign_S (w2[3], w3[0], offset); w6[0] = hc_bytealign_S (w2[2], w2[3], offset); w5[3] = hc_bytealign_S (w2[1], w2[2], offset); w5[2] = hc_bytealign_S (w2[0], w2[1], offset); w5[1] = hc_bytealign_S (w1[3], w2[0], offset); w5[0] = hc_bytealign_S (w1[2], w1[3], offset); w4[3] = hc_bytealign_S (w1[1], w1[2], offset); w4[2] = hc_bytealign_S (w1[0], w1[1], offset); w4[1] = hc_bytealign_S (w0[3], w1[0], offset); w4[0] = hc_bytealign_S (w0[2], w0[3], offset); w3[3] = hc_bytealign_S (w0[1], w0[2], offset); w3[2] = hc_bytealign_S (w0[0], w0[1], offset); w3[1] = hc_bytealign_S ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: w7[3] = hc_bytealign_S (w4[0], w4[1], offset); w7[2] = hc_bytealign_S (w3[3], w4[0], offset); w7[1] = hc_bytealign_S (w3[2], w3[3], offset); w7[0] = hc_bytealign_S (w3[1], w3[2], offset); w6[3] = hc_bytealign_S (w3[0], w3[1], offset); w6[2] = hc_bytealign_S (w2[3], w3[0], offset); w6[1] = hc_bytealign_S (w2[2], w2[3], offset); w6[0] = hc_bytealign_S (w2[1], w2[2], offset); w5[3] = hc_bytealign_S (w2[0], w2[1], offset); w5[2] = hc_bytealign_S (w1[3], w2[0], offset); w5[1] = hc_bytealign_S (w1[2], w1[3], offset); w5[0] = hc_bytealign_S (w1[1], w1[2], offset); w4[3] = hc_bytealign_S (w1[0], w1[1], offset); w4[2] = hc_bytealign_S (w0[3], w1[0], offset); w4[1] = hc_bytealign_S (w0[2], w0[3], offset); w4[0] = hc_bytealign_S (w0[1], w0[2], offset); w3[3] = hc_bytealign_S (w0[0], w0[1], offset); w3[2] = hc_bytealign_S ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: w7[3] = hc_bytealign_S (w3[3], w4[0], offset); w7[2] = hc_bytealign_S (w3[2], w3[3], offset); w7[1] = hc_bytealign_S (w3[1], w3[2], offset); w7[0] = hc_bytealign_S (w3[0], w3[1], offset); w6[3] = hc_bytealign_S (w2[3], w3[0], offset); w6[2] = hc_bytealign_S (w2[2], w2[3], offset); w6[1] = hc_bytealign_S (w2[1], w2[2], offset); w6[0] = hc_bytealign_S (w2[0], w2[1], offset); w5[3] = hc_bytealign_S (w1[3], w2[0], offset); w5[2] = hc_bytealign_S (w1[2], w1[3], offset); w5[1] = hc_bytealign_S (w1[1], w1[2], offset); w5[0] = hc_bytealign_S (w1[0], w1[1], offset); w4[3] = hc_bytealign_S (w0[3], w1[0], offset); w4[2] = hc_bytealign_S (w0[2], w0[3], offset); w4[1] = hc_bytealign_S (w0[1], w0[2], offset); w4[0] = hc_bytealign_S (w0[0], w0[1], offset); w3[3] = hc_bytealign_S ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 16: w7[3] = hc_bytealign_S (w3[2], w3[3], offset); w7[2] = hc_bytealign_S (w3[1], w3[2], offset); w7[1] = hc_bytealign_S (w3[0], w3[1], offset); w7[0] = hc_bytealign_S (w2[3], w3[0], offset); w6[3] = hc_bytealign_S (w2[2], w2[3], offset); w6[2] = hc_bytealign_S (w2[1], w2[2], offset); w6[1] = hc_bytealign_S (w2[0], w2[1], offset); w6[0] = hc_bytealign_S (w1[3], w2[0], offset); w5[3] = hc_bytealign_S (w1[2], w1[3], offset); w5[2] = hc_bytealign_S (w1[1], w1[2], offset); w5[1] = hc_bytealign_S (w1[0], w1[1], offset); w5[0] = hc_bytealign_S (w0[3], w1[0], offset); w4[3] = hc_bytealign_S (w0[2], w0[3], offset); w4[2] = hc_bytealign_S (w0[1], w0[2], offset); w4[1] = hc_bytealign_S (w0[0], w0[1], offset); w4[0] = hc_bytealign_S ( 0, w0[0], offset); w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 17: w7[3] = hc_bytealign_S (w3[1], w3[2], offset); w7[2] = hc_bytealign_S (w3[0], w3[1], offset); w7[1] = hc_bytealign_S (w2[3], w3[0], offset); w7[0] = hc_bytealign_S (w2[2], w2[3], offset); w6[3] = hc_bytealign_S (w2[1], w2[2], offset); w6[2] = hc_bytealign_S (w2[0], w2[1], offset); w6[1] = hc_bytealign_S (w1[3], w2[0], offset); w6[0] = hc_bytealign_S (w1[2], w1[3], offset); w5[3] = hc_bytealign_S (w1[1], w1[2], offset); w5[2] = hc_bytealign_S (w1[0], w1[1], offset); w5[1] = hc_bytealign_S (w0[3], w1[0], offset); w5[0] = hc_bytealign_S (w0[2], w0[3], offset); w4[3] = hc_bytealign_S (w0[1], w0[2], offset); w4[2] = hc_bytealign_S (w0[0], w0[1], offset); w4[1] = hc_bytealign_S ( 0, w0[0], offset); w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 18: w7[3] = hc_bytealign_S (w3[0], w3[1], offset); w7[2] = hc_bytealign_S (w2[3], w3[0], offset); w7[1] = hc_bytealign_S (w2[2], w2[3], offset); w7[0] = hc_bytealign_S (w2[1], w2[2], offset); w6[3] = hc_bytealign_S (w2[0], w2[1], offset); w6[2] = hc_bytealign_S (w1[3], w2[0], offset); w6[1] = hc_bytealign_S (w1[2], w1[3], offset); w6[0] = hc_bytealign_S (w1[1], w1[2], offset); w5[3] = hc_bytealign_S (w1[0], w1[1], offset); w5[2] = hc_bytealign_S (w0[3], w1[0], offset); w5[1] = hc_bytealign_S (w0[2], w0[3], offset); w5[0] = hc_bytealign_S (w0[1], w0[2], offset); w4[3] = hc_bytealign_S (w0[0], w0[1], offset); w4[2] = hc_bytealign_S ( 0, w0[0], offset); w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 19: w7[3] = hc_bytealign_S (w2[3], w3[0], offset); w7[2] = hc_bytealign_S (w2[2], w2[3], offset); w7[1] = hc_bytealign_S (w2[1], w2[2], offset); w7[0] = hc_bytealign_S (w2[0], w2[1], offset); w6[3] = hc_bytealign_S (w1[3], w2[0], offset); w6[2] = hc_bytealign_S (w1[2], w1[3], offset); w6[1] = hc_bytealign_S (w1[1], w1[2], offset); w6[0] = hc_bytealign_S (w1[0], w1[1], offset); w5[3] = hc_bytealign_S (w0[3], w1[0], offset); w5[2] = hc_bytealign_S (w0[2], w0[3], offset); w5[1] = hc_bytealign_S (w0[1], w0[2], offset); w5[0] = hc_bytealign_S (w0[0], w0[1], offset); w4[3] = hc_bytealign_S ( 0, w0[0], offset); w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 20: w7[3] = hc_bytealign_S (w2[2], w2[3], offset); w7[2] = hc_bytealign_S (w2[1], w2[2], offset); w7[1] = hc_bytealign_S (w2[0], w2[1], offset); w7[0] = hc_bytealign_S (w1[3], w2[0], offset); w6[3] = hc_bytealign_S (w1[2], w1[3], offset); w6[2] = hc_bytealign_S (w1[1], w1[2], offset); w6[1] = hc_bytealign_S (w1[0], w1[1], offset); w6[0] = hc_bytealign_S (w0[3], w1[0], offset); w5[3] = hc_bytealign_S (w0[2], w0[3], offset); w5[2] = hc_bytealign_S (w0[1], w0[2], offset); w5[1] = hc_bytealign_S (w0[0], w0[1], offset); w5[0] = hc_bytealign_S ( 0, w0[0], offset); w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 21: w7[3] = hc_bytealign_S (w2[1], w2[2], offset); w7[2] = hc_bytealign_S (w2[0], w2[1], offset); w7[1] = hc_bytealign_S (w1[3], w2[0], offset); w7[0] = hc_bytealign_S (w1[2], w1[3], offset); w6[3] = hc_bytealign_S (w1[1], w1[2], offset); w6[2] = hc_bytealign_S (w1[0], w1[1], offset); w6[1] = hc_bytealign_S (w0[3], w1[0], offset); w6[0] = hc_bytealign_S (w0[2], w0[3], offset); w5[3] = hc_bytealign_S (w0[1], w0[2], offset); w5[2] = hc_bytealign_S (w0[0], w0[1], offset); w5[1] = hc_bytealign_S ( 0, w0[0], offset); w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 22: w7[3] = hc_bytealign_S (w2[0], w2[1], offset); w7[2] = hc_bytealign_S (w1[3], w2[0], offset); w7[1] = hc_bytealign_S (w1[2], w1[3], offset); w7[0] = hc_bytealign_S (w1[1], w1[2], offset); w6[3] = hc_bytealign_S (w1[0], w1[1], offset); w6[2] = hc_bytealign_S (w0[3], w1[0], offset); w6[1] = hc_bytealign_S (w0[2], w0[3], offset); w6[0] = hc_bytealign_S (w0[1], w0[2], offset); w5[3] = hc_bytealign_S (w0[0], w0[1], offset); w5[2] = hc_bytealign_S ( 0, w0[0], offset); w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 23: w7[3] = hc_bytealign_S (w1[3], w2[0], offset); w7[2] = hc_bytealign_S (w1[2], w1[3], offset); w7[1] = hc_bytealign_S (w1[1], w1[2], offset); w7[0] = hc_bytealign_S (w1[0], w1[1], offset); w6[3] = hc_bytealign_S (w0[3], w1[0], offset); w6[2] = hc_bytealign_S (w0[2], w0[3], offset); w6[1] = hc_bytealign_S (w0[1], w0[2], offset); w6[0] = hc_bytealign_S (w0[0], w0[1], offset); w5[3] = hc_bytealign_S ( 0, w0[0], offset); w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 24: w7[3] = hc_bytealign_S (w1[2], w1[3], offset); w7[2] = hc_bytealign_S (w1[1], w1[2], offset); w7[1] = hc_bytealign_S (w1[0], w1[1], offset); w7[0] = hc_bytealign_S (w0[3], w1[0], offset); w6[3] = hc_bytealign_S (w0[2], w0[3], offset); w6[2] = hc_bytealign_S (w0[1], w0[2], offset); w6[1] = hc_bytealign_S (w0[0], w0[1], offset); w6[0] = hc_bytealign_S ( 0, w0[0], offset); w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 25: w7[3] = hc_bytealign_S (w1[1], w1[2], offset); w7[2] = hc_bytealign_S (w1[0], w1[1], offset); w7[1] = hc_bytealign_S (w0[3], w1[0], offset); w7[0] = hc_bytealign_S (w0[2], w0[3], offset); w6[3] = hc_bytealign_S (w0[1], w0[2], offset); w6[2] = hc_bytealign_S (w0[0], w0[1], offset); w6[1] = hc_bytealign_S ( 0, w0[0], offset); w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 26: w7[3] = hc_bytealign_S (w1[0], w1[1], offset); w7[2] = hc_bytealign_S (w0[3], w1[0], offset); w7[1] = hc_bytealign_S (w0[2], w0[3], offset); w7[0] = hc_bytealign_S (w0[1], w0[2], offset); w6[3] = hc_bytealign_S (w0[0], w0[1], offset); w6[2] = hc_bytealign_S ( 0, w0[0], offset); w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 27: w7[3] = hc_bytealign_S (w0[3], w1[0], offset); w7[2] = hc_bytealign_S (w0[2], w0[3], offset); w7[1] = hc_bytealign_S (w0[1], w0[2], offset); w7[0] = hc_bytealign_S (w0[0], w0[1], offset); w6[3] = hc_bytealign_S ( 0, w0[0], offset); w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 28: w7[3] = hc_bytealign_S (w0[2], w0[3], offset); w7[2] = hc_bytealign_S (w0[1], w0[2], offset); w7[1] = hc_bytealign_S (w0[0], w0[1], offset); w7[0] = hc_bytealign_S ( 0, w0[0], offset); w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 29: w7[3] = hc_bytealign_S (w0[1], w0[2], offset); w7[2] = hc_bytealign_S (w0[0], w0[1], offset); w7[1] = hc_bytealign_S ( 0, w0[0], offset); w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 30: w7[3] = hc_bytealign_S (w0[0], w0[1], offset); w7[2] = hc_bytealign_S ( 0, w0[0], offset); w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 31: w7[3] = hc_bytealign_S ( 0, w0[0], offset); w7[2] = 0; w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV const int offset_mod_4 = offset & 3; const int offset_minus_4 = 4 - offset_mod_4; #if defined IS_NV const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> (offset_minus_4 * 8)); #endif switch (offset_switch) { case 0: w7[3] = hc_byte_perm_S (w7[2], w7[3], selector); w7[2] = hc_byte_perm_S (w7[1], w7[2], selector); w7[1] = hc_byte_perm_S (w7[0], w7[1], selector); w7[0] = hc_byte_perm_S (w6[3], w7[0], selector); w6[3] = hc_byte_perm_S (w6[2], w6[3], selector); w6[2] = hc_byte_perm_S (w6[1], w6[2], selector); w6[1] = hc_byte_perm_S (w6[0], w6[1], selector); w6[0] = hc_byte_perm_S (w5[3], w6[0], selector); w5[3] = hc_byte_perm_S (w5[2], w5[3], selector); w5[2] = hc_byte_perm_S (w5[1], w5[2], selector); w5[1] = hc_byte_perm_S (w5[0], w5[1], selector); w5[0] = hc_byte_perm_S (w4[3], w5[0], selector); w4[3] = hc_byte_perm_S (w4[2], w4[3], selector); w4[2] = hc_byte_perm_S (w4[1], w4[2], selector); w4[1] = hc_byte_perm_S (w4[0], w4[1], selector); w4[0] = hc_byte_perm_S (w3[3], w4[0], selector); w3[3] = hc_byte_perm_S (w3[2], w3[3], selector); w3[2] = hc_byte_perm_S (w3[1], w3[2], selector); w3[1] = hc_byte_perm_S (w3[0], w3[1], selector); w3[0] = hc_byte_perm_S (w2[3], w3[0], selector); w2[3] = hc_byte_perm_S (w2[2], w2[3], selector); w2[2] = hc_byte_perm_S (w2[1], w2[2], selector); w2[1] = hc_byte_perm_S (w2[0], w2[1], selector); w2[0] = hc_byte_perm_S (w1[3], w2[0], selector); w1[3] = hc_byte_perm_S (w1[2], w1[3], selector); w1[2] = hc_byte_perm_S (w1[1], w1[2], selector); w1[1] = hc_byte_perm_S (w1[0], w1[1], selector); w1[0] = hc_byte_perm_S (w0[3], w1[0], selector); w0[3] = hc_byte_perm_S (w0[2], w0[3], selector); w0[2] = hc_byte_perm_S (w0[1], w0[2], selector); w0[1] = hc_byte_perm_S (w0[0], w0[1], selector); w0[0] = hc_byte_perm_S ( 0, w0[0], selector); break; case 1: w7[3] = hc_byte_perm_S (w7[1], w7[2], selector); w7[2] = hc_byte_perm_S (w7[0], w7[1], selector); w7[1] = hc_byte_perm_S (w6[3], w7[0], selector); w7[0] = hc_byte_perm_S (w6[2], w6[3], selector); w6[3] = hc_byte_perm_S (w6[1], w6[2], selector); w6[2] = hc_byte_perm_S (w6[0], w6[1], selector); w6[1] = hc_byte_perm_S (w5[3], w6[0], selector); w6[0] = hc_byte_perm_S (w5[2], w5[3], selector); w5[3] = hc_byte_perm_S (w5[1], w5[2], selector); w5[2] = hc_byte_perm_S (w5[0], w5[1], selector); w5[1] = hc_byte_perm_S (w4[3], w5[0], selector); w5[0] = hc_byte_perm_S (w4[2], w4[3], selector); w4[3] = hc_byte_perm_S (w4[1], w4[2], selector); w4[2] = hc_byte_perm_S (w4[0], w4[1], selector); w4[1] = hc_byte_perm_S (w3[3], w4[0], selector); w4[0] = hc_byte_perm_S (w3[2], w3[3], selector); w3[3] = hc_byte_perm_S (w3[1], w3[2], selector); w3[2] = hc_byte_perm_S (w3[0], w3[1], selector); w3[1] = hc_byte_perm_S (w2[3], w3[0], selector); w3[0] = hc_byte_perm_S (w2[2], w2[3], selector); w2[3] = hc_byte_perm_S (w2[1], w2[2], selector); w2[2] = hc_byte_perm_S (w2[0], w2[1], selector); w2[1] = hc_byte_perm_S (w1[3], w2[0], selector); w2[0] = hc_byte_perm_S (w1[2], w1[3], selector); w1[3] = hc_byte_perm_S (w1[1], w1[2], selector); w1[2] = hc_byte_perm_S (w1[0], w1[1], selector); w1[1] = hc_byte_perm_S (w0[3], w1[0], selector); w1[0] = hc_byte_perm_S (w0[2], w0[3], selector); w0[3] = hc_byte_perm_S (w0[1], w0[2], selector); w0[2] = hc_byte_perm_S (w0[0], w0[1], selector); w0[1] = hc_byte_perm_S ( 0, w0[0], selector); w0[0] = 0; break; case 2: w7[3] = hc_byte_perm_S (w7[0], w7[1], selector); w7[2] = hc_byte_perm_S (w6[3], w7[0], selector); w7[1] = hc_byte_perm_S (w6[2], w6[3], selector); w7[0] = hc_byte_perm_S (w6[1], w6[2], selector); w6[3] = hc_byte_perm_S (w6[0], w6[1], selector); w6[2] = hc_byte_perm_S (w5[3], w6[0], selector); w6[1] = hc_byte_perm_S (w5[2], w5[3], selector); w6[0] = hc_byte_perm_S (w5[1], w5[2], selector); w5[3] = hc_byte_perm_S (w5[0], w5[1], selector); w5[2] = hc_byte_perm_S (w4[3], w5[0], selector); w5[1] = hc_byte_perm_S (w4[2], w4[3], selector); w5[0] = hc_byte_perm_S (w4[1], w4[2], selector); w4[3] = hc_byte_perm_S (w4[0], w4[1], selector); w4[2] = hc_byte_perm_S (w3[3], w4[0], selector); w4[1] = hc_byte_perm_S (w3[2], w3[3], selector); w4[0] = hc_byte_perm_S (w3[1], w3[2], selector); w3[3] = hc_byte_perm_S (w3[0], w3[1], selector); w3[2] = hc_byte_perm_S (w2[3], w3[0], selector); w3[1] = hc_byte_perm_S (w2[2], w2[3], selector); w3[0] = hc_byte_perm_S (w2[1], w2[2], selector); w2[3] = hc_byte_perm_S (w2[0], w2[1], selector); w2[2] = hc_byte_perm_S (w1[3], w2[0], selector); w2[1] = hc_byte_perm_S (w1[2], w1[3], selector); w2[0] = hc_byte_perm_S (w1[1], w1[2], selector); w1[3] = hc_byte_perm_S (w1[0], w1[1], selector); w1[2] = hc_byte_perm_S (w0[3], w1[0], selector); w1[1] = hc_byte_perm_S (w0[2], w0[3], selector); w1[0] = hc_byte_perm_S (w0[1], w0[2], selector); w0[3] = hc_byte_perm_S (w0[0], w0[1], selector); w0[2] = hc_byte_perm_S ( 0, w0[0], selector); w0[1] = 0; w0[0] = 0; break; case 3: w7[3] = hc_byte_perm_S (w6[3], w7[0], selector); w7[2] = hc_byte_perm_S (w6[2], w6[3], selector); w7[1] = hc_byte_perm_S (w6[1], w6[2], selector); w7[0] = hc_byte_perm_S (w6[0], w6[1], selector); w6[3] = hc_byte_perm_S (w5[3], w6[0], selector); w6[2] = hc_byte_perm_S (w5[2], w5[3], selector); w6[1] = hc_byte_perm_S (w5[1], w5[2], selector); w6[0] = hc_byte_perm_S (w5[0], w5[1], selector); w5[3] = hc_byte_perm_S (w4[3], w5[0], selector); w5[2] = hc_byte_perm_S (w4[2], w4[3], selector); w5[1] = hc_byte_perm_S (w4[1], w4[2], selector); w5[0] = hc_byte_perm_S (w4[0], w4[1], selector); w4[3] = hc_byte_perm_S (w3[3], w4[0], selector); w4[2] = hc_byte_perm_S (w3[2], w3[3], selector); w4[1] = hc_byte_perm_S (w3[1], w3[2], selector); w4[0] = hc_byte_perm_S (w3[0], w3[1], selector); w3[3] = hc_byte_perm_S (w2[3], w3[0], selector); w3[2] = hc_byte_perm_S (w2[2], w2[3], selector); w3[1] = hc_byte_perm_S (w2[1], w2[2], selector); w3[0] = hc_byte_perm_S (w2[0], w2[1], selector); w2[3] = hc_byte_perm_S (w1[3], w2[0], selector); w2[2] = hc_byte_perm_S (w1[2], w1[3], selector); w2[1] = hc_byte_perm_S (w1[1], w1[2], selector); w2[0] = hc_byte_perm_S (w1[0], w1[1], selector); w1[3] = hc_byte_perm_S (w0[3], w1[0], selector); w1[2] = hc_byte_perm_S (w0[2], w0[3], selector); w1[1] = hc_byte_perm_S (w0[1], w0[2], selector); w1[0] = hc_byte_perm_S (w0[0], w0[1], selector); w0[3] = hc_byte_perm_S ( 0, w0[0], selector); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: w7[3] = hc_byte_perm_S (w6[2], w6[3], selector); w7[2] = hc_byte_perm_S (w6[1], w6[2], selector); w7[1] = hc_byte_perm_S (w6[0], w6[1], selector); w7[0] = hc_byte_perm_S (w5[3], w6[0], selector); w6[3] = hc_byte_perm_S (w5[2], w5[3], selector); w6[2] = hc_byte_perm_S (w5[1], w5[2], selector); w6[1] = hc_byte_perm_S (w5[0], w5[1], selector); w6[0] = hc_byte_perm_S (w4[3], w5[0], selector); w5[3] = hc_byte_perm_S (w4[2], w4[3], selector); w5[2] = hc_byte_perm_S (w4[1], w4[2], selector); w5[1] = hc_byte_perm_S (w4[0], w4[1], selector); w5[0] = hc_byte_perm_S (w3[3], w4[0], selector); w4[3] = hc_byte_perm_S (w3[2], w3[3], selector); w4[2] = hc_byte_perm_S (w3[1], w3[2], selector); w4[1] = hc_byte_perm_S (w3[0], w3[1], selector); w4[0] = hc_byte_perm_S (w2[3], w3[0], selector); w3[3] = hc_byte_perm_S (w2[2], w2[3], selector); w3[2] = hc_byte_perm_S (w2[1], w2[2], selector); w3[1] = hc_byte_perm_S (w2[0], w2[1], selector); w3[0] = hc_byte_perm_S (w1[3], w2[0], selector); w2[3] = hc_byte_perm_S (w1[2], w1[3], selector); w2[2] = hc_byte_perm_S (w1[1], w1[2], selector); w2[1] = hc_byte_perm_S (w1[0], w1[1], selector); w2[0] = hc_byte_perm_S (w0[3], w1[0], selector); w1[3] = hc_byte_perm_S (w0[2], w0[3], selector); w1[2] = hc_byte_perm_S (w0[1], w0[2], selector); w1[1] = hc_byte_perm_S (w0[0], w0[1], selector); w1[0] = hc_byte_perm_S ( 0, w0[0], selector); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: w7[3] = hc_byte_perm_S (w6[1], w6[2], selector); w7[2] = hc_byte_perm_S (w6[0], w6[1], selector); w7[1] = hc_byte_perm_S (w5[3], w6[0], selector); w7[0] = hc_byte_perm_S (w5[2], w5[3], selector); w6[3] = hc_byte_perm_S (w5[1], w5[2], selector); w6[2] = hc_byte_perm_S (w5[0], w5[1], selector); w6[1] = hc_byte_perm_S (w4[3], w5[0], selector); w6[0] = hc_byte_perm_S (w4[2], w4[3], selector); w5[3] = hc_byte_perm_S (w4[1], w4[2], selector); w5[2] = hc_byte_perm_S (w4[0], w4[1], selector); w5[1] = hc_byte_perm_S (w3[3], w4[0], selector); w5[0] = hc_byte_perm_S (w3[2], w3[3], selector); w4[3] = hc_byte_perm_S (w3[1], w3[2], selector); w4[2] = hc_byte_perm_S (w3[0], w3[1], selector); w4[1] = hc_byte_perm_S (w2[3], w3[0], selector); w4[0] = hc_byte_perm_S (w2[2], w2[3], selector); w3[3] = hc_byte_perm_S (w2[1], w2[2], selector); w3[2] = hc_byte_perm_S (w2[0], w2[1], selector); w3[1] = hc_byte_perm_S (w1[3], w2[0], selector); w3[0] = hc_byte_perm_S (w1[2], w1[3], selector); w2[3] = hc_byte_perm_S (w1[1], w1[2], selector); w2[2] = hc_byte_perm_S (w1[0], w1[1], selector); w2[1] = hc_byte_perm_S (w0[3], w1[0], selector); w2[0] = hc_byte_perm_S (w0[2], w0[3], selector); w1[3] = hc_byte_perm_S (w0[1], w0[2], selector); w1[2] = hc_byte_perm_S (w0[0], w0[1], selector); w1[1] = hc_byte_perm_S ( 0, w0[0], selector); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: w7[3] = hc_byte_perm_S (w6[0], w6[1], selector); w7[2] = hc_byte_perm_S (w5[3], w6[0], selector); w7[1] = hc_byte_perm_S (w5[2], w5[3], selector); w7[0] = hc_byte_perm_S (w5[1], w5[2], selector); w6[3] = hc_byte_perm_S (w5[0], w5[1], selector); w6[2] = hc_byte_perm_S (w4[3], w5[0], selector); w6[1] = hc_byte_perm_S (w4[2], w4[3], selector); w6[0] = hc_byte_perm_S (w4[1], w4[2], selector); w5[3] = hc_byte_perm_S (w4[0], w4[1], selector); w5[2] = hc_byte_perm_S (w3[3], w4[0], selector); w5[1] = hc_byte_perm_S (w3[2], w3[3], selector); w5[0] = hc_byte_perm_S (w3[1], w3[2], selector); w4[3] = hc_byte_perm_S (w3[0], w3[1], selector); w4[2] = hc_byte_perm_S (w2[3], w3[0], selector); w4[1] = hc_byte_perm_S (w2[2], w2[3], selector); w4[0] = hc_byte_perm_S (w2[1], w2[2], selector); w3[3] = hc_byte_perm_S (w2[0], w2[1], selector); w3[2] = hc_byte_perm_S (w1[3], w2[0], selector); w3[1] = hc_byte_perm_S (w1[2], w1[3], selector); w3[0] = hc_byte_perm_S (w1[1], w1[2], selector); w2[3] = hc_byte_perm_S (w1[0], w1[1], selector); w2[2] = hc_byte_perm_S (w0[3], w1[0], selector); w2[1] = hc_byte_perm_S (w0[2], w0[3], selector); w2[0] = hc_byte_perm_S (w0[1], w0[2], selector); w1[3] = hc_byte_perm_S (w0[0], w0[1], selector); w1[2] = hc_byte_perm_S ( 0, w0[0], selector); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: w7[3] = hc_byte_perm_S (w5[3], w6[0], selector); w7[2] = hc_byte_perm_S (w5[2], w5[3], selector); w7[1] = hc_byte_perm_S (w5[1], w5[2], selector); w7[0] = hc_byte_perm_S (w5[0], w5[1], selector); w6[3] = hc_byte_perm_S (w4[3], w5[0], selector); w6[2] = hc_byte_perm_S (w4[2], w4[3], selector); w6[1] = hc_byte_perm_S (w4[1], w4[2], selector); w6[0] = hc_byte_perm_S (w4[0], w4[1], selector); w5[3] = hc_byte_perm_S (w3[3], w4[0], selector); w5[2] = hc_byte_perm_S (w3[2], w3[3], selector); w5[1] = hc_byte_perm_S (w3[1], w3[2], selector); w5[0] = hc_byte_perm_S (w3[0], w3[1], selector); w4[3] = hc_byte_perm_S (w2[3], w3[0], selector); w4[2] = hc_byte_perm_S (w2[2], w2[3], selector); w4[1] = hc_byte_perm_S (w2[1], w2[2], selector); w4[0] = hc_byte_perm_S (w2[0], w2[1], selector); w3[3] = hc_byte_perm_S (w1[3], w2[0], selector); w3[2] = hc_byte_perm_S (w1[2], w1[3], selector); w3[1] = hc_byte_perm_S (w1[1], w1[2], selector); w3[0] = hc_byte_perm_S (w1[0], w1[1], selector); w2[3] = hc_byte_perm_S (w0[3], w1[0], selector); w2[2] = hc_byte_perm_S (w0[2], w0[3], selector); w2[1] = hc_byte_perm_S (w0[1], w0[2], selector); w2[0] = hc_byte_perm_S (w0[0], w0[1], selector); w1[3] = hc_byte_perm_S ( 0, w0[0], selector); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: w7[3] = hc_byte_perm_S (w5[2], w5[3], selector); w7[2] = hc_byte_perm_S (w5[1], w5[2], selector); w7[1] = hc_byte_perm_S (w5[0], w5[1], selector); w7[0] = hc_byte_perm_S (w4[3], w5[0], selector); w6[3] = hc_byte_perm_S (w4[2], w4[3], selector); w6[2] = hc_byte_perm_S (w4[1], w4[2], selector); w6[1] = hc_byte_perm_S (w4[0], w4[1], selector); w6[0] = hc_byte_perm_S (w3[3], w4[0], selector); w5[3] = hc_byte_perm_S (w3[2], w3[3], selector); w5[2] = hc_byte_perm_S (w3[1], w3[2], selector); w5[1] = hc_byte_perm_S (w3[0], w3[1], selector); w5[0] = hc_byte_perm_S (w2[3], w3[0], selector); w4[3] = hc_byte_perm_S (w2[2], w2[3], selector); w4[2] = hc_byte_perm_S (w2[1], w2[2], selector); w4[1] = hc_byte_perm_S (w2[0], w2[1], selector); w4[0] = hc_byte_perm_S (w1[3], w2[0], selector); w3[3] = hc_byte_perm_S (w1[2], w1[3], selector); w3[2] = hc_byte_perm_S (w1[1], w1[2], selector); w3[1] = hc_byte_perm_S (w1[0], w1[1], selector); w3[0] = hc_byte_perm_S (w0[3], w1[0], selector); w2[3] = hc_byte_perm_S (w0[2], w0[3], selector); w2[2] = hc_byte_perm_S (w0[1], w0[2], selector); w2[1] = hc_byte_perm_S (w0[0], w0[1], selector); w2[0] = hc_byte_perm_S ( 0, w0[0], selector); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: w7[3] = hc_byte_perm_S (w5[1], w5[2], selector); w7[2] = hc_byte_perm_S (w5[0], w5[1], selector); w7[1] = hc_byte_perm_S (w4[3], w5[0], selector); w7[0] = hc_byte_perm_S (w4[2], w4[3], selector); w6[3] = hc_byte_perm_S (w4[1], w4[2], selector); w6[2] = hc_byte_perm_S (w4[0], w4[1], selector); w6[1] = hc_byte_perm_S (w3[3], w4[0], selector); w6[0] = hc_byte_perm_S (w3[2], w3[3], selector); w5[3] = hc_byte_perm_S (w3[1], w3[2], selector); w5[2] = hc_byte_perm_S (w3[0], w3[1], selector); w5[1] = hc_byte_perm_S (w2[3], w3[0], selector); w5[0] = hc_byte_perm_S (w2[2], w2[3], selector); w4[3] = hc_byte_perm_S (w2[1], w2[2], selector); w4[2] = hc_byte_perm_S (w2[0], w2[1], selector); w4[1] = hc_byte_perm_S (w1[3], w2[0], selector); w4[0] = hc_byte_perm_S (w1[2], w1[3], selector); w3[3] = hc_byte_perm_S (w1[1], w1[2], selector); w3[2] = hc_byte_perm_S (w1[0], w1[1], selector); w3[1] = hc_byte_perm_S (w0[3], w1[0], selector); w3[0] = hc_byte_perm_S (w0[2], w0[3], selector); w2[3] = hc_byte_perm_S (w0[1], w0[2], selector); w2[2] = hc_byte_perm_S (w0[0], w0[1], selector); w2[1] = hc_byte_perm_S ( 0, w0[0], selector); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: w7[3] = hc_byte_perm_S (w5[0], w5[1], selector); w7[2] = hc_byte_perm_S (w4[3], w5[0], selector); w7[1] = hc_byte_perm_S (w4[2], w4[3], selector); w7[0] = hc_byte_perm_S (w4[1], w4[2], selector); w6[3] = hc_byte_perm_S (w4[0], w4[1], selector); w6[2] = hc_byte_perm_S (w3[3], w4[0], selector); w6[1] = hc_byte_perm_S (w3[2], w3[3], selector); w6[0] = hc_byte_perm_S (w3[1], w3[2], selector); w5[3] = hc_byte_perm_S (w3[0], w3[1], selector); w5[2] = hc_byte_perm_S (w2[3], w3[0], selector); w5[1] = hc_byte_perm_S (w2[2], w2[3], selector); w5[0] = hc_byte_perm_S (w2[1], w2[2], selector); w4[3] = hc_byte_perm_S (w2[0], w2[1], selector); w4[2] = hc_byte_perm_S (w1[3], w2[0], selector); w4[1] = hc_byte_perm_S (w1[2], w1[3], selector); w4[0] = hc_byte_perm_S (w1[1], w1[2], selector); w3[3] = hc_byte_perm_S (w1[0], w1[1], selector); w3[2] = hc_byte_perm_S (w0[3], w1[0], selector); w3[1] = hc_byte_perm_S (w0[2], w0[3], selector); w3[0] = hc_byte_perm_S (w0[1], w0[2], selector); w2[3] = hc_byte_perm_S (w0[0], w0[1], selector); w2[2] = hc_byte_perm_S ( 0, w0[0], selector); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: w7[3] = hc_byte_perm_S (w4[3], w5[0], selector); w7[2] = hc_byte_perm_S (w4[2], w4[3], selector); w7[1] = hc_byte_perm_S (w4[1], w4[2], selector); w7[0] = hc_byte_perm_S (w4[0], w4[1], selector); w6[3] = hc_byte_perm_S (w3[3], w4[0], selector); w6[2] = hc_byte_perm_S (w3[2], w3[3], selector); w6[1] = hc_byte_perm_S (w3[1], w3[2], selector); w6[0] = hc_byte_perm_S (w3[0], w3[1], selector); w5[3] = hc_byte_perm_S (w2[3], w3[0], selector); w5[2] = hc_byte_perm_S (w2[2], w2[3], selector); w5[1] = hc_byte_perm_S (w2[1], w2[2], selector); w5[0] = hc_byte_perm_S (w2[0], w2[1], selector); w4[3] = hc_byte_perm_S (w1[3], w2[0], selector); w4[2] = hc_byte_perm_S (w1[2], w1[3], selector); w4[1] = hc_byte_perm_S (w1[1], w1[2], selector); w4[0] = hc_byte_perm_S (w1[0], w1[1], selector); w3[3] = hc_byte_perm_S (w0[3], w1[0], selector); w3[2] = hc_byte_perm_S (w0[2], w0[3], selector); w3[1] = hc_byte_perm_S (w0[1], w0[2], selector); w3[0] = hc_byte_perm_S (w0[0], w0[1], selector); w2[3] = hc_byte_perm_S ( 0, w0[0], selector); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: w7[3] = hc_byte_perm_S (w4[2], w4[3], selector); w7[2] = hc_byte_perm_S (w4[1], w4[2], selector); w7[1] = hc_byte_perm_S (w4[0], w4[1], selector); w7[0] = hc_byte_perm_S (w3[3], w4[0], selector); w6[3] = hc_byte_perm_S (w3[2], w3[3], selector); w6[2] = hc_byte_perm_S (w3[1], w3[2], selector); w6[1] = hc_byte_perm_S (w3[0], w3[1], selector); w6[0] = hc_byte_perm_S (w2[3], w3[0], selector); w5[3] = hc_byte_perm_S (w2[2], w2[3], selector); w5[2] = hc_byte_perm_S (w2[1], w2[2], selector); w5[1] = hc_byte_perm_S (w2[0], w2[1], selector); w5[0] = hc_byte_perm_S (w1[3], w2[0], selector); w4[3] = hc_byte_perm_S (w1[2], w1[3], selector); w4[2] = hc_byte_perm_S (w1[1], w1[2], selector); w4[1] = hc_byte_perm_S (w1[0], w1[1], selector); w4[0] = hc_byte_perm_S (w0[3], w1[0], selector); w3[3] = hc_byte_perm_S (w0[2], w0[3], selector); w3[2] = hc_byte_perm_S (w0[1], w0[2], selector); w3[1] = hc_byte_perm_S (w0[0], w0[1], selector); w3[0] = hc_byte_perm_S ( 0, w0[0], selector); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: w7[3] = hc_byte_perm_S (w4[1], w4[2], selector); w7[2] = hc_byte_perm_S (w4[0], w4[1], selector); w7[1] = hc_byte_perm_S (w3[3], w4[0], selector); w7[0] = hc_byte_perm_S (w3[2], w3[3], selector); w6[3] = hc_byte_perm_S (w3[1], w3[2], selector); w6[2] = hc_byte_perm_S (w3[0], w3[1], selector); w6[1] = hc_byte_perm_S (w2[3], w3[0], selector); w6[0] = hc_byte_perm_S (w2[2], w2[3], selector); w5[3] = hc_byte_perm_S (w2[1], w2[2], selector); w5[2] = hc_byte_perm_S (w2[0], w2[1], selector); w5[1] = hc_byte_perm_S (w1[3], w2[0], selector); w5[0] = hc_byte_perm_S (w1[2], w1[3], selector); w4[3] = hc_byte_perm_S (w1[1], w1[2], selector); w4[2] = hc_byte_perm_S (w1[0], w1[1], selector); w4[1] = hc_byte_perm_S (w0[3], w1[0], selector); w4[0] = hc_byte_perm_S (w0[2], w0[3], selector); w3[3] = hc_byte_perm_S (w0[1], w0[2], selector); w3[2] = hc_byte_perm_S (w0[0], w0[1], selector); w3[1] = hc_byte_perm_S ( 0, w0[0], selector); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: w7[3] = hc_byte_perm_S (w4[0], w4[1], selector); w7[2] = hc_byte_perm_S (w3[3], w4[0], selector); w7[1] = hc_byte_perm_S (w3[2], w3[3], selector); w7[0] = hc_byte_perm_S (w3[1], w3[2], selector); w6[3] = hc_byte_perm_S (w3[0], w3[1], selector); w6[2] = hc_byte_perm_S (w2[3], w3[0], selector); w6[1] = hc_byte_perm_S (w2[2], w2[3], selector); w6[0] = hc_byte_perm_S (w2[1], w2[2], selector); w5[3] = hc_byte_perm_S (w2[0], w2[1], selector); w5[2] = hc_byte_perm_S (w1[3], w2[0], selector); w5[1] = hc_byte_perm_S (w1[2], w1[3], selector); w5[0] = hc_byte_perm_S (w1[1], w1[2], selector); w4[3] = hc_byte_perm_S (w1[0], w1[1], selector); w4[2] = hc_byte_perm_S (w0[3], w1[0], selector); w4[1] = hc_byte_perm_S (w0[2], w0[3], selector); w4[0] = hc_byte_perm_S (w0[1], w0[2], selector); w3[3] = hc_byte_perm_S (w0[0], w0[1], selector); w3[2] = hc_byte_perm_S ( 0, w0[0], selector); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: w7[3] = hc_byte_perm_S (w3[3], w4[0], selector); w7[2] = hc_byte_perm_S (w3[2], w3[3], selector); w7[1] = hc_byte_perm_S (w3[1], w3[2], selector); w7[0] = hc_byte_perm_S (w3[0], w3[1], selector); w6[3] = hc_byte_perm_S (w2[3], w3[0], selector); w6[2] = hc_byte_perm_S (w2[2], w2[3], selector); w6[1] = hc_byte_perm_S (w2[1], w2[2], selector); w6[0] = hc_byte_perm_S (w2[0], w2[1], selector); w5[3] = hc_byte_perm_S (w1[3], w2[0], selector); w5[2] = hc_byte_perm_S (w1[2], w1[3], selector); w5[1] = hc_byte_perm_S (w1[1], w1[2], selector); w5[0] = hc_byte_perm_S (w1[0], w1[1], selector); w4[3] = hc_byte_perm_S (w0[3], w1[0], selector); w4[2] = hc_byte_perm_S (w0[2], w0[3], selector); w4[1] = hc_byte_perm_S (w0[1], w0[2], selector); w4[0] = hc_byte_perm_S (w0[0], w0[1], selector); w3[3] = hc_byte_perm_S ( 0, w0[0], selector); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_8x4_carry_le_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, PRIVATE_AS u32 *w4, PRIVATE_AS u32 *w5, PRIVATE_AS u32 *w6, PRIVATE_AS u32 *w7, PRIVATE_AS u32 *c0, PRIVATE_AS u32 *c1, PRIVATE_AS u32 *c2, PRIVATE_AS u32 *c3, PRIVATE_AS u32 *c4, PRIVATE_AS u32 *c5, PRIVATE_AS u32 *c6, PRIVATE_AS u32 *c7, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: c0[0] = hc_bytealign_S (w7[3], 0, offset); w7[3] = hc_bytealign_S (w7[2], w7[3], offset); w7[2] = hc_bytealign_S (w7[1], w7[2], offset); w7[1] = hc_bytealign_S (w7[0], w7[1], offset); w7[0] = hc_bytealign_S (w6[3], w7[0], offset); w6[3] = hc_bytealign_S (w6[2], w6[3], offset); w6[2] = hc_bytealign_S (w6[1], w6[2], offset); w6[1] = hc_bytealign_S (w6[0], w6[1], offset); w6[0] = hc_bytealign_S (w5[3], w6[0], offset); w5[3] = hc_bytealign_S (w5[2], w5[3], offset); w5[2] = hc_bytealign_S (w5[1], w5[2], offset); w5[1] = hc_bytealign_S (w5[0], w5[1], offset); w5[0] = hc_bytealign_S (w4[3], w5[0], offset); w4[3] = hc_bytealign_S (w4[2], w4[3], offset); w4[2] = hc_bytealign_S (w4[1], w4[2], offset); w4[1] = hc_bytealign_S (w4[0], w4[1], offset); w4[0] = hc_bytealign_S (w3[3], w4[0], offset); w3[3] = hc_bytealign_S (w3[2], w3[3], offset); w3[2] = hc_bytealign_S (w3[1], w3[2], offset); w3[1] = hc_bytealign_S (w3[0], w3[1], offset); w3[0] = hc_bytealign_S (w2[3], w3[0], offset); w2[3] = hc_bytealign_S (w2[2], w2[3], offset); w2[2] = hc_bytealign_S (w2[1], w2[2], offset); w2[1] = hc_bytealign_S (w2[0], w2[1], offset); w2[0] = hc_bytealign_S (w1[3], w2[0], offset); w1[3] = hc_bytealign_S (w1[2], w1[3], offset); w1[2] = hc_bytealign_S (w1[1], w1[2], offset); w1[1] = hc_bytealign_S (w1[0], w1[1], offset); w1[0] = hc_bytealign_S (w0[3], w1[0], offset); w0[3] = hc_bytealign_S (w0[2], w0[3], offset); w0[2] = hc_bytealign_S (w0[1], w0[2], offset); w0[1] = hc_bytealign_S (w0[0], w0[1], offset); w0[0] = hc_bytealign_S ( 0, w0[0], offset); break; case 1: c0[1] = hc_bytealign_S (w7[3], 0, offset); c0[0] = hc_bytealign_S (w7[2], w7[3], offset); w7[3] = hc_bytealign_S (w7[1], w7[2], offset); w7[2] = hc_bytealign_S (w7[0], w7[1], offset); w7[1] = hc_bytealign_S (w6[3], w7[0], offset); w7[0] = hc_bytealign_S (w6[2], w6[3], offset); w6[3] = hc_bytealign_S (w6[1], w6[2], offset); w6[2] = hc_bytealign_S (w6[0], w6[1], offset); w6[1] = hc_bytealign_S (w5[3], w6[0], offset); w6[0] = hc_bytealign_S (w5[2], w5[3], offset); w5[3] = hc_bytealign_S (w5[1], w5[2], offset); w5[2] = hc_bytealign_S (w5[0], w5[1], offset); w5[1] = hc_bytealign_S (w4[3], w5[0], offset); w5[0] = hc_bytealign_S (w4[2], w4[3], offset); w4[3] = hc_bytealign_S (w4[1], w4[2], offset); w4[2] = hc_bytealign_S (w4[0], w4[1], offset); w4[1] = hc_bytealign_S (w3[3], w4[0], offset); w4[0] = hc_bytealign_S (w3[2], w3[3], offset); w3[3] = hc_bytealign_S (w3[1], w3[2], offset); w3[2] = hc_bytealign_S (w3[0], w3[1], offset); w3[1] = hc_bytealign_S (w2[3], w3[0], offset); w3[0] = hc_bytealign_S (w2[2], w2[3], offset); w2[3] = hc_bytealign_S (w2[1], w2[2], offset); w2[2] = hc_bytealign_S (w2[0], w2[1], offset); w2[1] = hc_bytealign_S (w1[3], w2[0], offset); w2[0] = hc_bytealign_S (w1[2], w1[3], offset); w1[3] = hc_bytealign_S (w1[1], w1[2], offset); w1[2] = hc_bytealign_S (w1[0], w1[1], offset); w1[1] = hc_bytealign_S (w0[3], w1[0], offset); w1[0] = hc_bytealign_S (w0[2], w0[3], offset); w0[3] = hc_bytealign_S (w0[1], w0[2], offset); w0[2] = hc_bytealign_S (w0[0], w0[1], offset); w0[1] = hc_bytealign_S ( 0, w0[0], offset); w0[0] = 0; break; case 2: c0[2] = hc_bytealign_S (w7[3], 0, offset); c0[1] = hc_bytealign_S (w7[2], w7[3], offset); c0[0] = hc_bytealign_S (w7[1], w7[2], offset); w7[3] = hc_bytealign_S (w7[0], w7[1], offset); w7[2] = hc_bytealign_S (w6[3], w7[0], offset); w7[1] = hc_bytealign_S (w6[2], w6[3], offset); w7[0] = hc_bytealign_S (w6[1], w6[2], offset); w6[3] = hc_bytealign_S (w6[0], w6[1], offset); w6[2] = hc_bytealign_S (w5[3], w6[0], offset); w6[1] = hc_bytealign_S (w5[2], w5[3], offset); w6[0] = hc_bytealign_S (w5[1], w5[2], offset); w5[3] = hc_bytealign_S (w5[0], w5[1], offset); w5[2] = hc_bytealign_S (w4[3], w5[0], offset); w5[1] = hc_bytealign_S (w4[2], w4[3], offset); w5[0] = hc_bytealign_S (w4[1], w4[2], offset); w4[3] = hc_bytealign_S (w4[0], w4[1], offset); w4[2] = hc_bytealign_S (w3[3], w4[0], offset); w4[1] = hc_bytealign_S (w3[2], w3[3], offset); w4[0] = hc_bytealign_S (w3[1], w3[2], offset); w3[3] = hc_bytealign_S (w3[0], w3[1], offset); w3[2] = hc_bytealign_S (w2[3], w3[0], offset); w3[1] = hc_bytealign_S (w2[2], w2[3], offset); w3[0] = hc_bytealign_S (w2[1], w2[2], offset); w2[3] = hc_bytealign_S (w2[0], w2[1], offset); w2[2] = hc_bytealign_S (w1[3], w2[0], offset); w2[1] = hc_bytealign_S (w1[2], w1[3], offset); w2[0] = hc_bytealign_S (w1[1], w1[2], offset); w1[3] = hc_bytealign_S (w1[0], w1[1], offset); w1[2] = hc_bytealign_S (w0[3], w1[0], offset); w1[1] = hc_bytealign_S (w0[2], w0[3], offset); w1[0] = hc_bytealign_S (w0[1], w0[2], offset); w0[3] = hc_bytealign_S (w0[0], w0[1], offset); w0[2] = hc_bytealign_S ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: c0[3] = hc_bytealign_S (w7[3], 0, offset); c0[2] = hc_bytealign_S (w7[2], w7[3], offset); c0[1] = hc_bytealign_S (w7[1], w7[2], offset); c0[0] = hc_bytealign_S (w7[0], w7[1], offset); w7[3] = hc_bytealign_S (w6[3], w7[0], offset); w7[2] = hc_bytealign_S (w6[2], w6[3], offset); w7[1] = hc_bytealign_S (w6[1], w6[2], offset); w7[0] = hc_bytealign_S (w6[0], w6[1], offset); w6[3] = hc_bytealign_S (w5[3], w6[0], offset); w6[2] = hc_bytealign_S (w5[2], w5[3], offset); w6[1] = hc_bytealign_S (w5[1], w5[2], offset); w6[0] = hc_bytealign_S (w5[0], w5[1], offset); w5[3] = hc_bytealign_S (w4[3], w5[0], offset); w5[2] = hc_bytealign_S (w4[2], w4[3], offset); w5[1] = hc_bytealign_S (w4[1], w4[2], offset); w5[0] = hc_bytealign_S (w4[0], w4[1], offset); w4[3] = hc_bytealign_S (w3[3], w4[0], offset); w4[2] = hc_bytealign_S (w3[2], w3[3], offset); w4[1] = hc_bytealign_S (w3[1], w3[2], offset); w4[0] = hc_bytealign_S (w3[0], w3[1], offset); w3[3] = hc_bytealign_S (w2[3], w3[0], offset); w3[2] = hc_bytealign_S (w2[2], w2[3], offset); w3[1] = hc_bytealign_S (w2[1], w2[2], offset); w3[0] = hc_bytealign_S (w2[0], w2[1], offset); w2[3] = hc_bytealign_S (w1[3], w2[0], offset); w2[2] = hc_bytealign_S (w1[2], w1[3], offset); w2[1] = hc_bytealign_S (w1[1], w1[2], offset); w2[0] = hc_bytealign_S (w1[0], w1[1], offset); w1[3] = hc_bytealign_S (w0[3], w1[0], offset); w1[2] = hc_bytealign_S (w0[2], w0[3], offset); w1[1] = hc_bytealign_S (w0[1], w0[2], offset); w1[0] = hc_bytealign_S (w0[0], w0[1], offset); w0[3] = hc_bytealign_S ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: c1[0] = hc_bytealign_S (w7[3], 0, offset); c0[3] = hc_bytealign_S (w7[2], w7[3], offset); c0[2] = hc_bytealign_S (w7[1], w7[2], offset); c0[1] = hc_bytealign_S (w7[0], w7[1], offset); c0[0] = hc_bytealign_S (w6[3], w7[0], offset); w7[3] = hc_bytealign_S (w6[2], w6[3], offset); w7[2] = hc_bytealign_S (w6[1], w6[2], offset); w7[1] = hc_bytealign_S (w6[0], w6[1], offset); w7[0] = hc_bytealign_S (w5[3], w6[0], offset); w6[3] = hc_bytealign_S (w5[2], w5[3], offset); w6[2] = hc_bytealign_S (w5[1], w5[2], offset); w6[1] = hc_bytealign_S (w5[0], w5[1], offset); w6[0] = hc_bytealign_S (w4[3], w5[0], offset); w5[3] = hc_bytealign_S (w4[2], w4[3], offset); w5[2] = hc_bytealign_S (w4[1], w4[2], offset); w5[1] = hc_bytealign_S (w4[0], w4[1], offset); w5[0] = hc_bytealign_S (w3[3], w4[0], offset); w4[3] = hc_bytealign_S (w3[2], w3[3], offset); w4[2] = hc_bytealign_S (w3[1], w3[2], offset); w4[1] = hc_bytealign_S (w3[0], w3[1], offset); w4[0] = hc_bytealign_S (w2[3], w3[0], offset); w3[3] = hc_bytealign_S (w2[2], w2[3], offset); w3[2] = hc_bytealign_S (w2[1], w2[2], offset); w3[1] = hc_bytealign_S (w2[0], w2[1], offset); w3[0] = hc_bytealign_S (w1[3], w2[0], offset); w2[3] = hc_bytealign_S (w1[2], w1[3], offset); w2[2] = hc_bytealign_S (w1[1], w1[2], offset); w2[1] = hc_bytealign_S (w1[0], w1[1], offset); w2[0] = hc_bytealign_S (w0[3], w1[0], offset); w1[3] = hc_bytealign_S (w0[2], w0[3], offset); w1[2] = hc_bytealign_S (w0[1], w0[2], offset); w1[1] = hc_bytealign_S (w0[0], w0[1], offset); w1[0] = hc_bytealign_S ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: c1[1] = hc_bytealign_S (w7[3], 0, offset); c1[0] = hc_bytealign_S (w7[2], w7[3], offset); c0[3] = hc_bytealign_S (w7[1], w7[2], offset); c0[2] = hc_bytealign_S (w7[0], w7[1], offset); c0[1] = hc_bytealign_S (w6[3], w7[0], offset); c0[0] = hc_bytealign_S (w6[2], w6[3], offset); w7[3] = hc_bytealign_S (w6[1], w6[2], offset); w7[2] = hc_bytealign_S (w6[0], w6[1], offset); w7[1] = hc_bytealign_S (w5[3], w6[0], offset); w7[0] = hc_bytealign_S (w5[2], w5[3], offset); w6[3] = hc_bytealign_S (w5[1], w5[2], offset); w6[2] = hc_bytealign_S (w5[0], w5[1], offset); w6[1] = hc_bytealign_S (w4[3], w5[0], offset); w6[0] = hc_bytealign_S (w4[2], w4[3], offset); w5[3] = hc_bytealign_S (w4[1], w4[2], offset); w5[2] = hc_bytealign_S (w4[0], w4[1], offset); w5[1] = hc_bytealign_S (w3[3], w4[0], offset); w5[0] = hc_bytealign_S (w3[2], w3[3], offset); w4[3] = hc_bytealign_S (w3[1], w3[2], offset); w4[2] = hc_bytealign_S (w3[0], w3[1], offset); w4[1] = hc_bytealign_S (w2[3], w3[0], offset); w4[0] = hc_bytealign_S (w2[2], w2[3], offset); w3[3] = hc_bytealign_S (w2[1], w2[2], offset); w3[2] = hc_bytealign_S (w2[0], w2[1], offset); w3[1] = hc_bytealign_S (w1[3], w2[0], offset); w3[0] = hc_bytealign_S (w1[2], w1[3], offset); w2[3] = hc_bytealign_S (w1[1], w1[2], offset); w2[2] = hc_bytealign_S (w1[0], w1[1], offset); w2[1] = hc_bytealign_S (w0[3], w1[0], offset); w2[0] = hc_bytealign_S (w0[2], w0[3], offset); w1[3] = hc_bytealign_S (w0[1], w0[2], offset); w1[2] = hc_bytealign_S (w0[0], w0[1], offset); w1[1] = hc_bytealign_S ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: c1[2] = hc_bytealign_S (w7[3], 0, offset); c1[1] = hc_bytealign_S (w7[2], w7[3], offset); c1[0] = hc_bytealign_S (w7[1], w7[2], offset); c0[3] = hc_bytealign_S (w7[0], w7[1], offset); c0[2] = hc_bytealign_S (w6[3], w7[0], offset); c0[1] = hc_bytealign_S (w6[2], w6[3], offset); c0[0] = hc_bytealign_S (w6[1], w6[2], offset); w7[3] = hc_bytealign_S (w6[0], w6[1], offset); w7[2] = hc_bytealign_S (w5[3], w6[0], offset); w7[1] = hc_bytealign_S (w5[2], w5[3], offset); w7[0] = hc_bytealign_S (w5[1], w5[2], offset); w6[3] = hc_bytealign_S (w5[0], w5[1], offset); w6[2] = hc_bytealign_S (w4[3], w5[0], offset); w6[1] = hc_bytealign_S (w4[2], w4[3], offset); w6[0] = hc_bytealign_S (w4[1], w4[2], offset); w5[3] = hc_bytealign_S (w4[0], w4[1], offset); w5[2] = hc_bytealign_S (w3[3], w4[0], offset); w5[1] = hc_bytealign_S (w3[2], w3[3], offset); w5[0] = hc_bytealign_S (w3[1], w3[2], offset); w4[3] = hc_bytealign_S (w3[0], w3[1], offset); w4[2] = hc_bytealign_S (w2[3], w3[0], offset); w4[1] = hc_bytealign_S (w2[2], w2[3], offset); w4[0] = hc_bytealign_S (w2[1], w2[2], offset); w3[3] = hc_bytealign_S (w2[0], w2[1], offset); w3[2] = hc_bytealign_S (w1[3], w2[0], offset); w3[1] = hc_bytealign_S (w1[2], w1[3], offset); w3[0] = hc_bytealign_S (w1[1], w1[2], offset); w2[3] = hc_bytealign_S (w1[0], w1[1], offset); w2[2] = hc_bytealign_S (w0[3], w1[0], offset); w2[1] = hc_bytealign_S (w0[2], w0[3], offset); w2[0] = hc_bytealign_S (w0[1], w0[2], offset); w1[3] = hc_bytealign_S (w0[0], w0[1], offset); w1[2] = hc_bytealign_S ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: c1[3] = hc_bytealign_S (w7[3], 0, offset); c1[2] = hc_bytealign_S (w7[2], w7[3], offset); c1[1] = hc_bytealign_S (w7[1], w7[2], offset); c1[0] = hc_bytealign_S (w7[0], w7[1], offset); c0[3] = hc_bytealign_S (w6[3], w7[0], offset); c0[2] = hc_bytealign_S (w6[2], w6[3], offset); c0[1] = hc_bytealign_S (w6[1], w6[2], offset); c0[0] = hc_bytealign_S (w6[0], w6[1], offset); w7[3] = hc_bytealign_S (w5[3], w6[0], offset); w7[2] = hc_bytealign_S (w5[2], w5[3], offset); w7[1] = hc_bytealign_S (w5[1], w5[2], offset); w7[0] = hc_bytealign_S (w5[0], w5[1], offset); w6[3] = hc_bytealign_S (w4[3], w5[0], offset); w6[2] = hc_bytealign_S (w4[2], w4[3], offset); w6[1] = hc_bytealign_S (w4[1], w4[2], offset); w6[0] = hc_bytealign_S (w4[0], w4[1], offset); w5[3] = hc_bytealign_S (w3[3], w4[0], offset); w5[2] = hc_bytealign_S (w3[2], w3[3], offset); w5[1] = hc_bytealign_S (w3[1], w3[2], offset); w5[0] = hc_bytealign_S (w3[0], w3[1], offset); w4[3] = hc_bytealign_S (w2[3], w3[0], offset); w4[2] = hc_bytealign_S (w2[2], w2[3], offset); w4[1] = hc_bytealign_S (w2[1], w2[2], offset); w4[0] = hc_bytealign_S (w2[0], w2[1], offset); w3[3] = hc_bytealign_S (w1[3], w2[0], offset); w3[2] = hc_bytealign_S (w1[2], w1[3], offset); w3[1] = hc_bytealign_S (w1[1], w1[2], offset); w3[0] = hc_bytealign_S (w1[0], w1[1], offset); w2[3] = hc_bytealign_S (w0[3], w1[0], offset); w2[2] = hc_bytealign_S (w0[2], w0[3], offset); w2[1] = hc_bytealign_S (w0[1], w0[2], offset); w2[0] = hc_bytealign_S (w0[0], w0[1], offset); w1[3] = hc_bytealign_S ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: c2[0] = hc_bytealign_S (w7[3], 0, offset); c1[3] = hc_bytealign_S (w7[2], w7[3], offset); c1[2] = hc_bytealign_S (w7[1], w7[2], offset); c1[1] = hc_bytealign_S (w7[0], w7[1], offset); c1[0] = hc_bytealign_S (w6[3], w7[0], offset); c0[3] = hc_bytealign_S (w6[2], w6[3], offset); c0[2] = hc_bytealign_S (w6[1], w6[2], offset); c0[1] = hc_bytealign_S (w6[0], w6[1], offset); c0[0] = hc_bytealign_S (w5[3], w6[0], offset); w7[3] = hc_bytealign_S (w5[2], w5[3], offset); w7[2] = hc_bytealign_S (w5[1], w5[2], offset); w7[1] = hc_bytealign_S (w5[0], w5[1], offset); w7[0] = hc_bytealign_S (w4[3], w5[0], offset); w6[3] = hc_bytealign_S (w4[2], w4[3], offset); w6[2] = hc_bytealign_S (w4[1], w4[2], offset); w6[1] = hc_bytealign_S (w4[0], w4[1], offset); w6[0] = hc_bytealign_S (w3[3], w4[0], offset); w5[3] = hc_bytealign_S (w3[2], w3[3], offset); w5[2] = hc_bytealign_S (w3[1], w3[2], offset); w5[1] = hc_bytealign_S (w3[0], w3[1], offset); w5[0] = hc_bytealign_S (w2[3], w3[0], offset); w4[3] = hc_bytealign_S (w2[2], w2[3], offset); w4[2] = hc_bytealign_S (w2[1], w2[2], offset); w4[1] = hc_bytealign_S (w2[0], w2[1], offset); w4[0] = hc_bytealign_S (w1[3], w2[0], offset); w3[3] = hc_bytealign_S (w1[2], w1[3], offset); w3[2] = hc_bytealign_S (w1[1], w1[2], offset); w3[1] = hc_bytealign_S (w1[0], w1[1], offset); w3[0] = hc_bytealign_S (w0[3], w1[0], offset); w2[3] = hc_bytealign_S (w0[2], w0[3], offset); w2[2] = hc_bytealign_S (w0[1], w0[2], offset); w2[1] = hc_bytealign_S (w0[0], w0[1], offset); w2[0] = hc_bytealign_S ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: c2[1] = hc_bytealign_S (w7[3], 0, offset); c2[0] = hc_bytealign_S (w7[2], w7[3], offset); c1[3] = hc_bytealign_S (w7[1], w7[2], offset); c1[2] = hc_bytealign_S (w7[0], w7[1], offset); c1[1] = hc_bytealign_S (w6[3], w7[0], offset); c1[0] = hc_bytealign_S (w6[2], w6[3], offset); c0[3] = hc_bytealign_S (w6[1], w6[2], offset); c0[2] = hc_bytealign_S (w6[0], w6[1], offset); c0[1] = hc_bytealign_S (w5[3], w6[0], offset); c0[0] = hc_bytealign_S (w5[2], w5[3], offset); w7[3] = hc_bytealign_S (w5[1], w5[2], offset); w7[2] = hc_bytealign_S (w5[0], w5[1], offset); w7[1] = hc_bytealign_S (w4[3], w5[0], offset); w7[0] = hc_bytealign_S (w4[2], w4[3], offset); w6[3] = hc_bytealign_S (w4[1], w4[2], offset); w6[2] = hc_bytealign_S (w4[0], w4[1], offset); w6[1] = hc_bytealign_S (w3[3], w4[0], offset); w6[0] = hc_bytealign_S (w3[2], w3[3], offset); w5[3] = hc_bytealign_S (w3[1], w3[2], offset); w5[2] = hc_bytealign_S (w3[0], w3[1], offset); w5[1] = hc_bytealign_S (w2[3], w3[0], offset); w5[0] = hc_bytealign_S (w2[2], w2[3], offset); w4[3] = hc_bytealign_S (w2[1], w2[2], offset); w4[2] = hc_bytealign_S (w2[0], w2[1], offset); w4[1] = hc_bytealign_S (w1[3], w2[0], offset); w4[0] = hc_bytealign_S (w1[2], w1[3], offset); w3[3] = hc_bytealign_S (w1[1], w1[2], offset); w3[2] = hc_bytealign_S (w1[0], w1[1], offset); w3[1] = hc_bytealign_S (w0[3], w1[0], offset); w3[0] = hc_bytealign_S (w0[2], w0[3], offset); w2[3] = hc_bytealign_S (w0[1], w0[2], offset); w2[2] = hc_bytealign_S (w0[0], w0[1], offset); w2[1] = hc_bytealign_S ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: c2[2] = hc_bytealign_S (w7[3], 0, offset); c2[1] = hc_bytealign_S (w7[2], w7[3], offset); c2[0] = hc_bytealign_S (w7[1], w7[2], offset); c1[3] = hc_bytealign_S (w7[0], w7[1], offset); c1[2] = hc_bytealign_S (w6[3], w7[0], offset); c1[1] = hc_bytealign_S (w6[2], w6[3], offset); c1[0] = hc_bytealign_S (w6[1], w6[2], offset); c0[3] = hc_bytealign_S (w6[0], w6[1], offset); c0[2] = hc_bytealign_S (w5[3], w6[0], offset); c0[1] = hc_bytealign_S (w5[2], w5[3], offset); c0[0] = hc_bytealign_S (w5[1], w5[2], offset); w7[3] = hc_bytealign_S (w5[0], w5[1], offset); w7[2] = hc_bytealign_S (w4[3], w5[0], offset); w7[1] = hc_bytealign_S (w4[2], w4[3], offset); w7[0] = hc_bytealign_S (w4[1], w4[2], offset); w6[3] = hc_bytealign_S (w4[0], w4[1], offset); w6[2] = hc_bytealign_S (w3[3], w4[0], offset); w6[1] = hc_bytealign_S (w3[2], w3[3], offset); w6[0] = hc_bytealign_S (w3[1], w3[2], offset); w5[3] = hc_bytealign_S (w3[0], w3[1], offset); w5[2] = hc_bytealign_S (w2[3], w3[0], offset); w5[1] = hc_bytealign_S (w2[2], w2[3], offset); w5[0] = hc_bytealign_S (w2[1], w2[2], offset); w4[3] = hc_bytealign_S (w2[0], w2[1], offset); w4[2] = hc_bytealign_S (w1[3], w2[0], offset); w4[1] = hc_bytealign_S (w1[2], w1[3], offset); w4[0] = hc_bytealign_S (w1[1], w1[2], offset); w3[3] = hc_bytealign_S (w1[0], w1[1], offset); w3[2] = hc_bytealign_S (w0[3], w1[0], offset); w3[1] = hc_bytealign_S (w0[2], w0[3], offset); w3[0] = hc_bytealign_S (w0[1], w0[2], offset); w2[3] = hc_bytealign_S (w0[0], w0[1], offset); w2[2] = hc_bytealign_S ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: c2[3] = hc_bytealign_S (w7[3], 0, offset); c2[2] = hc_bytealign_S (w7[2], w7[3], offset); c2[1] = hc_bytealign_S (w7[1], w7[2], offset); c2[0] = hc_bytealign_S (w7[0], w7[1], offset); c1[3] = hc_bytealign_S (w6[3], w7[0], offset); c1[2] = hc_bytealign_S (w6[2], w6[3], offset); c1[1] = hc_bytealign_S (w6[1], w6[2], offset); c1[0] = hc_bytealign_S (w6[0], w6[1], offset); c0[3] = hc_bytealign_S (w5[3], w6[0], offset); c0[2] = hc_bytealign_S (w5[2], w5[3], offset); c0[1] = hc_bytealign_S (w5[1], w5[2], offset); c0[0] = hc_bytealign_S (w5[0], w5[1], offset); w7[3] = hc_bytealign_S (w4[3], w5[0], offset); w7[2] = hc_bytealign_S (w4[2], w4[3], offset); w7[1] = hc_bytealign_S (w4[1], w4[2], offset); w7[0] = hc_bytealign_S (w4[0], w4[1], offset); w6[3] = hc_bytealign_S (w3[3], w4[0], offset); w6[2] = hc_bytealign_S (w3[2], w3[3], offset); w6[1] = hc_bytealign_S (w3[1], w3[2], offset); w6[0] = hc_bytealign_S (w3[0], w3[1], offset); w5[3] = hc_bytealign_S (w2[3], w3[0], offset); w5[2] = hc_bytealign_S (w2[2], w2[3], offset); w5[1] = hc_bytealign_S (w2[1], w2[2], offset); w5[0] = hc_bytealign_S (w2[0], w2[1], offset); w4[3] = hc_bytealign_S (w1[3], w2[0], offset); w4[2] = hc_bytealign_S (w1[2], w1[3], offset); w4[1] = hc_bytealign_S (w1[1], w1[2], offset); w4[0] = hc_bytealign_S (w1[0], w1[1], offset); w3[3] = hc_bytealign_S (w0[3], w1[0], offset); w3[2] = hc_bytealign_S (w0[2], w0[3], offset); w3[1] = hc_bytealign_S (w0[1], w0[2], offset); w3[0] = hc_bytealign_S (w0[0], w0[1], offset); w2[3] = hc_bytealign_S ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: c3[0] = hc_bytealign_S (w7[3], 0, offset); c2[3] = hc_bytealign_S (w7[2], w7[3], offset); c2[2] = hc_bytealign_S (w7[1], w7[2], offset); c2[1] = hc_bytealign_S (w7[0], w7[1], offset); c2[0] = hc_bytealign_S (w6[3], w7[0], offset); c1[3] = hc_bytealign_S (w6[2], w6[3], offset); c1[2] = hc_bytealign_S (w6[1], w6[2], offset); c1[1] = hc_bytealign_S (w6[0], w6[1], offset); c1[0] = hc_bytealign_S (w5[3], w6[0], offset); c0[3] = hc_bytealign_S (w5[2], w5[3], offset); c0[2] = hc_bytealign_S (w5[1], w5[2], offset); c0[1] = hc_bytealign_S (w5[0], w5[1], offset); c0[0] = hc_bytealign_S (w4[3], w5[0], offset); w7[3] = hc_bytealign_S (w4[2], w4[3], offset); w7[2] = hc_bytealign_S (w4[1], w4[2], offset); w7[1] = hc_bytealign_S (w4[0], w4[1], offset); w7[0] = hc_bytealign_S (w3[3], w4[0], offset); w6[3] = hc_bytealign_S (w3[2], w3[3], offset); w6[2] = hc_bytealign_S (w3[1], w3[2], offset); w6[1] = hc_bytealign_S (w3[0], w3[1], offset); w6[0] = hc_bytealign_S (w2[3], w3[0], offset); w5[3] = hc_bytealign_S (w2[2], w2[3], offset); w5[2] = hc_bytealign_S (w2[1], w2[2], offset); w5[1] = hc_bytealign_S (w2[0], w2[1], offset); w5[0] = hc_bytealign_S (w1[3], w2[0], offset); w4[3] = hc_bytealign_S (w1[2], w1[3], offset); w4[2] = hc_bytealign_S (w1[1], w1[2], offset); w4[1] = hc_bytealign_S (w1[0], w1[1], offset); w4[0] = hc_bytealign_S (w0[3], w1[0], offset); w3[3] = hc_bytealign_S (w0[2], w0[3], offset); w3[2] = hc_bytealign_S (w0[1], w0[2], offset); w3[1] = hc_bytealign_S (w0[0], w0[1], offset); w3[0] = hc_bytealign_S ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: c3[1] = hc_bytealign_S (w7[3], 0, offset); c3[0] = hc_bytealign_S (w7[2], w7[3], offset); c2[3] = hc_bytealign_S (w7[1], w7[2], offset); c2[2] = hc_bytealign_S (w7[0], w7[1], offset); c2[1] = hc_bytealign_S (w6[3], w7[0], offset); c2[0] = hc_bytealign_S (w6[2], w6[3], offset); c1[3] = hc_bytealign_S (w6[1], w6[2], offset); c1[2] = hc_bytealign_S (w6[0], w6[1], offset); c1[1] = hc_bytealign_S (w5[3], w6[0], offset); c1[0] = hc_bytealign_S (w5[2], w5[3], offset); c0[3] = hc_bytealign_S (w5[1], w5[2], offset); c0[2] = hc_bytealign_S (w5[0], w5[1], offset); c0[1] = hc_bytealign_S (w4[3], w5[0], offset); c0[0] = hc_bytealign_S (w4[2], w4[3], offset); w7[3] = hc_bytealign_S (w4[1], w4[2], offset); w7[2] = hc_bytealign_S (w4[0], w4[1], offset); w7[1] = hc_bytealign_S (w3[3], w4[0], offset); w7[0] = hc_bytealign_S (w3[2], w3[3], offset); w6[3] = hc_bytealign_S (w3[1], w3[2], offset); w6[2] = hc_bytealign_S (w3[0], w3[1], offset); w6[1] = hc_bytealign_S (w2[3], w3[0], offset); w6[0] = hc_bytealign_S (w2[2], w2[3], offset); w5[3] = hc_bytealign_S (w2[1], w2[2], offset); w5[2] = hc_bytealign_S (w2[0], w2[1], offset); w5[1] = hc_bytealign_S (w1[3], w2[0], offset); w5[0] = hc_bytealign_S (w1[2], w1[3], offset); w4[3] = hc_bytealign_S (w1[1], w1[2], offset); w4[2] = hc_bytealign_S (w1[0], w1[1], offset); w4[1] = hc_bytealign_S (w0[3], w1[0], offset); w4[0] = hc_bytealign_S (w0[2], w0[3], offset); w3[3] = hc_bytealign_S (w0[1], w0[2], offset); w3[2] = hc_bytealign_S (w0[0], w0[1], offset); w3[1] = hc_bytealign_S ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: c3[2] = hc_bytealign_S (w7[3], 0, offset); c3[1] = hc_bytealign_S (w7[2], w7[3], offset); c3[0] = hc_bytealign_S (w7[1], w7[2], offset); c2[3] = hc_bytealign_S (w7[0], w7[1], offset); c2[2] = hc_bytealign_S (w6[3], w7[0], offset); c2[1] = hc_bytealign_S (w6[2], w6[3], offset); c2[0] = hc_bytealign_S (w6[1], w6[2], offset); c1[3] = hc_bytealign_S (w6[0], w6[1], offset); c1[2] = hc_bytealign_S (w5[3], w6[0], offset); c1[1] = hc_bytealign_S (w5[2], w5[3], offset); c1[0] = hc_bytealign_S (w5[1], w5[2], offset); c0[3] = hc_bytealign_S (w5[0], w5[1], offset); c0[2] = hc_bytealign_S (w4[3], w5[0], offset); c0[1] = hc_bytealign_S (w4[2], w4[3], offset); c0[0] = hc_bytealign_S (w4[1], w4[2], offset); w7[3] = hc_bytealign_S (w4[0], w4[1], offset); w7[2] = hc_bytealign_S (w3[3], w4[0], offset); w7[1] = hc_bytealign_S (w3[2], w3[3], offset); w7[0] = hc_bytealign_S (w3[1], w3[2], offset); w6[3] = hc_bytealign_S (w3[0], w3[1], offset); w6[2] = hc_bytealign_S (w2[3], w3[0], offset); w6[1] = hc_bytealign_S (w2[2], w2[3], offset); w6[0] = hc_bytealign_S (w2[1], w2[2], offset); w5[3] = hc_bytealign_S (w2[0], w2[1], offset); w5[2] = hc_bytealign_S (w1[3], w2[0], offset); w5[1] = hc_bytealign_S (w1[2], w1[3], offset); w5[0] = hc_bytealign_S (w1[1], w1[2], offset); w4[3] = hc_bytealign_S (w1[0], w1[1], offset); w4[2] = hc_bytealign_S (w0[3], w1[0], offset); w4[1] = hc_bytealign_S (w0[2], w0[3], offset); w4[0] = hc_bytealign_S (w0[1], w0[2], offset); w3[3] = hc_bytealign_S (w0[0], w0[1], offset); w3[2] = hc_bytealign_S ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: c3[3] = hc_bytealign_S (w7[3], 0, offset); c3[2] = hc_bytealign_S (w7[2], w7[3], offset); c3[1] = hc_bytealign_S (w7[1], w7[2], offset); c3[0] = hc_bytealign_S (w7[0], w7[1], offset); c2[3] = hc_bytealign_S (w6[3], w7[0], offset); c2[2] = hc_bytealign_S (w6[2], w6[3], offset); c2[1] = hc_bytealign_S (w6[1], w6[2], offset); c2[0] = hc_bytealign_S (w6[0], w6[1], offset); c1[3] = hc_bytealign_S (w5[3], w6[0], offset); c1[2] = hc_bytealign_S (w5[2], w5[3], offset); c1[1] = hc_bytealign_S (w5[1], w5[2], offset); c1[0] = hc_bytealign_S (w5[0], w5[1], offset); c0[3] = hc_bytealign_S (w4[3], w5[0], offset); c0[2] = hc_bytealign_S (w4[2], w4[3], offset); c0[1] = hc_bytealign_S (w4[1], w4[2], offset); c0[0] = hc_bytealign_S (w4[0], w4[1], offset); w7[3] = hc_bytealign_S (w3[3], w4[0], offset); w7[2] = hc_bytealign_S (w3[2], w3[3], offset); w7[1] = hc_bytealign_S (w3[1], w3[2], offset); w7[0] = hc_bytealign_S (w3[0], w3[1], offset); w6[3] = hc_bytealign_S (w2[3], w3[0], offset); w6[2] = hc_bytealign_S (w2[2], w2[3], offset); w6[1] = hc_bytealign_S (w2[1], w2[2], offset); w6[0] = hc_bytealign_S (w2[0], w2[1], offset); w5[3] = hc_bytealign_S (w1[3], w2[0], offset); w5[2] = hc_bytealign_S (w1[2], w1[3], offset); w5[1] = hc_bytealign_S (w1[1], w1[2], offset); w5[0] = hc_bytealign_S (w1[0], w1[1], offset); w4[3] = hc_bytealign_S (w0[3], w1[0], offset); w4[2] = hc_bytealign_S (w0[2], w0[3], offset); w4[1] = hc_bytealign_S (w0[1], w0[2], offset); w4[0] = hc_bytealign_S (w0[0], w0[1], offset); w3[3] = hc_bytealign_S ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 16: c4[0] = hc_bytealign_S (w7[3], 0, offset); c3[3] = hc_bytealign_S (w7[2], w7[3], offset); c3[2] = hc_bytealign_S (w7[1], w7[2], offset); c3[1] = hc_bytealign_S (w7[0], w7[1], offset); c3[0] = hc_bytealign_S (w6[3], w7[0], offset); c2[3] = hc_bytealign_S (w6[2], w6[3], offset); c2[2] = hc_bytealign_S (w6[1], w6[2], offset); c2[1] = hc_bytealign_S (w6[0], w6[1], offset); c2[0] = hc_bytealign_S (w5[3], w6[0], offset); c1[3] = hc_bytealign_S (w5[2], w5[3], offset); c1[2] = hc_bytealign_S (w5[1], w5[2], offset); c1[1] = hc_bytealign_S (w5[0], w5[1], offset); c1[0] = hc_bytealign_S (w4[3], w5[0], offset); c0[3] = hc_bytealign_S (w4[2], w4[3], offset); c0[2] = hc_bytealign_S (w4[1], w4[2], offset); c0[1] = hc_bytealign_S (w4[0], w4[1], offset); c0[0] = hc_bytealign_S (w3[3], w4[0], offset); w7[3] = hc_bytealign_S (w3[2], w3[3], offset); w7[2] = hc_bytealign_S (w3[1], w3[2], offset); w7[1] = hc_bytealign_S (w3[0], w3[1], offset); w7[0] = hc_bytealign_S (w2[3], w3[0], offset); w6[3] = hc_bytealign_S (w2[2], w2[3], offset); w6[2] = hc_bytealign_S (w2[1], w2[2], offset); w6[1] = hc_bytealign_S (w2[0], w2[1], offset); w6[0] = hc_bytealign_S (w1[3], w2[0], offset); w5[3] = hc_bytealign_S (w1[2], w1[3], offset); w5[2] = hc_bytealign_S (w1[1], w1[2], offset); w5[1] = hc_bytealign_S (w1[0], w1[1], offset); w5[0] = hc_bytealign_S (w0[3], w1[0], offset); w4[3] = hc_bytealign_S (w0[2], w0[3], offset); w4[2] = hc_bytealign_S (w0[1], w0[2], offset); w4[1] = hc_bytealign_S (w0[0], w0[1], offset); w4[0] = hc_bytealign_S ( 0, w0[0], offset); w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 17: c4[1] = hc_bytealign_S (w7[3], 0, offset); c4[0] = hc_bytealign_S (w7[2], w7[3], offset); c3[3] = hc_bytealign_S (w7[1], w7[2], offset); c3[2] = hc_bytealign_S (w7[0], w7[1], offset); c3[1] = hc_bytealign_S (w6[3], w7[0], offset); c3[0] = hc_bytealign_S (w6[2], w6[3], offset); c2[3] = hc_bytealign_S (w6[1], w6[2], offset); c2[2] = hc_bytealign_S (w6[0], w6[1], offset); c2[1] = hc_bytealign_S (w5[3], w6[0], offset); c2[0] = hc_bytealign_S (w5[2], w5[3], offset); c1[3] = hc_bytealign_S (w5[1], w5[2], offset); c1[2] = hc_bytealign_S (w5[0], w5[1], offset); c1[1] = hc_bytealign_S (w4[3], w5[0], offset); c1[0] = hc_bytealign_S (w4[2], w4[3], offset); c0[3] = hc_bytealign_S (w4[1], w4[2], offset); c0[2] = hc_bytealign_S (w4[0], w4[1], offset); c0[1] = hc_bytealign_S (w3[3], w4[0], offset); c0[0] = hc_bytealign_S (w3[2], w3[3], offset); w7[3] = hc_bytealign_S (w3[1], w3[2], offset); w7[2] = hc_bytealign_S (w3[0], w3[1], offset); w7[1] = hc_bytealign_S (w2[3], w3[0], offset); w7[0] = hc_bytealign_S (w2[2], w2[3], offset); w6[3] = hc_bytealign_S (w2[1], w2[2], offset); w6[2] = hc_bytealign_S (w2[0], w2[1], offset); w6[1] = hc_bytealign_S (w1[3], w2[0], offset); w6[0] = hc_bytealign_S (w1[2], w1[3], offset); w5[3] = hc_bytealign_S (w1[1], w1[2], offset); w5[2] = hc_bytealign_S (w1[0], w1[1], offset); w5[1] = hc_bytealign_S (w0[3], w1[0], offset); w5[0] = hc_bytealign_S (w0[2], w0[3], offset); w4[3] = hc_bytealign_S (w0[1], w0[2], offset); w4[2] = hc_bytealign_S (w0[0], w0[1], offset); w4[1] = hc_bytealign_S ( 0, w0[0], offset); w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 18: c4[2] = hc_bytealign_S (w7[3], 0, offset); c4[1] = hc_bytealign_S (w7[2], w7[3], offset); c4[0] = hc_bytealign_S (w7[1], w7[2], offset); c3[3] = hc_bytealign_S (w7[0], w7[1], offset); c3[2] = hc_bytealign_S (w6[3], w7[0], offset); c3[1] = hc_bytealign_S (w6[2], w6[3], offset); c3[0] = hc_bytealign_S (w6[1], w6[2], offset); c2[3] = hc_bytealign_S (w6[0], w6[1], offset); c2[2] = hc_bytealign_S (w5[3], w6[0], offset); c2[1] = hc_bytealign_S (w5[2], w5[3], offset); c2[0] = hc_bytealign_S (w5[1], w5[2], offset); c1[3] = hc_bytealign_S (w5[0], w5[1], offset); c1[2] = hc_bytealign_S (w4[3], w5[0], offset); c1[1] = hc_bytealign_S (w4[2], w4[3], offset); c1[0] = hc_bytealign_S (w4[1], w4[2], offset); c0[3] = hc_bytealign_S (w4[0], w4[1], offset); c0[2] = hc_bytealign_S (w3[3], w4[0], offset); c0[1] = hc_bytealign_S (w3[2], w3[3], offset); c0[0] = hc_bytealign_S (w3[1], w3[2], offset); w7[3] = hc_bytealign_S (w3[0], w3[1], offset); w7[2] = hc_bytealign_S (w2[3], w3[0], offset); w7[1] = hc_bytealign_S (w2[2], w2[3], offset); w7[0] = hc_bytealign_S (w2[1], w2[2], offset); w6[3] = hc_bytealign_S (w2[0], w2[1], offset); w6[2] = hc_bytealign_S (w1[3], w2[0], offset); w6[1] = hc_bytealign_S (w1[2], w1[3], offset); w6[0] = hc_bytealign_S (w1[1], w1[2], offset); w5[3] = hc_bytealign_S (w1[0], w1[1], offset); w5[2] = hc_bytealign_S (w0[3], w1[0], offset); w5[1] = hc_bytealign_S (w0[2], w0[3], offset); w5[0] = hc_bytealign_S (w0[1], w0[2], offset); w4[3] = hc_bytealign_S (w0[0], w0[1], offset); w4[2] = hc_bytealign_S ( 0, w0[0], offset); w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 19: c4[3] = hc_bytealign_S (w7[3], 0, offset); c4[2] = hc_bytealign_S (w7[2], w7[3], offset); c4[1] = hc_bytealign_S (w7[1], w7[2], offset); c4[0] = hc_bytealign_S (w7[0], w7[1], offset); c3[3] = hc_bytealign_S (w6[3], w7[0], offset); c3[2] = hc_bytealign_S (w6[2], w6[3], offset); c3[1] = hc_bytealign_S (w6[1], w6[2], offset); c3[0] = hc_bytealign_S (w6[0], w6[1], offset); c2[3] = hc_bytealign_S (w5[3], w6[0], offset); c2[2] = hc_bytealign_S (w5[2], w5[3], offset); c2[1] = hc_bytealign_S (w5[1], w5[2], offset); c2[0] = hc_bytealign_S (w5[0], w5[1], offset); c1[3] = hc_bytealign_S (w4[3], w5[0], offset); c1[2] = hc_bytealign_S (w4[2], w4[3], offset); c1[1] = hc_bytealign_S (w4[1], w4[2], offset); c1[0] = hc_bytealign_S (w4[0], w4[1], offset); c0[3] = hc_bytealign_S (w3[3], w4[0], offset); c0[2] = hc_bytealign_S (w3[2], w3[3], offset); c0[1] = hc_bytealign_S (w3[1], w3[2], offset); c0[0] = hc_bytealign_S (w3[0], w3[1], offset); w7[3] = hc_bytealign_S (w2[3], w3[0], offset); w7[2] = hc_bytealign_S (w2[2], w2[3], offset); w7[1] = hc_bytealign_S (w2[1], w2[2], offset); w7[0] = hc_bytealign_S (w2[0], w2[1], offset); w6[3] = hc_bytealign_S (w1[3], w2[0], offset); w6[2] = hc_bytealign_S (w1[2], w1[3], offset); w6[1] = hc_bytealign_S (w1[1], w1[2], offset); w6[0] = hc_bytealign_S (w1[0], w1[1], offset); w5[3] = hc_bytealign_S (w0[3], w1[0], offset); w5[2] = hc_bytealign_S (w0[2], w0[3], offset); w5[1] = hc_bytealign_S (w0[1], w0[2], offset); w5[0] = hc_bytealign_S (w0[0], w0[1], offset); w4[3] = hc_bytealign_S ( 0, w0[0], offset); w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 20: c5[0] = hc_bytealign_S (w7[3], 0, offset); c4[3] = hc_bytealign_S (w7[2], w7[3], offset); c4[2] = hc_bytealign_S (w7[1], w7[2], offset); c4[1] = hc_bytealign_S (w7[0], w7[1], offset); c4[0] = hc_bytealign_S (w6[3], w7[0], offset); c3[3] = hc_bytealign_S (w6[2], w6[3], offset); c3[2] = hc_bytealign_S (w6[1], w6[2], offset); c3[1] = hc_bytealign_S (w6[0], w6[1], offset); c3[0] = hc_bytealign_S (w5[3], w6[0], offset); c2[3] = hc_bytealign_S (w5[2], w5[3], offset); c2[2] = hc_bytealign_S (w5[1], w5[2], offset); c2[1] = hc_bytealign_S (w5[0], w5[1], offset); c2[0] = hc_bytealign_S (w4[3], w5[0], offset); c1[3] = hc_bytealign_S (w4[2], w4[3], offset); c1[2] = hc_bytealign_S (w4[1], w4[2], offset); c1[1] = hc_bytealign_S (w4[0], w4[1], offset); c1[0] = hc_bytealign_S (w3[3], w4[0], offset); c0[3] = hc_bytealign_S (w3[2], w3[3], offset); c0[2] = hc_bytealign_S (w3[1], w3[2], offset); c0[1] = hc_bytealign_S (w3[0], w3[1], offset); c0[0] = hc_bytealign_S (w2[3], w3[0], offset); w7[3] = hc_bytealign_S (w2[2], w2[3], offset); w7[2] = hc_bytealign_S (w2[1], w2[2], offset); w7[1] = hc_bytealign_S (w2[0], w2[1], offset); w7[0] = hc_bytealign_S (w1[3], w2[0], offset); w6[3] = hc_bytealign_S (w1[2], w1[3], offset); w6[2] = hc_bytealign_S (w1[1], w1[2], offset); w6[1] = hc_bytealign_S (w1[0], w1[1], offset); w6[0] = hc_bytealign_S (w0[3], w1[0], offset); w5[3] = hc_bytealign_S (w0[2], w0[3], offset); w5[2] = hc_bytealign_S (w0[1], w0[2], offset); w5[1] = hc_bytealign_S (w0[0], w0[1], offset); w5[0] = hc_bytealign_S ( 0, w0[0], offset); w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 21: c5[1] = hc_bytealign_S (w7[3], 0, offset); c5[0] = hc_bytealign_S (w7[2], w7[3], offset); c4[3] = hc_bytealign_S (w7[1], w7[2], offset); c4[2] = hc_bytealign_S (w7[0], w7[1], offset); c4[1] = hc_bytealign_S (w6[3], w7[0], offset); c4[0] = hc_bytealign_S (w6[2], w6[3], offset); c3[3] = hc_bytealign_S (w6[1], w6[2], offset); c3[2] = hc_bytealign_S (w6[0], w6[1], offset); c3[1] = hc_bytealign_S (w5[3], w6[0], offset); c3[0] = hc_bytealign_S (w5[2], w5[3], offset); c2[3] = hc_bytealign_S (w5[1], w5[2], offset); c2[2] = hc_bytealign_S (w5[0], w5[1], offset); c2[1] = hc_bytealign_S (w4[3], w5[0], offset); c2[0] = hc_bytealign_S (w4[2], w4[3], offset); c1[3] = hc_bytealign_S (w4[1], w4[2], offset); c1[2] = hc_bytealign_S (w4[0], w4[1], offset); c1[1] = hc_bytealign_S (w3[3], w4[0], offset); c1[0] = hc_bytealign_S (w3[2], w3[3], offset); c0[3] = hc_bytealign_S (w3[1], w3[2], offset); c0[2] = hc_bytealign_S (w3[0], w3[1], offset); c0[1] = hc_bytealign_S (w2[3], w3[0], offset); c0[0] = hc_bytealign_S (w2[2], w2[3], offset); w7[3] = hc_bytealign_S (w2[1], w2[2], offset); w7[2] = hc_bytealign_S (w2[0], w2[1], offset); w7[1] = hc_bytealign_S (w1[3], w2[0], offset); w7[0] = hc_bytealign_S (w1[2], w1[3], offset); w6[3] = hc_bytealign_S (w1[1], w1[2], offset); w6[2] = hc_bytealign_S (w1[0], w1[1], offset); w6[1] = hc_bytealign_S (w0[3], w1[0], offset); w6[0] = hc_bytealign_S (w0[2], w0[3], offset); w5[3] = hc_bytealign_S (w0[1], w0[2], offset); w5[2] = hc_bytealign_S (w0[0], w0[1], offset); w5[1] = hc_bytealign_S ( 0, w0[0], offset); w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 22: c5[2] = hc_bytealign_S (w7[3], 0, offset); c5[1] = hc_bytealign_S (w7[2], w7[3], offset); c5[0] = hc_bytealign_S (w7[1], w7[2], offset); c4[3] = hc_bytealign_S (w7[0], w7[1], offset); c4[2] = hc_bytealign_S (w6[3], w7[0], offset); c4[1] = hc_bytealign_S (w6[2], w6[3], offset); c4[0] = hc_bytealign_S (w6[1], w6[2], offset); c3[3] = hc_bytealign_S (w6[0], w6[1], offset); c3[2] = hc_bytealign_S (w5[3], w6[0], offset); c3[1] = hc_bytealign_S (w5[2], w5[3], offset); c3[0] = hc_bytealign_S (w5[1], w5[2], offset); c2[3] = hc_bytealign_S (w5[0], w5[1], offset); c2[2] = hc_bytealign_S (w4[3], w5[0], offset); c2[1] = hc_bytealign_S (w4[2], w4[3], offset); c2[0] = hc_bytealign_S (w4[1], w4[2], offset); c1[3] = hc_bytealign_S (w4[0], w4[1], offset); c1[2] = hc_bytealign_S (w3[3], w4[0], offset); c1[1] = hc_bytealign_S (w3[2], w3[3], offset); c1[0] = hc_bytealign_S (w3[1], w3[2], offset); c0[3] = hc_bytealign_S (w3[0], w3[1], offset); c0[2] = hc_bytealign_S (w2[3], w3[0], offset); c0[1] = hc_bytealign_S (w2[2], w2[3], offset); c0[0] = hc_bytealign_S (w2[1], w2[2], offset); w7[3] = hc_bytealign_S (w2[0], w2[1], offset); w7[2] = hc_bytealign_S (w1[3], w2[0], offset); w7[1] = hc_bytealign_S (w1[2], w1[3], offset); w7[0] = hc_bytealign_S (w1[1], w1[2], offset); w6[3] = hc_bytealign_S (w1[0], w1[1], offset); w6[2] = hc_bytealign_S (w0[3], w1[0], offset); w6[1] = hc_bytealign_S (w0[2], w0[3], offset); w6[0] = hc_bytealign_S (w0[1], w0[2], offset); w5[3] = hc_bytealign_S (w0[0], w0[1], offset); w5[2] = hc_bytealign_S ( 0, w0[0], offset); w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 23: c5[3] = hc_bytealign_S (w7[3], 0, offset); c5[2] = hc_bytealign_S (w7[2], w7[3], offset); c5[1] = hc_bytealign_S (w7[1], w7[2], offset); c5[0] = hc_bytealign_S (w7[0], w7[1], offset); c4[3] = hc_bytealign_S (w6[3], w7[0], offset); c4[2] = hc_bytealign_S (w6[2], w6[3], offset); c4[1] = hc_bytealign_S (w6[1], w6[2], offset); c4[0] = hc_bytealign_S (w6[0], w6[1], offset); c3[3] = hc_bytealign_S (w5[3], w6[0], offset); c3[2] = hc_bytealign_S (w5[2], w5[3], offset); c3[1] = hc_bytealign_S (w5[1], w5[2], offset); c3[0] = hc_bytealign_S (w5[0], w5[1], offset); c2[3] = hc_bytealign_S (w4[3], w5[0], offset); c2[2] = hc_bytealign_S (w4[2], w4[3], offset); c2[1] = hc_bytealign_S (w4[1], w4[2], offset); c2[0] = hc_bytealign_S (w4[0], w4[1], offset); c1[3] = hc_bytealign_S (w3[3], w4[0], offset); c1[2] = hc_bytealign_S (w3[2], w3[3], offset); c1[1] = hc_bytealign_S (w3[1], w3[2], offset); c1[0] = hc_bytealign_S (w3[0], w3[1], offset); c0[3] = hc_bytealign_S (w2[3], w3[0], offset); c0[2] = hc_bytealign_S (w2[2], w2[3], offset); c0[1] = hc_bytealign_S (w2[1], w2[2], offset); c0[0] = hc_bytealign_S (w2[0], w2[1], offset); w7[3] = hc_bytealign_S (w1[3], w2[0], offset); w7[2] = hc_bytealign_S (w1[2], w1[3], offset); w7[1] = hc_bytealign_S (w1[1], w1[2], offset); w7[0] = hc_bytealign_S (w1[0], w1[1], offset); w6[3] = hc_bytealign_S (w0[3], w1[0], offset); w6[2] = hc_bytealign_S (w0[2], w0[3], offset); w6[1] = hc_bytealign_S (w0[1], w0[2], offset); w6[0] = hc_bytealign_S (w0[0], w0[1], offset); w5[3] = hc_bytealign_S ( 0, w0[0], offset); w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 24: c6[0] = hc_bytealign_S (w7[3], 0, offset); c5[3] = hc_bytealign_S (w7[2], w7[3], offset); c5[2] = hc_bytealign_S (w7[1], w7[2], offset); c5[1] = hc_bytealign_S (w7[0], w7[1], offset); c5[0] = hc_bytealign_S (w6[3], w7[0], offset); c4[3] = hc_bytealign_S (w6[2], w6[3], offset); c4[2] = hc_bytealign_S (w6[1], w6[2], offset); c4[1] = hc_bytealign_S (w6[0], w6[1], offset); c4[0] = hc_bytealign_S (w5[3], w6[0], offset); c3[3] = hc_bytealign_S (w5[2], w5[3], offset); c3[2] = hc_bytealign_S (w5[1], w5[2], offset); c3[1] = hc_bytealign_S (w5[0], w5[1], offset); c3[0] = hc_bytealign_S (w4[3], w5[0], offset); c2[3] = hc_bytealign_S (w4[2], w4[3], offset); c2[2] = hc_bytealign_S (w4[1], w4[2], offset); c2[1] = hc_bytealign_S (w4[0], w4[1], offset); c2[0] = hc_bytealign_S (w3[3], w4[0], offset); c1[3] = hc_bytealign_S (w3[2], w3[3], offset); c1[2] = hc_bytealign_S (w3[1], w3[2], offset); c1[1] = hc_bytealign_S (w3[0], w3[1], offset); c1[0] = hc_bytealign_S (w2[3], w3[0], offset); c0[3] = hc_bytealign_S (w2[2], w2[3], offset); c0[2] = hc_bytealign_S (w2[1], w2[2], offset); c0[1] = hc_bytealign_S (w2[0], w2[1], offset); c0[0] = hc_bytealign_S (w1[3], w2[0], offset); w7[3] = hc_bytealign_S (w1[2], w1[3], offset); w7[2] = hc_bytealign_S (w1[1], w1[2], offset); w7[1] = hc_bytealign_S (w1[0], w1[1], offset); w7[0] = hc_bytealign_S (w0[3], w1[0], offset); w6[3] = hc_bytealign_S (w0[2], w0[3], offset); w6[2] = hc_bytealign_S (w0[1], w0[2], offset); w6[1] = hc_bytealign_S (w0[0], w0[1], offset); w6[0] = hc_bytealign_S ( 0, w0[0], offset); w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 25: c6[1] = hc_bytealign_S (w7[3], 0, offset); c6[0] = hc_bytealign_S (w7[2], w7[3], offset); c5[3] = hc_bytealign_S (w7[1], w7[2], offset); c5[2] = hc_bytealign_S (w7[0], w7[1], offset); c5[1] = hc_bytealign_S (w6[3], w7[0], offset); c5[0] = hc_bytealign_S (w6[2], w6[3], offset); c4[3] = hc_bytealign_S (w6[1], w6[2], offset); c4[2] = hc_bytealign_S (w6[0], w6[1], offset); c4[1] = hc_bytealign_S (w5[3], w6[0], offset); c4[0] = hc_bytealign_S (w5[2], w5[3], offset); c3[3] = hc_bytealign_S (w5[1], w5[2], offset); c3[2] = hc_bytealign_S (w5[0], w5[1], offset); c3[1] = hc_bytealign_S (w4[3], w5[0], offset); c3[0] = hc_bytealign_S (w4[2], w4[3], offset); c2[3] = hc_bytealign_S (w4[1], w4[2], offset); c2[2] = hc_bytealign_S (w4[0], w4[1], offset); c2[1] = hc_bytealign_S (w3[3], w4[0], offset); c2[0] = hc_bytealign_S (w3[2], w3[3], offset); c1[3] = hc_bytealign_S (w3[1], w3[2], offset); c1[2] = hc_bytealign_S (w3[0], w3[1], offset); c1[1] = hc_bytealign_S (w2[3], w3[0], offset); c1[0] = hc_bytealign_S (w2[2], w2[3], offset); c0[3] = hc_bytealign_S (w2[1], w2[2], offset); c0[2] = hc_bytealign_S (w2[0], w2[1], offset); c0[1] = hc_bytealign_S (w1[3], w2[0], offset); c0[0] = hc_bytealign_S (w1[2], w1[3], offset); w7[3] = hc_bytealign_S (w1[1], w1[2], offset); w7[2] = hc_bytealign_S (w1[0], w1[1], offset); w7[1] = hc_bytealign_S (w0[3], w1[0], offset); w7[0] = hc_bytealign_S (w0[2], w0[3], offset); w6[3] = hc_bytealign_S (w0[1], w0[2], offset); w6[2] = hc_bytealign_S (w0[0], w0[1], offset); w6[1] = hc_bytealign_S ( 0, w0[0], offset); w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 26: c6[2] = hc_bytealign_S (w7[3], 0, offset); c6[1] = hc_bytealign_S (w7[2], w7[3], offset); c6[0] = hc_bytealign_S (w7[1], w7[2], offset); c5[3] = hc_bytealign_S (w7[0], w7[1], offset); c5[2] = hc_bytealign_S (w6[3], w7[0], offset); c5[1] = hc_bytealign_S (w6[2], w6[3], offset); c5[0] = hc_bytealign_S (w6[1], w6[2], offset); c4[3] = hc_bytealign_S (w6[0], w6[1], offset); c4[2] = hc_bytealign_S (w5[3], w6[0], offset); c4[1] = hc_bytealign_S (w5[2], w5[3], offset); c4[0] = hc_bytealign_S (w5[1], w5[2], offset); c3[3] = hc_bytealign_S (w5[0], w5[1], offset); c3[2] = hc_bytealign_S (w4[3], w5[0], offset); c3[1] = hc_bytealign_S (w4[2], w4[3], offset); c3[0] = hc_bytealign_S (w4[1], w4[2], offset); c2[3] = hc_bytealign_S (w4[0], w4[1], offset); c2[2] = hc_bytealign_S (w3[3], w4[0], offset); c2[1] = hc_bytealign_S (w3[2], w3[3], offset); c2[0] = hc_bytealign_S (w3[1], w3[2], offset); c1[3] = hc_bytealign_S (w3[0], w3[1], offset); c1[2] = hc_bytealign_S (w2[3], w3[0], offset); c1[1] = hc_bytealign_S (w2[2], w2[3], offset); c1[0] = hc_bytealign_S (w2[1], w2[2], offset); c0[3] = hc_bytealign_S (w2[0], w2[1], offset); c0[2] = hc_bytealign_S (w1[3], w2[0], offset); c0[1] = hc_bytealign_S (w1[2], w1[3], offset); c0[0] = hc_bytealign_S (w1[1], w1[2], offset); w7[3] = hc_bytealign_S (w1[0], w1[1], offset); w7[2] = hc_bytealign_S (w0[3], w1[0], offset); w7[1] = hc_bytealign_S (w0[2], w0[3], offset); w7[0] = hc_bytealign_S (w0[1], w0[2], offset); w6[3] = hc_bytealign_S (w0[0], w0[1], offset); w6[2] = hc_bytealign_S ( 0, w0[0], offset); w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 27: c6[3] = hc_bytealign_S (w7[3], 0, offset); c6[2] = hc_bytealign_S (w7[2], w7[3], offset); c6[1] = hc_bytealign_S (w7[1], w7[2], offset); c6[0] = hc_bytealign_S (w7[0], w7[1], offset); c5[3] = hc_bytealign_S (w6[3], w7[0], offset); c5[2] = hc_bytealign_S (w6[2], w6[3], offset); c5[1] = hc_bytealign_S (w6[1], w6[2], offset); c5[0] = hc_bytealign_S (w6[0], w6[1], offset); c4[3] = hc_bytealign_S (w5[3], w6[0], offset); c4[2] = hc_bytealign_S (w5[2], w5[3], offset); c4[1] = hc_bytealign_S (w5[1], w5[2], offset); c4[0] = hc_bytealign_S (w5[0], w5[1], offset); c3[3] = hc_bytealign_S (w4[3], w5[0], offset); c3[2] = hc_bytealign_S (w4[2], w4[3], offset); c3[1] = hc_bytealign_S (w4[1], w4[2], offset); c3[0] = hc_bytealign_S (w4[0], w4[1], offset); c2[3] = hc_bytealign_S (w3[3], w4[0], offset); c2[2] = hc_bytealign_S (w3[2], w3[3], offset); c2[1] = hc_bytealign_S (w3[1], w3[2], offset); c2[0] = hc_bytealign_S (w3[0], w3[1], offset); c1[3] = hc_bytealign_S (w2[3], w3[0], offset); c1[2] = hc_bytealign_S (w2[2], w2[3], offset); c1[1] = hc_bytealign_S (w2[1], w2[2], offset); c1[0] = hc_bytealign_S (w2[0], w2[1], offset); c0[3] = hc_bytealign_S (w1[3], w2[0], offset); c0[2] = hc_bytealign_S (w1[2], w1[3], offset); c0[1] = hc_bytealign_S (w1[1], w1[2], offset); c0[0] = hc_bytealign_S (w1[0], w1[1], offset); w7[3] = hc_bytealign_S (w0[3], w1[0], offset); w7[2] = hc_bytealign_S (w0[2], w0[3], offset); w7[1] = hc_bytealign_S (w0[1], w0[2], offset); w7[0] = hc_bytealign_S (w0[0], w0[1], offset); w6[3] = hc_bytealign_S ( 0, w0[0], offset); w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 28: c7[0] = hc_bytealign_S (w7[3], 0, offset); c6[3] = hc_bytealign_S (w7[2], w7[3], offset); c6[2] = hc_bytealign_S (w7[1], w7[2], offset); c6[1] = hc_bytealign_S (w7[0], w7[1], offset); c6[0] = hc_bytealign_S (w6[3], w7[0], offset); c5[3] = hc_bytealign_S (w6[2], w6[3], offset); c5[2] = hc_bytealign_S (w6[1], w6[2], offset); c5[1] = hc_bytealign_S (w6[0], w6[1], offset); c5[0] = hc_bytealign_S (w5[3], w6[0], offset); c4[3] = hc_bytealign_S (w5[2], w5[3], offset); c4[2] = hc_bytealign_S (w5[1], w5[2], offset); c4[1] = hc_bytealign_S (w5[0], w5[1], offset); c4[0] = hc_bytealign_S (w4[3], w5[0], offset); c3[3] = hc_bytealign_S (w4[2], w4[3], offset); c3[2] = hc_bytealign_S (w4[1], w4[2], offset); c3[1] = hc_bytealign_S (w4[0], w4[1], offset); c3[0] = hc_bytealign_S (w3[3], w4[0], offset); c2[3] = hc_bytealign_S (w3[2], w3[3], offset); c2[2] = hc_bytealign_S (w3[1], w3[2], offset); c2[1] = hc_bytealign_S (w3[0], w3[1], offset); c2[0] = hc_bytealign_S (w2[3], w3[0], offset); c1[3] = hc_bytealign_S (w2[2], w2[3], offset); c1[2] = hc_bytealign_S (w2[1], w2[2], offset); c1[1] = hc_bytealign_S (w2[0], w2[1], offset); c1[0] = hc_bytealign_S (w1[3], w2[0], offset); c0[3] = hc_bytealign_S (w1[2], w1[3], offset); c0[2] = hc_bytealign_S (w1[1], w1[2], offset); c0[1] = hc_bytealign_S (w1[0], w1[1], offset); c0[0] = hc_bytealign_S (w0[3], w1[0], offset); w7[3] = hc_bytealign_S (w0[2], w0[3], offset); w7[2] = hc_bytealign_S (w0[1], w0[2], offset); w7[1] = hc_bytealign_S (w0[0], w0[1], offset); w7[0] = hc_bytealign_S ( 0, w0[0], offset); w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 29: c7[1] = hc_bytealign_S (w7[3], 0, offset); c7[0] = hc_bytealign_S (w7[2], w7[3], offset); c6[3] = hc_bytealign_S (w7[1], w7[2], offset); c6[2] = hc_bytealign_S (w7[0], w7[1], offset); c6[1] = hc_bytealign_S (w6[3], w7[0], offset); c6[0] = hc_bytealign_S (w6[2], w6[3], offset); c5[3] = hc_bytealign_S (w6[1], w6[2], offset); c5[2] = hc_bytealign_S (w6[0], w6[1], offset); c5[1] = hc_bytealign_S (w5[3], w6[0], offset); c5[0] = hc_bytealign_S (w5[2], w5[3], offset); c4[3] = hc_bytealign_S (w5[1], w5[2], offset); c4[2] = hc_bytealign_S (w5[0], w5[1], offset); c4[1] = hc_bytealign_S (w4[3], w5[0], offset); c4[0] = hc_bytealign_S (w4[2], w4[3], offset); c3[3] = hc_bytealign_S (w4[1], w4[2], offset); c3[2] = hc_bytealign_S (w4[0], w4[1], offset); c3[1] = hc_bytealign_S (w3[3], w4[0], offset); c3[0] = hc_bytealign_S (w3[2], w3[3], offset); c2[3] = hc_bytealign_S (w3[1], w3[2], offset); c2[2] = hc_bytealign_S (w3[0], w3[1], offset); c2[1] = hc_bytealign_S (w2[3], w3[0], offset); c2[0] = hc_bytealign_S (w2[2], w2[3], offset); c1[3] = hc_bytealign_S (w2[1], w2[2], offset); c1[2] = hc_bytealign_S (w2[0], w2[1], offset); c1[1] = hc_bytealign_S (w1[3], w2[0], offset); c1[0] = hc_bytealign_S (w1[2], w1[3], offset); c0[3] = hc_bytealign_S (w1[1], w1[2], offset); c0[2] = hc_bytealign_S (w1[0], w1[1], offset); c0[1] = hc_bytealign_S (w0[3], w1[0], offset); c0[0] = hc_bytealign_S (w0[2], w0[3], offset); w7[3] = hc_bytealign_S (w0[1], w0[2], offset); w7[2] = hc_bytealign_S (w0[0], w0[1], offset); w7[1] = hc_bytealign_S ( 0, w0[0], offset); w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 30: c7[2] = hc_bytealign_S (w7[3], 0, offset); c7[1] = hc_bytealign_S (w7[2], w7[3], offset); c7[0] = hc_bytealign_S (w7[1], w7[2], offset); c6[3] = hc_bytealign_S (w7[0], w7[1], offset); c6[2] = hc_bytealign_S (w6[3], w7[0], offset); c6[1] = hc_bytealign_S (w6[2], w6[3], offset); c6[0] = hc_bytealign_S (w6[1], w6[2], offset); c5[3] = hc_bytealign_S (w6[0], w6[1], offset); c5[2] = hc_bytealign_S (w5[3], w6[0], offset); c5[1] = hc_bytealign_S (w5[2], w5[3], offset); c5[0] = hc_bytealign_S (w5[1], w5[2], offset); c4[3] = hc_bytealign_S (w5[0], w5[1], offset); c4[2] = hc_bytealign_S (w4[3], w5[0], offset); c4[1] = hc_bytealign_S (w4[2], w4[3], offset); c4[0] = hc_bytealign_S (w4[1], w4[2], offset); c3[3] = hc_bytealign_S (w4[0], w4[1], offset); c3[2] = hc_bytealign_S (w3[3], w4[0], offset); c3[1] = hc_bytealign_S (w3[2], w3[3], offset); c3[0] = hc_bytealign_S (w3[1], w3[2], offset); c2[3] = hc_bytealign_S (w3[0], w3[1], offset); c2[2] = hc_bytealign_S (w2[3], w3[0], offset); c2[1] = hc_bytealign_S (w2[2], w2[3], offset); c2[0] = hc_bytealign_S (w2[1], w2[2], offset); c1[3] = hc_bytealign_S (w2[0], w2[1], offset); c1[2] = hc_bytealign_S (w1[3], w2[0], offset); c1[1] = hc_bytealign_S (w1[2], w1[3], offset); c1[0] = hc_bytealign_S (w1[1], w1[2], offset); c0[3] = hc_bytealign_S (w1[0], w1[1], offset); c0[2] = hc_bytealign_S (w0[3], w1[0], offset); c0[1] = hc_bytealign_S (w0[2], w0[3], offset); c0[0] = hc_bytealign_S (w0[1], w0[2], offset); w7[3] = hc_bytealign_S (w0[0], w0[1], offset); w7[2] = hc_bytealign_S ( 0, w0[0], offset); w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 31: c7[3] = hc_bytealign_S (w7[3], 0, offset); c7[2] = hc_bytealign_S (w7[2], w7[3], offset); c7[1] = hc_bytealign_S (w7[1], w7[2], offset); c7[0] = hc_bytealign_S (w7[0], w7[1], offset); c6[3] = hc_bytealign_S (w6[3], w7[0], offset); c6[2] = hc_bytealign_S (w6[2], w6[3], offset); c6[1] = hc_bytealign_S (w6[1], w6[2], offset); c6[0] = hc_bytealign_S (w6[0], w6[1], offset); c5[3] = hc_bytealign_S (w5[3], w6[0], offset); c5[2] = hc_bytealign_S (w5[2], w5[3], offset); c5[1] = hc_bytealign_S (w5[1], w5[2], offset); c5[0] = hc_bytealign_S (w5[0], w5[1], offset); c4[3] = hc_bytealign_S (w4[3], w5[0], offset); c4[2] = hc_bytealign_S (w4[2], w4[3], offset); c4[1] = hc_bytealign_S (w4[1], w4[2], offset); c4[0] = hc_bytealign_S (w4[0], w4[1], offset); c3[3] = hc_bytealign_S (w3[3], w4[0], offset); c3[2] = hc_bytealign_S (w3[2], w3[3], offset); c3[1] = hc_bytealign_S (w3[1], w3[2], offset); c3[0] = hc_bytealign_S (w3[0], w3[1], offset); c2[3] = hc_bytealign_S (w2[3], w3[0], offset); c2[2] = hc_bytealign_S (w2[2], w2[3], offset); c2[1] = hc_bytealign_S (w2[1], w2[2], offset); c2[0] = hc_bytealign_S (w2[0], w2[1], offset); c1[3] = hc_bytealign_S (w1[3], w2[0], offset); c1[2] = hc_bytealign_S (w1[2], w1[3], offset); c1[1] = hc_bytealign_S (w1[1], w1[2], offset); c1[0] = hc_bytealign_S (w1[0], w1[1], offset); c0[3] = hc_bytealign_S (w0[3], w1[0], offset); c0[2] = hc_bytealign_S (w0[2], w0[3], offset); c0[1] = hc_bytealign_S (w0[1], w0[2], offset); c0[0] = hc_bytealign_S (w0[0], w0[1], offset); w7[3] = hc_bytealign_S ( 0, w0[0], offset); w7[2] = 0; w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV const int offset_mod_4 = offset & 3; const int offset_minus_4 = 4 - offset_mod_4; #if defined IS_NV const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> (offset_minus_4 * 8)); #endif switch (offset_switch) { case 0: c0[0] = hc_byte_perm_S (w7[3], 0, selector); w7[3] = hc_byte_perm_S (w7[2], w7[3], selector); w7[2] = hc_byte_perm_S (w7[1], w7[2], selector); w7[1] = hc_byte_perm_S (w7[0], w7[1], selector); w7[0] = hc_byte_perm_S (w6[3], w7[0], selector); w6[3] = hc_byte_perm_S (w6[2], w6[3], selector); w6[2] = hc_byte_perm_S (w6[1], w6[2], selector); w6[1] = hc_byte_perm_S (w6[0], w6[1], selector); w6[0] = hc_byte_perm_S (w5[3], w6[0], selector); w5[3] = hc_byte_perm_S (w5[2], w5[3], selector); w5[2] = hc_byte_perm_S (w5[1], w5[2], selector); w5[1] = hc_byte_perm_S (w5[0], w5[1], selector); w5[0] = hc_byte_perm_S (w4[3], w5[0], selector); w4[3] = hc_byte_perm_S (w4[2], w4[3], selector); w4[2] = hc_byte_perm_S (w4[1], w4[2], selector); w4[1] = hc_byte_perm_S (w4[0], w4[1], selector); w4[0] = hc_byte_perm_S (w3[3], w4[0], selector); w3[3] = hc_byte_perm_S (w3[2], w3[3], selector); w3[2] = hc_byte_perm_S (w3[1], w3[2], selector); w3[1] = hc_byte_perm_S (w3[0], w3[1], selector); w3[0] = hc_byte_perm_S (w2[3], w3[0], selector); w2[3] = hc_byte_perm_S (w2[2], w2[3], selector); w2[2] = hc_byte_perm_S (w2[1], w2[2], selector); w2[1] = hc_byte_perm_S (w2[0], w2[1], selector); w2[0] = hc_byte_perm_S (w1[3], w2[0], selector); w1[3] = hc_byte_perm_S (w1[2], w1[3], selector); w1[2] = hc_byte_perm_S (w1[1], w1[2], selector); w1[1] = hc_byte_perm_S (w1[0], w1[1], selector); w1[0] = hc_byte_perm_S (w0[3], w1[0], selector); w0[3] = hc_byte_perm_S (w0[2], w0[3], selector); w0[2] = hc_byte_perm_S (w0[1], w0[2], selector); w0[1] = hc_byte_perm_S (w0[0], w0[1], selector); w0[0] = hc_byte_perm_S ( 0, w0[0], selector); break; case 1: c0[1] = hc_byte_perm_S (w7[3], 0, selector); c0[0] = hc_byte_perm_S (w7[2], w7[3], selector); w7[3] = hc_byte_perm_S (w7[1], w7[2], selector); w7[2] = hc_byte_perm_S (w7[0], w7[1], selector); w7[1] = hc_byte_perm_S (w6[3], w7[0], selector); w7[0] = hc_byte_perm_S (w6[2], w6[3], selector); w6[3] = hc_byte_perm_S (w6[1], w6[2], selector); w6[2] = hc_byte_perm_S (w6[0], w6[1], selector); w6[1] = hc_byte_perm_S (w5[3], w6[0], selector); w6[0] = hc_byte_perm_S (w5[2], w5[3], selector); w5[3] = hc_byte_perm_S (w5[1], w5[2], selector); w5[2] = hc_byte_perm_S (w5[0], w5[1], selector); w5[1] = hc_byte_perm_S (w4[3], w5[0], selector); w5[0] = hc_byte_perm_S (w4[2], w4[3], selector); w4[3] = hc_byte_perm_S (w4[1], w4[2], selector); w4[2] = hc_byte_perm_S (w4[0], w4[1], selector); w4[1] = hc_byte_perm_S (w3[3], w4[0], selector); w4[0] = hc_byte_perm_S (w3[2], w3[3], selector); w3[3] = hc_byte_perm_S (w3[1], w3[2], selector); w3[2] = hc_byte_perm_S (w3[0], w3[1], selector); w3[1] = hc_byte_perm_S (w2[3], w3[0], selector); w3[0] = hc_byte_perm_S (w2[2], w2[3], selector); w2[3] = hc_byte_perm_S (w2[1], w2[2], selector); w2[2] = hc_byte_perm_S (w2[0], w2[1], selector); w2[1] = hc_byte_perm_S (w1[3], w2[0], selector); w2[0] = hc_byte_perm_S (w1[2], w1[3], selector); w1[3] = hc_byte_perm_S (w1[1], w1[2], selector); w1[2] = hc_byte_perm_S (w1[0], w1[1], selector); w1[1] = hc_byte_perm_S (w0[3], w1[0], selector); w1[0] = hc_byte_perm_S (w0[2], w0[3], selector); w0[3] = hc_byte_perm_S (w0[1], w0[2], selector); w0[2] = hc_byte_perm_S (w0[0], w0[1], selector); w0[1] = hc_byte_perm_S ( 0, w0[0], selector); w0[0] = 0; break; case 2: c0[2] = hc_byte_perm_S (w7[3], 0, selector); c0[1] = hc_byte_perm_S (w7[2], w7[3], selector); c0[0] = hc_byte_perm_S (w7[1], w7[2], selector); w7[3] = hc_byte_perm_S (w7[0], w7[1], selector); w7[2] = hc_byte_perm_S (w6[3], w7[0], selector); w7[1] = hc_byte_perm_S (w6[2], w6[3], selector); w7[0] = hc_byte_perm_S (w6[1], w6[2], selector); w6[3] = hc_byte_perm_S (w6[0], w6[1], selector); w6[2] = hc_byte_perm_S (w5[3], w6[0], selector); w6[1] = hc_byte_perm_S (w5[2], w5[3], selector); w6[0] = hc_byte_perm_S (w5[1], w5[2], selector); w5[3] = hc_byte_perm_S (w5[0], w5[1], selector); w5[2] = hc_byte_perm_S (w4[3], w5[0], selector); w5[1] = hc_byte_perm_S (w4[2], w4[3], selector); w5[0] = hc_byte_perm_S (w4[1], w4[2], selector); w4[3] = hc_byte_perm_S (w4[0], w4[1], selector); w4[2] = hc_byte_perm_S (w3[3], w4[0], selector); w4[1] = hc_byte_perm_S (w3[2], w3[3], selector); w4[0] = hc_byte_perm_S (w3[1], w3[2], selector); w3[3] = hc_byte_perm_S (w3[0], w3[1], selector); w3[2] = hc_byte_perm_S (w2[3], w3[0], selector); w3[1] = hc_byte_perm_S (w2[2], w2[3], selector); w3[0] = hc_byte_perm_S (w2[1], w2[2], selector); w2[3] = hc_byte_perm_S (w2[0], w2[1], selector); w2[2] = hc_byte_perm_S (w1[3], w2[0], selector); w2[1] = hc_byte_perm_S (w1[2], w1[3], selector); w2[0] = hc_byte_perm_S (w1[1], w1[2], selector); w1[3] = hc_byte_perm_S (w1[0], w1[1], selector); w1[2] = hc_byte_perm_S (w0[3], w1[0], selector); w1[1] = hc_byte_perm_S (w0[2], w0[3], selector); w1[0] = hc_byte_perm_S (w0[1], w0[2], selector); w0[3] = hc_byte_perm_S (w0[0], w0[1], selector); w0[2] = hc_byte_perm_S ( 0, w0[0], selector); w0[1] = 0; w0[0] = 0; break; case 3: c0[3] = hc_byte_perm_S (w7[3], 0, selector); c0[2] = hc_byte_perm_S (w7[2], w7[3], selector); c0[1] = hc_byte_perm_S (w7[1], w7[2], selector); c0[0] = hc_byte_perm_S (w7[0], w7[1], selector); w7[3] = hc_byte_perm_S (w6[3], w7[0], selector); w7[2] = hc_byte_perm_S (w6[2], w6[3], selector); w7[1] = hc_byte_perm_S (w6[1], w6[2], selector); w7[0] = hc_byte_perm_S (w6[0], w6[1], selector); w6[3] = hc_byte_perm_S (w5[3], w6[0], selector); w6[2] = hc_byte_perm_S (w5[2], w5[3], selector); w6[1] = hc_byte_perm_S (w5[1], w5[2], selector); w6[0] = hc_byte_perm_S (w5[0], w5[1], selector); w5[3] = hc_byte_perm_S (w4[3], w5[0], selector); w5[2] = hc_byte_perm_S (w4[2], w4[3], selector); w5[1] = hc_byte_perm_S (w4[1], w4[2], selector); w5[0] = hc_byte_perm_S (w4[0], w4[1], selector); w4[3] = hc_byte_perm_S (w3[3], w4[0], selector); w4[2] = hc_byte_perm_S (w3[2], w3[3], selector); w4[1] = hc_byte_perm_S (w3[1], w3[2], selector); w4[0] = hc_byte_perm_S (w3[0], w3[1], selector); w3[3] = hc_byte_perm_S (w2[3], w3[0], selector); w3[2] = hc_byte_perm_S (w2[2], w2[3], selector); w3[1] = hc_byte_perm_S (w2[1], w2[2], selector); w3[0] = hc_byte_perm_S (w2[0], w2[1], selector); w2[3] = hc_byte_perm_S (w1[3], w2[0], selector); w2[2] = hc_byte_perm_S (w1[2], w1[3], selector); w2[1] = hc_byte_perm_S (w1[1], w1[2], selector); w2[0] = hc_byte_perm_S (w1[0], w1[1], selector); w1[3] = hc_byte_perm_S (w0[3], w1[0], selector); w1[2] = hc_byte_perm_S (w0[2], w0[3], selector); w1[1] = hc_byte_perm_S (w0[1], w0[2], selector); w1[0] = hc_byte_perm_S (w0[0], w0[1], selector); w0[3] = hc_byte_perm_S ( 0, w0[0], selector); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: c1[0] = hc_byte_perm_S (w7[3], 0, selector); c0[3] = hc_byte_perm_S (w7[2], w7[3], selector); c0[2] = hc_byte_perm_S (w7[1], w7[2], selector); c0[1] = hc_byte_perm_S (w7[0], w7[1], selector); c0[0] = hc_byte_perm_S (w6[3], w7[0], selector); w7[3] = hc_byte_perm_S (w6[2], w6[3], selector); w7[2] = hc_byte_perm_S (w6[1], w6[2], selector); w7[1] = hc_byte_perm_S (w6[0], w6[1], selector); w7[0] = hc_byte_perm_S (w5[3], w6[0], selector); w6[3] = hc_byte_perm_S (w5[2], w5[3], selector); w6[2] = hc_byte_perm_S (w5[1], w5[2], selector); w6[1] = hc_byte_perm_S (w5[0], w5[1], selector); w6[0] = hc_byte_perm_S (w4[3], w5[0], selector); w5[3] = hc_byte_perm_S (w4[2], w4[3], selector); w5[2] = hc_byte_perm_S (w4[1], w4[2], selector); w5[1] = hc_byte_perm_S (w4[0], w4[1], selector); w5[0] = hc_byte_perm_S (w3[3], w4[0], selector); w4[3] = hc_byte_perm_S (w3[2], w3[3], selector); w4[2] = hc_byte_perm_S (w3[1], w3[2], selector); w4[1] = hc_byte_perm_S (w3[0], w3[1], selector); w4[0] = hc_byte_perm_S (w2[3], w3[0], selector); w3[3] = hc_byte_perm_S (w2[2], w2[3], selector); w3[2] = hc_byte_perm_S (w2[1], w2[2], selector); w3[1] = hc_byte_perm_S (w2[0], w2[1], selector); w3[0] = hc_byte_perm_S (w1[3], w2[0], selector); w2[3] = hc_byte_perm_S (w1[2], w1[3], selector); w2[2] = hc_byte_perm_S (w1[1], w1[2], selector); w2[1] = hc_byte_perm_S (w1[0], w1[1], selector); w2[0] = hc_byte_perm_S (w0[3], w1[0], selector); w1[3] = hc_byte_perm_S (w0[2], w0[3], selector); w1[2] = hc_byte_perm_S (w0[1], w0[2], selector); w1[1] = hc_byte_perm_S (w0[0], w0[1], selector); w1[0] = hc_byte_perm_S ( 0, w0[0], selector); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: c1[1] = hc_byte_perm_S (w7[3], 0, selector); c1[0] = hc_byte_perm_S (w7[2], w7[3], selector); c0[3] = hc_byte_perm_S (w7[1], w7[2], selector); c0[2] = hc_byte_perm_S (w7[0], w7[1], selector); c0[1] = hc_byte_perm_S (w6[3], w7[0], selector); c0[0] = hc_byte_perm_S (w6[2], w6[3], selector); w7[3] = hc_byte_perm_S (w6[1], w6[2], selector); w7[2] = hc_byte_perm_S (w6[0], w6[1], selector); w7[1] = hc_byte_perm_S (w5[3], w6[0], selector); w7[0] = hc_byte_perm_S (w5[2], w5[3], selector); w6[3] = hc_byte_perm_S (w5[1], w5[2], selector); w6[2] = hc_byte_perm_S (w5[0], w5[1], selector); w6[1] = hc_byte_perm_S (w4[3], w5[0], selector); w6[0] = hc_byte_perm_S (w4[2], w4[3], selector); w5[3] = hc_byte_perm_S (w4[1], w4[2], selector); w5[2] = hc_byte_perm_S (w4[0], w4[1], selector); w5[1] = hc_byte_perm_S (w3[3], w4[0], selector); w5[0] = hc_byte_perm_S (w3[2], w3[3], selector); w4[3] = hc_byte_perm_S (w3[1], w3[2], selector); w4[2] = hc_byte_perm_S (w3[0], w3[1], selector); w4[1] = hc_byte_perm_S (w2[3], w3[0], selector); w4[0] = hc_byte_perm_S (w2[2], w2[3], selector); w3[3] = hc_byte_perm_S (w2[1], w2[2], selector); w3[2] = hc_byte_perm_S (w2[0], w2[1], selector); w3[1] = hc_byte_perm_S (w1[3], w2[0], selector); w3[0] = hc_byte_perm_S (w1[2], w1[3], selector); w2[3] = hc_byte_perm_S (w1[1], w1[2], selector); w2[2] = hc_byte_perm_S (w1[0], w1[1], selector); w2[1] = hc_byte_perm_S (w0[3], w1[0], selector); w2[0] = hc_byte_perm_S (w0[2], w0[3], selector); w1[3] = hc_byte_perm_S (w0[1], w0[2], selector); w1[2] = hc_byte_perm_S (w0[0], w0[1], selector); w1[1] = hc_byte_perm_S ( 0, w0[0], selector); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: c1[2] = hc_byte_perm_S (w7[3], 0, selector); c1[1] = hc_byte_perm_S (w7[2], w7[3], selector); c1[0] = hc_byte_perm_S (w7[1], w7[2], selector); c0[3] = hc_byte_perm_S (w7[0], w7[1], selector); c0[2] = hc_byte_perm_S (w6[3], w7[0], selector); c0[1] = hc_byte_perm_S (w6[2], w6[3], selector); c0[0] = hc_byte_perm_S (w6[1], w6[2], selector); w7[3] = hc_byte_perm_S (w6[0], w6[1], selector); w7[2] = hc_byte_perm_S (w5[3], w6[0], selector); w7[1] = hc_byte_perm_S (w5[2], w5[3], selector); w7[0] = hc_byte_perm_S (w5[1], w5[2], selector); w6[3] = hc_byte_perm_S (w5[0], w5[1], selector); w6[2] = hc_byte_perm_S (w4[3], w5[0], selector); w6[1] = hc_byte_perm_S (w4[2], w4[3], selector); w6[0] = hc_byte_perm_S (w4[1], w4[2], selector); w5[3] = hc_byte_perm_S (w4[0], w4[1], selector); w5[2] = hc_byte_perm_S (w3[3], w4[0], selector); w5[1] = hc_byte_perm_S (w3[2], w3[3], selector); w5[0] = hc_byte_perm_S (w3[1], w3[2], selector); w4[3] = hc_byte_perm_S (w3[0], w3[1], selector); w4[2] = hc_byte_perm_S (w2[3], w3[0], selector); w4[1] = hc_byte_perm_S (w2[2], w2[3], selector); w4[0] = hc_byte_perm_S (w2[1], w2[2], selector); w3[3] = hc_byte_perm_S (w2[0], w2[1], selector); w3[2] = hc_byte_perm_S (w1[3], w2[0], selector); w3[1] = hc_byte_perm_S (w1[2], w1[3], selector); w3[0] = hc_byte_perm_S (w1[1], w1[2], selector); w2[3] = hc_byte_perm_S (w1[0], w1[1], selector); w2[2] = hc_byte_perm_S (w0[3], w1[0], selector); w2[1] = hc_byte_perm_S (w0[2], w0[3], selector); w2[0] = hc_byte_perm_S (w0[1], w0[2], selector); w1[3] = hc_byte_perm_S (w0[0], w0[1], selector); w1[2] = hc_byte_perm_S ( 0, w0[0], selector); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: c1[3] = hc_byte_perm_S (w7[3], 0, selector); c1[2] = hc_byte_perm_S (w7[2], w7[3], selector); c1[1] = hc_byte_perm_S (w7[1], w7[2], selector); c1[0] = hc_byte_perm_S (w7[0], w7[1], selector); c0[3] = hc_byte_perm_S (w6[3], w7[0], selector); c0[2] = hc_byte_perm_S (w6[2], w6[3], selector); c0[1] = hc_byte_perm_S (w6[1], w6[2], selector); c0[0] = hc_byte_perm_S (w6[0], w6[1], selector); w7[3] = hc_byte_perm_S (w5[3], w6[0], selector); w7[2] = hc_byte_perm_S (w5[2], w5[3], selector); w7[1] = hc_byte_perm_S (w5[1], w5[2], selector); w7[0] = hc_byte_perm_S (w5[0], w5[1], selector); w6[3] = hc_byte_perm_S (w4[3], w5[0], selector); w6[2] = hc_byte_perm_S (w4[2], w4[3], selector); w6[1] = hc_byte_perm_S (w4[1], w4[2], selector); w6[0] = hc_byte_perm_S (w4[0], w4[1], selector); w5[3] = hc_byte_perm_S (w3[3], w4[0], selector); w5[2] = hc_byte_perm_S (w3[2], w3[3], selector); w5[1] = hc_byte_perm_S (w3[1], w3[2], selector); w5[0] = hc_byte_perm_S (w3[0], w3[1], selector); w4[3] = hc_byte_perm_S (w2[3], w3[0], selector); w4[2] = hc_byte_perm_S (w2[2], w2[3], selector); w4[1] = hc_byte_perm_S (w2[1], w2[2], selector); w4[0] = hc_byte_perm_S (w2[0], w2[1], selector); w3[3] = hc_byte_perm_S (w1[3], w2[0], selector); w3[2] = hc_byte_perm_S (w1[2], w1[3], selector); w3[1] = hc_byte_perm_S (w1[1], w1[2], selector); w3[0] = hc_byte_perm_S (w1[0], w1[1], selector); w2[3] = hc_byte_perm_S (w0[3], w1[0], selector); w2[2] = hc_byte_perm_S (w0[2], w0[3], selector); w2[1] = hc_byte_perm_S (w0[1], w0[2], selector); w2[0] = hc_byte_perm_S (w0[0], w0[1], selector); w1[3] = hc_byte_perm_S ( 0, w0[0], selector); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: c2[0] = hc_byte_perm_S (w7[3], 0, selector); c1[3] = hc_byte_perm_S (w7[2], w7[3], selector); c1[2] = hc_byte_perm_S (w7[1], w7[2], selector); c1[1] = hc_byte_perm_S (w7[0], w7[1], selector); c1[0] = hc_byte_perm_S (w6[3], w7[0], selector); c0[3] = hc_byte_perm_S (w6[2], w6[3], selector); c0[2] = hc_byte_perm_S (w6[1], w6[2], selector); c0[1] = hc_byte_perm_S (w6[0], w6[1], selector); c0[0] = hc_byte_perm_S (w5[3], w6[0], selector); w7[3] = hc_byte_perm_S (w5[2], w5[3], selector); w7[2] = hc_byte_perm_S (w5[1], w5[2], selector); w7[1] = hc_byte_perm_S (w5[0], w5[1], selector); w7[0] = hc_byte_perm_S (w4[3], w5[0], selector); w6[3] = hc_byte_perm_S (w4[2], w4[3], selector); w6[2] = hc_byte_perm_S (w4[1], w4[2], selector); w6[1] = hc_byte_perm_S (w4[0], w4[1], selector); w6[0] = hc_byte_perm_S (w3[3], w4[0], selector); w5[3] = hc_byte_perm_S (w3[2], w3[3], selector); w5[2] = hc_byte_perm_S (w3[1], w3[2], selector); w5[1] = hc_byte_perm_S (w3[0], w3[1], selector); w5[0] = hc_byte_perm_S (w2[3], w3[0], selector); w4[3] = hc_byte_perm_S (w2[2], w2[3], selector); w4[2] = hc_byte_perm_S (w2[1], w2[2], selector); w4[1] = hc_byte_perm_S (w2[0], w2[1], selector); w4[0] = hc_byte_perm_S (w1[3], w2[0], selector); w3[3] = hc_byte_perm_S (w1[2], w1[3], selector); w3[2] = hc_byte_perm_S (w1[1], w1[2], selector); w3[1] = hc_byte_perm_S (w1[0], w1[1], selector); w3[0] = hc_byte_perm_S (w0[3], w1[0], selector); w2[3] = hc_byte_perm_S (w0[2], w0[3], selector); w2[2] = hc_byte_perm_S (w0[1], w0[2], selector); w2[1] = hc_byte_perm_S (w0[0], w0[1], selector); w2[0] = hc_byte_perm_S ( 0, w0[0], selector); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: c2[1] = hc_byte_perm_S (w7[3], 0, selector); c2[0] = hc_byte_perm_S (w7[2], w7[3], selector); c1[3] = hc_byte_perm_S (w7[1], w7[2], selector); c1[2] = hc_byte_perm_S (w7[0], w7[1], selector); c1[1] = hc_byte_perm_S (w6[3], w7[0], selector); c1[0] = hc_byte_perm_S (w6[2], w6[3], selector); c0[3] = hc_byte_perm_S (w6[1], w6[2], selector); c0[2] = hc_byte_perm_S (w6[0], w6[1], selector); c0[1] = hc_byte_perm_S (w5[3], w6[0], selector); c0[0] = hc_byte_perm_S (w5[2], w5[3], selector); w7[3] = hc_byte_perm_S (w5[1], w5[2], selector); w7[2] = hc_byte_perm_S (w5[0], w5[1], selector); w7[1] = hc_byte_perm_S (w4[3], w5[0], selector); w7[0] = hc_byte_perm_S (w4[2], w4[3], selector); w6[3] = hc_byte_perm_S (w4[1], w4[2], selector); w6[2] = hc_byte_perm_S (w4[0], w4[1], selector); w6[1] = hc_byte_perm_S (w3[3], w4[0], selector); w6[0] = hc_byte_perm_S (w3[2], w3[3], selector); w5[3] = hc_byte_perm_S (w3[1], w3[2], selector); w5[2] = hc_byte_perm_S (w3[0], w3[1], selector); w5[1] = hc_byte_perm_S (w2[3], w3[0], selector); w5[0] = hc_byte_perm_S (w2[2], w2[3], selector); w4[3] = hc_byte_perm_S (w2[1], w2[2], selector); w4[2] = hc_byte_perm_S (w2[0], w2[1], selector); w4[1] = hc_byte_perm_S (w1[3], w2[0], selector); w4[0] = hc_byte_perm_S (w1[2], w1[3], selector); w3[3] = hc_byte_perm_S (w1[1], w1[2], selector); w3[2] = hc_byte_perm_S (w1[0], w1[1], selector); w3[1] = hc_byte_perm_S (w0[3], w1[0], selector); w3[0] = hc_byte_perm_S (w0[2], w0[3], selector); w2[3] = hc_byte_perm_S (w0[1], w0[2], selector); w2[2] = hc_byte_perm_S (w0[0], w0[1], selector); w2[1] = hc_byte_perm_S ( 0, w0[0], selector); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: c2[2] = hc_byte_perm_S (w7[3], 0, selector); c2[1] = hc_byte_perm_S (w7[2], w7[3], selector); c2[0] = hc_byte_perm_S (w7[1], w7[2], selector); c1[3] = hc_byte_perm_S (w7[0], w7[1], selector); c1[2] = hc_byte_perm_S (w6[3], w7[0], selector); c1[1] = hc_byte_perm_S (w6[2], w6[3], selector); c1[0] = hc_byte_perm_S (w6[1], w6[2], selector); c0[3] = hc_byte_perm_S (w6[0], w6[1], selector); c0[2] = hc_byte_perm_S (w5[3], w6[0], selector); c0[1] = hc_byte_perm_S (w5[2], w5[3], selector); c0[0] = hc_byte_perm_S (w5[1], w5[2], selector); w7[3] = hc_byte_perm_S (w5[0], w5[1], selector); w7[2] = hc_byte_perm_S (w4[3], w5[0], selector); w7[1] = hc_byte_perm_S (w4[2], w4[3], selector); w7[0] = hc_byte_perm_S (w4[1], w4[2], selector); w6[3] = hc_byte_perm_S (w4[0], w4[1], selector); w6[2] = hc_byte_perm_S (w3[3], w4[0], selector); w6[1] = hc_byte_perm_S (w3[2], w3[3], selector); w6[0] = hc_byte_perm_S (w3[1], w3[2], selector); w5[3] = hc_byte_perm_S (w3[0], w3[1], selector); w5[2] = hc_byte_perm_S (w2[3], w3[0], selector); w5[1] = hc_byte_perm_S (w2[2], w2[3], selector); w5[0] = hc_byte_perm_S (w2[1], w2[2], selector); w4[3] = hc_byte_perm_S (w2[0], w2[1], selector); w4[2] = hc_byte_perm_S (w1[3], w2[0], selector); w4[1] = hc_byte_perm_S (w1[2], w1[3], selector); w4[0] = hc_byte_perm_S (w1[1], w1[2], selector); w3[3] = hc_byte_perm_S (w1[0], w1[1], selector); w3[2] = hc_byte_perm_S (w0[3], w1[0], selector); w3[1] = hc_byte_perm_S (w0[2], w0[3], selector); w3[0] = hc_byte_perm_S (w0[1], w0[2], selector); w2[3] = hc_byte_perm_S (w0[0], w0[1], selector); w2[2] = hc_byte_perm_S ( 0, w0[0], selector); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: c2[3] = hc_byte_perm_S (w7[3], 0, selector); c2[2] = hc_byte_perm_S (w7[2], w7[3], selector); c2[1] = hc_byte_perm_S (w7[1], w7[2], selector); c2[0] = hc_byte_perm_S (w7[0], w7[1], selector); c1[3] = hc_byte_perm_S (w6[3], w7[0], selector); c1[2] = hc_byte_perm_S (w6[2], w6[3], selector); c1[1] = hc_byte_perm_S (w6[1], w6[2], selector); c1[0] = hc_byte_perm_S (w6[0], w6[1], selector); c0[3] = hc_byte_perm_S (w5[3], w6[0], selector); c0[2] = hc_byte_perm_S (w5[2], w5[3], selector); c0[1] = hc_byte_perm_S (w5[1], w5[2], selector); c0[0] = hc_byte_perm_S (w5[0], w5[1], selector); w7[3] = hc_byte_perm_S (w4[3], w5[0], selector); w7[2] = hc_byte_perm_S (w4[2], w4[3], selector); w7[1] = hc_byte_perm_S (w4[1], w4[2], selector); w7[0] = hc_byte_perm_S (w4[0], w4[1], selector); w6[3] = hc_byte_perm_S (w3[3], w4[0], selector); w6[2] = hc_byte_perm_S (w3[2], w3[3], selector); w6[1] = hc_byte_perm_S (w3[1], w3[2], selector); w6[0] = hc_byte_perm_S (w3[0], w3[1], selector); w5[3] = hc_byte_perm_S (w2[3], w3[0], selector); w5[2] = hc_byte_perm_S (w2[2], w2[3], selector); w5[1] = hc_byte_perm_S (w2[1], w2[2], selector); w5[0] = hc_byte_perm_S (w2[0], w2[1], selector); w4[3] = hc_byte_perm_S (w1[3], w2[0], selector); w4[2] = hc_byte_perm_S (w1[2], w1[3], selector); w4[1] = hc_byte_perm_S (w1[1], w1[2], selector); w4[0] = hc_byte_perm_S (w1[0], w1[1], selector); w3[3] = hc_byte_perm_S (w0[3], w1[0], selector); w3[2] = hc_byte_perm_S (w0[2], w0[3], selector); w3[1] = hc_byte_perm_S (w0[1], w0[2], selector); w3[0] = hc_byte_perm_S (w0[0], w0[1], selector); w2[3] = hc_byte_perm_S ( 0, w0[0], selector); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: c3[0] = hc_byte_perm_S (w7[3], 0, selector); c2[3] = hc_byte_perm_S (w7[2], w7[3], selector); c2[2] = hc_byte_perm_S (w7[1], w7[2], selector); c2[1] = hc_byte_perm_S (w7[0], w7[1], selector); c2[0] = hc_byte_perm_S (w6[3], w7[0], selector); c1[3] = hc_byte_perm_S (w6[2], w6[3], selector); c1[2] = hc_byte_perm_S (w6[1], w6[2], selector); c1[1] = hc_byte_perm_S (w6[0], w6[1], selector); c1[0] = hc_byte_perm_S (w5[3], w6[0], selector); c0[3] = hc_byte_perm_S (w5[2], w5[3], selector); c0[2] = hc_byte_perm_S (w5[1], w5[2], selector); c0[1] = hc_byte_perm_S (w5[0], w5[1], selector); c0[0] = hc_byte_perm_S (w4[3], w5[0], selector); w7[3] = hc_byte_perm_S (w4[2], w4[3], selector); w7[2] = hc_byte_perm_S (w4[1], w4[2], selector); w7[1] = hc_byte_perm_S (w4[0], w4[1], selector); w7[0] = hc_byte_perm_S (w3[3], w4[0], selector); w6[3] = hc_byte_perm_S (w3[2], w3[3], selector); w6[2] = hc_byte_perm_S (w3[1], w3[2], selector); w6[1] = hc_byte_perm_S (w3[0], w3[1], selector); w6[0] = hc_byte_perm_S (w2[3], w3[0], selector); w5[3] = hc_byte_perm_S (w2[2], w2[3], selector); w5[2] = hc_byte_perm_S (w2[1], w2[2], selector); w5[1] = hc_byte_perm_S (w2[0], w2[1], selector); w5[0] = hc_byte_perm_S (w1[3], w2[0], selector); w4[3] = hc_byte_perm_S (w1[2], w1[3], selector); w4[2] = hc_byte_perm_S (w1[1], w1[2], selector); w4[1] = hc_byte_perm_S (w1[0], w1[1], selector); w4[0] = hc_byte_perm_S (w0[3], w1[0], selector); w3[3] = hc_byte_perm_S (w0[2], w0[3], selector); w3[2] = hc_byte_perm_S (w0[1], w0[2], selector); w3[1] = hc_byte_perm_S (w0[0], w0[1], selector); w3[0] = hc_byte_perm_S ( 0, w0[0], selector); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: c3[1] = hc_byte_perm_S (w7[3], 0, selector); c3[0] = hc_byte_perm_S (w7[2], w7[3], selector); c2[3] = hc_byte_perm_S (w7[1], w7[2], selector); c2[2] = hc_byte_perm_S (w7[0], w7[1], selector); c2[1] = hc_byte_perm_S (w6[3], w7[0], selector); c2[0] = hc_byte_perm_S (w6[2], w6[3], selector); c1[3] = hc_byte_perm_S (w6[1], w6[2], selector); c1[2] = hc_byte_perm_S (w6[0], w6[1], selector); c1[1] = hc_byte_perm_S (w5[3], w6[0], selector); c1[0] = hc_byte_perm_S (w5[2], w5[3], selector); c0[3] = hc_byte_perm_S (w5[1], w5[2], selector); c0[2] = hc_byte_perm_S (w5[0], w5[1], selector); c0[1] = hc_byte_perm_S (w4[3], w5[0], selector); c0[0] = hc_byte_perm_S (w4[2], w4[3], selector); w7[3] = hc_byte_perm_S (w4[1], w4[2], selector); w7[2] = hc_byte_perm_S (w4[0], w4[1], selector); w7[1] = hc_byte_perm_S (w3[3], w4[0], selector); w7[0] = hc_byte_perm_S (w3[2], w3[3], selector); w6[3] = hc_byte_perm_S (w3[1], w3[2], selector); w6[2] = hc_byte_perm_S (w3[0], w3[1], selector); w6[1] = hc_byte_perm_S (w2[3], w3[0], selector); w6[0] = hc_byte_perm_S (w2[2], w2[3], selector); w5[3] = hc_byte_perm_S (w2[1], w2[2], selector); w5[2] = hc_byte_perm_S (w2[0], w2[1], selector); w5[1] = hc_byte_perm_S (w1[3], w2[0], selector); w5[0] = hc_byte_perm_S (w1[2], w1[3], selector); w4[3] = hc_byte_perm_S (w1[1], w1[2], selector); w4[2] = hc_byte_perm_S (w1[0], w1[1], selector); w4[1] = hc_byte_perm_S (w0[3], w1[0], selector); w4[0] = hc_byte_perm_S (w0[2], w0[3], selector); w3[3] = hc_byte_perm_S (w0[1], w0[2], selector); w3[2] = hc_byte_perm_S (w0[0], w0[1], selector); w3[1] = hc_byte_perm_S ( 0, w0[0], selector); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: c3[2] = hc_byte_perm_S (w7[3], 0, selector); c3[1] = hc_byte_perm_S (w7[2], w7[3], selector); c3[0] = hc_byte_perm_S (w7[1], w7[2], selector); c2[3] = hc_byte_perm_S (w7[0], w7[1], selector); c2[2] = hc_byte_perm_S (w6[3], w7[0], selector); c2[1] = hc_byte_perm_S (w6[2], w6[3], selector); c2[0] = hc_byte_perm_S (w6[1], w6[2], selector); c1[3] = hc_byte_perm_S (w6[0], w6[1], selector); c1[2] = hc_byte_perm_S (w5[3], w6[0], selector); c1[1] = hc_byte_perm_S (w5[2], w5[3], selector); c1[0] = hc_byte_perm_S (w5[1], w5[2], selector); c0[3] = hc_byte_perm_S (w5[0], w5[1], selector); c0[2] = hc_byte_perm_S (w4[3], w5[0], selector); c0[1] = hc_byte_perm_S (w4[2], w4[3], selector); c0[0] = hc_byte_perm_S (w4[1], w4[2], selector); w7[3] = hc_byte_perm_S (w4[0], w4[1], selector); w7[2] = hc_byte_perm_S (w3[3], w4[0], selector); w7[1] = hc_byte_perm_S (w3[2], w3[3], selector); w7[0] = hc_byte_perm_S (w3[1], w3[2], selector); w6[3] = hc_byte_perm_S (w3[0], w3[1], selector); w6[2] = hc_byte_perm_S (w2[3], w3[0], selector); w6[1] = hc_byte_perm_S (w2[2], w2[3], selector); w6[0] = hc_byte_perm_S (w2[1], w2[2], selector); w5[3] = hc_byte_perm_S (w2[0], w2[1], selector); w5[2] = hc_byte_perm_S (w1[3], w2[0], selector); w5[1] = hc_byte_perm_S (w1[2], w1[3], selector); w5[0] = hc_byte_perm_S (w1[1], w1[2], selector); w4[3] = hc_byte_perm_S (w1[0], w1[1], selector); w4[2] = hc_byte_perm_S (w0[3], w1[0], selector); w4[1] = hc_byte_perm_S (w0[2], w0[3], selector); w4[0] = hc_byte_perm_S (w0[1], w0[2], selector); w3[3] = hc_byte_perm_S (w0[0], w0[1], selector); w3[2] = hc_byte_perm_S ( 0, w0[0], selector); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: c3[3] = hc_byte_perm_S (w7[3], 0, selector); c3[2] = hc_byte_perm_S (w7[2], w7[3], selector); c3[1] = hc_byte_perm_S (w7[1], w7[2], selector); c3[0] = hc_byte_perm_S (w7[0], w7[1], selector); c2[3] = hc_byte_perm_S (w6[3], w7[0], selector); c2[2] = hc_byte_perm_S (w6[2], w6[3], selector); c2[1] = hc_byte_perm_S (w6[1], w6[2], selector); c2[0] = hc_byte_perm_S (w6[0], w6[1], selector); c1[3] = hc_byte_perm_S (w5[3], w6[0], selector); c1[2] = hc_byte_perm_S (w5[2], w5[3], selector); c1[1] = hc_byte_perm_S (w5[1], w5[2], selector); c1[0] = hc_byte_perm_S (w5[0], w5[1], selector); c0[3] = hc_byte_perm_S (w4[3], w5[0], selector); c0[2] = hc_byte_perm_S (w4[2], w4[3], selector); c0[1] = hc_byte_perm_S (w4[1], w4[2], selector); c0[0] = hc_byte_perm_S (w4[0], w4[1], selector); w7[3] = hc_byte_perm_S (w3[3], w4[0], selector); w7[2] = hc_byte_perm_S (w3[2], w3[3], selector); w7[1] = hc_byte_perm_S (w3[1], w3[2], selector); w7[0] = hc_byte_perm_S (w3[0], w3[1], selector); w6[3] = hc_byte_perm_S (w2[3], w3[0], selector); w6[2] = hc_byte_perm_S (w2[2], w2[3], selector); w6[1] = hc_byte_perm_S (w2[1], w2[2], selector); w6[0] = hc_byte_perm_S (w2[0], w2[1], selector); w5[3] = hc_byte_perm_S (w1[3], w2[0], selector); w5[2] = hc_byte_perm_S (w1[2], w1[3], selector); w5[1] = hc_byte_perm_S (w1[1], w1[2], selector); w5[0] = hc_byte_perm_S (w1[0], w1[1], selector); w4[3] = hc_byte_perm_S (w0[3], w1[0], selector); w4[2] = hc_byte_perm_S (w0[2], w0[3], selector); w4[1] = hc_byte_perm_S (w0[1], w0[2], selector); w4[0] = hc_byte_perm_S (w0[0], w0[1], selector); w3[3] = hc_byte_perm_S ( 0, w0[0], selector); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 16: c4[0] = hc_byte_perm_S (w7[3], 0, selector); c3[3] = hc_byte_perm_S (w7[2], w7[3], selector); c3[2] = hc_byte_perm_S (w7[1], w7[2], selector); c3[1] = hc_byte_perm_S (w7[0], w7[1], selector); c3[0] = hc_byte_perm_S (w6[3], w7[0], selector); c2[3] = hc_byte_perm_S (w6[2], w6[3], selector); c2[2] = hc_byte_perm_S (w6[1], w6[2], selector); c2[1] = hc_byte_perm_S (w6[0], w6[1], selector); c2[0] = hc_byte_perm_S (w5[3], w6[0], selector); c1[3] = hc_byte_perm_S (w5[2], w5[3], selector); c1[2] = hc_byte_perm_S (w5[1], w5[2], selector); c1[1] = hc_byte_perm_S (w5[0], w5[1], selector); c1[0] = hc_byte_perm_S (w4[3], w5[0], selector); c0[3] = hc_byte_perm_S (w4[2], w4[3], selector); c0[2] = hc_byte_perm_S (w4[1], w4[2], selector); c0[1] = hc_byte_perm_S (w4[0], w4[1], selector); c0[0] = hc_byte_perm_S (w3[3], w4[0], selector); w7[3] = hc_byte_perm_S (w3[2], w3[3], selector); w7[2] = hc_byte_perm_S (w3[1], w3[2], selector); w7[1] = hc_byte_perm_S (w3[0], w3[1], selector); w7[0] = hc_byte_perm_S (w2[3], w3[0], selector); w6[3] = hc_byte_perm_S (w2[2], w2[3], selector); w6[2] = hc_byte_perm_S (w2[1], w2[2], selector); w6[1] = hc_byte_perm_S (w2[0], w2[1], selector); w6[0] = hc_byte_perm_S (w1[3], w2[0], selector); w5[3] = hc_byte_perm_S (w1[2], w1[3], selector); w5[2] = hc_byte_perm_S (w1[1], w1[2], selector); w5[1] = hc_byte_perm_S (w1[0], w1[1], selector); w5[0] = hc_byte_perm_S (w0[3], w1[0], selector); w4[3] = hc_byte_perm_S (w0[2], w0[3], selector); w4[2] = hc_byte_perm_S (w0[1], w0[2], selector); w4[1] = hc_byte_perm_S (w0[0], w0[1], selector); w4[0] = hc_byte_perm_S ( 0, w0[0], selector); w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 17: c4[1] = hc_byte_perm_S (w7[3], 0, selector); c4[0] = hc_byte_perm_S (w7[2], w7[3], selector); c3[3] = hc_byte_perm_S (w7[1], w7[2], selector); c3[2] = hc_byte_perm_S (w7[0], w7[1], selector); c3[1] = hc_byte_perm_S (w6[3], w7[0], selector); c3[0] = hc_byte_perm_S (w6[2], w6[3], selector); c2[3] = hc_byte_perm_S (w6[1], w6[2], selector); c2[2] = hc_byte_perm_S (w6[0], w6[1], selector); c2[1] = hc_byte_perm_S (w5[3], w6[0], selector); c2[0] = hc_byte_perm_S (w5[2], w5[3], selector); c1[3] = hc_byte_perm_S (w5[1], w5[2], selector); c1[2] = hc_byte_perm_S (w5[0], w5[1], selector); c1[1] = hc_byte_perm_S (w4[3], w5[0], selector); c1[0] = hc_byte_perm_S (w4[2], w4[3], selector); c0[3] = hc_byte_perm_S (w4[1], w4[2], selector); c0[2] = hc_byte_perm_S (w4[0], w4[1], selector); c0[1] = hc_byte_perm_S (w3[3], w4[0], selector); c0[0] = hc_byte_perm_S (w3[2], w3[3], selector); w7[3] = hc_byte_perm_S (w3[1], w3[2], selector); w7[2] = hc_byte_perm_S (w3[0], w3[1], selector); w7[1] = hc_byte_perm_S (w2[3], w3[0], selector); w7[0] = hc_byte_perm_S (w2[2], w2[3], selector); w6[3] = hc_byte_perm_S (w2[1], w2[2], selector); w6[2] = hc_byte_perm_S (w2[0], w2[1], selector); w6[1] = hc_byte_perm_S (w1[3], w2[0], selector); w6[0] = hc_byte_perm_S (w1[2], w1[3], selector); w5[3] = hc_byte_perm_S (w1[1], w1[2], selector); w5[2] = hc_byte_perm_S (w1[0], w1[1], selector); w5[1] = hc_byte_perm_S (w0[3], w1[0], selector); w5[0] = hc_byte_perm_S (w0[2], w0[3], selector); w4[3] = hc_byte_perm_S (w0[1], w0[2], selector); w4[2] = hc_byte_perm_S (w0[0], w0[1], selector); w4[1] = hc_byte_perm_S ( 0, w0[0], selector); w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 18: c4[2] = hc_byte_perm_S (w7[3], 0, selector); c4[1] = hc_byte_perm_S (w7[2], w7[3], selector); c4[0] = hc_byte_perm_S (w7[1], w7[2], selector); c3[3] = hc_byte_perm_S (w7[0], w7[1], selector); c3[2] = hc_byte_perm_S (w6[3], w7[0], selector); c3[1] = hc_byte_perm_S (w6[2], w6[3], selector); c3[0] = hc_byte_perm_S (w6[1], w6[2], selector); c2[3] = hc_byte_perm_S (w6[0], w6[1], selector); c2[2] = hc_byte_perm_S (w5[3], w6[0], selector); c2[1] = hc_byte_perm_S (w5[2], w5[3], selector); c2[0] = hc_byte_perm_S (w5[1], w5[2], selector); c1[3] = hc_byte_perm_S (w5[0], w5[1], selector); c1[2] = hc_byte_perm_S (w4[3], w5[0], selector); c1[1] = hc_byte_perm_S (w4[2], w4[3], selector); c1[0] = hc_byte_perm_S (w4[1], w4[2], selector); c0[3] = hc_byte_perm_S (w4[0], w4[1], selector); c0[2] = hc_byte_perm_S (w3[3], w4[0], selector); c0[1] = hc_byte_perm_S (w3[2], w3[3], selector); c0[0] = hc_byte_perm_S (w3[1], w3[2], selector); w7[3] = hc_byte_perm_S (w3[0], w3[1], selector); w7[2] = hc_byte_perm_S (w2[3], w3[0], selector); w7[1] = hc_byte_perm_S (w2[2], w2[3], selector); w7[0] = hc_byte_perm_S (w2[1], w2[2], selector); w6[3] = hc_byte_perm_S (w2[0], w2[1], selector); w6[2] = hc_byte_perm_S (w1[3], w2[0], selector); w6[1] = hc_byte_perm_S (w1[2], w1[3], selector); w6[0] = hc_byte_perm_S (w1[1], w1[2], selector); w5[3] = hc_byte_perm_S (w1[0], w1[1], selector); w5[2] = hc_byte_perm_S (w0[3], w1[0], selector); w5[1] = hc_byte_perm_S (w0[2], w0[3], selector); w5[0] = hc_byte_perm_S (w0[1], w0[2], selector); w4[3] = hc_byte_perm_S (w0[0], w0[1], selector); w4[2] = hc_byte_perm_S ( 0, w0[0], selector); w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 19: c4[3] = hc_byte_perm_S (w7[3], 0, selector); c4[2] = hc_byte_perm_S (w7[2], w7[3], selector); c4[1] = hc_byte_perm_S (w7[1], w7[2], selector); c4[0] = hc_byte_perm_S (w7[0], w7[1], selector); c3[3] = hc_byte_perm_S (w6[3], w7[0], selector); c3[2] = hc_byte_perm_S (w6[2], w6[3], selector); c3[1] = hc_byte_perm_S (w6[1], w6[2], selector); c3[0] = hc_byte_perm_S (w6[0], w6[1], selector); c2[3] = hc_byte_perm_S (w5[3], w6[0], selector); c2[2] = hc_byte_perm_S (w5[2], w5[3], selector); c2[1] = hc_byte_perm_S (w5[1], w5[2], selector); c2[0] = hc_byte_perm_S (w5[0], w5[1], selector); c1[3] = hc_byte_perm_S (w4[3], w5[0], selector); c1[2] = hc_byte_perm_S (w4[2], w4[3], selector); c1[1] = hc_byte_perm_S (w4[1], w4[2], selector); c1[0] = hc_byte_perm_S (w4[0], w4[1], selector); c0[3] = hc_byte_perm_S (w3[3], w4[0], selector); c0[2] = hc_byte_perm_S (w3[2], w3[3], selector); c0[1] = hc_byte_perm_S (w3[1], w3[2], selector); c0[0] = hc_byte_perm_S (w3[0], w3[1], selector); w7[3] = hc_byte_perm_S (w2[3], w3[0], selector); w7[2] = hc_byte_perm_S (w2[2], w2[3], selector); w7[1] = hc_byte_perm_S (w2[1], w2[2], selector); w7[0] = hc_byte_perm_S (w2[0], w2[1], selector); w6[3] = hc_byte_perm_S (w1[3], w2[0], selector); w6[2] = hc_byte_perm_S (w1[2], w1[3], selector); w6[1] = hc_byte_perm_S (w1[1], w1[2], selector); w6[0] = hc_byte_perm_S (w1[0], w1[1], selector); w5[3] = hc_byte_perm_S (w0[3], w1[0], selector); w5[2] = hc_byte_perm_S (w0[2], w0[3], selector); w5[1] = hc_byte_perm_S (w0[1], w0[2], selector); w5[0] = hc_byte_perm_S (w0[0], w0[1], selector); w4[3] = hc_byte_perm_S ( 0, w0[0], selector); w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 20: c5[0] = hc_byte_perm_S (w7[3], 0, selector); c4[3] = hc_byte_perm_S (w7[2], w7[3], selector); c4[2] = hc_byte_perm_S (w7[1], w7[2], selector); c4[1] = hc_byte_perm_S (w7[0], w7[1], selector); c4[0] = hc_byte_perm_S (w6[3], w7[0], selector); c3[3] = hc_byte_perm_S (w6[2], w6[3], selector); c3[2] = hc_byte_perm_S (w6[1], w6[2], selector); c3[1] = hc_byte_perm_S (w6[0], w6[1], selector); c3[0] = hc_byte_perm_S (w5[3], w6[0], selector); c2[3] = hc_byte_perm_S (w5[2], w5[3], selector); c2[2] = hc_byte_perm_S (w5[1], w5[2], selector); c2[1] = hc_byte_perm_S (w5[0], w5[1], selector); c2[0] = hc_byte_perm_S (w4[3], w5[0], selector); c1[3] = hc_byte_perm_S (w4[2], w4[3], selector); c1[2] = hc_byte_perm_S (w4[1], w4[2], selector); c1[1] = hc_byte_perm_S (w4[0], w4[1], selector); c1[0] = hc_byte_perm_S (w3[3], w4[0], selector); c0[3] = hc_byte_perm_S (w3[2], w3[3], selector); c0[2] = hc_byte_perm_S (w3[1], w3[2], selector); c0[1] = hc_byte_perm_S (w3[0], w3[1], selector); c0[0] = hc_byte_perm_S (w2[3], w3[0], selector); w7[3] = hc_byte_perm_S (w2[2], w2[3], selector); w7[2] = hc_byte_perm_S (w2[1], w2[2], selector); w7[1] = hc_byte_perm_S (w2[0], w2[1], selector); w7[0] = hc_byte_perm_S (w1[3], w2[0], selector); w6[3] = hc_byte_perm_S (w1[2], w1[3], selector); w6[2] = hc_byte_perm_S (w1[1], w1[2], selector); w6[1] = hc_byte_perm_S (w1[0], w1[1], selector); w6[0] = hc_byte_perm_S (w0[3], w1[0], selector); w5[3] = hc_byte_perm_S (w0[2], w0[3], selector); w5[2] = hc_byte_perm_S (w0[1], w0[2], selector); w5[1] = hc_byte_perm_S (w0[0], w0[1], selector); w5[0] = hc_byte_perm_S ( 0, w0[0], selector); w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 21: c5[1] = hc_byte_perm_S (w7[3], 0, selector); c5[0] = hc_byte_perm_S (w7[2], w7[3], selector); c4[3] = hc_byte_perm_S (w7[1], w7[2], selector); c4[2] = hc_byte_perm_S (w7[0], w7[1], selector); c4[1] = hc_byte_perm_S (w6[3], w7[0], selector); c4[0] = hc_byte_perm_S (w6[2], w6[3], selector); c3[3] = hc_byte_perm_S (w6[1], w6[2], selector); c3[2] = hc_byte_perm_S (w6[0], w6[1], selector); c3[1] = hc_byte_perm_S (w5[3], w6[0], selector); c3[0] = hc_byte_perm_S (w5[2], w5[3], selector); c2[3] = hc_byte_perm_S (w5[1], w5[2], selector); c2[2] = hc_byte_perm_S (w5[0], w5[1], selector); c2[1] = hc_byte_perm_S (w4[3], w5[0], selector); c2[0] = hc_byte_perm_S (w4[2], w4[3], selector); c1[3] = hc_byte_perm_S (w4[1], w4[2], selector); c1[2] = hc_byte_perm_S (w4[0], w4[1], selector); c1[1] = hc_byte_perm_S (w3[3], w4[0], selector); c1[0] = hc_byte_perm_S (w3[2], w3[3], selector); c0[3] = hc_byte_perm_S (w3[1], w3[2], selector); c0[2] = hc_byte_perm_S (w3[0], w3[1], selector); c0[1] = hc_byte_perm_S (w2[3], w3[0], selector); c0[0] = hc_byte_perm_S (w2[2], w2[3], selector); w7[3] = hc_byte_perm_S (w2[1], w2[2], selector); w7[2] = hc_byte_perm_S (w2[0], w2[1], selector); w7[1] = hc_byte_perm_S (w1[3], w2[0], selector); w7[0] = hc_byte_perm_S (w1[2], w1[3], selector); w6[3] = hc_byte_perm_S (w1[1], w1[2], selector); w6[2] = hc_byte_perm_S (w1[0], w1[1], selector); w6[1] = hc_byte_perm_S (w0[3], w1[0], selector); w6[0] = hc_byte_perm_S (w0[2], w0[3], selector); w5[3] = hc_byte_perm_S (w0[1], w0[2], selector); w5[2] = hc_byte_perm_S (w0[0], w0[1], selector); w5[1] = hc_byte_perm_S ( 0, w0[0], selector); w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 22: c5[2] = hc_byte_perm_S (w7[3], 0, selector); c5[1] = hc_byte_perm_S (w7[2], w7[3], selector); c5[0] = hc_byte_perm_S (w7[1], w7[2], selector); c4[3] = hc_byte_perm_S (w7[0], w7[1], selector); c4[2] = hc_byte_perm_S (w6[3], w7[0], selector); c4[1] = hc_byte_perm_S (w6[2], w6[3], selector); c4[0] = hc_byte_perm_S (w6[1], w6[2], selector); c3[3] = hc_byte_perm_S (w6[0], w6[1], selector); c3[2] = hc_byte_perm_S (w5[3], w6[0], selector); c3[1] = hc_byte_perm_S (w5[2], w5[3], selector); c3[0] = hc_byte_perm_S (w5[1], w5[2], selector); c2[3] = hc_byte_perm_S (w5[0], w5[1], selector); c2[2] = hc_byte_perm_S (w4[3], w5[0], selector); c2[1] = hc_byte_perm_S (w4[2], w4[3], selector); c2[0] = hc_byte_perm_S (w4[1], w4[2], selector); c1[3] = hc_byte_perm_S (w4[0], w4[1], selector); c1[2] = hc_byte_perm_S (w3[3], w4[0], selector); c1[1] = hc_byte_perm_S (w3[2], w3[3], selector); c1[0] = hc_byte_perm_S (w3[1], w3[2], selector); c0[3] = hc_byte_perm_S (w3[0], w3[1], selector); c0[2] = hc_byte_perm_S (w2[3], w3[0], selector); c0[1] = hc_byte_perm_S (w2[2], w2[3], selector); c0[0] = hc_byte_perm_S (w2[1], w2[2], selector); w7[3] = hc_byte_perm_S (w2[0], w2[1], selector); w7[2] = hc_byte_perm_S (w1[3], w2[0], selector); w7[1] = hc_byte_perm_S (w1[2], w1[3], selector); w7[0] = hc_byte_perm_S (w1[1], w1[2], selector); w6[3] = hc_byte_perm_S (w1[0], w1[1], selector); w6[2] = hc_byte_perm_S (w0[3], w1[0], selector); w6[1] = hc_byte_perm_S (w0[2], w0[3], selector); w6[0] = hc_byte_perm_S (w0[1], w0[2], selector); w5[3] = hc_byte_perm_S (w0[0], w0[1], selector); w5[2] = hc_byte_perm_S ( 0, w0[0], selector); w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 23: c5[3] = hc_byte_perm_S (w7[3], 0, selector); c5[2] = hc_byte_perm_S (w7[2], w7[3], selector); c5[1] = hc_byte_perm_S (w7[1], w7[2], selector); c5[0] = hc_byte_perm_S (w7[0], w7[1], selector); c4[3] = hc_byte_perm_S (w6[3], w7[0], selector); c4[2] = hc_byte_perm_S (w6[2], w6[3], selector); c4[1] = hc_byte_perm_S (w6[1], w6[2], selector); c4[0] = hc_byte_perm_S (w6[0], w6[1], selector); c3[3] = hc_byte_perm_S (w5[3], w6[0], selector); c3[2] = hc_byte_perm_S (w5[2], w5[3], selector); c3[1] = hc_byte_perm_S (w5[1], w5[2], selector); c3[0] = hc_byte_perm_S (w5[0], w5[1], selector); c2[3] = hc_byte_perm_S (w4[3], w5[0], selector); c2[2] = hc_byte_perm_S (w4[2], w4[3], selector); c2[1] = hc_byte_perm_S (w4[1], w4[2], selector); c2[0] = hc_byte_perm_S (w4[0], w4[1], selector); c1[3] = hc_byte_perm_S (w3[3], w4[0], selector); c1[2] = hc_byte_perm_S (w3[2], w3[3], selector); c1[1] = hc_byte_perm_S (w3[1], w3[2], selector); c1[0] = hc_byte_perm_S (w3[0], w3[1], selector); c0[3] = hc_byte_perm_S (w2[3], w3[0], selector); c0[2] = hc_byte_perm_S (w2[2], w2[3], selector); c0[1] = hc_byte_perm_S (w2[1], w2[2], selector); c0[0] = hc_byte_perm_S (w2[0], w2[1], selector); w7[3] = hc_byte_perm_S (w1[3], w2[0], selector); w7[2] = hc_byte_perm_S (w1[2], w1[3], selector); w7[1] = hc_byte_perm_S (w1[1], w1[2], selector); w7[0] = hc_byte_perm_S (w1[0], w1[1], selector); w6[3] = hc_byte_perm_S (w0[3], w1[0], selector); w6[2] = hc_byte_perm_S (w0[2], w0[3], selector); w6[1] = hc_byte_perm_S (w0[1], w0[2], selector); w6[0] = hc_byte_perm_S (w0[0], w0[1], selector); w5[3] = hc_byte_perm_S ( 0, w0[0], selector); w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 24: c6[0] = hc_byte_perm_S (w7[3], 0, selector); c5[3] = hc_byte_perm_S (w7[2], w7[3], selector); c5[2] = hc_byte_perm_S (w7[1], w7[2], selector); c5[1] = hc_byte_perm_S (w7[0], w7[1], selector); c5[0] = hc_byte_perm_S (w6[3], w7[0], selector); c4[3] = hc_byte_perm_S (w6[2], w6[3], selector); c4[2] = hc_byte_perm_S (w6[1], w6[2], selector); c4[1] = hc_byte_perm_S (w6[0], w6[1], selector); c4[0] = hc_byte_perm_S (w5[3], w6[0], selector); c3[3] = hc_byte_perm_S (w5[2], w5[3], selector); c3[2] = hc_byte_perm_S (w5[1], w5[2], selector); c3[1] = hc_byte_perm_S (w5[0], w5[1], selector); c3[0] = hc_byte_perm_S (w4[3], w5[0], selector); c2[3] = hc_byte_perm_S (w4[2], w4[3], selector); c2[2] = hc_byte_perm_S (w4[1], w4[2], selector); c2[1] = hc_byte_perm_S (w4[0], w4[1], selector); c2[0] = hc_byte_perm_S (w3[3], w4[0], selector); c1[3] = hc_byte_perm_S (w3[2], w3[3], selector); c1[2] = hc_byte_perm_S (w3[1], w3[2], selector); c1[1] = hc_byte_perm_S (w3[0], w3[1], selector); c1[0] = hc_byte_perm_S (w2[3], w3[0], selector); c0[3] = hc_byte_perm_S (w2[2], w2[3], selector); c0[2] = hc_byte_perm_S (w2[1], w2[2], selector); c0[1] = hc_byte_perm_S (w2[0], w2[1], selector); c0[0] = hc_byte_perm_S (w1[3], w2[0], selector); w7[3] = hc_byte_perm_S (w1[2], w1[3], selector); w7[2] = hc_byte_perm_S (w1[1], w1[2], selector); w7[1] = hc_byte_perm_S (w1[0], w1[1], selector); w7[0] = hc_byte_perm_S (w0[3], w1[0], selector); w6[3] = hc_byte_perm_S (w0[2], w0[3], selector); w6[2] = hc_byte_perm_S (w0[1], w0[2], selector); w6[1] = hc_byte_perm_S (w0[0], w0[1], selector); w6[0] = hc_byte_perm_S ( 0, w0[0], selector); w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 25: c6[1] = hc_byte_perm_S (w7[3], 0, selector); c6[0] = hc_byte_perm_S (w7[2], w7[3], selector); c5[3] = hc_byte_perm_S (w7[1], w7[2], selector); c5[2] = hc_byte_perm_S (w7[0], w7[1], selector); c5[1] = hc_byte_perm_S (w6[3], w7[0], selector); c5[0] = hc_byte_perm_S (w6[2], w6[3], selector); c4[3] = hc_byte_perm_S (w6[1], w6[2], selector); c4[2] = hc_byte_perm_S (w6[0], w6[1], selector); c4[1] = hc_byte_perm_S (w5[3], w6[0], selector); c4[0] = hc_byte_perm_S (w5[2], w5[3], selector); c3[3] = hc_byte_perm_S (w5[1], w5[2], selector); c3[2] = hc_byte_perm_S (w5[0], w5[1], selector); c3[1] = hc_byte_perm_S (w4[3], w5[0], selector); c3[0] = hc_byte_perm_S (w4[2], w4[3], selector); c2[3] = hc_byte_perm_S (w4[1], w4[2], selector); c2[2] = hc_byte_perm_S (w4[0], w4[1], selector); c2[1] = hc_byte_perm_S (w3[3], w4[0], selector); c2[0] = hc_byte_perm_S (w3[2], w3[3], selector); c1[3] = hc_byte_perm_S (w3[1], w3[2], selector); c1[2] = hc_byte_perm_S (w3[0], w3[1], selector); c1[1] = hc_byte_perm_S (w2[3], w3[0], selector); c1[0] = hc_byte_perm_S (w2[2], w2[3], selector); c0[3] = hc_byte_perm_S (w2[1], w2[2], selector); c0[2] = hc_byte_perm_S (w2[0], w2[1], selector); c0[1] = hc_byte_perm_S (w1[3], w2[0], selector); c0[0] = hc_byte_perm_S (w1[2], w1[3], selector); w7[3] = hc_byte_perm_S (w1[1], w1[2], selector); w7[2] = hc_byte_perm_S (w1[0], w1[1], selector); w7[1] = hc_byte_perm_S (w0[3], w1[0], selector); w7[0] = hc_byte_perm_S (w0[2], w0[3], selector); w6[3] = hc_byte_perm_S (w0[1], w0[2], selector); w6[2] = hc_byte_perm_S (w0[0], w0[1], selector); w6[1] = hc_byte_perm_S ( 0, w0[0], selector); w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 26: c6[2] = hc_byte_perm_S (w7[3], 0, selector); c6[1] = hc_byte_perm_S (w7[2], w7[3], selector); c6[0] = hc_byte_perm_S (w7[1], w7[2], selector); c5[3] = hc_byte_perm_S (w7[0], w7[1], selector); c5[2] = hc_byte_perm_S (w6[3], w7[0], selector); c5[1] = hc_byte_perm_S (w6[2], w6[3], selector); c5[0] = hc_byte_perm_S (w6[1], w6[2], selector); c4[3] = hc_byte_perm_S (w6[0], w6[1], selector); c4[2] = hc_byte_perm_S (w5[3], w6[0], selector); c4[1] = hc_byte_perm_S (w5[2], w5[3], selector); c4[0] = hc_byte_perm_S (w5[1], w5[2], selector); c3[3] = hc_byte_perm_S (w5[0], w5[1], selector); c3[2] = hc_byte_perm_S (w4[3], w5[0], selector); c3[1] = hc_byte_perm_S (w4[2], w4[3], selector); c3[0] = hc_byte_perm_S (w4[1], w4[2], selector); c2[3] = hc_byte_perm_S (w4[0], w4[1], selector); c2[2] = hc_byte_perm_S (w3[3], w4[0], selector); c2[1] = hc_byte_perm_S (w3[2], w3[3], selector); c2[0] = hc_byte_perm_S (w3[1], w3[2], selector); c1[3] = hc_byte_perm_S (w3[0], w3[1], selector); c1[2] = hc_byte_perm_S (w2[3], w3[0], selector); c1[1] = hc_byte_perm_S (w2[2], w2[3], selector); c1[0] = hc_byte_perm_S (w2[1], w2[2], selector); c0[3] = hc_byte_perm_S (w2[0], w2[1], selector); c0[2] = hc_byte_perm_S (w1[3], w2[0], selector); c0[1] = hc_byte_perm_S (w1[2], w1[3], selector); c0[0] = hc_byte_perm_S (w1[1], w1[2], selector); w7[3] = hc_byte_perm_S (w1[0], w1[1], selector); w7[2] = hc_byte_perm_S (w0[3], w1[0], selector); w7[1] = hc_byte_perm_S (w0[2], w0[3], selector); w7[0] = hc_byte_perm_S (w0[1], w0[2], selector); w6[3] = hc_byte_perm_S (w0[0], w0[1], selector); w6[2] = hc_byte_perm_S ( 0, w0[0], selector); w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 27: c6[3] = hc_byte_perm_S (w7[3], 0, selector); c6[2] = hc_byte_perm_S (w7[2], w7[3], selector); c6[1] = hc_byte_perm_S (w7[1], w7[2], selector); c6[0] = hc_byte_perm_S (w7[0], w7[1], selector); c5[3] = hc_byte_perm_S (w6[3], w7[0], selector); c5[2] = hc_byte_perm_S (w6[2], w6[3], selector); c5[1] = hc_byte_perm_S (w6[1], w6[2], selector); c5[0] = hc_byte_perm_S (w6[0], w6[1], selector); c4[3] = hc_byte_perm_S (w5[3], w6[0], selector); c4[2] = hc_byte_perm_S (w5[2], w5[3], selector); c4[1] = hc_byte_perm_S (w5[1], w5[2], selector); c4[0] = hc_byte_perm_S (w5[0], w5[1], selector); c3[3] = hc_byte_perm_S (w4[3], w5[0], selector); c3[2] = hc_byte_perm_S (w4[2], w4[3], selector); c3[1] = hc_byte_perm_S (w4[1], w4[2], selector); c3[0] = hc_byte_perm_S (w4[0], w4[1], selector); c2[3] = hc_byte_perm_S (w3[3], w4[0], selector); c2[2] = hc_byte_perm_S (w3[2], w3[3], selector); c2[1] = hc_byte_perm_S (w3[1], w3[2], selector); c2[0] = hc_byte_perm_S (w3[0], w3[1], selector); c1[3] = hc_byte_perm_S (w2[3], w3[0], selector); c1[2] = hc_byte_perm_S (w2[2], w2[3], selector); c1[1] = hc_byte_perm_S (w2[1], w2[2], selector); c1[0] = hc_byte_perm_S (w2[0], w2[1], selector); c0[3] = hc_byte_perm_S (w1[3], w2[0], selector); c0[2] = hc_byte_perm_S (w1[2], w1[3], selector); c0[1] = hc_byte_perm_S (w1[1], w1[2], selector); c0[0] = hc_byte_perm_S (w1[0], w1[1], selector); w7[3] = hc_byte_perm_S (w0[3], w1[0], selector); w7[2] = hc_byte_perm_S (w0[2], w0[3], selector); w7[1] = hc_byte_perm_S (w0[1], w0[2], selector); w7[0] = hc_byte_perm_S (w0[0], w0[1], selector); w6[3] = hc_byte_perm_S ( 0, w0[0], selector); w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 28: c7[0] = hc_byte_perm_S (w7[3], 0, selector); c6[3] = hc_byte_perm_S (w7[2], w7[3], selector); c6[2] = hc_byte_perm_S (w7[1], w7[2], selector); c6[1] = hc_byte_perm_S (w7[0], w7[1], selector); c6[0] = hc_byte_perm_S (w6[3], w7[0], selector); c5[3] = hc_byte_perm_S (w6[2], w6[3], selector); c5[2] = hc_byte_perm_S (w6[1], w6[2], selector); c5[1] = hc_byte_perm_S (w6[0], w6[1], selector); c5[0] = hc_byte_perm_S (w5[3], w6[0], selector); c4[3] = hc_byte_perm_S (w5[2], w5[3], selector); c4[2] = hc_byte_perm_S (w5[1], w5[2], selector); c4[1] = hc_byte_perm_S (w5[0], w5[1], selector); c4[0] = hc_byte_perm_S (w4[3], w5[0], selector); c3[3] = hc_byte_perm_S (w4[2], w4[3], selector); c3[2] = hc_byte_perm_S (w4[1], w4[2], selector); c3[1] = hc_byte_perm_S (w4[0], w4[1], selector); c3[0] = hc_byte_perm_S (w3[3], w4[0], selector); c2[3] = hc_byte_perm_S (w3[2], w3[3], selector); c2[2] = hc_byte_perm_S (w3[1], w3[2], selector); c2[1] = hc_byte_perm_S (w3[0], w3[1], selector); c2[0] = hc_byte_perm_S (w2[3], w3[0], selector); c1[3] = hc_byte_perm_S (w2[2], w2[3], selector); c1[2] = hc_byte_perm_S (w2[1], w2[2], selector); c1[1] = hc_byte_perm_S (w2[0], w2[1], selector); c1[0] = hc_byte_perm_S (w1[3], w2[0], selector); c0[3] = hc_byte_perm_S (w1[2], w1[3], selector); c0[2] = hc_byte_perm_S (w1[1], w1[2], selector); c0[1] = hc_byte_perm_S (w1[0], w1[1], selector); c0[0] = hc_byte_perm_S (w0[3], w1[0], selector); w7[3] = hc_byte_perm_S (w0[2], w0[3], selector); w7[2] = hc_byte_perm_S (w0[1], w0[2], selector); w7[1] = hc_byte_perm_S (w0[0], w0[1], selector); w7[0] = hc_byte_perm_S ( 0, w0[0], selector); w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 29: c7[1] = hc_byte_perm_S (w7[3], 0, selector); c7[0] = hc_byte_perm_S (w7[2], w7[3], selector); c6[3] = hc_byte_perm_S (w7[1], w7[2], selector); c6[2] = hc_byte_perm_S (w7[0], w7[1], selector); c6[1] = hc_byte_perm_S (w6[3], w7[0], selector); c6[0] = hc_byte_perm_S (w6[2], w6[3], selector); c5[3] = hc_byte_perm_S (w6[1], w6[2], selector); c5[2] = hc_byte_perm_S (w6[0], w6[1], selector); c5[1] = hc_byte_perm_S (w5[3], w6[0], selector); c5[0] = hc_byte_perm_S (w5[2], w5[3], selector); c4[3] = hc_byte_perm_S (w5[1], w5[2], selector); c4[2] = hc_byte_perm_S (w5[0], w5[1], selector); c4[1] = hc_byte_perm_S (w4[3], w5[0], selector); c4[0] = hc_byte_perm_S (w4[2], w4[3], selector); c3[3] = hc_byte_perm_S (w4[1], w4[2], selector); c3[2] = hc_byte_perm_S (w4[0], w4[1], selector); c3[1] = hc_byte_perm_S (w3[3], w4[0], selector); c3[0] = hc_byte_perm_S (w3[2], w3[3], selector); c2[3] = hc_byte_perm_S (w3[1], w3[2], selector); c2[2] = hc_byte_perm_S (w3[0], w3[1], selector); c2[1] = hc_byte_perm_S (w2[3], w3[0], selector); c2[0] = hc_byte_perm_S (w2[2], w2[3], selector); c1[3] = hc_byte_perm_S (w2[1], w2[2], selector); c1[2] = hc_byte_perm_S (w2[0], w2[1], selector); c1[1] = hc_byte_perm_S (w1[3], w2[0], selector); c1[0] = hc_byte_perm_S (w1[2], w1[3], selector); c0[3] = hc_byte_perm_S (w1[1], w1[2], selector); c0[2] = hc_byte_perm_S (w1[0], w1[1], selector); c0[1] = hc_byte_perm_S (w0[3], w1[0], selector); c0[0] = hc_byte_perm_S (w0[2], w0[3], selector); w7[3] = hc_byte_perm_S (w0[1], w0[2], selector); w7[2] = hc_byte_perm_S (w0[0], w0[1], selector); w7[1] = hc_byte_perm_S ( 0, w0[0], selector); w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 30: c7[2] = hc_byte_perm_S (w7[3], 0, selector); c7[1] = hc_byte_perm_S (w7[2], w7[3], selector); c7[0] = hc_byte_perm_S (w7[1], w7[2], selector); c6[3] = hc_byte_perm_S (w7[0], w7[1], selector); c6[2] = hc_byte_perm_S (w6[3], w7[0], selector); c6[1] = hc_byte_perm_S (w6[2], w6[3], selector); c6[0] = hc_byte_perm_S (w6[1], w6[2], selector); c5[3] = hc_byte_perm_S (w6[0], w6[1], selector); c5[2] = hc_byte_perm_S (w5[3], w6[0], selector); c5[1] = hc_byte_perm_S (w5[2], w5[3], selector); c5[0] = hc_byte_perm_S (w5[1], w5[2], selector); c4[3] = hc_byte_perm_S (w5[0], w5[1], selector); c4[2] = hc_byte_perm_S (w4[3], w5[0], selector); c4[1] = hc_byte_perm_S (w4[2], w4[3], selector); c4[0] = hc_byte_perm_S (w4[1], w4[2], selector); c3[3] = hc_byte_perm_S (w4[0], w4[1], selector); c3[2] = hc_byte_perm_S (w3[3], w4[0], selector); c3[1] = hc_byte_perm_S (w3[2], w3[3], selector); c3[0] = hc_byte_perm_S (w3[1], w3[2], selector); c2[3] = hc_byte_perm_S (w3[0], w3[1], selector); c2[2] = hc_byte_perm_S (w2[3], w3[0], selector); c2[1] = hc_byte_perm_S (w2[2], w2[3], selector); c2[0] = hc_byte_perm_S (w2[1], w2[2], selector); c1[3] = hc_byte_perm_S (w2[0], w2[1], selector); c1[2] = hc_byte_perm_S (w1[3], w2[0], selector); c1[1] = hc_byte_perm_S (w1[2], w1[3], selector); c1[0] = hc_byte_perm_S (w1[1], w1[2], selector); c0[3] = hc_byte_perm_S (w1[0], w1[1], selector); c0[2] = hc_byte_perm_S (w0[3], w1[0], selector); c0[1] = hc_byte_perm_S (w0[2], w0[3], selector); c0[0] = hc_byte_perm_S (w0[1], w0[2], selector); w7[3] = hc_byte_perm_S (w0[0], w0[1], selector); w7[2] = hc_byte_perm_S ( 0, w0[0], selector); w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 31: c7[3] = hc_byte_perm_S (w7[3], 0, selector); c7[2] = hc_byte_perm_S (w7[2], w7[3], selector); c7[1] = hc_byte_perm_S (w7[1], w7[2], selector); c7[0] = hc_byte_perm_S (w7[0], w7[1], selector); c6[3] = hc_byte_perm_S (w6[3], w7[0], selector); c6[2] = hc_byte_perm_S (w6[2], w6[3], selector); c6[1] = hc_byte_perm_S (w6[1], w6[2], selector); c6[0] = hc_byte_perm_S (w6[0], w6[1], selector); c5[3] = hc_byte_perm_S (w5[3], w6[0], selector); c5[2] = hc_byte_perm_S (w5[2], w5[3], selector); c5[1] = hc_byte_perm_S (w5[1], w5[2], selector); c5[0] = hc_byte_perm_S (w5[0], w5[1], selector); c4[3] = hc_byte_perm_S (w4[3], w5[0], selector); c4[2] = hc_byte_perm_S (w4[2], w4[3], selector); c4[1] = hc_byte_perm_S (w4[1], w4[2], selector); c4[0] = hc_byte_perm_S (w4[0], w4[1], selector); c3[3] = hc_byte_perm_S (w3[3], w4[0], selector); c3[2] = hc_byte_perm_S (w3[2], w3[3], selector); c3[1] = hc_byte_perm_S (w3[1], w3[2], selector); c3[0] = hc_byte_perm_S (w3[0], w3[1], selector); c2[3] = hc_byte_perm_S (w2[3], w3[0], selector); c2[2] = hc_byte_perm_S (w2[2], w2[3], selector); c2[1] = hc_byte_perm_S (w2[1], w2[2], selector); c2[0] = hc_byte_perm_S (w2[0], w2[1], selector); c1[3] = hc_byte_perm_S (w1[3], w2[0], selector); c1[2] = hc_byte_perm_S (w1[2], w1[3], selector); c1[1] = hc_byte_perm_S (w1[1], w1[2], selector); c1[0] = hc_byte_perm_S (w1[0], w1[1], selector); c0[3] = hc_byte_perm_S (w0[3], w1[0], selector); c0[2] = hc_byte_perm_S (w0[2], w0[3], selector); c0[1] = hc_byte_perm_S (w0[1], w0[2], selector); c0[0] = hc_byte_perm_S (w0[0], w0[1], selector); w7[3] = hc_byte_perm_S ( 0, w0[0], selector); w7[2] = 0; w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_8x4_be_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, PRIVATE_AS u32 *w4, PRIVATE_AS u32 *w5, PRIVATE_AS u32 *w6, PRIVATE_AS u32 *w7, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: w7[3] = hc_bytealign_be_S (w7[2], w7[3], offset); w7[2] = hc_bytealign_be_S (w7[1], w7[2], offset); w7[1] = hc_bytealign_be_S (w7[0], w7[1], offset); w7[0] = hc_bytealign_be_S (w6[3], w7[0], offset); w6[3] = hc_bytealign_be_S (w6[2], w6[3], offset); w6[2] = hc_bytealign_be_S (w6[1], w6[2], offset); w6[1] = hc_bytealign_be_S (w6[0], w6[1], offset); w6[0] = hc_bytealign_be_S (w5[3], w6[0], offset); w5[3] = hc_bytealign_be_S (w5[2], w5[3], offset); w5[2] = hc_bytealign_be_S (w5[1], w5[2], offset); w5[1] = hc_bytealign_be_S (w5[0], w5[1], offset); w5[0] = hc_bytealign_be_S (w4[3], w5[0], offset); w4[3] = hc_bytealign_be_S (w4[2], w4[3], offset); w4[2] = hc_bytealign_be_S (w4[1], w4[2], offset); w4[1] = hc_bytealign_be_S (w4[0], w4[1], offset); w4[0] = hc_bytealign_be_S (w3[3], w4[0], offset); w3[3] = hc_bytealign_be_S (w3[2], w3[3], offset); w3[2] = hc_bytealign_be_S (w3[1], w3[2], offset); w3[1] = hc_bytealign_be_S (w3[0], w3[1], offset); w3[0] = hc_bytealign_be_S (w2[3], w3[0], offset); w2[3] = hc_bytealign_be_S (w2[2], w2[3], offset); w2[2] = hc_bytealign_be_S (w2[1], w2[2], offset); w2[1] = hc_bytealign_be_S (w2[0], w2[1], offset); w2[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w1[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w1[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w1[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w1[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w0[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w0[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w0[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w0[0] = hc_bytealign_be_S ( 0, w0[0], offset); break; case 1: w7[3] = hc_bytealign_be_S (w7[1], w7[2], offset); w7[2] = hc_bytealign_be_S (w7[0], w7[1], offset); w7[1] = hc_bytealign_be_S (w6[3], w7[0], offset); w7[0] = hc_bytealign_be_S (w6[2], w6[3], offset); w6[3] = hc_bytealign_be_S (w6[1], w6[2], offset); w6[2] = hc_bytealign_be_S (w6[0], w6[1], offset); w6[1] = hc_bytealign_be_S (w5[3], w6[0], offset); w6[0] = hc_bytealign_be_S (w5[2], w5[3], offset); w5[3] = hc_bytealign_be_S (w5[1], w5[2], offset); w5[2] = hc_bytealign_be_S (w5[0], w5[1], offset); w5[1] = hc_bytealign_be_S (w4[3], w5[0], offset); w5[0] = hc_bytealign_be_S (w4[2], w4[3], offset); w4[3] = hc_bytealign_be_S (w4[1], w4[2], offset); w4[2] = hc_bytealign_be_S (w4[0], w4[1], offset); w4[1] = hc_bytealign_be_S (w3[3], w4[0], offset); w4[0] = hc_bytealign_be_S (w3[2], w3[3], offset); w3[3] = hc_bytealign_be_S (w3[1], w3[2], offset); w3[2] = hc_bytealign_be_S (w3[0], w3[1], offset); w3[1] = hc_bytealign_be_S (w2[3], w3[0], offset); w3[0] = hc_bytealign_be_S (w2[2], w2[3], offset); w2[3] = hc_bytealign_be_S (w2[1], w2[2], offset); w2[2] = hc_bytealign_be_S (w2[0], w2[1], offset); w2[1] = hc_bytealign_be_S (w1[3], w2[0], offset); w2[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w1[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w1[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w1[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w1[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w0[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w0[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w0[1] = hc_bytealign_be_S ( 0, w0[0], offset); w0[0] = 0; break; case 2: w7[3] = hc_bytealign_be_S (w7[0], w7[1], offset); w7[2] = hc_bytealign_be_S (w6[3], w7[0], offset); w7[1] = hc_bytealign_be_S (w6[2], w6[3], offset); w7[0] = hc_bytealign_be_S (w6[1], w6[2], offset); w6[3] = hc_bytealign_be_S (w6[0], w6[1], offset); w6[2] = hc_bytealign_be_S (w5[3], w6[0], offset); w6[1] = hc_bytealign_be_S (w5[2], w5[3], offset); w6[0] = hc_bytealign_be_S (w5[1], w5[2], offset); w5[3] = hc_bytealign_be_S (w5[0], w5[1], offset); w5[2] = hc_bytealign_be_S (w4[3], w5[0], offset); w5[1] = hc_bytealign_be_S (w4[2], w4[3], offset); w5[0] = hc_bytealign_be_S (w4[1], w4[2], offset); w4[3] = hc_bytealign_be_S (w4[0], w4[1], offset); w4[2] = hc_bytealign_be_S (w3[3], w4[0], offset); w4[1] = hc_bytealign_be_S (w3[2], w3[3], offset); w4[0] = hc_bytealign_be_S (w3[1], w3[2], offset); w3[3] = hc_bytealign_be_S (w3[0], w3[1], offset); w3[2] = hc_bytealign_be_S (w2[3], w3[0], offset); w3[1] = hc_bytealign_be_S (w2[2], w2[3], offset); w3[0] = hc_bytealign_be_S (w2[1], w2[2], offset); w2[3] = hc_bytealign_be_S (w2[0], w2[1], offset); w2[2] = hc_bytealign_be_S (w1[3], w2[0], offset); w2[1] = hc_bytealign_be_S (w1[2], w1[3], offset); w2[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w1[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w1[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w1[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w1[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w0[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w0[2] = hc_bytealign_be_S ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: w7[3] = hc_bytealign_be_S (w6[3], w7[0], offset); w7[2] = hc_bytealign_be_S (w6[2], w6[3], offset); w7[1] = hc_bytealign_be_S (w6[1], w6[2], offset); w7[0] = hc_bytealign_be_S (w6[0], w6[1], offset); w6[3] = hc_bytealign_be_S (w5[3], w6[0], offset); w6[2] = hc_bytealign_be_S (w5[2], w5[3], offset); w6[1] = hc_bytealign_be_S (w5[1], w5[2], offset); w6[0] = hc_bytealign_be_S (w5[0], w5[1], offset); w5[3] = hc_bytealign_be_S (w4[3], w5[0], offset); w5[2] = hc_bytealign_be_S (w4[2], w4[3], offset); w5[1] = hc_bytealign_be_S (w4[1], w4[2], offset); w5[0] = hc_bytealign_be_S (w4[0], w4[1], offset); w4[3] = hc_bytealign_be_S (w3[3], w4[0], offset); w4[2] = hc_bytealign_be_S (w3[2], w3[3], offset); w4[1] = hc_bytealign_be_S (w3[1], w3[2], offset); w4[0] = hc_bytealign_be_S (w3[0], w3[1], offset); w3[3] = hc_bytealign_be_S (w2[3], w3[0], offset); w3[2] = hc_bytealign_be_S (w2[2], w2[3], offset); w3[1] = hc_bytealign_be_S (w2[1], w2[2], offset); w3[0] = hc_bytealign_be_S (w2[0], w2[1], offset); w2[3] = hc_bytealign_be_S (w1[3], w2[0], offset); w2[2] = hc_bytealign_be_S (w1[2], w1[3], offset); w2[1] = hc_bytealign_be_S (w1[1], w1[2], offset); w2[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w1[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w1[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w1[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w1[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w0[3] = hc_bytealign_be_S ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: w7[3] = hc_bytealign_be_S (w6[2], w6[3], offset); w7[2] = hc_bytealign_be_S (w6[1], w6[2], offset); w7[1] = hc_bytealign_be_S (w6[0], w6[1], offset); w7[0] = hc_bytealign_be_S (w5[3], w6[0], offset); w6[3] = hc_bytealign_be_S (w5[2], w5[3], offset); w6[2] = hc_bytealign_be_S (w5[1], w5[2], offset); w6[1] = hc_bytealign_be_S (w5[0], w5[1], offset); w6[0] = hc_bytealign_be_S (w4[3], w5[0], offset); w5[3] = hc_bytealign_be_S (w4[2], w4[3], offset); w5[2] = hc_bytealign_be_S (w4[1], w4[2], offset); w5[1] = hc_bytealign_be_S (w4[0], w4[1], offset); w5[0] = hc_bytealign_be_S (w3[3], w4[0], offset); w4[3] = hc_bytealign_be_S (w3[2], w3[3], offset); w4[2] = hc_bytealign_be_S (w3[1], w3[2], offset); w4[1] = hc_bytealign_be_S (w3[0], w3[1], offset); w4[0] = hc_bytealign_be_S (w2[3], w3[0], offset); w3[3] = hc_bytealign_be_S (w2[2], w2[3], offset); w3[2] = hc_bytealign_be_S (w2[1], w2[2], offset); w3[1] = hc_bytealign_be_S (w2[0], w2[1], offset); w3[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w2[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w2[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w2[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w2[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w1[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w1[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w1[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w1[0] = hc_bytealign_be_S ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: w7[3] = hc_bytealign_be_S (w6[1], w6[2], offset); w7[2] = hc_bytealign_be_S (w6[0], w6[1], offset); w7[1] = hc_bytealign_be_S (w5[3], w6[0], offset); w7[0] = hc_bytealign_be_S (w5[2], w5[3], offset); w6[3] = hc_bytealign_be_S (w5[1], w5[2], offset); w6[2] = hc_bytealign_be_S (w5[0], w5[1], offset); w6[1] = hc_bytealign_be_S (w4[3], w5[0], offset); w6[0] = hc_bytealign_be_S (w4[2], w4[3], offset); w5[3] = hc_bytealign_be_S (w4[1], w4[2], offset); w5[2] = hc_bytealign_be_S (w4[0], w4[1], offset); w5[1] = hc_bytealign_be_S (w3[3], w4[0], offset); w5[0] = hc_bytealign_be_S (w3[2], w3[3], offset); w4[3] = hc_bytealign_be_S (w3[1], w3[2], offset); w4[2] = hc_bytealign_be_S (w3[0], w3[1], offset); w4[1] = hc_bytealign_be_S (w2[3], w3[0], offset); w4[0] = hc_bytealign_be_S (w2[2], w2[3], offset); w3[3] = hc_bytealign_be_S (w2[1], w2[2], offset); w3[2] = hc_bytealign_be_S (w2[0], w2[1], offset); w3[1] = hc_bytealign_be_S (w1[3], w2[0], offset); w3[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w2[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w2[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w2[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w2[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w1[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w1[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w1[1] = hc_bytealign_be_S ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: w7[3] = hc_bytealign_be_S (w6[0], w6[1], offset); w7[2] = hc_bytealign_be_S (w5[3], w6[0], offset); w7[1] = hc_bytealign_be_S (w5[2], w5[3], offset); w7[0] = hc_bytealign_be_S (w5[1], w5[2], offset); w6[3] = hc_bytealign_be_S (w5[0], w5[1], offset); w6[2] = hc_bytealign_be_S (w4[3], w5[0], offset); w6[1] = hc_bytealign_be_S (w4[2], w4[3], offset); w6[0] = hc_bytealign_be_S (w4[1], w4[2], offset); w5[3] = hc_bytealign_be_S (w4[0], w4[1], offset); w5[2] = hc_bytealign_be_S (w3[3], w4[0], offset); w5[1] = hc_bytealign_be_S (w3[2], w3[3], offset); w5[0] = hc_bytealign_be_S (w3[1], w3[2], offset); w4[3] = hc_bytealign_be_S (w3[0], w3[1], offset); w4[2] = hc_bytealign_be_S (w2[3], w3[0], offset); w4[1] = hc_bytealign_be_S (w2[2], w2[3], offset); w4[0] = hc_bytealign_be_S (w2[1], w2[2], offset); w3[3] = hc_bytealign_be_S (w2[0], w2[1], offset); w3[2] = hc_bytealign_be_S (w1[3], w2[0], offset); w3[1] = hc_bytealign_be_S (w1[2], w1[3], offset); w3[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w2[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w2[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w2[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w2[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w1[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w1[2] = hc_bytealign_be_S ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: w7[3] = hc_bytealign_be_S (w5[3], w6[0], offset); w7[2] = hc_bytealign_be_S (w5[2], w5[3], offset); w7[1] = hc_bytealign_be_S (w5[1], w5[2], offset); w7[0] = hc_bytealign_be_S (w5[0], w5[1], offset); w6[3] = hc_bytealign_be_S (w4[3], w5[0], offset); w6[2] = hc_bytealign_be_S (w4[2], w4[3], offset); w6[1] = hc_bytealign_be_S (w4[1], w4[2], offset); w6[0] = hc_bytealign_be_S (w4[0], w4[1], offset); w5[3] = hc_bytealign_be_S (w3[3], w4[0], offset); w5[2] = hc_bytealign_be_S (w3[2], w3[3], offset); w5[1] = hc_bytealign_be_S (w3[1], w3[2], offset); w5[0] = hc_bytealign_be_S (w3[0], w3[1], offset); w4[3] = hc_bytealign_be_S (w2[3], w3[0], offset); w4[2] = hc_bytealign_be_S (w2[2], w2[3], offset); w4[1] = hc_bytealign_be_S (w2[1], w2[2], offset); w4[0] = hc_bytealign_be_S (w2[0], w2[1], offset); w3[3] = hc_bytealign_be_S (w1[3], w2[0], offset); w3[2] = hc_bytealign_be_S (w1[2], w1[3], offset); w3[1] = hc_bytealign_be_S (w1[1], w1[2], offset); w3[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w2[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w2[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w2[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w2[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w1[3] = hc_bytealign_be_S ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: w7[3] = hc_bytealign_be_S (w5[2], w5[3], offset); w7[2] = hc_bytealign_be_S (w5[1], w5[2], offset); w7[1] = hc_bytealign_be_S (w5[0], w5[1], offset); w7[0] = hc_bytealign_be_S (w4[3], w5[0], offset); w6[3] = hc_bytealign_be_S (w4[2], w4[3], offset); w6[2] = hc_bytealign_be_S (w4[1], w4[2], offset); w6[1] = hc_bytealign_be_S (w4[0], w4[1], offset); w6[0] = hc_bytealign_be_S (w3[3], w4[0], offset); w5[3] = hc_bytealign_be_S (w3[2], w3[3], offset); w5[2] = hc_bytealign_be_S (w3[1], w3[2], offset); w5[1] = hc_bytealign_be_S (w3[0], w3[1], offset); w5[0] = hc_bytealign_be_S (w2[3], w3[0], offset); w4[3] = hc_bytealign_be_S (w2[2], w2[3], offset); w4[2] = hc_bytealign_be_S (w2[1], w2[2], offset); w4[1] = hc_bytealign_be_S (w2[0], w2[1], offset); w4[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w3[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w3[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w3[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w3[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w2[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w2[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w2[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w2[0] = hc_bytealign_be_S ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: w7[3] = hc_bytealign_be_S (w5[1], w5[2], offset); w7[2] = hc_bytealign_be_S (w5[0], w5[1], offset); w7[1] = hc_bytealign_be_S (w4[3], w5[0], offset); w7[0] = hc_bytealign_be_S (w4[2], w4[3], offset); w6[3] = hc_bytealign_be_S (w4[1], w4[2], offset); w6[2] = hc_bytealign_be_S (w4[0], w4[1], offset); w6[1] = hc_bytealign_be_S (w3[3], w4[0], offset); w6[0] = hc_bytealign_be_S (w3[2], w3[3], offset); w5[3] = hc_bytealign_be_S (w3[1], w3[2], offset); w5[2] = hc_bytealign_be_S (w3[0], w3[1], offset); w5[1] = hc_bytealign_be_S (w2[3], w3[0], offset); w5[0] = hc_bytealign_be_S (w2[2], w2[3], offset); w4[3] = hc_bytealign_be_S (w2[1], w2[2], offset); w4[2] = hc_bytealign_be_S (w2[0], w2[1], offset); w4[1] = hc_bytealign_be_S (w1[3], w2[0], offset); w4[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w3[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w3[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w3[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w3[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w2[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w2[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w2[1] = hc_bytealign_be_S ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: w7[3] = hc_bytealign_be_S (w5[0], w5[1], offset); w7[2] = hc_bytealign_be_S (w4[3], w5[0], offset); w7[1] = hc_bytealign_be_S (w4[2], w4[3], offset); w7[0] = hc_bytealign_be_S (w4[1], w4[2], offset); w6[3] = hc_bytealign_be_S (w4[0], w4[1], offset); w6[2] = hc_bytealign_be_S (w3[3], w4[0], offset); w6[1] = hc_bytealign_be_S (w3[2], w3[3], offset); w6[0] = hc_bytealign_be_S (w3[1], w3[2], offset); w5[3] = hc_bytealign_be_S (w3[0], w3[1], offset); w5[2] = hc_bytealign_be_S (w2[3], w3[0], offset); w5[1] = hc_bytealign_be_S (w2[2], w2[3], offset); w5[0] = hc_bytealign_be_S (w2[1], w2[2], offset); w4[3] = hc_bytealign_be_S (w2[0], w2[1], offset); w4[2] = hc_bytealign_be_S (w1[3], w2[0], offset); w4[1] = hc_bytealign_be_S (w1[2], w1[3], offset); w4[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w3[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w3[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w3[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w3[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w2[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w2[2] = hc_bytealign_be_S ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: w7[3] = hc_bytealign_be_S (w4[3], w5[0], offset); w7[2] = hc_bytealign_be_S (w4[2], w4[3], offset); w7[1] = hc_bytealign_be_S (w4[1], w4[2], offset); w7[0] = hc_bytealign_be_S (w4[0], w4[1], offset); w6[3] = hc_bytealign_be_S (w3[3], w4[0], offset); w6[2] = hc_bytealign_be_S (w3[2], w3[3], offset); w6[1] = hc_bytealign_be_S (w3[1], w3[2], offset); w6[0] = hc_bytealign_be_S (w3[0], w3[1], offset); w5[3] = hc_bytealign_be_S (w2[3], w3[0], offset); w5[2] = hc_bytealign_be_S (w2[2], w2[3], offset); w5[1] = hc_bytealign_be_S (w2[1], w2[2], offset); w5[0] = hc_bytealign_be_S (w2[0], w2[1], offset); w4[3] = hc_bytealign_be_S (w1[3], w2[0], offset); w4[2] = hc_bytealign_be_S (w1[2], w1[3], offset); w4[1] = hc_bytealign_be_S (w1[1], w1[2], offset); w4[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w3[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w3[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w3[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w3[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w2[3] = hc_bytealign_be_S ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: w7[3] = hc_bytealign_be_S (w4[2], w4[3], offset); w7[2] = hc_bytealign_be_S (w4[1], w4[2], offset); w7[1] = hc_bytealign_be_S (w4[0], w4[1], offset); w7[0] = hc_bytealign_be_S (w3[3], w4[0], offset); w6[3] = hc_bytealign_be_S (w3[2], w3[3], offset); w6[2] = hc_bytealign_be_S (w3[1], w3[2], offset); w6[1] = hc_bytealign_be_S (w3[0], w3[1], offset); w6[0] = hc_bytealign_be_S (w2[3], w3[0], offset); w5[3] = hc_bytealign_be_S (w2[2], w2[3], offset); w5[2] = hc_bytealign_be_S (w2[1], w2[2], offset); w5[1] = hc_bytealign_be_S (w2[0], w2[1], offset); w5[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w4[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w4[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w4[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w4[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w3[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w3[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w3[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w3[0] = hc_bytealign_be_S ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: w7[3] = hc_bytealign_be_S (w4[1], w4[2], offset); w7[2] = hc_bytealign_be_S (w4[0], w4[1], offset); w7[1] = hc_bytealign_be_S (w3[3], w4[0], offset); w7[0] = hc_bytealign_be_S (w3[2], w3[3], offset); w6[3] = hc_bytealign_be_S (w3[1], w3[2], offset); w6[2] = hc_bytealign_be_S (w3[0], w3[1], offset); w6[1] = hc_bytealign_be_S (w2[3], w3[0], offset); w6[0] = hc_bytealign_be_S (w2[2], w2[3], offset); w5[3] = hc_bytealign_be_S (w2[1], w2[2], offset); w5[2] = hc_bytealign_be_S (w2[0], w2[1], offset); w5[1] = hc_bytealign_be_S (w1[3], w2[0], offset); w5[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w4[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w4[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w4[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w4[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w3[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w3[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w3[1] = hc_bytealign_be_S ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: w7[3] = hc_bytealign_be_S (w4[0], w4[1], offset); w7[2] = hc_bytealign_be_S (w3[3], w4[0], offset); w7[1] = hc_bytealign_be_S (w3[2], w3[3], offset); w7[0] = hc_bytealign_be_S (w3[1], w3[2], offset); w6[3] = hc_bytealign_be_S (w3[0], w3[1], offset); w6[2] = hc_bytealign_be_S (w2[3], w3[0], offset); w6[1] = hc_bytealign_be_S (w2[2], w2[3], offset); w6[0] = hc_bytealign_be_S (w2[1], w2[2], offset); w5[3] = hc_bytealign_be_S (w2[0], w2[1], offset); w5[2] = hc_bytealign_be_S (w1[3], w2[0], offset); w5[1] = hc_bytealign_be_S (w1[2], w1[3], offset); w5[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w4[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w4[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w4[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w4[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w3[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w3[2] = hc_bytealign_be_S ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: w7[3] = hc_bytealign_be_S (w3[3], w4[0], offset); w7[2] = hc_bytealign_be_S (w3[2], w3[3], offset); w7[1] = hc_bytealign_be_S (w3[1], w3[2], offset); w7[0] = hc_bytealign_be_S (w3[0], w3[1], offset); w6[3] = hc_bytealign_be_S (w2[3], w3[0], offset); w6[2] = hc_bytealign_be_S (w2[2], w2[3], offset); w6[1] = hc_bytealign_be_S (w2[1], w2[2], offset); w6[0] = hc_bytealign_be_S (w2[0], w2[1], offset); w5[3] = hc_bytealign_be_S (w1[3], w2[0], offset); w5[2] = hc_bytealign_be_S (w1[2], w1[3], offset); w5[1] = hc_bytealign_be_S (w1[1], w1[2], offset); w5[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w4[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w4[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w4[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w4[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w3[3] = hc_bytealign_be_S ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 16: w7[3] = hc_bytealign_be_S (w3[2], w3[3], offset); w7[2] = hc_bytealign_be_S (w3[1], w3[2], offset); w7[1] = hc_bytealign_be_S (w3[0], w3[1], offset); w7[0] = hc_bytealign_be_S (w2[3], w3[0], offset); w6[3] = hc_bytealign_be_S (w2[2], w2[3], offset); w6[2] = hc_bytealign_be_S (w2[1], w2[2], offset); w6[1] = hc_bytealign_be_S (w2[0], w2[1], offset); w6[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w5[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w5[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w5[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w5[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w4[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w4[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w4[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w4[0] = hc_bytealign_be_S ( 0, w0[0], offset); w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 17: w7[3] = hc_bytealign_be_S (w3[1], w3[2], offset); w7[2] = hc_bytealign_be_S (w3[0], w3[1], offset); w7[1] = hc_bytealign_be_S (w2[3], w3[0], offset); w7[0] = hc_bytealign_be_S (w2[2], w2[3], offset); w6[3] = hc_bytealign_be_S (w2[1], w2[2], offset); w6[2] = hc_bytealign_be_S (w2[0], w2[1], offset); w6[1] = hc_bytealign_be_S (w1[3], w2[0], offset); w6[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w5[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w5[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w5[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w5[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w4[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w4[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w4[1] = hc_bytealign_be_S ( 0, w0[0], offset); w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 18: w7[3] = hc_bytealign_be_S (w3[0], w3[1], offset); w7[2] = hc_bytealign_be_S (w2[3], w3[0], offset); w7[1] = hc_bytealign_be_S (w2[2], w2[3], offset); w7[0] = hc_bytealign_be_S (w2[1], w2[2], offset); w6[3] = hc_bytealign_be_S (w2[0], w2[1], offset); w6[2] = hc_bytealign_be_S (w1[3], w2[0], offset); w6[1] = hc_bytealign_be_S (w1[2], w1[3], offset); w6[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w5[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w5[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w5[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w5[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w4[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w4[2] = hc_bytealign_be_S ( 0, w0[0], offset); w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 19: w7[3] = hc_bytealign_be_S (w2[3], w3[0], offset); w7[2] = hc_bytealign_be_S (w2[2], w2[3], offset); w7[1] = hc_bytealign_be_S (w2[1], w2[2], offset); w7[0] = hc_bytealign_be_S (w2[0], w2[1], offset); w6[3] = hc_bytealign_be_S (w1[3], w2[0], offset); w6[2] = hc_bytealign_be_S (w1[2], w1[3], offset); w6[1] = hc_bytealign_be_S (w1[1], w1[2], offset); w6[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w5[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w5[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w5[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w5[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w4[3] = hc_bytealign_be_S ( 0, w0[0], offset); w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 20: w7[3] = hc_bytealign_be_S (w2[2], w2[3], offset); w7[2] = hc_bytealign_be_S (w2[1], w2[2], offset); w7[1] = hc_bytealign_be_S (w2[0], w2[1], offset); w7[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w6[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w6[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w6[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w6[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w5[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w5[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w5[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w5[0] = hc_bytealign_be_S ( 0, w0[0], offset); w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 21: w7[3] = hc_bytealign_be_S (w2[1], w2[2], offset); w7[2] = hc_bytealign_be_S (w2[0], w2[1], offset); w7[1] = hc_bytealign_be_S (w1[3], w2[0], offset); w7[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w6[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w6[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w6[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w6[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w5[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w5[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w5[1] = hc_bytealign_be_S ( 0, w0[0], offset); w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 22: w7[3] = hc_bytealign_be_S (w2[0], w2[1], offset); w7[2] = hc_bytealign_be_S (w1[3], w2[0], offset); w7[1] = hc_bytealign_be_S (w1[2], w1[3], offset); w7[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w6[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w6[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w6[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w6[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w5[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w5[2] = hc_bytealign_be_S ( 0, w0[0], offset); w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 23: w7[3] = hc_bytealign_be_S (w1[3], w2[0], offset); w7[2] = hc_bytealign_be_S (w1[2], w1[3], offset); w7[1] = hc_bytealign_be_S (w1[1], w1[2], offset); w7[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w6[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w6[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w6[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w6[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w5[3] = hc_bytealign_be_S ( 0, w0[0], offset); w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 24: w7[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w7[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w7[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w7[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w6[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w6[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w6[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w6[0] = hc_bytealign_be_S ( 0, w0[0], offset); w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 25: w7[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w7[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w7[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w7[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w6[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w6[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w6[1] = hc_bytealign_be_S ( 0, w0[0], offset); w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 26: w7[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w7[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w7[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w7[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w6[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w6[2] = hc_bytealign_be_S ( 0, w0[0], offset); w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 27: w7[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w7[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w7[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w7[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w6[3] = hc_bytealign_be_S ( 0, w0[0], offset); w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 28: w7[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w7[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w7[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w7[0] = hc_bytealign_be_S ( 0, w0[0], offset); w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 29: w7[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w7[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w7[1] = hc_bytealign_be_S ( 0, w0[0], offset); w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 30: w7[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w7[2] = hc_bytealign_be_S ( 0, w0[0], offset); w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 31: w7[3] = hc_bytealign_be_S ( 0, w0[0], offset); w7[2] = 0; w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV #if defined IS_NV const int selector = (0x76543210 >> ((offset & 3) * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> ((offset & 3) * 8)); #endif switch (offset_switch) { case 0: w7[3] = hc_byte_perm_S (w7[3], w7[2], selector); w7[2] = hc_byte_perm_S (w7[2], w7[1], selector); w7[1] = hc_byte_perm_S (w7[1], w7[0], selector); w7[0] = hc_byte_perm_S (w7[0], w6[3], selector); w6[3] = hc_byte_perm_S (w6[3], w6[2], selector); w6[2] = hc_byte_perm_S (w6[2], w6[1], selector); w6[1] = hc_byte_perm_S (w6[1], w6[0], selector); w6[0] = hc_byte_perm_S (w6[0], w5[3], selector); w5[3] = hc_byte_perm_S (w5[3], w5[2], selector); w5[2] = hc_byte_perm_S (w5[2], w5[1], selector); w5[1] = hc_byte_perm_S (w5[1], w5[0], selector); w5[0] = hc_byte_perm_S (w5[0], w4[3], selector); w4[3] = hc_byte_perm_S (w4[3], w4[2], selector); w4[2] = hc_byte_perm_S (w4[2], w4[1], selector); w4[1] = hc_byte_perm_S (w4[1], w4[0], selector); w4[0] = hc_byte_perm_S (w4[0], w3[3], selector); w3[3] = hc_byte_perm_S (w3[3], w3[2], selector); w3[2] = hc_byte_perm_S (w3[2], w3[1], selector); w3[1] = hc_byte_perm_S (w3[1], w3[0], selector); w3[0] = hc_byte_perm_S (w3[0], w2[3], selector); w2[3] = hc_byte_perm_S (w2[3], w2[2], selector); w2[2] = hc_byte_perm_S (w2[2], w2[1], selector); w2[1] = hc_byte_perm_S (w2[1], w2[0], selector); w2[0] = hc_byte_perm_S (w2[0], w1[3], selector); w1[3] = hc_byte_perm_S (w1[3], w1[2], selector); w1[2] = hc_byte_perm_S (w1[2], w1[1], selector); w1[1] = hc_byte_perm_S (w1[1], w1[0], selector); w1[0] = hc_byte_perm_S (w1[0], w0[3], selector); w0[3] = hc_byte_perm_S (w0[3], w0[2], selector); w0[2] = hc_byte_perm_S (w0[2], w0[1], selector); w0[1] = hc_byte_perm_S (w0[1], w0[0], selector); w0[0] = hc_byte_perm_S (w0[0], 0, selector); break; case 1: w7[3] = hc_byte_perm_S (w7[2], w7[1], selector); w7[2] = hc_byte_perm_S (w7[1], w7[0], selector); w7[1] = hc_byte_perm_S (w7[0], w6[3], selector); w7[0] = hc_byte_perm_S (w6[3], w6[2], selector); w6[3] = hc_byte_perm_S (w6[2], w6[1], selector); w6[2] = hc_byte_perm_S (w6[1], w6[0], selector); w6[1] = hc_byte_perm_S (w6[0], w5[3], selector); w6[0] = hc_byte_perm_S (w5[3], w5[2], selector); w5[3] = hc_byte_perm_S (w5[2], w5[1], selector); w5[2] = hc_byte_perm_S (w5[1], w5[0], selector); w5[1] = hc_byte_perm_S (w5[0], w4[3], selector); w5[0] = hc_byte_perm_S (w4[3], w4[2], selector); w4[3] = hc_byte_perm_S (w4[2], w4[1], selector); w4[2] = hc_byte_perm_S (w4[1], w4[0], selector); w4[1] = hc_byte_perm_S (w4[0], w3[3], selector); w4[0] = hc_byte_perm_S (w3[3], w3[2], selector); w3[3] = hc_byte_perm_S (w3[2], w3[1], selector); w3[2] = hc_byte_perm_S (w3[1], w3[0], selector); w3[1] = hc_byte_perm_S (w3[0], w2[3], selector); w3[0] = hc_byte_perm_S (w2[3], w2[2], selector); w2[3] = hc_byte_perm_S (w2[2], w2[1], selector); w2[2] = hc_byte_perm_S (w2[1], w2[0], selector); w2[1] = hc_byte_perm_S (w2[0], w1[3], selector); w2[0] = hc_byte_perm_S (w1[3], w1[2], selector); w1[3] = hc_byte_perm_S (w1[2], w1[1], selector); w1[2] = hc_byte_perm_S (w1[1], w1[0], selector); w1[1] = hc_byte_perm_S (w1[0], w0[3], selector); w1[0] = hc_byte_perm_S (w0[3], w0[2], selector); w0[3] = hc_byte_perm_S (w0[2], w0[1], selector); w0[2] = hc_byte_perm_S (w0[1], w0[0], selector); w0[1] = hc_byte_perm_S (w0[0], 0, selector); w0[0] = 0; break; case 2: w7[3] = hc_byte_perm_S (w7[1], w7[0], selector); w7[2] = hc_byte_perm_S (w7[0], w6[3], selector); w7[1] = hc_byte_perm_S (w6[3], w6[2], selector); w7[0] = hc_byte_perm_S (w6[2], w6[1], selector); w6[3] = hc_byte_perm_S (w6[1], w6[0], selector); w6[2] = hc_byte_perm_S (w6[0], w5[3], selector); w6[1] = hc_byte_perm_S (w5[3], w5[2], selector); w6[0] = hc_byte_perm_S (w5[2], w5[1], selector); w5[3] = hc_byte_perm_S (w5[1], w5[0], selector); w5[2] = hc_byte_perm_S (w5[0], w4[3], selector); w5[1] = hc_byte_perm_S (w4[3], w4[2], selector); w5[0] = hc_byte_perm_S (w4[2], w4[1], selector); w4[3] = hc_byte_perm_S (w4[1], w4[0], selector); w4[2] = hc_byte_perm_S (w4[0], w3[3], selector); w4[1] = hc_byte_perm_S (w3[3], w3[2], selector); w4[0] = hc_byte_perm_S (w3[2], w3[1], selector); w3[3] = hc_byte_perm_S (w3[1], w3[0], selector); w3[2] = hc_byte_perm_S (w3[0], w2[3], selector); w3[1] = hc_byte_perm_S (w2[3], w2[2], selector); w3[0] = hc_byte_perm_S (w2[2], w2[1], selector); w2[3] = hc_byte_perm_S (w2[1], w2[0], selector); w2[2] = hc_byte_perm_S (w2[0], w1[3], selector); w2[1] = hc_byte_perm_S (w1[3], w1[2], selector); w2[0] = hc_byte_perm_S (w1[2], w1[1], selector); w1[3] = hc_byte_perm_S (w1[1], w1[0], selector); w1[2] = hc_byte_perm_S (w1[0], w0[3], selector); w1[1] = hc_byte_perm_S (w0[3], w0[2], selector); w1[0] = hc_byte_perm_S (w0[2], w0[1], selector); w0[3] = hc_byte_perm_S (w0[1], w0[0], selector); w0[2] = hc_byte_perm_S (w0[0], 0, selector); w0[1] = 0; w0[0] = 0; break; case 3: w7[3] = hc_byte_perm_S (w7[0], w6[3], selector); w7[2] = hc_byte_perm_S (w6[3], w6[2], selector); w7[1] = hc_byte_perm_S (w6[2], w6[1], selector); w7[0] = hc_byte_perm_S (w6[1], w6[0], selector); w6[3] = hc_byte_perm_S (w6[0], w5[3], selector); w6[2] = hc_byte_perm_S (w5[3], w5[2], selector); w6[1] = hc_byte_perm_S (w5[2], w5[1], selector); w6[0] = hc_byte_perm_S (w5[1], w5[0], selector); w5[3] = hc_byte_perm_S (w5[0], w4[3], selector); w5[2] = hc_byte_perm_S (w4[3], w4[2], selector); w5[1] = hc_byte_perm_S (w4[2], w4[1], selector); w5[0] = hc_byte_perm_S (w4[1], w4[0], selector); w4[3] = hc_byte_perm_S (w4[0], w3[3], selector); w4[2] = hc_byte_perm_S (w3[3], w3[2], selector); w4[1] = hc_byte_perm_S (w3[2], w3[1], selector); w4[0] = hc_byte_perm_S (w3[1], w3[0], selector); w3[3] = hc_byte_perm_S (w3[0], w2[3], selector); w3[2] = hc_byte_perm_S (w2[3], w2[2], selector); w3[1] = hc_byte_perm_S (w2[2], w2[1], selector); w3[0] = hc_byte_perm_S (w2[1], w2[0], selector); w2[3] = hc_byte_perm_S (w2[0], w1[3], selector); w2[2] = hc_byte_perm_S (w1[3], w1[2], selector); w2[1] = hc_byte_perm_S (w1[2], w1[1], selector); w2[0] = hc_byte_perm_S (w1[1], w1[0], selector); w1[3] = hc_byte_perm_S (w1[0], w0[3], selector); w1[2] = hc_byte_perm_S (w0[3], w0[2], selector); w1[1] = hc_byte_perm_S (w0[2], w0[1], selector); w1[0] = hc_byte_perm_S (w0[1], w0[0], selector); w0[3] = hc_byte_perm_S (w0[0], 0, selector); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: w7[3] = hc_byte_perm_S (w6[3], w6[2], selector); w7[2] = hc_byte_perm_S (w6[2], w6[1], selector); w7[1] = hc_byte_perm_S (w6[1], w6[0], selector); w7[0] = hc_byte_perm_S (w6[0], w5[3], selector); w6[3] = hc_byte_perm_S (w5[3], w5[2], selector); w6[2] = hc_byte_perm_S (w5[2], w5[1], selector); w6[1] = hc_byte_perm_S (w5[1], w5[0], selector); w6[0] = hc_byte_perm_S (w5[0], w4[3], selector); w5[3] = hc_byte_perm_S (w4[3], w4[2], selector); w5[2] = hc_byte_perm_S (w4[2], w4[1], selector); w5[1] = hc_byte_perm_S (w4[1], w4[0], selector); w5[0] = hc_byte_perm_S (w4[0], w3[3], selector); w4[3] = hc_byte_perm_S (w3[3], w3[2], selector); w4[2] = hc_byte_perm_S (w3[2], w3[1], selector); w4[1] = hc_byte_perm_S (w3[1], w3[0], selector); w4[0] = hc_byte_perm_S (w3[0], w2[3], selector); w3[3] = hc_byte_perm_S (w2[3], w2[2], selector); w3[2] = hc_byte_perm_S (w2[2], w2[1], selector); w3[1] = hc_byte_perm_S (w2[1], w2[0], selector); w3[0] = hc_byte_perm_S (w2[0], w1[3], selector); w2[3] = hc_byte_perm_S (w1[3], w1[2], selector); w2[2] = hc_byte_perm_S (w1[2], w1[1], selector); w2[1] = hc_byte_perm_S (w1[1], w1[0], selector); w2[0] = hc_byte_perm_S (w1[0], w0[3], selector); w1[3] = hc_byte_perm_S (w0[3], w0[2], selector); w1[2] = hc_byte_perm_S (w0[2], w0[1], selector); w1[1] = hc_byte_perm_S (w0[1], w0[0], selector); w1[0] = hc_byte_perm_S (w0[0], 0, selector); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: w7[3] = hc_byte_perm_S (w6[2], w6[1], selector); w7[2] = hc_byte_perm_S (w6[1], w6[0], selector); w7[1] = hc_byte_perm_S (w6[0], w5[3], selector); w7[0] = hc_byte_perm_S (w5[3], w5[2], selector); w6[3] = hc_byte_perm_S (w5[2], w5[1], selector); w6[2] = hc_byte_perm_S (w5[1], w5[0], selector); w6[1] = hc_byte_perm_S (w5[0], w4[3], selector); w6[0] = hc_byte_perm_S (w4[3], w4[2], selector); w5[3] = hc_byte_perm_S (w4[2], w4[1], selector); w5[2] = hc_byte_perm_S (w4[1], w4[0], selector); w5[1] = hc_byte_perm_S (w4[0], w3[3], selector); w5[0] = hc_byte_perm_S (w3[3], w3[2], selector); w4[3] = hc_byte_perm_S (w3[2], w3[1], selector); w4[2] = hc_byte_perm_S (w3[1], w3[0], selector); w4[1] = hc_byte_perm_S (w3[0], w2[3], selector); w4[0] = hc_byte_perm_S (w2[3], w2[2], selector); w3[3] = hc_byte_perm_S (w2[2], w2[1], selector); w3[2] = hc_byte_perm_S (w2[1], w2[0], selector); w3[1] = hc_byte_perm_S (w2[0], w1[3], selector); w3[0] = hc_byte_perm_S (w1[3], w1[2], selector); w2[3] = hc_byte_perm_S (w1[2], w1[1], selector); w2[2] = hc_byte_perm_S (w1[1], w1[0], selector); w2[1] = hc_byte_perm_S (w1[0], w0[3], selector); w2[0] = hc_byte_perm_S (w0[3], w0[2], selector); w1[3] = hc_byte_perm_S (w0[2], w0[1], selector); w1[2] = hc_byte_perm_S (w0[1], w0[0], selector); w1[1] = hc_byte_perm_S (w0[0], 0, selector); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: w7[3] = hc_byte_perm_S (w6[1], w6[0], selector); w7[2] = hc_byte_perm_S (w6[0], w5[3], selector); w7[1] = hc_byte_perm_S (w5[3], w5[2], selector); w7[0] = hc_byte_perm_S (w5[2], w5[1], selector); w6[3] = hc_byte_perm_S (w5[1], w5[0], selector); w6[2] = hc_byte_perm_S (w5[0], w4[3], selector); w6[1] = hc_byte_perm_S (w4[3], w4[2], selector); w6[0] = hc_byte_perm_S (w4[2], w4[1], selector); w5[3] = hc_byte_perm_S (w4[1], w4[0], selector); w5[2] = hc_byte_perm_S (w4[0], w3[3], selector); w5[1] = hc_byte_perm_S (w3[3], w3[2], selector); w5[0] = hc_byte_perm_S (w3[2], w3[1], selector); w4[3] = hc_byte_perm_S (w3[1], w3[0], selector); w4[2] = hc_byte_perm_S (w3[0], w2[3], selector); w4[1] = hc_byte_perm_S (w2[3], w2[2], selector); w4[0] = hc_byte_perm_S (w2[2], w2[1], selector); w3[3] = hc_byte_perm_S (w2[1], w2[0], selector); w3[2] = hc_byte_perm_S (w2[0], w1[3], selector); w3[1] = hc_byte_perm_S (w1[3], w1[2], selector); w3[0] = hc_byte_perm_S (w1[2], w1[1], selector); w2[3] = hc_byte_perm_S (w1[1], w1[0], selector); w2[2] = hc_byte_perm_S (w1[0], w0[3], selector); w2[1] = hc_byte_perm_S (w0[3], w0[2], selector); w2[0] = hc_byte_perm_S (w0[2], w0[1], selector); w1[3] = hc_byte_perm_S (w0[1], w0[0], selector); w1[2] = hc_byte_perm_S (w0[0], 0, selector); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: w7[3] = hc_byte_perm_S (w6[0], w5[3], selector); w7[2] = hc_byte_perm_S (w5[3], w5[2], selector); w7[1] = hc_byte_perm_S (w5[2], w5[1], selector); w7[0] = hc_byte_perm_S (w5[1], w5[0], selector); w6[3] = hc_byte_perm_S (w5[0], w4[3], selector); w6[2] = hc_byte_perm_S (w4[3], w4[2], selector); w6[1] = hc_byte_perm_S (w4[2], w4[1], selector); w6[0] = hc_byte_perm_S (w4[1], w4[0], selector); w5[3] = hc_byte_perm_S (w4[0], w3[3], selector); w5[2] = hc_byte_perm_S (w3[3], w3[2], selector); w5[1] = hc_byte_perm_S (w3[2], w3[1], selector); w5[0] = hc_byte_perm_S (w3[1], w3[0], selector); w4[3] = hc_byte_perm_S (w3[0], w2[3], selector); w4[2] = hc_byte_perm_S (w2[3], w2[2], selector); w4[1] = hc_byte_perm_S (w2[2], w2[1], selector); w4[0] = hc_byte_perm_S (w2[1], w2[0], selector); w3[3] = hc_byte_perm_S (w2[0], w1[3], selector); w3[2] = hc_byte_perm_S (w1[3], w1[2], selector); w3[1] = hc_byte_perm_S (w1[2], w1[1], selector); w3[0] = hc_byte_perm_S (w1[1], w1[0], selector); w2[3] = hc_byte_perm_S (w1[0], w0[3], selector); w2[2] = hc_byte_perm_S (w0[3], w0[2], selector); w2[1] = hc_byte_perm_S (w0[2], w0[1], selector); w2[0] = hc_byte_perm_S (w0[1], w0[0], selector); w1[3] = hc_byte_perm_S (w0[0], 0, selector); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: w7[3] = hc_byte_perm_S (w5[3], w5[2], selector); w7[2] = hc_byte_perm_S (w5[2], w5[1], selector); w7[1] = hc_byte_perm_S (w5[1], w5[0], selector); w7[0] = hc_byte_perm_S (w5[0], w4[3], selector); w6[3] = hc_byte_perm_S (w4[3], w4[2], selector); w6[2] = hc_byte_perm_S (w4[2], w4[1], selector); w6[1] = hc_byte_perm_S (w4[1], w4[0], selector); w6[0] = hc_byte_perm_S (w4[0], w3[3], selector); w5[3] = hc_byte_perm_S (w3[3], w3[2], selector); w5[2] = hc_byte_perm_S (w3[2], w3[1], selector); w5[1] = hc_byte_perm_S (w3[1], w3[0], selector); w5[0] = hc_byte_perm_S (w3[0], w2[3], selector); w4[3] = hc_byte_perm_S (w2[3], w2[2], selector); w4[2] = hc_byte_perm_S (w2[2], w2[1], selector); w4[1] = hc_byte_perm_S (w2[1], w2[0], selector); w4[0] = hc_byte_perm_S (w2[0], w1[3], selector); w3[3] = hc_byte_perm_S (w1[3], w1[2], selector); w3[2] = hc_byte_perm_S (w1[2], w1[1], selector); w3[1] = hc_byte_perm_S (w1[1], w1[0], selector); w3[0] = hc_byte_perm_S (w1[0], w0[3], selector); w2[3] = hc_byte_perm_S (w0[3], w0[2], selector); w2[2] = hc_byte_perm_S (w0[2], w0[1], selector); w2[1] = hc_byte_perm_S (w0[1], w0[0], selector); w2[0] = hc_byte_perm_S (w0[0], 0, selector); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: w7[3] = hc_byte_perm_S (w5[2], w5[1], selector); w7[2] = hc_byte_perm_S (w5[1], w5[0], selector); w7[1] = hc_byte_perm_S (w5[0], w4[3], selector); w7[0] = hc_byte_perm_S (w4[3], w4[2], selector); w6[3] = hc_byte_perm_S (w4[2], w4[1], selector); w6[2] = hc_byte_perm_S (w4[1], w4[0], selector); w6[1] = hc_byte_perm_S (w4[0], w3[3], selector); w6[0] = hc_byte_perm_S (w3[3], w3[2], selector); w5[3] = hc_byte_perm_S (w3[2], w3[1], selector); w5[2] = hc_byte_perm_S (w3[1], w3[0], selector); w5[1] = hc_byte_perm_S (w3[0], w2[3], selector); w5[0] = hc_byte_perm_S (w2[3], w2[2], selector); w4[3] = hc_byte_perm_S (w2[2], w2[1], selector); w4[2] = hc_byte_perm_S (w2[1], w2[0], selector); w4[1] = hc_byte_perm_S (w2[0], w1[3], selector); w4[0] = hc_byte_perm_S (w1[3], w1[2], selector); w3[3] = hc_byte_perm_S (w1[2], w1[1], selector); w3[2] = hc_byte_perm_S (w1[1], w1[0], selector); w3[1] = hc_byte_perm_S (w1[0], w0[3], selector); w3[0] = hc_byte_perm_S (w0[3], w0[2], selector); w2[3] = hc_byte_perm_S (w0[2], w0[1], selector); w2[2] = hc_byte_perm_S (w0[1], w0[0], selector); w2[1] = hc_byte_perm_S (w0[0], 0, selector); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: w7[3] = hc_byte_perm_S (w5[1], w5[0], selector); w7[2] = hc_byte_perm_S (w5[0], w4[3], selector); w7[1] = hc_byte_perm_S (w4[3], w4[2], selector); w7[0] = hc_byte_perm_S (w4[2], w4[1], selector); w6[3] = hc_byte_perm_S (w4[1], w4[0], selector); w6[2] = hc_byte_perm_S (w4[0], w3[3], selector); w6[1] = hc_byte_perm_S (w3[3], w3[2], selector); w6[0] = hc_byte_perm_S (w3[2], w3[1], selector); w5[3] = hc_byte_perm_S (w3[1], w3[0], selector); w5[2] = hc_byte_perm_S (w3[0], w2[3], selector); w5[1] = hc_byte_perm_S (w2[3], w2[2], selector); w5[0] = hc_byte_perm_S (w2[2], w2[1], selector); w4[3] = hc_byte_perm_S (w2[1], w2[0], selector); w4[2] = hc_byte_perm_S (w2[0], w1[3], selector); w4[1] = hc_byte_perm_S (w1[3], w1[2], selector); w4[0] = hc_byte_perm_S (w1[2], w1[1], selector); w3[3] = hc_byte_perm_S (w1[1], w1[0], selector); w3[2] = hc_byte_perm_S (w1[0], w0[3], selector); w3[1] = hc_byte_perm_S (w0[3], w0[2], selector); w3[0] = hc_byte_perm_S (w0[2], w0[1], selector); w2[3] = hc_byte_perm_S (w0[1], w0[0], selector); w2[2] = hc_byte_perm_S (w0[0], 0, selector); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: w7[3] = hc_byte_perm_S (w5[0], w4[3], selector); w7[2] = hc_byte_perm_S (w4[3], w4[2], selector); w7[1] = hc_byte_perm_S (w4[2], w4[1], selector); w7[0] = hc_byte_perm_S (w4[1], w4[0], selector); w6[3] = hc_byte_perm_S (w4[0], w3[3], selector); w6[2] = hc_byte_perm_S (w3[3], w3[2], selector); w6[1] = hc_byte_perm_S (w3[2], w3[1], selector); w6[0] = hc_byte_perm_S (w3[1], w3[0], selector); w5[3] = hc_byte_perm_S (w3[0], w2[3], selector); w5[2] = hc_byte_perm_S (w2[3], w2[2], selector); w5[1] = hc_byte_perm_S (w2[2], w2[1], selector); w5[0] = hc_byte_perm_S (w2[1], w2[0], selector); w4[3] = hc_byte_perm_S (w2[0], w1[3], selector); w4[2] = hc_byte_perm_S (w1[3], w1[2], selector); w4[1] = hc_byte_perm_S (w1[2], w1[1], selector); w4[0] = hc_byte_perm_S (w1[1], w1[0], selector); w3[3] = hc_byte_perm_S (w1[0], w0[3], selector); w3[2] = hc_byte_perm_S (w0[3], w0[2], selector); w3[1] = hc_byte_perm_S (w0[2], w0[1], selector); w3[0] = hc_byte_perm_S (w0[1], w0[0], selector); w2[3] = hc_byte_perm_S (w0[0], 0, selector); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: w7[3] = hc_byte_perm_S (w4[3], w4[2], selector); w7[2] = hc_byte_perm_S (w4[2], w4[1], selector); w7[1] = hc_byte_perm_S (w4[1], w4[0], selector); w7[0] = hc_byte_perm_S (w4[0], w3[3], selector); w6[3] = hc_byte_perm_S (w3[3], w3[2], selector); w6[2] = hc_byte_perm_S (w3[2], w3[1], selector); w6[1] = hc_byte_perm_S (w3[1], w3[0], selector); w6[0] = hc_byte_perm_S (w3[0], w2[3], selector); w5[3] = hc_byte_perm_S (w2[3], w2[2], selector); w5[2] = hc_byte_perm_S (w2[2], w2[1], selector); w5[1] = hc_byte_perm_S (w2[1], w2[0], selector); w5[0] = hc_byte_perm_S (w2[0], w1[3], selector); w4[3] = hc_byte_perm_S (w1[3], w1[2], selector); w4[2] = hc_byte_perm_S (w1[2], w1[1], selector); w4[1] = hc_byte_perm_S (w1[1], w1[0], selector); w4[0] = hc_byte_perm_S (w1[0], w0[3], selector); w3[3] = hc_byte_perm_S (w0[3], w0[2], selector); w3[2] = hc_byte_perm_S (w0[2], w0[1], selector); w3[1] = hc_byte_perm_S (w0[1], w0[0], selector); w3[0] = hc_byte_perm_S (w0[0], 0, selector); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: w7[3] = hc_byte_perm_S (w4[2], w4[1], selector); w7[2] = hc_byte_perm_S (w4[1], w4[0], selector); w7[1] = hc_byte_perm_S (w4[0], w3[3], selector); w7[0] = hc_byte_perm_S (w3[3], w3[2], selector); w6[3] = hc_byte_perm_S (w3[2], w3[1], selector); w6[2] = hc_byte_perm_S (w3[1], w3[0], selector); w6[1] = hc_byte_perm_S (w3[0], w2[3], selector); w6[0] = hc_byte_perm_S (w2[3], w2[2], selector); w5[3] = hc_byte_perm_S (w2[2], w2[1], selector); w5[2] = hc_byte_perm_S (w2[1], w2[0], selector); w5[1] = hc_byte_perm_S (w2[0], w1[3], selector); w5[0] = hc_byte_perm_S (w1[3], w1[2], selector); w4[3] = hc_byte_perm_S (w1[2], w1[1], selector); w4[2] = hc_byte_perm_S (w1[1], w1[0], selector); w4[1] = hc_byte_perm_S (w1[0], w0[3], selector); w4[0] = hc_byte_perm_S (w0[3], w0[2], selector); w3[3] = hc_byte_perm_S (w0[2], w0[1], selector); w3[2] = hc_byte_perm_S (w0[1], w0[0], selector); w3[1] = hc_byte_perm_S (w0[0], 0, selector); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: w7[3] = hc_byte_perm_S (w4[1], w4[0], selector); w7[2] = hc_byte_perm_S (w4[0], w3[3], selector); w7[1] = hc_byte_perm_S (w3[3], w3[2], selector); w7[0] = hc_byte_perm_S (w3[2], w3[1], selector); w6[3] = hc_byte_perm_S (w3[1], w3[0], selector); w6[2] = hc_byte_perm_S (w3[0], w2[3], selector); w6[1] = hc_byte_perm_S (w2[3], w2[2], selector); w6[0] = hc_byte_perm_S (w2[2], w2[1], selector); w5[3] = hc_byte_perm_S (w2[1], w2[0], selector); w5[2] = hc_byte_perm_S (w2[0], w1[3], selector); w5[1] = hc_byte_perm_S (w1[3], w1[2], selector); w5[0] = hc_byte_perm_S (w1[2], w1[1], selector); w4[3] = hc_byte_perm_S (w1[1], w1[0], selector); w4[2] = hc_byte_perm_S (w1[0], w0[3], selector); w4[1] = hc_byte_perm_S (w0[3], w0[2], selector); w4[0] = hc_byte_perm_S (w0[2], w0[1], selector); w3[3] = hc_byte_perm_S (w0[1], w0[0], selector); w3[2] = hc_byte_perm_S (w0[0], 0, selector); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: w7[3] = hc_byte_perm_S (w4[0], w3[3], selector); w7[2] = hc_byte_perm_S (w3[3], w3[2], selector); w7[1] = hc_byte_perm_S (w3[2], w3[1], selector); w7[0] = hc_byte_perm_S (w3[1], w3[0], selector); w6[3] = hc_byte_perm_S (w3[0], w2[3], selector); w6[2] = hc_byte_perm_S (w2[3], w2[2], selector); w6[1] = hc_byte_perm_S (w2[2], w2[1], selector); w6[0] = hc_byte_perm_S (w2[1], w2[0], selector); w5[3] = hc_byte_perm_S (w2[0], w1[3], selector); w5[2] = hc_byte_perm_S (w1[3], w1[2], selector); w5[1] = hc_byte_perm_S (w1[2], w1[1], selector); w5[0] = hc_byte_perm_S (w1[1], w1[0], selector); w4[3] = hc_byte_perm_S (w1[0], w0[3], selector); w4[2] = hc_byte_perm_S (w0[3], w0[2], selector); w4[1] = hc_byte_perm_S (w0[2], w0[1], selector); w4[0] = hc_byte_perm_S (w0[1], w0[0], selector); w3[3] = hc_byte_perm_S (w0[0], 0, selector); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 16: w7[3] = hc_byte_perm_S (w3[3], w3[2], selector); w7[2] = hc_byte_perm_S (w3[2], w3[1], selector); w7[1] = hc_byte_perm_S (w3[1], w3[0], selector); w7[0] = hc_byte_perm_S (w3[0], w2[3], selector); w6[3] = hc_byte_perm_S (w2[3], w2[2], selector); w6[2] = hc_byte_perm_S (w2[2], w2[1], selector); w6[1] = hc_byte_perm_S (w2[1], w2[0], selector); w6[0] = hc_byte_perm_S (w2[0], w1[3], selector); w5[3] = hc_byte_perm_S (w1[3], w1[2], selector); w5[2] = hc_byte_perm_S (w1[2], w1[1], selector); w5[1] = hc_byte_perm_S (w1[1], w1[0], selector); w5[0] = hc_byte_perm_S (w1[0], w0[3], selector); w4[3] = hc_byte_perm_S (w0[3], w0[2], selector); w4[2] = hc_byte_perm_S (w0[2], w0[1], selector); w4[1] = hc_byte_perm_S (w0[1], w0[0], selector); w4[0] = hc_byte_perm_S (w0[0], 0, selector); w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 17: w7[3] = hc_byte_perm_S (w3[2], w3[1], selector); w7[2] = hc_byte_perm_S (w3[1], w3[0], selector); w7[1] = hc_byte_perm_S (w3[0], w2[3], selector); w7[0] = hc_byte_perm_S (w2[3], w2[2], selector); w6[3] = hc_byte_perm_S (w2[2], w2[1], selector); w6[2] = hc_byte_perm_S (w2[1], w2[0], selector); w6[1] = hc_byte_perm_S (w2[0], w1[3], selector); w6[0] = hc_byte_perm_S (w1[3], w1[2], selector); w5[3] = hc_byte_perm_S (w1[2], w1[1], selector); w5[2] = hc_byte_perm_S (w1[1], w1[0], selector); w5[1] = hc_byte_perm_S (w1[0], w0[3], selector); w5[0] = hc_byte_perm_S (w0[3], w0[2], selector); w4[3] = hc_byte_perm_S (w0[2], w0[1], selector); w4[2] = hc_byte_perm_S (w0[1], w0[0], selector); w4[1] = hc_byte_perm_S (w0[0], 0, selector); w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 18: w7[3] = hc_byte_perm_S (w3[1], w3[0], selector); w7[2] = hc_byte_perm_S (w3[0], w2[3], selector); w7[1] = hc_byte_perm_S (w2[3], w2[2], selector); w7[0] = hc_byte_perm_S (w2[2], w2[1], selector); w6[3] = hc_byte_perm_S (w2[1], w2[0], selector); w6[2] = hc_byte_perm_S (w2[0], w1[3], selector); w6[1] = hc_byte_perm_S (w1[3], w1[2], selector); w6[0] = hc_byte_perm_S (w1[2], w1[1], selector); w5[3] = hc_byte_perm_S (w1[1], w1[0], selector); w5[2] = hc_byte_perm_S (w1[0], w0[3], selector); w5[1] = hc_byte_perm_S (w0[3], w0[2], selector); w5[0] = hc_byte_perm_S (w0[2], w0[1], selector); w4[3] = hc_byte_perm_S (w0[1], w0[0], selector); w4[2] = hc_byte_perm_S (w0[0], 0, selector); w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 19: w7[3] = hc_byte_perm_S (w3[0], w2[3], selector); w7[2] = hc_byte_perm_S (w2[3], w2[2], selector); w7[1] = hc_byte_perm_S (w2[2], w2[1], selector); w7[0] = hc_byte_perm_S (w2[1], w2[0], selector); w6[3] = hc_byte_perm_S (w2[0], w1[3], selector); w6[2] = hc_byte_perm_S (w1[3], w1[2], selector); w6[1] = hc_byte_perm_S (w1[2], w1[1], selector); w6[0] = hc_byte_perm_S (w1[1], w1[0], selector); w5[3] = hc_byte_perm_S (w1[0], w0[3], selector); w5[2] = hc_byte_perm_S (w0[3], w0[2], selector); w5[1] = hc_byte_perm_S (w0[2], w0[1], selector); w5[0] = hc_byte_perm_S (w0[1], w0[0], selector); w4[3] = hc_byte_perm_S (w0[0], 0, selector); w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 20: w7[3] = hc_byte_perm_S (w2[3], w2[2], selector); w7[2] = hc_byte_perm_S (w2[2], w2[1], selector); w7[1] = hc_byte_perm_S (w2[1], w2[0], selector); w7[0] = hc_byte_perm_S (w2[0], w1[3], selector); w6[3] = hc_byte_perm_S (w1[3], w1[2], selector); w6[2] = hc_byte_perm_S (w1[2], w1[1], selector); w6[1] = hc_byte_perm_S (w1[1], w1[0], selector); w6[0] = hc_byte_perm_S (w1[0], w0[3], selector); w5[3] = hc_byte_perm_S (w0[3], w0[2], selector); w5[2] = hc_byte_perm_S (w0[2], w0[1], selector); w5[1] = hc_byte_perm_S (w0[1], w0[0], selector); w5[0] = hc_byte_perm_S (w0[0], 0, selector); w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 21: w7[3] = hc_byte_perm_S (w2[2], w2[1], selector); w7[2] = hc_byte_perm_S (w2[1], w2[0], selector); w7[1] = hc_byte_perm_S (w2[0], w1[3], selector); w7[0] = hc_byte_perm_S (w1[3], w1[2], selector); w6[3] = hc_byte_perm_S (w1[2], w1[1], selector); w6[2] = hc_byte_perm_S (w1[1], w1[0], selector); w6[1] = hc_byte_perm_S (w1[0], w0[3], selector); w6[0] = hc_byte_perm_S (w0[3], w0[2], selector); w5[3] = hc_byte_perm_S (w0[2], w0[1], selector); w5[2] = hc_byte_perm_S (w0[1], w0[0], selector); w5[1] = hc_byte_perm_S (w0[0], 0, selector); w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 22: w7[3] = hc_byte_perm_S (w2[1], w2[0], selector); w7[2] = hc_byte_perm_S (w2[0], w1[3], selector); w7[1] = hc_byte_perm_S (w1[3], w1[2], selector); w7[0] = hc_byte_perm_S (w1[2], w1[1], selector); w6[3] = hc_byte_perm_S (w1[1], w1[0], selector); w6[2] = hc_byte_perm_S (w1[0], w0[3], selector); w6[1] = hc_byte_perm_S (w0[3], w0[2], selector); w6[0] = hc_byte_perm_S (w0[2], w0[1], selector); w5[3] = hc_byte_perm_S (w0[1], w0[0], selector); w5[2] = hc_byte_perm_S (w0[0], 0, selector); w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 23: w7[3] = hc_byte_perm_S (w2[0], w1[3], selector); w7[2] = hc_byte_perm_S (w1[3], w1[2], selector); w7[1] = hc_byte_perm_S (w1[2], w1[1], selector); w7[0] = hc_byte_perm_S (w1[1], w1[0], selector); w6[3] = hc_byte_perm_S (w1[0], w0[3], selector); w6[2] = hc_byte_perm_S (w0[3], w0[2], selector); w6[1] = hc_byte_perm_S (w0[2], w0[1], selector); w6[0] = hc_byte_perm_S (w0[1], w0[0], selector); w5[3] = hc_byte_perm_S (w0[0], 0, selector); w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 24: w7[3] = hc_byte_perm_S (w1[3], w1[2], selector); w7[2] = hc_byte_perm_S (w1[2], w1[1], selector); w7[1] = hc_byte_perm_S (w1[1], w1[0], selector); w7[0] = hc_byte_perm_S (w1[0], w0[3], selector); w6[3] = hc_byte_perm_S (w0[3], w0[2], selector); w6[2] = hc_byte_perm_S (w0[2], w0[1], selector); w6[1] = hc_byte_perm_S (w0[1], w0[0], selector); w6[0] = hc_byte_perm_S (w0[0], 0, selector); w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 25: w7[3] = hc_byte_perm_S (w1[2], w1[1], selector); w7[2] = hc_byte_perm_S (w1[1], w1[0], selector); w7[1] = hc_byte_perm_S (w1[0], w0[3], selector); w7[0] = hc_byte_perm_S (w0[3], w0[2], selector); w6[3] = hc_byte_perm_S (w0[2], w0[1], selector); w6[2] = hc_byte_perm_S (w0[1], w0[0], selector); w6[1] = hc_byte_perm_S (w0[0], 0, selector); w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 26: w7[3] = hc_byte_perm_S (w1[1], w1[0], selector); w7[2] = hc_byte_perm_S (w1[0], w0[3], selector); w7[1] = hc_byte_perm_S (w0[3], w0[2], selector); w7[0] = hc_byte_perm_S (w0[2], w0[1], selector); w6[3] = hc_byte_perm_S (w0[1], w0[0], selector); w6[2] = hc_byte_perm_S (w0[0], 0, selector); w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 27: w7[3] = hc_byte_perm_S (w1[0], w0[3], selector); w7[2] = hc_byte_perm_S (w0[3], w0[2], selector); w7[1] = hc_byte_perm_S (w0[2], w0[1], selector); w7[0] = hc_byte_perm_S (w0[1], w0[0], selector); w6[3] = hc_byte_perm_S (w0[0], 0, selector); w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 28: w7[3] = hc_byte_perm_S (w0[3], w0[2], selector); w7[2] = hc_byte_perm_S (w0[2], w0[1], selector); w7[1] = hc_byte_perm_S (w0[1], w0[0], selector); w7[0] = hc_byte_perm_S (w0[0], 0, selector); w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 29: w7[3] = hc_byte_perm_S (w0[2], w0[1], selector); w7[2] = hc_byte_perm_S (w0[1], w0[0], selector); w7[1] = hc_byte_perm_S (w0[0], 0, selector); w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 30: w7[3] = hc_byte_perm_S (w0[1], w0[0], selector); w7[2] = hc_byte_perm_S (w0[0], 0, selector); w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 31: w7[3] = hc_byte_perm_S (w0[0], 0, selector); w7[2] = 0; w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_8x4_carry_be_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, PRIVATE_AS u32 *w4, PRIVATE_AS u32 *w5, PRIVATE_AS u32 *w6, PRIVATE_AS u32 *w7, PRIVATE_AS u32 *c0, PRIVATE_AS u32 *c1, PRIVATE_AS u32 *c2, PRIVATE_AS u32 *c3, PRIVATE_AS u32 *c4, PRIVATE_AS u32 *c5, PRIVATE_AS u32 *c6, PRIVATE_AS u32 *c7, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: c0[0] = hc_bytealign_be_S (w7[3], 0, offset); w7[3] = hc_bytealign_be_S (w7[2], w7[3], offset); w7[2] = hc_bytealign_be_S (w7[1], w7[2], offset); w7[1] = hc_bytealign_be_S (w7[0], w7[1], offset); w7[0] = hc_bytealign_be_S (w6[3], w7[0], offset); w6[3] = hc_bytealign_be_S (w6[2], w6[3], offset); w6[2] = hc_bytealign_be_S (w6[1], w6[2], offset); w6[1] = hc_bytealign_be_S (w6[0], w6[1], offset); w6[0] = hc_bytealign_be_S (w5[3], w6[0], offset); w5[3] = hc_bytealign_be_S (w5[2], w5[3], offset); w5[2] = hc_bytealign_be_S (w5[1], w5[2], offset); w5[1] = hc_bytealign_be_S (w5[0], w5[1], offset); w5[0] = hc_bytealign_be_S (w4[3], w5[0], offset); w4[3] = hc_bytealign_be_S (w4[2], w4[3], offset); w4[2] = hc_bytealign_be_S (w4[1], w4[2], offset); w4[1] = hc_bytealign_be_S (w4[0], w4[1], offset); w4[0] = hc_bytealign_be_S (w3[3], w4[0], offset); w3[3] = hc_bytealign_be_S (w3[2], w3[3], offset); w3[2] = hc_bytealign_be_S (w3[1], w3[2], offset); w3[1] = hc_bytealign_be_S (w3[0], w3[1], offset); w3[0] = hc_bytealign_be_S (w2[3], w3[0], offset); w2[3] = hc_bytealign_be_S (w2[2], w2[3], offset); w2[2] = hc_bytealign_be_S (w2[1], w2[2], offset); w2[1] = hc_bytealign_be_S (w2[0], w2[1], offset); w2[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w1[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w1[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w1[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w1[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w0[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w0[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w0[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w0[0] = hc_bytealign_be_S ( 0, w0[0], offset); break; case 1: c0[1] = hc_bytealign_be_S (w7[3], 0, offset); c0[0] = hc_bytealign_be_S (w7[2], w7[3], offset); w7[3] = hc_bytealign_be_S (w7[1], w7[2], offset); w7[2] = hc_bytealign_be_S (w7[0], w7[1], offset); w7[1] = hc_bytealign_be_S (w6[3], w7[0], offset); w7[0] = hc_bytealign_be_S (w6[2], w6[3], offset); w6[3] = hc_bytealign_be_S (w6[1], w6[2], offset); w6[2] = hc_bytealign_be_S (w6[0], w6[1], offset); w6[1] = hc_bytealign_be_S (w5[3], w6[0], offset); w6[0] = hc_bytealign_be_S (w5[2], w5[3], offset); w5[3] = hc_bytealign_be_S (w5[1], w5[2], offset); w5[2] = hc_bytealign_be_S (w5[0], w5[1], offset); w5[1] = hc_bytealign_be_S (w4[3], w5[0], offset); w5[0] = hc_bytealign_be_S (w4[2], w4[3], offset); w4[3] = hc_bytealign_be_S (w4[1], w4[2], offset); w4[2] = hc_bytealign_be_S (w4[0], w4[1], offset); w4[1] = hc_bytealign_be_S (w3[3], w4[0], offset); w4[0] = hc_bytealign_be_S (w3[2], w3[3], offset); w3[3] = hc_bytealign_be_S (w3[1], w3[2], offset); w3[2] = hc_bytealign_be_S (w3[0], w3[1], offset); w3[1] = hc_bytealign_be_S (w2[3], w3[0], offset); w3[0] = hc_bytealign_be_S (w2[2], w2[3], offset); w2[3] = hc_bytealign_be_S (w2[1], w2[2], offset); w2[2] = hc_bytealign_be_S (w2[0], w2[1], offset); w2[1] = hc_bytealign_be_S (w1[3], w2[0], offset); w2[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w1[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w1[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w1[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w1[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w0[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w0[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w0[1] = hc_bytealign_be_S ( 0, w0[0], offset); w0[0] = 0; break; case 2: c0[2] = hc_bytealign_be_S (w7[3], 0, offset); c0[1] = hc_bytealign_be_S (w7[2], w7[3], offset); c0[0] = hc_bytealign_be_S (w7[1], w7[2], offset); w7[3] = hc_bytealign_be_S (w7[0], w7[1], offset); w7[2] = hc_bytealign_be_S (w6[3], w7[0], offset); w7[1] = hc_bytealign_be_S (w6[2], w6[3], offset); w7[0] = hc_bytealign_be_S (w6[1], w6[2], offset); w6[3] = hc_bytealign_be_S (w6[0], w6[1], offset); w6[2] = hc_bytealign_be_S (w5[3], w6[0], offset); w6[1] = hc_bytealign_be_S (w5[2], w5[3], offset); w6[0] = hc_bytealign_be_S (w5[1], w5[2], offset); w5[3] = hc_bytealign_be_S (w5[0], w5[1], offset); w5[2] = hc_bytealign_be_S (w4[3], w5[0], offset); w5[1] = hc_bytealign_be_S (w4[2], w4[3], offset); w5[0] = hc_bytealign_be_S (w4[1], w4[2], offset); w4[3] = hc_bytealign_be_S (w4[0], w4[1], offset); w4[2] = hc_bytealign_be_S (w3[3], w4[0], offset); w4[1] = hc_bytealign_be_S (w3[2], w3[3], offset); w4[0] = hc_bytealign_be_S (w3[1], w3[2], offset); w3[3] = hc_bytealign_be_S (w3[0], w3[1], offset); w3[2] = hc_bytealign_be_S (w2[3], w3[0], offset); w3[1] = hc_bytealign_be_S (w2[2], w2[3], offset); w3[0] = hc_bytealign_be_S (w2[1], w2[2], offset); w2[3] = hc_bytealign_be_S (w2[0], w2[1], offset); w2[2] = hc_bytealign_be_S (w1[3], w2[0], offset); w2[1] = hc_bytealign_be_S (w1[2], w1[3], offset); w2[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w1[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w1[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w1[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w1[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w0[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w0[2] = hc_bytealign_be_S ( 0, w0[0], offset); w0[1] = 0; w0[0] = 0; break; case 3: c0[3] = hc_bytealign_be_S (w7[3], 0, offset); c0[2] = hc_bytealign_be_S (w7[2], w7[3], offset); c0[1] = hc_bytealign_be_S (w7[1], w7[2], offset); c0[0] = hc_bytealign_be_S (w7[0], w7[1], offset); w7[3] = hc_bytealign_be_S (w6[3], w7[0], offset); w7[2] = hc_bytealign_be_S (w6[2], w6[3], offset); w7[1] = hc_bytealign_be_S (w6[1], w6[2], offset); w7[0] = hc_bytealign_be_S (w6[0], w6[1], offset); w6[3] = hc_bytealign_be_S (w5[3], w6[0], offset); w6[2] = hc_bytealign_be_S (w5[2], w5[3], offset); w6[1] = hc_bytealign_be_S (w5[1], w5[2], offset); w6[0] = hc_bytealign_be_S (w5[0], w5[1], offset); w5[3] = hc_bytealign_be_S (w4[3], w5[0], offset); w5[2] = hc_bytealign_be_S (w4[2], w4[3], offset); w5[1] = hc_bytealign_be_S (w4[1], w4[2], offset); w5[0] = hc_bytealign_be_S (w4[0], w4[1], offset); w4[3] = hc_bytealign_be_S (w3[3], w4[0], offset); w4[2] = hc_bytealign_be_S (w3[2], w3[3], offset); w4[1] = hc_bytealign_be_S (w3[1], w3[2], offset); w4[0] = hc_bytealign_be_S (w3[0], w3[1], offset); w3[3] = hc_bytealign_be_S (w2[3], w3[0], offset); w3[2] = hc_bytealign_be_S (w2[2], w2[3], offset); w3[1] = hc_bytealign_be_S (w2[1], w2[2], offset); w3[0] = hc_bytealign_be_S (w2[0], w2[1], offset); w2[3] = hc_bytealign_be_S (w1[3], w2[0], offset); w2[2] = hc_bytealign_be_S (w1[2], w1[3], offset); w2[1] = hc_bytealign_be_S (w1[1], w1[2], offset); w2[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w1[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w1[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w1[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w1[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w0[3] = hc_bytealign_be_S ( 0, w0[0], offset); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: c1[0] = hc_bytealign_be_S (w7[3], 0, offset); c0[3] = hc_bytealign_be_S (w7[2], w7[3], offset); c0[2] = hc_bytealign_be_S (w7[1], w7[2], offset); c0[1] = hc_bytealign_be_S (w7[0], w7[1], offset); c0[0] = hc_bytealign_be_S (w6[3], w7[0], offset); w7[3] = hc_bytealign_be_S (w6[2], w6[3], offset); w7[2] = hc_bytealign_be_S (w6[1], w6[2], offset); w7[1] = hc_bytealign_be_S (w6[0], w6[1], offset); w7[0] = hc_bytealign_be_S (w5[3], w6[0], offset); w6[3] = hc_bytealign_be_S (w5[2], w5[3], offset); w6[2] = hc_bytealign_be_S (w5[1], w5[2], offset); w6[1] = hc_bytealign_be_S (w5[0], w5[1], offset); w6[0] = hc_bytealign_be_S (w4[3], w5[0], offset); w5[3] = hc_bytealign_be_S (w4[2], w4[3], offset); w5[2] = hc_bytealign_be_S (w4[1], w4[2], offset); w5[1] = hc_bytealign_be_S (w4[0], w4[1], offset); w5[0] = hc_bytealign_be_S (w3[3], w4[0], offset); w4[3] = hc_bytealign_be_S (w3[2], w3[3], offset); w4[2] = hc_bytealign_be_S (w3[1], w3[2], offset); w4[1] = hc_bytealign_be_S (w3[0], w3[1], offset); w4[0] = hc_bytealign_be_S (w2[3], w3[0], offset); w3[3] = hc_bytealign_be_S (w2[2], w2[3], offset); w3[2] = hc_bytealign_be_S (w2[1], w2[2], offset); w3[1] = hc_bytealign_be_S (w2[0], w2[1], offset); w3[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w2[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w2[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w2[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w2[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w1[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w1[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w1[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w1[0] = hc_bytealign_be_S ( 0, w0[0], offset); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: c1[1] = hc_bytealign_be_S (w7[3], 0, offset); c1[0] = hc_bytealign_be_S (w7[2], w7[3], offset); c0[3] = hc_bytealign_be_S (w7[1], w7[2], offset); c0[2] = hc_bytealign_be_S (w7[0], w7[1], offset); c0[1] = hc_bytealign_be_S (w6[3], w7[0], offset); c0[0] = hc_bytealign_be_S (w6[2], w6[3], offset); w7[3] = hc_bytealign_be_S (w6[1], w6[2], offset); w7[2] = hc_bytealign_be_S (w6[0], w6[1], offset); w7[1] = hc_bytealign_be_S (w5[3], w6[0], offset); w7[0] = hc_bytealign_be_S (w5[2], w5[3], offset); w6[3] = hc_bytealign_be_S (w5[1], w5[2], offset); w6[2] = hc_bytealign_be_S (w5[0], w5[1], offset); w6[1] = hc_bytealign_be_S (w4[3], w5[0], offset); w6[0] = hc_bytealign_be_S (w4[2], w4[3], offset); w5[3] = hc_bytealign_be_S (w4[1], w4[2], offset); w5[2] = hc_bytealign_be_S (w4[0], w4[1], offset); w5[1] = hc_bytealign_be_S (w3[3], w4[0], offset); w5[0] = hc_bytealign_be_S (w3[2], w3[3], offset); w4[3] = hc_bytealign_be_S (w3[1], w3[2], offset); w4[2] = hc_bytealign_be_S (w3[0], w3[1], offset); w4[1] = hc_bytealign_be_S (w2[3], w3[0], offset); w4[0] = hc_bytealign_be_S (w2[2], w2[3], offset); w3[3] = hc_bytealign_be_S (w2[1], w2[2], offset); w3[2] = hc_bytealign_be_S (w2[0], w2[1], offset); w3[1] = hc_bytealign_be_S (w1[3], w2[0], offset); w3[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w2[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w2[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w2[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w2[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w1[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w1[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w1[1] = hc_bytealign_be_S ( 0, w0[0], offset); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: c1[2] = hc_bytealign_be_S (w7[3], 0, offset); c1[1] = hc_bytealign_be_S (w7[2], w7[3], offset); c1[0] = hc_bytealign_be_S (w7[1], w7[2], offset); c0[3] = hc_bytealign_be_S (w7[0], w7[1], offset); c0[2] = hc_bytealign_be_S (w6[3], w7[0], offset); c0[1] = hc_bytealign_be_S (w6[2], w6[3], offset); c0[0] = hc_bytealign_be_S (w6[1], w6[2], offset); w7[3] = hc_bytealign_be_S (w6[0], w6[1], offset); w7[2] = hc_bytealign_be_S (w5[3], w6[0], offset); w7[1] = hc_bytealign_be_S (w5[2], w5[3], offset); w7[0] = hc_bytealign_be_S (w5[1], w5[2], offset); w6[3] = hc_bytealign_be_S (w5[0], w5[1], offset); w6[2] = hc_bytealign_be_S (w4[3], w5[0], offset); w6[1] = hc_bytealign_be_S (w4[2], w4[3], offset); w6[0] = hc_bytealign_be_S (w4[1], w4[2], offset); w5[3] = hc_bytealign_be_S (w4[0], w4[1], offset); w5[2] = hc_bytealign_be_S (w3[3], w4[0], offset); w5[1] = hc_bytealign_be_S (w3[2], w3[3], offset); w5[0] = hc_bytealign_be_S (w3[1], w3[2], offset); w4[3] = hc_bytealign_be_S (w3[0], w3[1], offset); w4[2] = hc_bytealign_be_S (w2[3], w3[0], offset); w4[1] = hc_bytealign_be_S (w2[2], w2[3], offset); w4[0] = hc_bytealign_be_S (w2[1], w2[2], offset); w3[3] = hc_bytealign_be_S (w2[0], w2[1], offset); w3[2] = hc_bytealign_be_S (w1[3], w2[0], offset); w3[1] = hc_bytealign_be_S (w1[2], w1[3], offset); w3[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w2[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w2[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w2[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w2[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w1[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w1[2] = hc_bytealign_be_S ( 0, w0[0], offset); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: c1[3] = hc_bytealign_be_S (w7[3], 0, offset); c1[2] = hc_bytealign_be_S (w7[2], w7[3], offset); c1[1] = hc_bytealign_be_S (w7[1], w7[2], offset); c1[0] = hc_bytealign_be_S (w7[0], w7[1], offset); c0[3] = hc_bytealign_be_S (w6[3], w7[0], offset); c0[2] = hc_bytealign_be_S (w6[2], w6[3], offset); c0[1] = hc_bytealign_be_S (w6[1], w6[2], offset); c0[0] = hc_bytealign_be_S (w6[0], w6[1], offset); w7[3] = hc_bytealign_be_S (w5[3], w6[0], offset); w7[2] = hc_bytealign_be_S (w5[2], w5[3], offset); w7[1] = hc_bytealign_be_S (w5[1], w5[2], offset); w7[0] = hc_bytealign_be_S (w5[0], w5[1], offset); w6[3] = hc_bytealign_be_S (w4[3], w5[0], offset); w6[2] = hc_bytealign_be_S (w4[2], w4[3], offset); w6[1] = hc_bytealign_be_S (w4[1], w4[2], offset); w6[0] = hc_bytealign_be_S (w4[0], w4[1], offset); w5[3] = hc_bytealign_be_S (w3[3], w4[0], offset); w5[2] = hc_bytealign_be_S (w3[2], w3[3], offset); w5[1] = hc_bytealign_be_S (w3[1], w3[2], offset); w5[0] = hc_bytealign_be_S (w3[0], w3[1], offset); w4[3] = hc_bytealign_be_S (w2[3], w3[0], offset); w4[2] = hc_bytealign_be_S (w2[2], w2[3], offset); w4[1] = hc_bytealign_be_S (w2[1], w2[2], offset); w4[0] = hc_bytealign_be_S (w2[0], w2[1], offset); w3[3] = hc_bytealign_be_S (w1[3], w2[0], offset); w3[2] = hc_bytealign_be_S (w1[2], w1[3], offset); w3[1] = hc_bytealign_be_S (w1[1], w1[2], offset); w3[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w2[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w2[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w2[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w2[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w1[3] = hc_bytealign_be_S ( 0, w0[0], offset); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: c2[0] = hc_bytealign_be_S (w7[3], 0, offset); c1[3] = hc_bytealign_be_S (w7[2], w7[3], offset); c1[2] = hc_bytealign_be_S (w7[1], w7[2], offset); c1[1] = hc_bytealign_be_S (w7[0], w7[1], offset); c1[0] = hc_bytealign_be_S (w6[3], w7[0], offset); c0[3] = hc_bytealign_be_S (w6[2], w6[3], offset); c0[2] = hc_bytealign_be_S (w6[1], w6[2], offset); c0[1] = hc_bytealign_be_S (w6[0], w6[1], offset); c0[0] = hc_bytealign_be_S (w5[3], w6[0], offset); w7[3] = hc_bytealign_be_S (w5[2], w5[3], offset); w7[2] = hc_bytealign_be_S (w5[1], w5[2], offset); w7[1] = hc_bytealign_be_S (w5[0], w5[1], offset); w7[0] = hc_bytealign_be_S (w4[3], w5[0], offset); w6[3] = hc_bytealign_be_S (w4[2], w4[3], offset); w6[2] = hc_bytealign_be_S (w4[1], w4[2], offset); w6[1] = hc_bytealign_be_S (w4[0], w4[1], offset); w6[0] = hc_bytealign_be_S (w3[3], w4[0], offset); w5[3] = hc_bytealign_be_S (w3[2], w3[3], offset); w5[2] = hc_bytealign_be_S (w3[1], w3[2], offset); w5[1] = hc_bytealign_be_S (w3[0], w3[1], offset); w5[0] = hc_bytealign_be_S (w2[3], w3[0], offset); w4[3] = hc_bytealign_be_S (w2[2], w2[3], offset); w4[2] = hc_bytealign_be_S (w2[1], w2[2], offset); w4[1] = hc_bytealign_be_S (w2[0], w2[1], offset); w4[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w3[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w3[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w3[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w3[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w2[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w2[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w2[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w2[0] = hc_bytealign_be_S ( 0, w0[0], offset); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: c2[1] = hc_bytealign_be_S (w7[3], 0, offset); c2[0] = hc_bytealign_be_S (w7[2], w7[3], offset); c1[3] = hc_bytealign_be_S (w7[1], w7[2], offset); c1[2] = hc_bytealign_be_S (w7[0], w7[1], offset); c1[1] = hc_bytealign_be_S (w6[3], w7[0], offset); c1[0] = hc_bytealign_be_S (w6[2], w6[3], offset); c0[3] = hc_bytealign_be_S (w6[1], w6[2], offset); c0[2] = hc_bytealign_be_S (w6[0], w6[1], offset); c0[1] = hc_bytealign_be_S (w5[3], w6[0], offset); c0[0] = hc_bytealign_be_S (w5[2], w5[3], offset); w7[3] = hc_bytealign_be_S (w5[1], w5[2], offset); w7[2] = hc_bytealign_be_S (w5[0], w5[1], offset); w7[1] = hc_bytealign_be_S (w4[3], w5[0], offset); w7[0] = hc_bytealign_be_S (w4[2], w4[3], offset); w6[3] = hc_bytealign_be_S (w4[1], w4[2], offset); w6[2] = hc_bytealign_be_S (w4[0], w4[1], offset); w6[1] = hc_bytealign_be_S (w3[3], w4[0], offset); w6[0] = hc_bytealign_be_S (w3[2], w3[3], offset); w5[3] = hc_bytealign_be_S (w3[1], w3[2], offset); w5[2] = hc_bytealign_be_S (w3[0], w3[1], offset); w5[1] = hc_bytealign_be_S (w2[3], w3[0], offset); w5[0] = hc_bytealign_be_S (w2[2], w2[3], offset); w4[3] = hc_bytealign_be_S (w2[1], w2[2], offset); w4[2] = hc_bytealign_be_S (w2[0], w2[1], offset); w4[1] = hc_bytealign_be_S (w1[3], w2[0], offset); w4[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w3[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w3[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w3[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w3[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w2[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w2[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w2[1] = hc_bytealign_be_S ( 0, w0[0], offset); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: c2[2] = hc_bytealign_be_S (w7[3], 0, offset); c2[1] = hc_bytealign_be_S (w7[2], w7[3], offset); c2[0] = hc_bytealign_be_S (w7[1], w7[2], offset); c1[3] = hc_bytealign_be_S (w7[0], w7[1], offset); c1[2] = hc_bytealign_be_S (w6[3], w7[0], offset); c1[1] = hc_bytealign_be_S (w6[2], w6[3], offset); c1[0] = hc_bytealign_be_S (w6[1], w6[2], offset); c0[3] = hc_bytealign_be_S (w6[0], w6[1], offset); c0[2] = hc_bytealign_be_S (w5[3], w6[0], offset); c0[1] = hc_bytealign_be_S (w5[2], w5[3], offset); c0[0] = hc_bytealign_be_S (w5[1], w5[2], offset); w7[3] = hc_bytealign_be_S (w5[0], w5[1], offset); w7[2] = hc_bytealign_be_S (w4[3], w5[0], offset); w7[1] = hc_bytealign_be_S (w4[2], w4[3], offset); w7[0] = hc_bytealign_be_S (w4[1], w4[2], offset); w6[3] = hc_bytealign_be_S (w4[0], w4[1], offset); w6[2] = hc_bytealign_be_S (w3[3], w4[0], offset); w6[1] = hc_bytealign_be_S (w3[2], w3[3], offset); w6[0] = hc_bytealign_be_S (w3[1], w3[2], offset); w5[3] = hc_bytealign_be_S (w3[0], w3[1], offset); w5[2] = hc_bytealign_be_S (w2[3], w3[0], offset); w5[1] = hc_bytealign_be_S (w2[2], w2[3], offset); w5[0] = hc_bytealign_be_S (w2[1], w2[2], offset); w4[3] = hc_bytealign_be_S (w2[0], w2[1], offset); w4[2] = hc_bytealign_be_S (w1[3], w2[0], offset); w4[1] = hc_bytealign_be_S (w1[2], w1[3], offset); w4[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w3[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w3[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w3[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w3[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w2[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w2[2] = hc_bytealign_be_S ( 0, w0[0], offset); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: c2[3] = hc_bytealign_be_S (w7[3], 0, offset); c2[2] = hc_bytealign_be_S (w7[2], w7[3], offset); c2[1] = hc_bytealign_be_S (w7[1], w7[2], offset); c2[0] = hc_bytealign_be_S (w7[0], w7[1], offset); c1[3] = hc_bytealign_be_S (w6[3], w7[0], offset); c1[2] = hc_bytealign_be_S (w6[2], w6[3], offset); c1[1] = hc_bytealign_be_S (w6[1], w6[2], offset); c1[0] = hc_bytealign_be_S (w6[0], w6[1], offset); c0[3] = hc_bytealign_be_S (w5[3], w6[0], offset); c0[2] = hc_bytealign_be_S (w5[2], w5[3], offset); c0[1] = hc_bytealign_be_S (w5[1], w5[2], offset); c0[0] = hc_bytealign_be_S (w5[0], w5[1], offset); w7[3] = hc_bytealign_be_S (w4[3], w5[0], offset); w7[2] = hc_bytealign_be_S (w4[2], w4[3], offset); w7[1] = hc_bytealign_be_S (w4[1], w4[2], offset); w7[0] = hc_bytealign_be_S (w4[0], w4[1], offset); w6[3] = hc_bytealign_be_S (w3[3], w4[0], offset); w6[2] = hc_bytealign_be_S (w3[2], w3[3], offset); w6[1] = hc_bytealign_be_S (w3[1], w3[2], offset); w6[0] = hc_bytealign_be_S (w3[0], w3[1], offset); w5[3] = hc_bytealign_be_S (w2[3], w3[0], offset); w5[2] = hc_bytealign_be_S (w2[2], w2[3], offset); w5[1] = hc_bytealign_be_S (w2[1], w2[2], offset); w5[0] = hc_bytealign_be_S (w2[0], w2[1], offset); w4[3] = hc_bytealign_be_S (w1[3], w2[0], offset); w4[2] = hc_bytealign_be_S (w1[2], w1[3], offset); w4[1] = hc_bytealign_be_S (w1[1], w1[2], offset); w4[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w3[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w3[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w3[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w3[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w2[3] = hc_bytealign_be_S ( 0, w0[0], offset); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: c3[0] = hc_bytealign_be_S (w7[3], 0, offset); c2[3] = hc_bytealign_be_S (w7[2], w7[3], offset); c2[2] = hc_bytealign_be_S (w7[1], w7[2], offset); c2[1] = hc_bytealign_be_S (w7[0], w7[1], offset); c2[0] = hc_bytealign_be_S (w6[3], w7[0], offset); c1[3] = hc_bytealign_be_S (w6[2], w6[3], offset); c1[2] = hc_bytealign_be_S (w6[1], w6[2], offset); c1[1] = hc_bytealign_be_S (w6[0], w6[1], offset); c1[0] = hc_bytealign_be_S (w5[3], w6[0], offset); c0[3] = hc_bytealign_be_S (w5[2], w5[3], offset); c0[2] = hc_bytealign_be_S (w5[1], w5[2], offset); c0[1] = hc_bytealign_be_S (w5[0], w5[1], offset); c0[0] = hc_bytealign_be_S (w4[3], w5[0], offset); w7[3] = hc_bytealign_be_S (w4[2], w4[3], offset); w7[2] = hc_bytealign_be_S (w4[1], w4[2], offset); w7[1] = hc_bytealign_be_S (w4[0], w4[1], offset); w7[0] = hc_bytealign_be_S (w3[3], w4[0], offset); w6[3] = hc_bytealign_be_S (w3[2], w3[3], offset); w6[2] = hc_bytealign_be_S (w3[1], w3[2], offset); w6[1] = hc_bytealign_be_S (w3[0], w3[1], offset); w6[0] = hc_bytealign_be_S (w2[3], w3[0], offset); w5[3] = hc_bytealign_be_S (w2[2], w2[3], offset); w5[2] = hc_bytealign_be_S (w2[1], w2[2], offset); w5[1] = hc_bytealign_be_S (w2[0], w2[1], offset); w5[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w4[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w4[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w4[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w4[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w3[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w3[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w3[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w3[0] = hc_bytealign_be_S ( 0, w0[0], offset); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: c3[1] = hc_bytealign_be_S (w7[3], 0, offset); c3[0] = hc_bytealign_be_S (w7[2], w7[3], offset); c2[3] = hc_bytealign_be_S (w7[1], w7[2], offset); c2[2] = hc_bytealign_be_S (w7[0], w7[1], offset); c2[1] = hc_bytealign_be_S (w6[3], w7[0], offset); c2[0] = hc_bytealign_be_S (w6[2], w6[3], offset); c1[3] = hc_bytealign_be_S (w6[1], w6[2], offset); c1[2] = hc_bytealign_be_S (w6[0], w6[1], offset); c1[1] = hc_bytealign_be_S (w5[3], w6[0], offset); c1[0] = hc_bytealign_be_S (w5[2], w5[3], offset); c0[3] = hc_bytealign_be_S (w5[1], w5[2], offset); c0[2] = hc_bytealign_be_S (w5[0], w5[1], offset); c0[1] = hc_bytealign_be_S (w4[3], w5[0], offset); c0[0] = hc_bytealign_be_S (w4[2], w4[3], offset); w7[3] = hc_bytealign_be_S (w4[1], w4[2], offset); w7[2] = hc_bytealign_be_S (w4[0], w4[1], offset); w7[1] = hc_bytealign_be_S (w3[3], w4[0], offset); w7[0] = hc_bytealign_be_S (w3[2], w3[3], offset); w6[3] = hc_bytealign_be_S (w3[1], w3[2], offset); w6[2] = hc_bytealign_be_S (w3[0], w3[1], offset); w6[1] = hc_bytealign_be_S (w2[3], w3[0], offset); w6[0] = hc_bytealign_be_S (w2[2], w2[3], offset); w5[3] = hc_bytealign_be_S (w2[1], w2[2], offset); w5[2] = hc_bytealign_be_S (w2[0], w2[1], offset); w5[1] = hc_bytealign_be_S (w1[3], w2[0], offset); w5[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w4[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w4[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w4[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w4[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w3[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w3[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w3[1] = hc_bytealign_be_S ( 0, w0[0], offset); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: c3[2] = hc_bytealign_be_S (w7[3], 0, offset); c3[1] = hc_bytealign_be_S (w7[2], w7[3], offset); c3[0] = hc_bytealign_be_S (w7[1], w7[2], offset); c2[3] = hc_bytealign_be_S (w7[0], w7[1], offset); c2[2] = hc_bytealign_be_S (w6[3], w7[0], offset); c2[1] = hc_bytealign_be_S (w6[2], w6[3], offset); c2[0] = hc_bytealign_be_S (w6[1], w6[2], offset); c1[3] = hc_bytealign_be_S (w6[0], w6[1], offset); c1[2] = hc_bytealign_be_S (w5[3], w6[0], offset); c1[1] = hc_bytealign_be_S (w5[2], w5[3], offset); c1[0] = hc_bytealign_be_S (w5[1], w5[2], offset); c0[3] = hc_bytealign_be_S (w5[0], w5[1], offset); c0[2] = hc_bytealign_be_S (w4[3], w5[0], offset); c0[1] = hc_bytealign_be_S (w4[2], w4[3], offset); c0[0] = hc_bytealign_be_S (w4[1], w4[2], offset); w7[3] = hc_bytealign_be_S (w4[0], w4[1], offset); w7[2] = hc_bytealign_be_S (w3[3], w4[0], offset); w7[1] = hc_bytealign_be_S (w3[2], w3[3], offset); w7[0] = hc_bytealign_be_S (w3[1], w3[2], offset); w6[3] = hc_bytealign_be_S (w3[0], w3[1], offset); w6[2] = hc_bytealign_be_S (w2[3], w3[0], offset); w6[1] = hc_bytealign_be_S (w2[2], w2[3], offset); w6[0] = hc_bytealign_be_S (w2[1], w2[2], offset); w5[3] = hc_bytealign_be_S (w2[0], w2[1], offset); w5[2] = hc_bytealign_be_S (w1[3], w2[0], offset); w5[1] = hc_bytealign_be_S (w1[2], w1[3], offset); w5[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w4[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w4[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w4[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w4[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w3[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w3[2] = hc_bytealign_be_S ( 0, w0[0], offset); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: c3[3] = hc_bytealign_be_S (w7[3], 0, offset); c3[2] = hc_bytealign_be_S (w7[2], w7[3], offset); c3[1] = hc_bytealign_be_S (w7[1], w7[2], offset); c3[0] = hc_bytealign_be_S (w7[0], w7[1], offset); c2[3] = hc_bytealign_be_S (w6[3], w7[0], offset); c2[2] = hc_bytealign_be_S (w6[2], w6[3], offset); c2[1] = hc_bytealign_be_S (w6[1], w6[2], offset); c2[0] = hc_bytealign_be_S (w6[0], w6[1], offset); c1[3] = hc_bytealign_be_S (w5[3], w6[0], offset); c1[2] = hc_bytealign_be_S (w5[2], w5[3], offset); c1[1] = hc_bytealign_be_S (w5[1], w5[2], offset); c1[0] = hc_bytealign_be_S (w5[0], w5[1], offset); c0[3] = hc_bytealign_be_S (w4[3], w5[0], offset); c0[2] = hc_bytealign_be_S (w4[2], w4[3], offset); c0[1] = hc_bytealign_be_S (w4[1], w4[2], offset); c0[0] = hc_bytealign_be_S (w4[0], w4[1], offset); w7[3] = hc_bytealign_be_S (w3[3], w4[0], offset); w7[2] = hc_bytealign_be_S (w3[2], w3[3], offset); w7[1] = hc_bytealign_be_S (w3[1], w3[2], offset); w7[0] = hc_bytealign_be_S (w3[0], w3[1], offset); w6[3] = hc_bytealign_be_S (w2[3], w3[0], offset); w6[2] = hc_bytealign_be_S (w2[2], w2[3], offset); w6[1] = hc_bytealign_be_S (w2[1], w2[2], offset); w6[0] = hc_bytealign_be_S (w2[0], w2[1], offset); w5[3] = hc_bytealign_be_S (w1[3], w2[0], offset); w5[2] = hc_bytealign_be_S (w1[2], w1[3], offset); w5[1] = hc_bytealign_be_S (w1[1], w1[2], offset); w5[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w4[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w4[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w4[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w4[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w3[3] = hc_bytealign_be_S ( 0, w0[0], offset); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 16: c4[0] = hc_bytealign_be_S (w7[3], 0, offset); c3[3] = hc_bytealign_be_S (w7[2], w7[3], offset); c3[2] = hc_bytealign_be_S (w7[1], w7[2], offset); c3[1] = hc_bytealign_be_S (w7[0], w7[1], offset); c3[0] = hc_bytealign_be_S (w6[3], w7[0], offset); c2[3] = hc_bytealign_be_S (w6[2], w6[3], offset); c2[2] = hc_bytealign_be_S (w6[1], w6[2], offset); c2[1] = hc_bytealign_be_S (w6[0], w6[1], offset); c2[0] = hc_bytealign_be_S (w5[3], w6[0], offset); c1[3] = hc_bytealign_be_S (w5[2], w5[3], offset); c1[2] = hc_bytealign_be_S (w5[1], w5[2], offset); c1[1] = hc_bytealign_be_S (w5[0], w5[1], offset); c1[0] = hc_bytealign_be_S (w4[3], w5[0], offset); c0[3] = hc_bytealign_be_S (w4[2], w4[3], offset); c0[2] = hc_bytealign_be_S (w4[1], w4[2], offset); c0[1] = hc_bytealign_be_S (w4[0], w4[1], offset); c0[0] = hc_bytealign_be_S (w3[3], w4[0], offset); w7[3] = hc_bytealign_be_S (w3[2], w3[3], offset); w7[2] = hc_bytealign_be_S (w3[1], w3[2], offset); w7[1] = hc_bytealign_be_S (w3[0], w3[1], offset); w7[0] = hc_bytealign_be_S (w2[3], w3[0], offset); w6[3] = hc_bytealign_be_S (w2[2], w2[3], offset); w6[2] = hc_bytealign_be_S (w2[1], w2[2], offset); w6[1] = hc_bytealign_be_S (w2[0], w2[1], offset); w6[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w5[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w5[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w5[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w5[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w4[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w4[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w4[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w4[0] = hc_bytealign_be_S ( 0, w0[0], offset); w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 17: c4[1] = hc_bytealign_be_S (w7[3], 0, offset); c4[0] = hc_bytealign_be_S (w7[2], w7[3], offset); c3[3] = hc_bytealign_be_S (w7[1], w7[2], offset); c3[2] = hc_bytealign_be_S (w7[0], w7[1], offset); c3[1] = hc_bytealign_be_S (w6[3], w7[0], offset); c3[0] = hc_bytealign_be_S (w6[2], w6[3], offset); c2[3] = hc_bytealign_be_S (w6[1], w6[2], offset); c2[2] = hc_bytealign_be_S (w6[0], w6[1], offset); c2[1] = hc_bytealign_be_S (w5[3], w6[0], offset); c2[0] = hc_bytealign_be_S (w5[2], w5[3], offset); c1[3] = hc_bytealign_be_S (w5[1], w5[2], offset); c1[2] = hc_bytealign_be_S (w5[0], w5[1], offset); c1[1] = hc_bytealign_be_S (w4[3], w5[0], offset); c1[0] = hc_bytealign_be_S (w4[2], w4[3], offset); c0[3] = hc_bytealign_be_S (w4[1], w4[2], offset); c0[2] = hc_bytealign_be_S (w4[0], w4[1], offset); c0[1] = hc_bytealign_be_S (w3[3], w4[0], offset); c0[0] = hc_bytealign_be_S (w3[2], w3[3], offset); w7[3] = hc_bytealign_be_S (w3[1], w3[2], offset); w7[2] = hc_bytealign_be_S (w3[0], w3[1], offset); w7[1] = hc_bytealign_be_S (w2[3], w3[0], offset); w7[0] = hc_bytealign_be_S (w2[2], w2[3], offset); w6[3] = hc_bytealign_be_S (w2[1], w2[2], offset); w6[2] = hc_bytealign_be_S (w2[0], w2[1], offset); w6[1] = hc_bytealign_be_S (w1[3], w2[0], offset); w6[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w5[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w5[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w5[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w5[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w4[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w4[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w4[1] = hc_bytealign_be_S ( 0, w0[0], offset); w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 18: c4[2] = hc_bytealign_be_S (w7[3], 0, offset); c4[1] = hc_bytealign_be_S (w7[2], w7[3], offset); c4[0] = hc_bytealign_be_S (w7[1], w7[2], offset); c3[3] = hc_bytealign_be_S (w7[0], w7[1], offset); c3[2] = hc_bytealign_be_S (w6[3], w7[0], offset); c3[1] = hc_bytealign_be_S (w6[2], w6[3], offset); c3[0] = hc_bytealign_be_S (w6[1], w6[2], offset); c2[3] = hc_bytealign_be_S (w6[0], w6[1], offset); c2[2] = hc_bytealign_be_S (w5[3], w6[0], offset); c2[1] = hc_bytealign_be_S (w5[2], w5[3], offset); c2[0] = hc_bytealign_be_S (w5[1], w5[2], offset); c1[3] = hc_bytealign_be_S (w5[0], w5[1], offset); c1[2] = hc_bytealign_be_S (w4[3], w5[0], offset); c1[1] = hc_bytealign_be_S (w4[2], w4[3], offset); c1[0] = hc_bytealign_be_S (w4[1], w4[2], offset); c0[3] = hc_bytealign_be_S (w4[0], w4[1], offset); c0[2] = hc_bytealign_be_S (w3[3], w4[0], offset); c0[1] = hc_bytealign_be_S (w3[2], w3[3], offset); c0[0] = hc_bytealign_be_S (w3[1], w3[2], offset); w7[3] = hc_bytealign_be_S (w3[0], w3[1], offset); w7[2] = hc_bytealign_be_S (w2[3], w3[0], offset); w7[1] = hc_bytealign_be_S (w2[2], w2[3], offset); w7[0] = hc_bytealign_be_S (w2[1], w2[2], offset); w6[3] = hc_bytealign_be_S (w2[0], w2[1], offset); w6[2] = hc_bytealign_be_S (w1[3], w2[0], offset); w6[1] = hc_bytealign_be_S (w1[2], w1[3], offset); w6[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w5[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w5[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w5[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w5[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w4[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w4[2] = hc_bytealign_be_S ( 0, w0[0], offset); w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 19: c4[3] = hc_bytealign_be_S (w7[3], 0, offset); c4[2] = hc_bytealign_be_S (w7[2], w7[3], offset); c4[1] = hc_bytealign_be_S (w7[1], w7[2], offset); c4[0] = hc_bytealign_be_S (w7[0], w7[1], offset); c3[3] = hc_bytealign_be_S (w6[3], w7[0], offset); c3[2] = hc_bytealign_be_S (w6[2], w6[3], offset); c3[1] = hc_bytealign_be_S (w6[1], w6[2], offset); c3[0] = hc_bytealign_be_S (w6[0], w6[1], offset); c2[3] = hc_bytealign_be_S (w5[3], w6[0], offset); c2[2] = hc_bytealign_be_S (w5[2], w5[3], offset); c2[1] = hc_bytealign_be_S (w5[1], w5[2], offset); c2[0] = hc_bytealign_be_S (w5[0], w5[1], offset); c1[3] = hc_bytealign_be_S (w4[3], w5[0], offset); c1[2] = hc_bytealign_be_S (w4[2], w4[3], offset); c1[1] = hc_bytealign_be_S (w4[1], w4[2], offset); c1[0] = hc_bytealign_be_S (w4[0], w4[1], offset); c0[3] = hc_bytealign_be_S (w3[3], w4[0], offset); c0[2] = hc_bytealign_be_S (w3[2], w3[3], offset); c0[1] = hc_bytealign_be_S (w3[1], w3[2], offset); c0[0] = hc_bytealign_be_S (w3[0], w3[1], offset); w7[3] = hc_bytealign_be_S (w2[3], w3[0], offset); w7[2] = hc_bytealign_be_S (w2[2], w2[3], offset); w7[1] = hc_bytealign_be_S (w2[1], w2[2], offset); w7[0] = hc_bytealign_be_S (w2[0], w2[1], offset); w6[3] = hc_bytealign_be_S (w1[3], w2[0], offset); w6[2] = hc_bytealign_be_S (w1[2], w1[3], offset); w6[1] = hc_bytealign_be_S (w1[1], w1[2], offset); w6[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w5[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w5[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w5[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w5[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w4[3] = hc_bytealign_be_S ( 0, w0[0], offset); w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 20: c5[0] = hc_bytealign_be_S (w7[3], 0, offset); c4[3] = hc_bytealign_be_S (w7[2], w7[3], offset); c4[2] = hc_bytealign_be_S (w7[1], w7[2], offset); c4[1] = hc_bytealign_be_S (w7[0], w7[1], offset); c4[0] = hc_bytealign_be_S (w6[3], w7[0], offset); c3[3] = hc_bytealign_be_S (w6[2], w6[3], offset); c3[2] = hc_bytealign_be_S (w6[1], w6[2], offset); c3[1] = hc_bytealign_be_S (w6[0], w6[1], offset); c3[0] = hc_bytealign_be_S (w5[3], w6[0], offset); c2[3] = hc_bytealign_be_S (w5[2], w5[3], offset); c2[2] = hc_bytealign_be_S (w5[1], w5[2], offset); c2[1] = hc_bytealign_be_S (w5[0], w5[1], offset); c2[0] = hc_bytealign_be_S (w4[3], w5[0], offset); c1[3] = hc_bytealign_be_S (w4[2], w4[3], offset); c1[2] = hc_bytealign_be_S (w4[1], w4[2], offset); c1[1] = hc_bytealign_be_S (w4[0], w4[1], offset); c1[0] = hc_bytealign_be_S (w3[3], w4[0], offset); c0[3] = hc_bytealign_be_S (w3[2], w3[3], offset); c0[2] = hc_bytealign_be_S (w3[1], w3[2], offset); c0[1] = hc_bytealign_be_S (w3[0], w3[1], offset); c0[0] = hc_bytealign_be_S (w2[3], w3[0], offset); w7[3] = hc_bytealign_be_S (w2[2], w2[3], offset); w7[2] = hc_bytealign_be_S (w2[1], w2[2], offset); w7[1] = hc_bytealign_be_S (w2[0], w2[1], offset); w7[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w6[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w6[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w6[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w6[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w5[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w5[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w5[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w5[0] = hc_bytealign_be_S ( 0, w0[0], offset); w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 21: c5[1] = hc_bytealign_be_S (w7[3], 0, offset); c5[0] = hc_bytealign_be_S (w7[2], w7[3], offset); c4[3] = hc_bytealign_be_S (w7[1], w7[2], offset); c4[2] = hc_bytealign_be_S (w7[0], w7[1], offset); c4[1] = hc_bytealign_be_S (w6[3], w7[0], offset); c4[0] = hc_bytealign_be_S (w6[2], w6[3], offset); c3[3] = hc_bytealign_be_S (w6[1], w6[2], offset); c3[2] = hc_bytealign_be_S (w6[0], w6[1], offset); c3[1] = hc_bytealign_be_S (w5[3], w6[0], offset); c3[0] = hc_bytealign_be_S (w5[2], w5[3], offset); c2[3] = hc_bytealign_be_S (w5[1], w5[2], offset); c2[2] = hc_bytealign_be_S (w5[0], w5[1], offset); c2[1] = hc_bytealign_be_S (w4[3], w5[0], offset); c2[0] = hc_bytealign_be_S (w4[2], w4[3], offset); c1[3] = hc_bytealign_be_S (w4[1], w4[2], offset); c1[2] = hc_bytealign_be_S (w4[0], w4[1], offset); c1[1] = hc_bytealign_be_S (w3[3], w4[0], offset); c1[0] = hc_bytealign_be_S (w3[2], w3[3], offset); c0[3] = hc_bytealign_be_S (w3[1], w3[2], offset); c0[2] = hc_bytealign_be_S (w3[0], w3[1], offset); c0[1] = hc_bytealign_be_S (w2[3], w3[0], offset); c0[0] = hc_bytealign_be_S (w2[2], w2[3], offset); w7[3] = hc_bytealign_be_S (w2[1], w2[2], offset); w7[2] = hc_bytealign_be_S (w2[0], w2[1], offset); w7[1] = hc_bytealign_be_S (w1[3], w2[0], offset); w7[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w6[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w6[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w6[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w6[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w5[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w5[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w5[1] = hc_bytealign_be_S ( 0, w0[0], offset); w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 22: c5[2] = hc_bytealign_be_S (w7[3], 0, offset); c5[1] = hc_bytealign_be_S (w7[2], w7[3], offset); c5[0] = hc_bytealign_be_S (w7[1], w7[2], offset); c4[3] = hc_bytealign_be_S (w7[0], w7[1], offset); c4[2] = hc_bytealign_be_S (w6[3], w7[0], offset); c4[1] = hc_bytealign_be_S (w6[2], w6[3], offset); c4[0] = hc_bytealign_be_S (w6[1], w6[2], offset); c3[3] = hc_bytealign_be_S (w6[0], w6[1], offset); c3[2] = hc_bytealign_be_S (w5[3], w6[0], offset); c3[1] = hc_bytealign_be_S (w5[2], w5[3], offset); c3[0] = hc_bytealign_be_S (w5[1], w5[2], offset); c2[3] = hc_bytealign_be_S (w5[0], w5[1], offset); c2[2] = hc_bytealign_be_S (w4[3], w5[0], offset); c2[1] = hc_bytealign_be_S (w4[2], w4[3], offset); c2[0] = hc_bytealign_be_S (w4[1], w4[2], offset); c1[3] = hc_bytealign_be_S (w4[0], w4[1], offset); c1[2] = hc_bytealign_be_S (w3[3], w4[0], offset); c1[1] = hc_bytealign_be_S (w3[2], w3[3], offset); c1[0] = hc_bytealign_be_S (w3[1], w3[2], offset); c0[3] = hc_bytealign_be_S (w3[0], w3[1], offset); c0[2] = hc_bytealign_be_S (w2[3], w3[0], offset); c0[1] = hc_bytealign_be_S (w2[2], w2[3], offset); c0[0] = hc_bytealign_be_S (w2[1], w2[2], offset); w7[3] = hc_bytealign_be_S (w2[0], w2[1], offset); w7[2] = hc_bytealign_be_S (w1[3], w2[0], offset); w7[1] = hc_bytealign_be_S (w1[2], w1[3], offset); w7[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w6[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w6[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w6[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w6[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w5[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w5[2] = hc_bytealign_be_S ( 0, w0[0], offset); w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 23: c5[3] = hc_bytealign_be_S (w7[3], 0, offset); c5[2] = hc_bytealign_be_S (w7[2], w7[3], offset); c5[1] = hc_bytealign_be_S (w7[1], w7[2], offset); c5[0] = hc_bytealign_be_S (w7[0], w7[1], offset); c4[3] = hc_bytealign_be_S (w6[3], w7[0], offset); c4[2] = hc_bytealign_be_S (w6[2], w6[3], offset); c4[1] = hc_bytealign_be_S (w6[1], w6[2], offset); c4[0] = hc_bytealign_be_S (w6[0], w6[1], offset); c3[3] = hc_bytealign_be_S (w5[3], w6[0], offset); c3[2] = hc_bytealign_be_S (w5[2], w5[3], offset); c3[1] = hc_bytealign_be_S (w5[1], w5[2], offset); c3[0] = hc_bytealign_be_S (w5[0], w5[1], offset); c2[3] = hc_bytealign_be_S (w4[3], w5[0], offset); c2[2] = hc_bytealign_be_S (w4[2], w4[3], offset); c2[1] = hc_bytealign_be_S (w4[1], w4[2], offset); c2[0] = hc_bytealign_be_S (w4[0], w4[1], offset); c1[3] = hc_bytealign_be_S (w3[3], w4[0], offset); c1[2] = hc_bytealign_be_S (w3[2], w3[3], offset); c1[1] = hc_bytealign_be_S (w3[1], w3[2], offset); c1[0] = hc_bytealign_be_S (w3[0], w3[1], offset); c0[3] = hc_bytealign_be_S (w2[3], w3[0], offset); c0[2] = hc_bytealign_be_S (w2[2], w2[3], offset); c0[1] = hc_bytealign_be_S (w2[1], w2[2], offset); c0[0] = hc_bytealign_be_S (w2[0], w2[1], offset); w7[3] = hc_bytealign_be_S (w1[3], w2[0], offset); w7[2] = hc_bytealign_be_S (w1[2], w1[3], offset); w7[1] = hc_bytealign_be_S (w1[1], w1[2], offset); w7[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w6[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w6[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w6[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w6[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w5[3] = hc_bytealign_be_S ( 0, w0[0], offset); w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 24: c6[0] = hc_bytealign_be_S (w7[3], 0, offset); c5[3] = hc_bytealign_be_S (w7[2], w7[3], offset); c5[2] = hc_bytealign_be_S (w7[1], w7[2], offset); c5[1] = hc_bytealign_be_S (w7[0], w7[1], offset); c5[0] = hc_bytealign_be_S (w6[3], w7[0], offset); c4[3] = hc_bytealign_be_S (w6[2], w6[3], offset); c4[2] = hc_bytealign_be_S (w6[1], w6[2], offset); c4[1] = hc_bytealign_be_S (w6[0], w6[1], offset); c4[0] = hc_bytealign_be_S (w5[3], w6[0], offset); c3[3] = hc_bytealign_be_S (w5[2], w5[3], offset); c3[2] = hc_bytealign_be_S (w5[1], w5[2], offset); c3[1] = hc_bytealign_be_S (w5[0], w5[1], offset); c3[0] = hc_bytealign_be_S (w4[3], w5[0], offset); c2[3] = hc_bytealign_be_S (w4[2], w4[3], offset); c2[2] = hc_bytealign_be_S (w4[1], w4[2], offset); c2[1] = hc_bytealign_be_S (w4[0], w4[1], offset); c2[0] = hc_bytealign_be_S (w3[3], w4[0], offset); c1[3] = hc_bytealign_be_S (w3[2], w3[3], offset); c1[2] = hc_bytealign_be_S (w3[1], w3[2], offset); c1[1] = hc_bytealign_be_S (w3[0], w3[1], offset); c1[0] = hc_bytealign_be_S (w2[3], w3[0], offset); c0[3] = hc_bytealign_be_S (w2[2], w2[3], offset); c0[2] = hc_bytealign_be_S (w2[1], w2[2], offset); c0[1] = hc_bytealign_be_S (w2[0], w2[1], offset); c0[0] = hc_bytealign_be_S (w1[3], w2[0], offset); w7[3] = hc_bytealign_be_S (w1[2], w1[3], offset); w7[2] = hc_bytealign_be_S (w1[1], w1[2], offset); w7[1] = hc_bytealign_be_S (w1[0], w1[1], offset); w7[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w6[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w6[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w6[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w6[0] = hc_bytealign_be_S ( 0, w0[0], offset); w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 25: c6[1] = hc_bytealign_be_S (w7[3], 0, offset); c6[0] = hc_bytealign_be_S (w7[2], w7[3], offset); c5[3] = hc_bytealign_be_S (w7[1], w7[2], offset); c5[2] = hc_bytealign_be_S (w7[0], w7[1], offset); c5[1] = hc_bytealign_be_S (w6[3], w7[0], offset); c5[0] = hc_bytealign_be_S (w6[2], w6[3], offset); c4[3] = hc_bytealign_be_S (w6[1], w6[2], offset); c4[2] = hc_bytealign_be_S (w6[0], w6[1], offset); c4[1] = hc_bytealign_be_S (w5[3], w6[0], offset); c4[0] = hc_bytealign_be_S (w5[2], w5[3], offset); c3[3] = hc_bytealign_be_S (w5[1], w5[2], offset); c3[2] = hc_bytealign_be_S (w5[0], w5[1], offset); c3[1] = hc_bytealign_be_S (w4[3], w5[0], offset); c3[0] = hc_bytealign_be_S (w4[2], w4[3], offset); c2[3] = hc_bytealign_be_S (w4[1], w4[2], offset); c2[2] = hc_bytealign_be_S (w4[0], w4[1], offset); c2[1] = hc_bytealign_be_S (w3[3], w4[0], offset); c2[0] = hc_bytealign_be_S (w3[2], w3[3], offset); c1[3] = hc_bytealign_be_S (w3[1], w3[2], offset); c1[2] = hc_bytealign_be_S (w3[0], w3[1], offset); c1[1] = hc_bytealign_be_S (w2[3], w3[0], offset); c1[0] = hc_bytealign_be_S (w2[2], w2[3], offset); c0[3] = hc_bytealign_be_S (w2[1], w2[2], offset); c0[2] = hc_bytealign_be_S (w2[0], w2[1], offset); c0[1] = hc_bytealign_be_S (w1[3], w2[0], offset); c0[0] = hc_bytealign_be_S (w1[2], w1[3], offset); w7[3] = hc_bytealign_be_S (w1[1], w1[2], offset); w7[2] = hc_bytealign_be_S (w1[0], w1[1], offset); w7[1] = hc_bytealign_be_S (w0[3], w1[0], offset); w7[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w6[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w6[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w6[1] = hc_bytealign_be_S ( 0, w0[0], offset); w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 26: c6[2] = hc_bytealign_be_S (w7[3], 0, offset); c6[1] = hc_bytealign_be_S (w7[2], w7[3], offset); c6[0] = hc_bytealign_be_S (w7[1], w7[2], offset); c5[3] = hc_bytealign_be_S (w7[0], w7[1], offset); c5[2] = hc_bytealign_be_S (w6[3], w7[0], offset); c5[1] = hc_bytealign_be_S (w6[2], w6[3], offset); c5[0] = hc_bytealign_be_S (w6[1], w6[2], offset); c4[3] = hc_bytealign_be_S (w6[0], w6[1], offset); c4[2] = hc_bytealign_be_S (w5[3], w6[0], offset); c4[1] = hc_bytealign_be_S (w5[2], w5[3], offset); c4[0] = hc_bytealign_be_S (w5[1], w5[2], offset); c3[3] = hc_bytealign_be_S (w5[0], w5[1], offset); c3[2] = hc_bytealign_be_S (w4[3], w5[0], offset); c3[1] = hc_bytealign_be_S (w4[2], w4[3], offset); c3[0] = hc_bytealign_be_S (w4[1], w4[2], offset); c2[3] = hc_bytealign_be_S (w4[0], w4[1], offset); c2[2] = hc_bytealign_be_S (w3[3], w4[0], offset); c2[1] = hc_bytealign_be_S (w3[2], w3[3], offset); c2[0] = hc_bytealign_be_S (w3[1], w3[2], offset); c1[3] = hc_bytealign_be_S (w3[0], w3[1], offset); c1[2] = hc_bytealign_be_S (w2[3], w3[0], offset); c1[1] = hc_bytealign_be_S (w2[2], w2[3], offset); c1[0] = hc_bytealign_be_S (w2[1], w2[2], offset); c0[3] = hc_bytealign_be_S (w2[0], w2[1], offset); c0[2] = hc_bytealign_be_S (w1[3], w2[0], offset); c0[1] = hc_bytealign_be_S (w1[2], w1[3], offset); c0[0] = hc_bytealign_be_S (w1[1], w1[2], offset); w7[3] = hc_bytealign_be_S (w1[0], w1[1], offset); w7[2] = hc_bytealign_be_S (w0[3], w1[0], offset); w7[1] = hc_bytealign_be_S (w0[2], w0[3], offset); w7[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w6[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w6[2] = hc_bytealign_be_S ( 0, w0[0], offset); w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 27: c6[3] = hc_bytealign_be_S (w7[3], 0, offset); c6[2] = hc_bytealign_be_S (w7[2], w7[3], offset); c6[1] = hc_bytealign_be_S (w7[1], w7[2], offset); c6[0] = hc_bytealign_be_S (w7[0], w7[1], offset); c5[3] = hc_bytealign_be_S (w6[3], w7[0], offset); c5[2] = hc_bytealign_be_S (w6[2], w6[3], offset); c5[1] = hc_bytealign_be_S (w6[1], w6[2], offset); c5[0] = hc_bytealign_be_S (w6[0], w6[1], offset); c4[3] = hc_bytealign_be_S (w5[3], w6[0], offset); c4[2] = hc_bytealign_be_S (w5[2], w5[3], offset); c4[1] = hc_bytealign_be_S (w5[1], w5[2], offset); c4[0] = hc_bytealign_be_S (w5[0], w5[1], offset); c3[3] = hc_bytealign_be_S (w4[3], w5[0], offset); c3[2] = hc_bytealign_be_S (w4[2], w4[3], offset); c3[1] = hc_bytealign_be_S (w4[1], w4[2], offset); c3[0] = hc_bytealign_be_S (w4[0], w4[1], offset); c2[3] = hc_bytealign_be_S (w3[3], w4[0], offset); c2[2] = hc_bytealign_be_S (w3[2], w3[3], offset); c2[1] = hc_bytealign_be_S (w3[1], w3[2], offset); c2[0] = hc_bytealign_be_S (w3[0], w3[1], offset); c1[3] = hc_bytealign_be_S (w2[3], w3[0], offset); c1[2] = hc_bytealign_be_S (w2[2], w2[3], offset); c1[1] = hc_bytealign_be_S (w2[1], w2[2], offset); c1[0] = hc_bytealign_be_S (w2[0], w2[1], offset); c0[3] = hc_bytealign_be_S (w1[3], w2[0], offset); c0[2] = hc_bytealign_be_S (w1[2], w1[3], offset); c0[1] = hc_bytealign_be_S (w1[1], w1[2], offset); c0[0] = hc_bytealign_be_S (w1[0], w1[1], offset); w7[3] = hc_bytealign_be_S (w0[3], w1[0], offset); w7[2] = hc_bytealign_be_S (w0[2], w0[3], offset); w7[1] = hc_bytealign_be_S (w0[1], w0[2], offset); w7[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w6[3] = hc_bytealign_be_S ( 0, w0[0], offset); w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 28: c7[0] = hc_bytealign_be_S (w7[3], 0, offset); c6[3] = hc_bytealign_be_S (w7[2], w7[3], offset); c6[2] = hc_bytealign_be_S (w7[1], w7[2], offset); c6[1] = hc_bytealign_be_S (w7[0], w7[1], offset); c6[0] = hc_bytealign_be_S (w6[3], w7[0], offset); c5[3] = hc_bytealign_be_S (w6[2], w6[3], offset); c5[2] = hc_bytealign_be_S (w6[1], w6[2], offset); c5[1] = hc_bytealign_be_S (w6[0], w6[1], offset); c5[0] = hc_bytealign_be_S (w5[3], w6[0], offset); c4[3] = hc_bytealign_be_S (w5[2], w5[3], offset); c4[2] = hc_bytealign_be_S (w5[1], w5[2], offset); c4[1] = hc_bytealign_be_S (w5[0], w5[1], offset); c4[0] = hc_bytealign_be_S (w4[3], w5[0], offset); c3[3] = hc_bytealign_be_S (w4[2], w4[3], offset); c3[2] = hc_bytealign_be_S (w4[1], w4[2], offset); c3[1] = hc_bytealign_be_S (w4[0], w4[1], offset); c3[0] = hc_bytealign_be_S (w3[3], w4[0], offset); c2[3] = hc_bytealign_be_S (w3[2], w3[3], offset); c2[2] = hc_bytealign_be_S (w3[1], w3[2], offset); c2[1] = hc_bytealign_be_S (w3[0], w3[1], offset); c2[0] = hc_bytealign_be_S (w2[3], w3[0], offset); c1[3] = hc_bytealign_be_S (w2[2], w2[3], offset); c1[2] = hc_bytealign_be_S (w2[1], w2[2], offset); c1[1] = hc_bytealign_be_S (w2[0], w2[1], offset); c1[0] = hc_bytealign_be_S (w1[3], w2[0], offset); c0[3] = hc_bytealign_be_S (w1[2], w1[3], offset); c0[2] = hc_bytealign_be_S (w1[1], w1[2], offset); c0[1] = hc_bytealign_be_S (w1[0], w1[1], offset); c0[0] = hc_bytealign_be_S (w0[3], w1[0], offset); w7[3] = hc_bytealign_be_S (w0[2], w0[3], offset); w7[2] = hc_bytealign_be_S (w0[1], w0[2], offset); w7[1] = hc_bytealign_be_S (w0[0], w0[1], offset); w7[0] = hc_bytealign_be_S ( 0, w0[0], offset); w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 29: c7[1] = hc_bytealign_be_S (w7[3], 0, offset); c7[0] = hc_bytealign_be_S (w7[2], w7[3], offset); c6[3] = hc_bytealign_be_S (w7[1], w7[2], offset); c6[2] = hc_bytealign_be_S (w7[0], w7[1], offset); c6[1] = hc_bytealign_be_S (w6[3], w7[0], offset); c6[0] = hc_bytealign_be_S (w6[2], w6[3], offset); c5[3] = hc_bytealign_be_S (w6[1], w6[2], offset); c5[2] = hc_bytealign_be_S (w6[0], w6[1], offset); c5[1] = hc_bytealign_be_S (w5[3], w6[0], offset); c5[0] = hc_bytealign_be_S (w5[2], w5[3], offset); c4[3] = hc_bytealign_be_S (w5[1], w5[2], offset); c4[2] = hc_bytealign_be_S (w5[0], w5[1], offset); c4[1] = hc_bytealign_be_S (w4[3], w5[0], offset); c4[0] = hc_bytealign_be_S (w4[2], w4[3], offset); c3[3] = hc_bytealign_be_S (w4[1], w4[2], offset); c3[2] = hc_bytealign_be_S (w4[0], w4[1], offset); c3[1] = hc_bytealign_be_S (w3[3], w4[0], offset); c3[0] = hc_bytealign_be_S (w3[2], w3[3], offset); c2[3] = hc_bytealign_be_S (w3[1], w3[2], offset); c2[2] = hc_bytealign_be_S (w3[0], w3[1], offset); c2[1] = hc_bytealign_be_S (w2[3], w3[0], offset); c2[0] = hc_bytealign_be_S (w2[2], w2[3], offset); c1[3] = hc_bytealign_be_S (w2[1], w2[2], offset); c1[2] = hc_bytealign_be_S (w2[0], w2[1], offset); c1[1] = hc_bytealign_be_S (w1[3], w2[0], offset); c1[0] = hc_bytealign_be_S (w1[2], w1[3], offset); c0[3] = hc_bytealign_be_S (w1[1], w1[2], offset); c0[2] = hc_bytealign_be_S (w1[0], w1[1], offset); c0[1] = hc_bytealign_be_S (w0[3], w1[0], offset); c0[0] = hc_bytealign_be_S (w0[2], w0[3], offset); w7[3] = hc_bytealign_be_S (w0[1], w0[2], offset); w7[2] = hc_bytealign_be_S (w0[0], w0[1], offset); w7[1] = hc_bytealign_be_S ( 0, w0[0], offset); w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 30: c7[2] = hc_bytealign_be_S (w7[3], 0, offset); c7[1] = hc_bytealign_be_S (w7[2], w7[3], offset); c7[0] = hc_bytealign_be_S (w7[1], w7[2], offset); c6[3] = hc_bytealign_be_S (w7[0], w7[1], offset); c6[2] = hc_bytealign_be_S (w6[3], w7[0], offset); c6[1] = hc_bytealign_be_S (w6[2], w6[3], offset); c6[0] = hc_bytealign_be_S (w6[1], w6[2], offset); c5[3] = hc_bytealign_be_S (w6[0], w6[1], offset); c5[2] = hc_bytealign_be_S (w5[3], w6[0], offset); c5[1] = hc_bytealign_be_S (w5[2], w5[3], offset); c5[0] = hc_bytealign_be_S (w5[1], w5[2], offset); c4[3] = hc_bytealign_be_S (w5[0], w5[1], offset); c4[2] = hc_bytealign_be_S (w4[3], w5[0], offset); c4[1] = hc_bytealign_be_S (w4[2], w4[3], offset); c4[0] = hc_bytealign_be_S (w4[1], w4[2], offset); c3[3] = hc_bytealign_be_S (w4[0], w4[1], offset); c3[2] = hc_bytealign_be_S (w3[3], w4[0], offset); c3[1] = hc_bytealign_be_S (w3[2], w3[3], offset); c3[0] = hc_bytealign_be_S (w3[1], w3[2], offset); c2[3] = hc_bytealign_be_S (w3[0], w3[1], offset); c2[2] = hc_bytealign_be_S (w2[3], w3[0], offset); c2[1] = hc_bytealign_be_S (w2[2], w2[3], offset); c2[0] = hc_bytealign_be_S (w2[1], w2[2], offset); c1[3] = hc_bytealign_be_S (w2[0], w2[1], offset); c1[2] = hc_bytealign_be_S (w1[3], w2[0], offset); c1[1] = hc_bytealign_be_S (w1[2], w1[3], offset); c1[0] = hc_bytealign_be_S (w1[1], w1[2], offset); c0[3] = hc_bytealign_be_S (w1[0], w1[1], offset); c0[2] = hc_bytealign_be_S (w0[3], w1[0], offset); c0[1] = hc_bytealign_be_S (w0[2], w0[3], offset); c0[0] = hc_bytealign_be_S (w0[1], w0[2], offset); w7[3] = hc_bytealign_be_S (w0[0], w0[1], offset); w7[2] = hc_bytealign_be_S ( 0, w0[0], offset); w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 31: c7[3] = hc_bytealign_be_S (w7[3], 0, offset); c7[2] = hc_bytealign_be_S (w7[2], w7[3], offset); c7[1] = hc_bytealign_be_S (w7[1], w7[2], offset); c7[0] = hc_bytealign_be_S (w7[0], w7[1], offset); c6[3] = hc_bytealign_be_S (w6[3], w7[0], offset); c6[2] = hc_bytealign_be_S (w6[2], w6[3], offset); c6[1] = hc_bytealign_be_S (w6[1], w6[2], offset); c6[0] = hc_bytealign_be_S (w6[0], w6[1], offset); c5[3] = hc_bytealign_be_S (w5[3], w6[0], offset); c5[2] = hc_bytealign_be_S (w5[2], w5[3], offset); c5[1] = hc_bytealign_be_S (w5[1], w5[2], offset); c5[0] = hc_bytealign_be_S (w5[0], w5[1], offset); c4[3] = hc_bytealign_be_S (w4[3], w5[0], offset); c4[2] = hc_bytealign_be_S (w4[2], w4[3], offset); c4[1] = hc_bytealign_be_S (w4[1], w4[2], offset); c4[0] = hc_bytealign_be_S (w4[0], w4[1], offset); c3[3] = hc_bytealign_be_S (w3[3], w4[0], offset); c3[2] = hc_bytealign_be_S (w3[2], w3[3], offset); c3[1] = hc_bytealign_be_S (w3[1], w3[2], offset); c3[0] = hc_bytealign_be_S (w3[0], w3[1], offset); c2[3] = hc_bytealign_be_S (w2[3], w3[0], offset); c2[2] = hc_bytealign_be_S (w2[2], w2[3], offset); c2[1] = hc_bytealign_be_S (w2[1], w2[2], offset); c2[0] = hc_bytealign_be_S (w2[0], w2[1], offset); c1[3] = hc_bytealign_be_S (w1[3], w2[0], offset); c1[2] = hc_bytealign_be_S (w1[2], w1[3], offset); c1[1] = hc_bytealign_be_S (w1[1], w1[2], offset); c1[0] = hc_bytealign_be_S (w1[0], w1[1], offset); c0[3] = hc_bytealign_be_S (w0[3], w1[0], offset); c0[2] = hc_bytealign_be_S (w0[2], w0[3], offset); c0[1] = hc_bytealign_be_S (w0[1], w0[2], offset); c0[0] = hc_bytealign_be_S (w0[0], w0[1], offset); w7[3] = hc_bytealign_be_S ( 0, w0[0], offset); w7[2] = 0; w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV #if defined IS_NV const int selector = (0x76543210 >> ((offset & 3) * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> ((offset & 3) * 8)); #endif switch (offset_switch) { case 0: c0[0] = hc_byte_perm_S ( 0, w7[3], selector); w7[3] = hc_byte_perm_S (w7[3], w7[2], selector); w7[2] = hc_byte_perm_S (w7[2], w7[1], selector); w7[1] = hc_byte_perm_S (w7[1], w7[0], selector); w7[0] = hc_byte_perm_S (w7[0], w6[3], selector); w6[3] = hc_byte_perm_S (w6[3], w6[2], selector); w6[2] = hc_byte_perm_S (w6[2], w6[1], selector); w6[1] = hc_byte_perm_S (w6[1], w6[0], selector); w6[0] = hc_byte_perm_S (w6[0], w5[3], selector); w5[3] = hc_byte_perm_S (w5[3], w5[2], selector); w5[2] = hc_byte_perm_S (w5[2], w5[1], selector); w5[1] = hc_byte_perm_S (w5[1], w5[0], selector); w5[0] = hc_byte_perm_S (w5[0], w4[3], selector); w4[3] = hc_byte_perm_S (w4[3], w4[2], selector); w4[2] = hc_byte_perm_S (w4[2], w4[1], selector); w4[1] = hc_byte_perm_S (w4[1], w4[0], selector); w4[0] = hc_byte_perm_S (w4[0], w3[3], selector); w3[3] = hc_byte_perm_S (w3[3], w3[2], selector); w3[2] = hc_byte_perm_S (w3[2], w3[1], selector); w3[1] = hc_byte_perm_S (w3[1], w3[0], selector); w3[0] = hc_byte_perm_S (w3[0], w2[3], selector); w2[3] = hc_byte_perm_S (w2[3], w2[2], selector); w2[2] = hc_byte_perm_S (w2[2], w2[1], selector); w2[1] = hc_byte_perm_S (w2[1], w2[0], selector); w2[0] = hc_byte_perm_S (w2[0], w1[3], selector); w1[3] = hc_byte_perm_S (w1[3], w1[2], selector); w1[2] = hc_byte_perm_S (w1[2], w1[1], selector); w1[1] = hc_byte_perm_S (w1[1], w1[0], selector); w1[0] = hc_byte_perm_S (w1[0], w0[3], selector); w0[3] = hc_byte_perm_S (w0[3], w0[2], selector); w0[2] = hc_byte_perm_S (w0[2], w0[1], selector); w0[1] = hc_byte_perm_S (w0[1], w0[0], selector); w0[0] = hc_byte_perm_S (w0[0], 0, selector); break; case 1: c0[1] = hc_byte_perm_S ( 0, w7[3], selector); c0[0] = hc_byte_perm_S (w7[3], w7[2], selector); w7[3] = hc_byte_perm_S (w7[2], w7[1], selector); w7[2] = hc_byte_perm_S (w7[1], w7[0], selector); w7[1] = hc_byte_perm_S (w7[0], w6[3], selector); w7[0] = hc_byte_perm_S (w6[3], w6[2], selector); w6[3] = hc_byte_perm_S (w6[2], w6[1], selector); w6[2] = hc_byte_perm_S (w6[1], w6[0], selector); w6[1] = hc_byte_perm_S (w6[0], w5[3], selector); w6[0] = hc_byte_perm_S (w5[3], w5[2], selector); w5[3] = hc_byte_perm_S (w5[2], w5[1], selector); w5[2] = hc_byte_perm_S (w5[1], w5[0], selector); w5[1] = hc_byte_perm_S (w5[0], w4[3], selector); w5[0] = hc_byte_perm_S (w4[3], w4[2], selector); w4[3] = hc_byte_perm_S (w4[2], w4[1], selector); w4[2] = hc_byte_perm_S (w4[1], w4[0], selector); w4[1] = hc_byte_perm_S (w4[0], w3[3], selector); w4[0] = hc_byte_perm_S (w3[3], w3[2], selector); w3[3] = hc_byte_perm_S (w3[2], w3[1], selector); w3[2] = hc_byte_perm_S (w3[1], w3[0], selector); w3[1] = hc_byte_perm_S (w3[0], w2[3], selector); w3[0] = hc_byte_perm_S (w2[3], w2[2], selector); w2[3] = hc_byte_perm_S (w2[2], w2[1], selector); w2[2] = hc_byte_perm_S (w2[1], w2[0], selector); w2[1] = hc_byte_perm_S (w2[0], w1[3], selector); w2[0] = hc_byte_perm_S (w1[3], w1[2], selector); w1[3] = hc_byte_perm_S (w1[2], w1[1], selector); w1[2] = hc_byte_perm_S (w1[1], w1[0], selector); w1[1] = hc_byte_perm_S (w1[0], w0[3], selector); w1[0] = hc_byte_perm_S (w0[3], w0[2], selector); w0[3] = hc_byte_perm_S (w0[2], w0[1], selector); w0[2] = hc_byte_perm_S (w0[1], w0[0], selector); w0[1] = hc_byte_perm_S (w0[0], 0, selector); w0[0] = 0; break; case 2: c0[2] = hc_byte_perm_S ( 0, w7[3], selector); c0[1] = hc_byte_perm_S (w7[3], w7[2], selector); c0[0] = hc_byte_perm_S (w7[2], w7[1], selector); w7[3] = hc_byte_perm_S (w7[1], w7[0], selector); w7[2] = hc_byte_perm_S (w7[0], w6[3], selector); w7[1] = hc_byte_perm_S (w6[3], w6[2], selector); w7[0] = hc_byte_perm_S (w6[2], w6[1], selector); w6[3] = hc_byte_perm_S (w6[1], w6[0], selector); w6[2] = hc_byte_perm_S (w6[0], w5[3], selector); w6[1] = hc_byte_perm_S (w5[3], w5[2], selector); w6[0] = hc_byte_perm_S (w5[2], w5[1], selector); w5[3] = hc_byte_perm_S (w5[1], w5[0], selector); w5[2] = hc_byte_perm_S (w5[0], w4[3], selector); w5[1] = hc_byte_perm_S (w4[3], w4[2], selector); w5[0] = hc_byte_perm_S (w4[2], w4[1], selector); w4[3] = hc_byte_perm_S (w4[1], w4[0], selector); w4[2] = hc_byte_perm_S (w4[0], w3[3], selector); w4[1] = hc_byte_perm_S (w3[3], w3[2], selector); w4[0] = hc_byte_perm_S (w3[2], w3[1], selector); w3[3] = hc_byte_perm_S (w3[1], w3[0], selector); w3[2] = hc_byte_perm_S (w3[0], w2[3], selector); w3[1] = hc_byte_perm_S (w2[3], w2[2], selector); w3[0] = hc_byte_perm_S (w2[2], w2[1], selector); w2[3] = hc_byte_perm_S (w2[1], w2[0], selector); w2[2] = hc_byte_perm_S (w2[0], w1[3], selector); w2[1] = hc_byte_perm_S (w1[3], w1[2], selector); w2[0] = hc_byte_perm_S (w1[2], w1[1], selector); w1[3] = hc_byte_perm_S (w1[1], w1[0], selector); w1[2] = hc_byte_perm_S (w1[0], w0[3], selector); w1[1] = hc_byte_perm_S (w0[3], w0[2], selector); w1[0] = hc_byte_perm_S (w0[2], w0[1], selector); w0[3] = hc_byte_perm_S (w0[1], w0[0], selector); w0[2] = hc_byte_perm_S (w0[0], 0, selector); w0[1] = 0; w0[0] = 0; break; case 3: c0[3] = hc_byte_perm_S ( 0, w7[3], selector); c0[2] = hc_byte_perm_S (w7[3], w7[2], selector); c0[1] = hc_byte_perm_S (w7[2], w7[1], selector); c0[0] = hc_byte_perm_S (w7[1], w7[0], selector); w7[3] = hc_byte_perm_S (w7[0], w6[3], selector); w7[2] = hc_byte_perm_S (w6[3], w6[2], selector); w7[1] = hc_byte_perm_S (w6[2], w6[1], selector); w7[0] = hc_byte_perm_S (w6[1], w6[0], selector); w6[3] = hc_byte_perm_S (w6[0], w5[3], selector); w6[2] = hc_byte_perm_S (w5[3], w5[2], selector); w6[1] = hc_byte_perm_S (w5[2], w5[1], selector); w6[0] = hc_byte_perm_S (w5[1], w5[0], selector); w5[3] = hc_byte_perm_S (w5[0], w4[3], selector); w5[2] = hc_byte_perm_S (w4[3], w4[2], selector); w5[1] = hc_byte_perm_S (w4[2], w4[1], selector); w5[0] = hc_byte_perm_S (w4[1], w4[0], selector); w4[3] = hc_byte_perm_S (w4[0], w3[3], selector); w4[2] = hc_byte_perm_S (w3[3], w3[2], selector); w4[1] = hc_byte_perm_S (w3[2], w3[1], selector); w4[0] = hc_byte_perm_S (w3[1], w3[0], selector); w3[3] = hc_byte_perm_S (w3[0], w2[3], selector); w3[2] = hc_byte_perm_S (w2[3], w2[2], selector); w3[1] = hc_byte_perm_S (w2[2], w2[1], selector); w3[0] = hc_byte_perm_S (w2[1], w2[0], selector); w2[3] = hc_byte_perm_S (w2[0], w1[3], selector); w2[2] = hc_byte_perm_S (w1[3], w1[2], selector); w2[1] = hc_byte_perm_S (w1[2], w1[1], selector); w2[0] = hc_byte_perm_S (w1[1], w1[0], selector); w1[3] = hc_byte_perm_S (w1[0], w0[3], selector); w1[2] = hc_byte_perm_S (w0[3], w0[2], selector); w1[1] = hc_byte_perm_S (w0[2], w0[1], selector); w1[0] = hc_byte_perm_S (w0[1], w0[0], selector); w0[3] = hc_byte_perm_S (w0[0], 0, selector); w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 4: c1[0] = hc_byte_perm_S ( 0, w7[3], selector); c0[3] = hc_byte_perm_S (w7[3], w7[2], selector); c0[2] = hc_byte_perm_S (w7[2], w7[1], selector); c0[1] = hc_byte_perm_S (w7[1], w7[0], selector); c0[0] = hc_byte_perm_S (w7[0], w6[3], selector); w7[3] = hc_byte_perm_S (w6[3], w6[2], selector); w7[2] = hc_byte_perm_S (w6[2], w6[1], selector); w7[1] = hc_byte_perm_S (w6[1], w6[0], selector); w7[0] = hc_byte_perm_S (w6[0], w5[3], selector); w6[3] = hc_byte_perm_S (w5[3], w5[2], selector); w6[2] = hc_byte_perm_S (w5[2], w5[1], selector); w6[1] = hc_byte_perm_S (w5[1], w5[0], selector); w6[0] = hc_byte_perm_S (w5[0], w4[3], selector); w5[3] = hc_byte_perm_S (w4[3], w4[2], selector); w5[2] = hc_byte_perm_S (w4[2], w4[1], selector); w5[1] = hc_byte_perm_S (w4[1], w4[0], selector); w5[0] = hc_byte_perm_S (w4[0], w3[3], selector); w4[3] = hc_byte_perm_S (w3[3], w3[2], selector); w4[2] = hc_byte_perm_S (w3[2], w3[1], selector); w4[1] = hc_byte_perm_S (w3[1], w3[0], selector); w4[0] = hc_byte_perm_S (w3[0], w2[3], selector); w3[3] = hc_byte_perm_S (w2[3], w2[2], selector); w3[2] = hc_byte_perm_S (w2[2], w2[1], selector); w3[1] = hc_byte_perm_S (w2[1], w2[0], selector); w3[0] = hc_byte_perm_S (w2[0], w1[3], selector); w2[3] = hc_byte_perm_S (w1[3], w1[2], selector); w2[2] = hc_byte_perm_S (w1[2], w1[1], selector); w2[1] = hc_byte_perm_S (w1[1], w1[0], selector); w2[0] = hc_byte_perm_S (w1[0], w0[3], selector); w1[3] = hc_byte_perm_S (w0[3], w0[2], selector); w1[2] = hc_byte_perm_S (w0[2], w0[1], selector); w1[1] = hc_byte_perm_S (w0[1], w0[0], selector); w1[0] = hc_byte_perm_S (w0[0], 0, selector); w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 5: c1[1] = hc_byte_perm_S ( 0, w7[3], selector); c1[0] = hc_byte_perm_S (w7[3], w7[2], selector); c0[3] = hc_byte_perm_S (w7[2], w7[1], selector); c0[2] = hc_byte_perm_S (w7[1], w7[0], selector); c0[1] = hc_byte_perm_S (w7[0], w6[3], selector); c0[0] = hc_byte_perm_S (w6[3], w6[2], selector); w7[3] = hc_byte_perm_S (w6[2], w6[1], selector); w7[2] = hc_byte_perm_S (w6[1], w6[0], selector); w7[1] = hc_byte_perm_S (w6[0], w5[3], selector); w7[0] = hc_byte_perm_S (w5[3], w5[2], selector); w6[3] = hc_byte_perm_S (w5[2], w5[1], selector); w6[2] = hc_byte_perm_S (w5[1], w5[0], selector); w6[1] = hc_byte_perm_S (w5[0], w4[3], selector); w6[0] = hc_byte_perm_S (w4[3], w4[2], selector); w5[3] = hc_byte_perm_S (w4[2], w4[1], selector); w5[2] = hc_byte_perm_S (w4[1], w4[0], selector); w5[1] = hc_byte_perm_S (w4[0], w3[3], selector); w5[0] = hc_byte_perm_S (w3[3], w3[2], selector); w4[3] = hc_byte_perm_S (w3[2], w3[1], selector); w4[2] = hc_byte_perm_S (w3[1], w3[0], selector); w4[1] = hc_byte_perm_S (w3[0], w2[3], selector); w4[0] = hc_byte_perm_S (w2[3], w2[2], selector); w3[3] = hc_byte_perm_S (w2[2], w2[1], selector); w3[2] = hc_byte_perm_S (w2[1], w2[0], selector); w3[1] = hc_byte_perm_S (w2[0], w1[3], selector); w3[0] = hc_byte_perm_S (w1[3], w1[2], selector); w2[3] = hc_byte_perm_S (w1[2], w1[1], selector); w2[2] = hc_byte_perm_S (w1[1], w1[0], selector); w2[1] = hc_byte_perm_S (w1[0], w0[3], selector); w2[0] = hc_byte_perm_S (w0[3], w0[2], selector); w1[3] = hc_byte_perm_S (w0[2], w0[1], selector); w1[2] = hc_byte_perm_S (w0[1], w0[0], selector); w1[1] = hc_byte_perm_S (w0[0], 0, selector); w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 6: c1[2] = hc_byte_perm_S ( 0, w7[3], selector); c1[1] = hc_byte_perm_S (w7[3], w7[2], selector); c1[0] = hc_byte_perm_S (w7[2], w7[1], selector); c0[3] = hc_byte_perm_S (w7[1], w7[0], selector); c0[2] = hc_byte_perm_S (w7[0], w6[3], selector); c0[1] = hc_byte_perm_S (w6[3], w6[2], selector); c0[0] = hc_byte_perm_S (w6[2], w6[1], selector); w7[3] = hc_byte_perm_S (w6[1], w6[0], selector); w7[2] = hc_byte_perm_S (w6[0], w5[3], selector); w7[1] = hc_byte_perm_S (w5[3], w5[2], selector); w7[0] = hc_byte_perm_S (w5[2], w5[1], selector); w6[3] = hc_byte_perm_S (w5[1], w5[0], selector); w6[2] = hc_byte_perm_S (w5[0], w4[3], selector); w6[1] = hc_byte_perm_S (w4[3], w4[2], selector); w6[0] = hc_byte_perm_S (w4[2], w4[1], selector); w5[3] = hc_byte_perm_S (w4[1], w4[0], selector); w5[2] = hc_byte_perm_S (w4[0], w3[3], selector); w5[1] = hc_byte_perm_S (w3[3], w3[2], selector); w5[0] = hc_byte_perm_S (w3[2], w3[1], selector); w4[3] = hc_byte_perm_S (w3[1], w3[0], selector); w4[2] = hc_byte_perm_S (w3[0], w2[3], selector); w4[1] = hc_byte_perm_S (w2[3], w2[2], selector); w4[0] = hc_byte_perm_S (w2[2], w2[1], selector); w3[3] = hc_byte_perm_S (w2[1], w2[0], selector); w3[2] = hc_byte_perm_S (w2[0], w1[3], selector); w3[1] = hc_byte_perm_S (w1[3], w1[2], selector); w3[0] = hc_byte_perm_S (w1[2], w1[1], selector); w2[3] = hc_byte_perm_S (w1[1], w1[0], selector); w2[2] = hc_byte_perm_S (w1[0], w0[3], selector); w2[1] = hc_byte_perm_S (w0[3], w0[2], selector); w2[0] = hc_byte_perm_S (w0[2], w0[1], selector); w1[3] = hc_byte_perm_S (w0[1], w0[0], selector); w1[2] = hc_byte_perm_S (w0[0], 0, selector); w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 7: c1[3] = hc_byte_perm_S ( 0, w7[3], selector); c1[2] = hc_byte_perm_S (w7[3], w7[2], selector); c1[1] = hc_byte_perm_S (w7[2], w7[1], selector); c1[0] = hc_byte_perm_S (w7[1], w7[0], selector); c0[3] = hc_byte_perm_S (w7[0], w6[3], selector); c0[2] = hc_byte_perm_S (w6[3], w6[2], selector); c0[1] = hc_byte_perm_S (w6[2], w6[1], selector); c0[0] = hc_byte_perm_S (w6[1], w6[0], selector); w7[3] = hc_byte_perm_S (w6[0], w5[3], selector); w7[2] = hc_byte_perm_S (w5[3], w5[2], selector); w7[1] = hc_byte_perm_S (w5[2], w5[1], selector); w7[0] = hc_byte_perm_S (w5[1], w5[0], selector); w6[3] = hc_byte_perm_S (w5[0], w4[3], selector); w6[2] = hc_byte_perm_S (w4[3], w4[2], selector); w6[1] = hc_byte_perm_S (w4[2], w4[1], selector); w6[0] = hc_byte_perm_S (w4[1], w4[0], selector); w5[3] = hc_byte_perm_S (w4[0], w3[3], selector); w5[2] = hc_byte_perm_S (w3[3], w3[2], selector); w5[1] = hc_byte_perm_S (w3[2], w3[1], selector); w5[0] = hc_byte_perm_S (w3[1], w3[0], selector); w4[3] = hc_byte_perm_S (w3[0], w2[3], selector); w4[2] = hc_byte_perm_S (w2[3], w2[2], selector); w4[1] = hc_byte_perm_S (w2[2], w2[1], selector); w4[0] = hc_byte_perm_S (w2[1], w2[0], selector); w3[3] = hc_byte_perm_S (w2[0], w1[3], selector); w3[2] = hc_byte_perm_S (w1[3], w1[2], selector); w3[1] = hc_byte_perm_S (w1[2], w1[1], selector); w3[0] = hc_byte_perm_S (w1[1], w1[0], selector); w2[3] = hc_byte_perm_S (w1[0], w0[3], selector); w2[2] = hc_byte_perm_S (w0[3], w0[2], selector); w2[1] = hc_byte_perm_S (w0[2], w0[1], selector); w2[0] = hc_byte_perm_S (w0[1], w0[0], selector); w1[3] = hc_byte_perm_S (w0[0], 0, selector); w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 8: c2[0] = hc_byte_perm_S ( 0, w7[3], selector); c1[3] = hc_byte_perm_S (w7[3], w7[2], selector); c1[2] = hc_byte_perm_S (w7[2], w7[1], selector); c1[1] = hc_byte_perm_S (w7[1], w7[0], selector); c1[0] = hc_byte_perm_S (w7[0], w6[3], selector); c0[3] = hc_byte_perm_S (w6[3], w6[2], selector); c0[2] = hc_byte_perm_S (w6[2], w6[1], selector); c0[1] = hc_byte_perm_S (w6[1], w6[0], selector); c0[0] = hc_byte_perm_S (w6[0], w5[3], selector); w7[3] = hc_byte_perm_S (w5[3], w5[2], selector); w7[2] = hc_byte_perm_S (w5[2], w5[1], selector); w7[1] = hc_byte_perm_S (w5[1], w5[0], selector); w7[0] = hc_byte_perm_S (w5[0], w4[3], selector); w6[3] = hc_byte_perm_S (w4[3], w4[2], selector); w6[2] = hc_byte_perm_S (w4[2], w4[1], selector); w6[1] = hc_byte_perm_S (w4[1], w4[0], selector); w6[0] = hc_byte_perm_S (w4[0], w3[3], selector); w5[3] = hc_byte_perm_S (w3[3], w3[2], selector); w5[2] = hc_byte_perm_S (w3[2], w3[1], selector); w5[1] = hc_byte_perm_S (w3[1], w3[0], selector); w5[0] = hc_byte_perm_S (w3[0], w2[3], selector); w4[3] = hc_byte_perm_S (w2[3], w2[2], selector); w4[2] = hc_byte_perm_S (w2[2], w2[1], selector); w4[1] = hc_byte_perm_S (w2[1], w2[0], selector); w4[0] = hc_byte_perm_S (w2[0], w1[3], selector); w3[3] = hc_byte_perm_S (w1[3], w1[2], selector); w3[2] = hc_byte_perm_S (w1[2], w1[1], selector); w3[1] = hc_byte_perm_S (w1[1], w1[0], selector); w3[0] = hc_byte_perm_S (w1[0], w0[3], selector); w2[3] = hc_byte_perm_S (w0[3], w0[2], selector); w2[2] = hc_byte_perm_S (w0[2], w0[1], selector); w2[1] = hc_byte_perm_S (w0[1], w0[0], selector); w2[0] = hc_byte_perm_S (w0[0], 0, selector); w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 9: c2[1] = hc_byte_perm_S ( 0, w7[3], selector); c2[0] = hc_byte_perm_S (w7[3], w7[2], selector); c1[3] = hc_byte_perm_S (w7[2], w7[1], selector); c1[2] = hc_byte_perm_S (w7[1], w7[0], selector); c1[1] = hc_byte_perm_S (w7[0], w6[3], selector); c1[0] = hc_byte_perm_S (w6[3], w6[2], selector); c0[3] = hc_byte_perm_S (w6[2], w6[1], selector); c0[2] = hc_byte_perm_S (w6[1], w6[0], selector); c0[1] = hc_byte_perm_S (w6[0], w5[3], selector); c0[0] = hc_byte_perm_S (w5[3], w5[2], selector); w7[3] = hc_byte_perm_S (w5[2], w5[1], selector); w7[2] = hc_byte_perm_S (w5[1], w5[0], selector); w7[1] = hc_byte_perm_S (w5[0], w4[3], selector); w7[0] = hc_byte_perm_S (w4[3], w4[2], selector); w6[3] = hc_byte_perm_S (w4[2], w4[1], selector); w6[2] = hc_byte_perm_S (w4[1], w4[0], selector); w6[1] = hc_byte_perm_S (w4[0], w3[3], selector); w6[0] = hc_byte_perm_S (w3[3], w3[2], selector); w5[3] = hc_byte_perm_S (w3[2], w3[1], selector); w5[2] = hc_byte_perm_S (w3[1], w3[0], selector); w5[1] = hc_byte_perm_S (w3[0], w2[3], selector); w5[0] = hc_byte_perm_S (w2[3], w2[2], selector); w4[3] = hc_byte_perm_S (w2[2], w2[1], selector); w4[2] = hc_byte_perm_S (w2[1], w2[0], selector); w4[1] = hc_byte_perm_S (w2[0], w1[3], selector); w4[0] = hc_byte_perm_S (w1[3], w1[2], selector); w3[3] = hc_byte_perm_S (w1[2], w1[1], selector); w3[2] = hc_byte_perm_S (w1[1], w1[0], selector); w3[1] = hc_byte_perm_S (w1[0], w0[3], selector); w3[0] = hc_byte_perm_S (w0[3], w0[2], selector); w2[3] = hc_byte_perm_S (w0[2], w0[1], selector); w2[2] = hc_byte_perm_S (w0[1], w0[0], selector); w2[1] = hc_byte_perm_S (w0[0], 0, selector); w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 10: c2[2] = hc_byte_perm_S ( 0, w7[3], selector); c2[1] = hc_byte_perm_S (w7[3], w7[2], selector); c2[0] = hc_byte_perm_S (w7[2], w7[1], selector); c1[3] = hc_byte_perm_S (w7[1], w7[0], selector); c1[2] = hc_byte_perm_S (w7[0], w6[3], selector); c1[1] = hc_byte_perm_S (w6[3], w6[2], selector); c1[0] = hc_byte_perm_S (w6[2], w6[1], selector); c0[3] = hc_byte_perm_S (w6[1], w6[0], selector); c0[2] = hc_byte_perm_S (w6[0], w5[3], selector); c0[1] = hc_byte_perm_S (w5[3], w5[2], selector); c0[0] = hc_byte_perm_S (w5[2], w5[1], selector); w7[3] = hc_byte_perm_S (w5[1], w5[0], selector); w7[2] = hc_byte_perm_S (w5[0], w4[3], selector); w7[1] = hc_byte_perm_S (w4[3], w4[2], selector); w7[0] = hc_byte_perm_S (w4[2], w4[1], selector); w6[3] = hc_byte_perm_S (w4[1], w4[0], selector); w6[2] = hc_byte_perm_S (w4[0], w3[3], selector); w6[1] = hc_byte_perm_S (w3[3], w3[2], selector); w6[0] = hc_byte_perm_S (w3[2], w3[1], selector); w5[3] = hc_byte_perm_S (w3[1], w3[0], selector); w5[2] = hc_byte_perm_S (w3[0], w2[3], selector); w5[1] = hc_byte_perm_S (w2[3], w2[2], selector); w5[0] = hc_byte_perm_S (w2[2], w2[1], selector); w4[3] = hc_byte_perm_S (w2[1], w2[0], selector); w4[2] = hc_byte_perm_S (w2[0], w1[3], selector); w4[1] = hc_byte_perm_S (w1[3], w1[2], selector); w4[0] = hc_byte_perm_S (w1[2], w1[1], selector); w3[3] = hc_byte_perm_S (w1[1], w1[0], selector); w3[2] = hc_byte_perm_S (w1[0], w0[3], selector); w3[1] = hc_byte_perm_S (w0[3], w0[2], selector); w3[0] = hc_byte_perm_S (w0[2], w0[1], selector); w2[3] = hc_byte_perm_S (w0[1], w0[0], selector); w2[2] = hc_byte_perm_S (w0[0], 0, selector); w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 11: c2[3] = hc_byte_perm_S ( 0, w7[3], selector); c2[2] = hc_byte_perm_S (w7[3], w7[2], selector); c2[1] = hc_byte_perm_S (w7[2], w7[1], selector); c2[0] = hc_byte_perm_S (w7[1], w7[0], selector); c1[3] = hc_byte_perm_S (w7[0], w6[3], selector); c1[2] = hc_byte_perm_S (w6[3], w6[2], selector); c1[1] = hc_byte_perm_S (w6[2], w6[1], selector); c1[0] = hc_byte_perm_S (w6[1], w6[0], selector); c0[3] = hc_byte_perm_S (w6[0], w5[3], selector); c0[2] = hc_byte_perm_S (w5[3], w5[2], selector); c0[1] = hc_byte_perm_S (w5[2], w5[1], selector); c0[0] = hc_byte_perm_S (w5[1], w5[0], selector); w7[3] = hc_byte_perm_S (w5[0], w4[3], selector); w7[2] = hc_byte_perm_S (w4[3], w4[2], selector); w7[1] = hc_byte_perm_S (w4[2], w4[1], selector); w7[0] = hc_byte_perm_S (w4[1], w4[0], selector); w6[3] = hc_byte_perm_S (w4[0], w3[3], selector); w6[2] = hc_byte_perm_S (w3[3], w3[2], selector); w6[1] = hc_byte_perm_S (w3[2], w3[1], selector); w6[0] = hc_byte_perm_S (w3[1], w3[0], selector); w5[3] = hc_byte_perm_S (w3[0], w2[3], selector); w5[2] = hc_byte_perm_S (w2[3], w2[2], selector); w5[1] = hc_byte_perm_S (w2[2], w2[1], selector); w5[0] = hc_byte_perm_S (w2[1], w2[0], selector); w4[3] = hc_byte_perm_S (w2[0], w1[3], selector); w4[2] = hc_byte_perm_S (w1[3], w1[2], selector); w4[1] = hc_byte_perm_S (w1[2], w1[1], selector); w4[0] = hc_byte_perm_S (w1[1], w1[0], selector); w3[3] = hc_byte_perm_S (w1[0], w0[3], selector); w3[2] = hc_byte_perm_S (w0[3], w0[2], selector); w3[1] = hc_byte_perm_S (w0[2], w0[1], selector); w3[0] = hc_byte_perm_S (w0[1], w0[0], selector); w2[3] = hc_byte_perm_S (w0[0], 0, selector); w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 12: c3[0] = hc_byte_perm_S ( 0, w7[3], selector); c2[3] = hc_byte_perm_S (w7[3], w7[2], selector); c2[2] = hc_byte_perm_S (w7[2], w7[1], selector); c2[1] = hc_byte_perm_S (w7[1], w7[0], selector); c2[0] = hc_byte_perm_S (w7[0], w6[3], selector); c1[3] = hc_byte_perm_S (w6[3], w6[2], selector); c1[2] = hc_byte_perm_S (w6[2], w6[1], selector); c1[1] = hc_byte_perm_S (w6[1], w6[0], selector); c1[0] = hc_byte_perm_S (w6[0], w5[3], selector); c0[3] = hc_byte_perm_S (w5[3], w5[2], selector); c0[2] = hc_byte_perm_S (w5[2], w5[1], selector); c0[1] = hc_byte_perm_S (w5[1], w5[0], selector); c0[0] = hc_byte_perm_S (w5[0], w4[3], selector); w7[3] = hc_byte_perm_S (w4[3], w4[2], selector); w7[2] = hc_byte_perm_S (w4[2], w4[1], selector); w7[1] = hc_byte_perm_S (w4[1], w4[0], selector); w7[0] = hc_byte_perm_S (w4[0], w3[3], selector); w6[3] = hc_byte_perm_S (w3[3], w3[2], selector); w6[2] = hc_byte_perm_S (w3[2], w3[1], selector); w6[1] = hc_byte_perm_S (w3[1], w3[0], selector); w6[0] = hc_byte_perm_S (w3[0], w2[3], selector); w5[3] = hc_byte_perm_S (w2[3], w2[2], selector); w5[2] = hc_byte_perm_S (w2[2], w2[1], selector); w5[1] = hc_byte_perm_S (w2[1], w2[0], selector); w5[0] = hc_byte_perm_S (w2[0], w1[3], selector); w4[3] = hc_byte_perm_S (w1[3], w1[2], selector); w4[2] = hc_byte_perm_S (w1[2], w1[1], selector); w4[1] = hc_byte_perm_S (w1[1], w1[0], selector); w4[0] = hc_byte_perm_S (w1[0], w0[3], selector); w3[3] = hc_byte_perm_S (w0[3], w0[2], selector); w3[2] = hc_byte_perm_S (w0[2], w0[1], selector); w3[1] = hc_byte_perm_S (w0[1], w0[0], selector); w3[0] = hc_byte_perm_S (w0[0], 0, selector); w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 13: c3[1] = hc_byte_perm_S ( 0, w7[3], selector); c3[0] = hc_byte_perm_S (w7[3], w7[2], selector); c2[3] = hc_byte_perm_S (w7[2], w7[1], selector); c2[2] = hc_byte_perm_S (w7[1], w7[0], selector); c2[1] = hc_byte_perm_S (w7[0], w6[3], selector); c2[0] = hc_byte_perm_S (w6[3], w6[2], selector); c1[3] = hc_byte_perm_S (w6[2], w6[1], selector); c1[2] = hc_byte_perm_S (w6[1], w6[0], selector); c1[1] = hc_byte_perm_S (w6[0], w5[3], selector); c1[0] = hc_byte_perm_S (w5[3], w5[2], selector); c0[3] = hc_byte_perm_S (w5[2], w5[1], selector); c0[2] = hc_byte_perm_S (w5[1], w5[0], selector); c0[1] = hc_byte_perm_S (w5[0], w4[3], selector); c0[0] = hc_byte_perm_S (w4[3], w4[2], selector); w7[3] = hc_byte_perm_S (w4[2], w4[1], selector); w7[2] = hc_byte_perm_S (w4[1], w4[0], selector); w7[1] = hc_byte_perm_S (w4[0], w3[3], selector); w7[0] = hc_byte_perm_S (w3[3], w3[2], selector); w6[3] = hc_byte_perm_S (w3[2], w3[1], selector); w6[2] = hc_byte_perm_S (w3[1], w3[0], selector); w6[1] = hc_byte_perm_S (w3[0], w2[3], selector); w6[0] = hc_byte_perm_S (w2[3], w2[2], selector); w5[3] = hc_byte_perm_S (w2[2], w2[1], selector); w5[2] = hc_byte_perm_S (w2[1], w2[0], selector); w5[1] = hc_byte_perm_S (w2[0], w1[3], selector); w5[0] = hc_byte_perm_S (w1[3], w1[2], selector); w4[3] = hc_byte_perm_S (w1[2], w1[1], selector); w4[2] = hc_byte_perm_S (w1[1], w1[0], selector); w4[1] = hc_byte_perm_S (w1[0], w0[3], selector); w4[0] = hc_byte_perm_S (w0[3], w0[2], selector); w3[3] = hc_byte_perm_S (w0[2], w0[1], selector); w3[2] = hc_byte_perm_S (w0[1], w0[0], selector); w3[1] = hc_byte_perm_S (w0[0], 0, selector); w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 14: c3[2] = hc_byte_perm_S ( 0, w7[3], selector); c3[1] = hc_byte_perm_S (w7[3], w7[2], selector); c3[0] = hc_byte_perm_S (w7[2], w7[1], selector); c2[3] = hc_byte_perm_S (w7[1], w7[0], selector); c2[2] = hc_byte_perm_S (w7[0], w6[3], selector); c2[1] = hc_byte_perm_S (w6[3], w6[2], selector); c2[0] = hc_byte_perm_S (w6[2], w6[1], selector); c1[3] = hc_byte_perm_S (w6[1], w6[0], selector); c1[2] = hc_byte_perm_S (w6[0], w5[3], selector); c1[1] = hc_byte_perm_S (w5[3], w5[2], selector); c1[0] = hc_byte_perm_S (w5[2], w5[1], selector); c0[3] = hc_byte_perm_S (w5[1], w5[0], selector); c0[2] = hc_byte_perm_S (w5[0], w4[3], selector); c0[1] = hc_byte_perm_S (w4[3], w4[2], selector); c0[0] = hc_byte_perm_S (w4[2], w4[1], selector); w7[3] = hc_byte_perm_S (w4[1], w4[0], selector); w7[2] = hc_byte_perm_S (w4[0], w3[3], selector); w7[1] = hc_byte_perm_S (w3[3], w3[2], selector); w7[0] = hc_byte_perm_S (w3[2], w3[1], selector); w6[3] = hc_byte_perm_S (w3[1], w3[0], selector); w6[2] = hc_byte_perm_S (w3[0], w2[3], selector); w6[1] = hc_byte_perm_S (w2[3], w2[2], selector); w6[0] = hc_byte_perm_S (w2[2], w2[1], selector); w5[3] = hc_byte_perm_S (w2[1], w2[0], selector); w5[2] = hc_byte_perm_S (w2[0], w1[3], selector); w5[1] = hc_byte_perm_S (w1[3], w1[2], selector); w5[0] = hc_byte_perm_S (w1[2], w1[1], selector); w4[3] = hc_byte_perm_S (w1[1], w1[0], selector); w4[2] = hc_byte_perm_S (w1[0], w0[3], selector); w4[1] = hc_byte_perm_S (w0[3], w0[2], selector); w4[0] = hc_byte_perm_S (w0[2], w0[1], selector); w3[3] = hc_byte_perm_S (w0[1], w0[0], selector); w3[2] = hc_byte_perm_S (w0[0], 0, selector); w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 15: c3[3] = hc_byte_perm_S ( 0, w7[3], selector); c3[2] = hc_byte_perm_S (w7[3], w7[2], selector); c3[1] = hc_byte_perm_S (w7[2], w7[1], selector); c3[0] = hc_byte_perm_S (w7[1], w7[0], selector); c2[3] = hc_byte_perm_S (w7[0], w6[3], selector); c2[2] = hc_byte_perm_S (w6[3], w6[2], selector); c2[1] = hc_byte_perm_S (w6[2], w6[1], selector); c2[0] = hc_byte_perm_S (w6[1], w6[0], selector); c1[3] = hc_byte_perm_S (w6[0], w5[3], selector); c1[2] = hc_byte_perm_S (w5[3], w5[2], selector); c1[1] = hc_byte_perm_S (w5[2], w5[1], selector); c1[0] = hc_byte_perm_S (w5[1], w5[0], selector); c0[3] = hc_byte_perm_S (w5[0], w4[3], selector); c0[2] = hc_byte_perm_S (w4[3], w4[2], selector); c0[1] = hc_byte_perm_S (w4[2], w4[1], selector); c0[0] = hc_byte_perm_S (w4[1], w4[0], selector); w7[3] = hc_byte_perm_S (w4[0], w3[3], selector); w7[2] = hc_byte_perm_S (w3[3], w3[2], selector); w7[1] = hc_byte_perm_S (w3[2], w3[1], selector); w7[0] = hc_byte_perm_S (w3[1], w3[0], selector); w6[3] = hc_byte_perm_S (w3[0], w2[3], selector); w6[2] = hc_byte_perm_S (w2[3], w2[2], selector); w6[1] = hc_byte_perm_S (w2[2], w2[1], selector); w6[0] = hc_byte_perm_S (w2[1], w2[0], selector); w5[3] = hc_byte_perm_S (w2[0], w1[3], selector); w5[2] = hc_byte_perm_S (w1[3], w1[2], selector); w5[1] = hc_byte_perm_S (w1[2], w1[1], selector); w5[0] = hc_byte_perm_S (w1[1], w1[0], selector); w4[3] = hc_byte_perm_S (w1[0], w0[3], selector); w4[2] = hc_byte_perm_S (w0[3], w0[2], selector); w4[1] = hc_byte_perm_S (w0[2], w0[1], selector); w4[0] = hc_byte_perm_S (w0[1], w0[0], selector); w3[3] = hc_byte_perm_S (w0[0], 0, selector); w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 16: c4[0] = hc_byte_perm_S ( 0, w7[3], selector); c3[3] = hc_byte_perm_S (w7[3], w7[2], selector); c3[2] = hc_byte_perm_S (w7[2], w7[1], selector); c3[1] = hc_byte_perm_S (w7[1], w7[0], selector); c3[0] = hc_byte_perm_S (w7[0], w6[3], selector); c2[3] = hc_byte_perm_S (w6[3], w6[2], selector); c2[2] = hc_byte_perm_S (w6[2], w6[1], selector); c2[1] = hc_byte_perm_S (w6[1], w6[0], selector); c2[0] = hc_byte_perm_S (w6[0], w5[3], selector); c1[3] = hc_byte_perm_S (w5[3], w5[2], selector); c1[2] = hc_byte_perm_S (w5[2], w5[1], selector); c1[1] = hc_byte_perm_S (w5[1], w5[0], selector); c1[0] = hc_byte_perm_S (w5[0], w4[3], selector); c0[3] = hc_byte_perm_S (w4[3], w4[2], selector); c0[2] = hc_byte_perm_S (w4[2], w4[1], selector); c0[1] = hc_byte_perm_S (w4[1], w4[0], selector); c0[0] = hc_byte_perm_S (w4[0], w3[3], selector); w7[3] = hc_byte_perm_S (w3[3], w3[2], selector); w7[2] = hc_byte_perm_S (w3[2], w3[1], selector); w7[1] = hc_byte_perm_S (w3[1], w3[0], selector); w7[0] = hc_byte_perm_S (w3[0], w2[3], selector); w6[3] = hc_byte_perm_S (w2[3], w2[2], selector); w6[2] = hc_byte_perm_S (w2[2], w2[1], selector); w6[1] = hc_byte_perm_S (w2[1], w2[0], selector); w6[0] = hc_byte_perm_S (w2[0], w1[3], selector); w5[3] = hc_byte_perm_S (w1[3], w1[2], selector); w5[2] = hc_byte_perm_S (w1[2], w1[1], selector); w5[1] = hc_byte_perm_S (w1[1], w1[0], selector); w5[0] = hc_byte_perm_S (w1[0], w0[3], selector); w4[3] = hc_byte_perm_S (w0[3], w0[2], selector); w4[2] = hc_byte_perm_S (w0[2], w0[1], selector); w4[1] = hc_byte_perm_S (w0[1], w0[0], selector); w4[0] = hc_byte_perm_S (w0[0], 0, selector); w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 17: c4[1] = hc_byte_perm_S ( 0, w7[3], selector); c4[0] = hc_byte_perm_S (w7[3], w7[2], selector); c3[3] = hc_byte_perm_S (w7[2], w7[1], selector); c3[2] = hc_byte_perm_S (w7[1], w7[0], selector); c3[1] = hc_byte_perm_S (w7[0], w6[3], selector); c3[0] = hc_byte_perm_S (w6[3], w6[2], selector); c2[3] = hc_byte_perm_S (w6[2], w6[1], selector); c2[2] = hc_byte_perm_S (w6[1], w6[0], selector); c2[1] = hc_byte_perm_S (w6[0], w5[3], selector); c2[0] = hc_byte_perm_S (w5[3], w5[2], selector); c1[3] = hc_byte_perm_S (w5[2], w5[1], selector); c1[2] = hc_byte_perm_S (w5[1], w5[0], selector); c1[1] = hc_byte_perm_S (w5[0], w4[3], selector); c1[0] = hc_byte_perm_S (w4[3], w4[2], selector); c0[3] = hc_byte_perm_S (w4[2], w4[1], selector); c0[2] = hc_byte_perm_S (w4[1], w4[0], selector); c0[1] = hc_byte_perm_S (w4[0], w3[3], selector); c0[0] = hc_byte_perm_S (w3[3], w3[2], selector); w7[3] = hc_byte_perm_S (w3[2], w3[1], selector); w7[2] = hc_byte_perm_S (w3[1], w3[0], selector); w7[1] = hc_byte_perm_S (w3[0], w2[3], selector); w7[0] = hc_byte_perm_S (w2[3], w2[2], selector); w6[3] = hc_byte_perm_S (w2[2], w2[1], selector); w6[2] = hc_byte_perm_S (w2[1], w2[0], selector); w6[1] = hc_byte_perm_S (w2[0], w1[3], selector); w6[0] = hc_byte_perm_S (w1[3], w1[2], selector); w5[3] = hc_byte_perm_S (w1[2], w1[1], selector); w5[2] = hc_byte_perm_S (w1[1], w1[0], selector); w5[1] = hc_byte_perm_S (w1[0], w0[3], selector); w5[0] = hc_byte_perm_S (w0[3], w0[2], selector); w4[3] = hc_byte_perm_S (w0[2], w0[1], selector); w4[2] = hc_byte_perm_S (w0[1], w0[0], selector); w4[1] = hc_byte_perm_S (w0[0], 0, selector); w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 18: c4[2] = hc_byte_perm_S ( 0, w7[3], selector); c4[1] = hc_byte_perm_S (w7[3], w7[2], selector); c4[0] = hc_byte_perm_S (w7[2], w7[1], selector); c3[3] = hc_byte_perm_S (w7[1], w7[0], selector); c3[2] = hc_byte_perm_S (w7[0], w6[3], selector); c3[1] = hc_byte_perm_S (w6[3], w6[2], selector); c3[0] = hc_byte_perm_S (w6[2], w6[1], selector); c2[3] = hc_byte_perm_S (w6[1], w6[0], selector); c2[2] = hc_byte_perm_S (w6[0], w5[3], selector); c2[1] = hc_byte_perm_S (w5[3], w5[2], selector); c2[0] = hc_byte_perm_S (w5[2], w5[1], selector); c1[3] = hc_byte_perm_S (w5[1], w5[0], selector); c1[2] = hc_byte_perm_S (w5[0], w4[3], selector); c1[1] = hc_byte_perm_S (w4[3], w4[2], selector); c1[0] = hc_byte_perm_S (w4[2], w4[1], selector); c0[3] = hc_byte_perm_S (w4[1], w4[0], selector); c0[2] = hc_byte_perm_S (w4[0], w3[3], selector); c0[1] = hc_byte_perm_S (w3[3], w3[2], selector); c0[0] = hc_byte_perm_S (w3[2], w3[1], selector); w7[3] = hc_byte_perm_S (w3[1], w3[0], selector); w7[2] = hc_byte_perm_S (w3[0], w2[3], selector); w7[1] = hc_byte_perm_S (w2[3], w2[2], selector); w7[0] = hc_byte_perm_S (w2[2], w2[1], selector); w6[3] = hc_byte_perm_S (w2[1], w2[0], selector); w6[2] = hc_byte_perm_S (w2[0], w1[3], selector); w6[1] = hc_byte_perm_S (w1[3], w1[2], selector); w6[0] = hc_byte_perm_S (w1[2], w1[1], selector); w5[3] = hc_byte_perm_S (w1[1], w1[0], selector); w5[2] = hc_byte_perm_S (w1[0], w0[3], selector); w5[1] = hc_byte_perm_S (w0[3], w0[2], selector); w5[0] = hc_byte_perm_S (w0[2], w0[1], selector); w4[3] = hc_byte_perm_S (w0[1], w0[0], selector); w4[2] = hc_byte_perm_S (w0[0], 0, selector); w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 19: c4[3] = hc_byte_perm_S ( 0, w7[3], selector); c4[2] = hc_byte_perm_S (w7[3], w7[2], selector); c4[1] = hc_byte_perm_S (w7[2], w7[1], selector); c4[0] = hc_byte_perm_S (w7[1], w7[0], selector); c3[3] = hc_byte_perm_S (w7[0], w6[3], selector); c3[2] = hc_byte_perm_S (w6[3], w6[2], selector); c3[1] = hc_byte_perm_S (w6[2], w6[1], selector); c3[0] = hc_byte_perm_S (w6[1], w6[0], selector); c2[3] = hc_byte_perm_S (w6[0], w5[3], selector); c2[2] = hc_byte_perm_S (w5[3], w5[2], selector); c2[1] = hc_byte_perm_S (w5[2], w5[1], selector); c2[0] = hc_byte_perm_S (w5[1], w5[0], selector); c1[3] = hc_byte_perm_S (w5[0], w4[3], selector); c1[2] = hc_byte_perm_S (w4[3], w4[2], selector); c1[1] = hc_byte_perm_S (w4[2], w4[1], selector); c1[0] = hc_byte_perm_S (w4[1], w4[0], selector); c0[3] = hc_byte_perm_S (w4[0], w3[3], selector); c0[2] = hc_byte_perm_S (w3[3], w3[2], selector); c0[1] = hc_byte_perm_S (w3[2], w3[1], selector); c0[0] = hc_byte_perm_S (w3[1], w3[0], selector); w7[3] = hc_byte_perm_S (w3[0], w2[3], selector); w7[2] = hc_byte_perm_S (w2[3], w2[2], selector); w7[1] = hc_byte_perm_S (w2[2], w2[1], selector); w7[0] = hc_byte_perm_S (w2[1], w2[0], selector); w6[3] = hc_byte_perm_S (w2[0], w1[3], selector); w6[2] = hc_byte_perm_S (w1[3], w1[2], selector); w6[1] = hc_byte_perm_S (w1[2], w1[1], selector); w6[0] = hc_byte_perm_S (w1[1], w1[0], selector); w5[3] = hc_byte_perm_S (w1[0], w0[3], selector); w5[2] = hc_byte_perm_S (w0[3], w0[2], selector); w5[1] = hc_byte_perm_S (w0[2], w0[1], selector); w5[0] = hc_byte_perm_S (w0[1], w0[0], selector); w4[3] = hc_byte_perm_S (w0[0], 0, selector); w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 20: c5[0] = hc_byte_perm_S ( 0, w7[3], selector); c4[3] = hc_byte_perm_S (w7[3], w7[2], selector); c4[2] = hc_byte_perm_S (w7[2], w7[1], selector); c4[1] = hc_byte_perm_S (w7[1], w7[0], selector); c4[0] = hc_byte_perm_S (w7[0], w6[3], selector); c3[3] = hc_byte_perm_S (w6[3], w6[2], selector); c3[2] = hc_byte_perm_S (w6[2], w6[1], selector); c3[1] = hc_byte_perm_S (w6[1], w6[0], selector); c3[0] = hc_byte_perm_S (w6[0], w5[3], selector); c2[3] = hc_byte_perm_S (w5[3], w5[2], selector); c2[2] = hc_byte_perm_S (w5[2], w5[1], selector); c2[1] = hc_byte_perm_S (w5[1], w5[0], selector); c2[0] = hc_byte_perm_S (w5[0], w4[3], selector); c1[3] = hc_byte_perm_S (w4[3], w4[2], selector); c1[2] = hc_byte_perm_S (w4[2], w4[1], selector); c1[1] = hc_byte_perm_S (w4[1], w4[0], selector); c1[0] = hc_byte_perm_S (w4[0], w3[3], selector); c0[3] = hc_byte_perm_S (w3[3], w3[2], selector); c0[2] = hc_byte_perm_S (w3[2], w3[1], selector); c0[1] = hc_byte_perm_S (w3[1], w3[0], selector); c0[0] = hc_byte_perm_S (w3[0], w2[3], selector); w7[3] = hc_byte_perm_S (w2[3], w2[2], selector); w7[2] = hc_byte_perm_S (w2[2], w2[1], selector); w7[1] = hc_byte_perm_S (w2[1], w2[0], selector); w7[0] = hc_byte_perm_S (w2[0], w1[3], selector); w6[3] = hc_byte_perm_S (w1[3], w1[2], selector); w6[2] = hc_byte_perm_S (w1[2], w1[1], selector); w6[1] = hc_byte_perm_S (w1[1], w1[0], selector); w6[0] = hc_byte_perm_S (w1[0], w0[3], selector); w5[3] = hc_byte_perm_S (w0[3], w0[2], selector); w5[2] = hc_byte_perm_S (w0[2], w0[1], selector); w5[1] = hc_byte_perm_S (w0[1], w0[0], selector); w5[0] = hc_byte_perm_S (w0[0], 0, selector); w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 21: c5[1] = hc_byte_perm_S ( 0, w7[3], selector); c5[0] = hc_byte_perm_S (w7[3], w7[2], selector); c4[3] = hc_byte_perm_S (w7[2], w7[1], selector); c4[2] = hc_byte_perm_S (w7[1], w7[0], selector); c4[1] = hc_byte_perm_S (w7[0], w6[3], selector); c4[0] = hc_byte_perm_S (w6[3], w6[2], selector); c3[3] = hc_byte_perm_S (w6[2], w6[1], selector); c3[2] = hc_byte_perm_S (w6[1], w6[0], selector); c3[1] = hc_byte_perm_S (w6[0], w5[3], selector); c3[0] = hc_byte_perm_S (w5[3], w5[2], selector); c2[3] = hc_byte_perm_S (w5[2], w5[1], selector); c2[2] = hc_byte_perm_S (w5[1], w5[0], selector); c2[1] = hc_byte_perm_S (w5[0], w4[3], selector); c2[0] = hc_byte_perm_S (w4[3], w4[2], selector); c1[3] = hc_byte_perm_S (w4[2], w4[1], selector); c1[2] = hc_byte_perm_S (w4[1], w4[0], selector); c1[1] = hc_byte_perm_S (w4[0], w3[3], selector); c1[0] = hc_byte_perm_S (w3[3], w3[2], selector); c0[3] = hc_byte_perm_S (w3[2], w3[1], selector); c0[2] = hc_byte_perm_S (w3[1], w3[0], selector); c0[1] = hc_byte_perm_S (w3[0], w2[3], selector); c0[0] = hc_byte_perm_S (w2[3], w2[2], selector); w7[3] = hc_byte_perm_S (w2[2], w2[1], selector); w7[2] = hc_byte_perm_S (w2[1], w2[0], selector); w7[1] = hc_byte_perm_S (w2[0], w1[3], selector); w7[0] = hc_byte_perm_S (w1[3], w1[2], selector); w6[3] = hc_byte_perm_S (w1[2], w1[1], selector); w6[2] = hc_byte_perm_S (w1[1], w1[0], selector); w6[1] = hc_byte_perm_S (w1[0], w0[3], selector); w6[0] = hc_byte_perm_S (w0[3], w0[2], selector); w5[3] = hc_byte_perm_S (w0[2], w0[1], selector); w5[2] = hc_byte_perm_S (w0[1], w0[0], selector); w5[1] = hc_byte_perm_S (w0[0], 0, selector); w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 22: c5[2] = hc_byte_perm_S ( 0, w7[3], selector); c5[1] = hc_byte_perm_S (w7[3], w7[2], selector); c5[0] = hc_byte_perm_S (w7[2], w7[1], selector); c4[3] = hc_byte_perm_S (w7[1], w7[0], selector); c4[2] = hc_byte_perm_S (w7[0], w6[3], selector); c4[1] = hc_byte_perm_S (w6[3], w6[2], selector); c4[0] = hc_byte_perm_S (w6[2], w6[1], selector); c3[3] = hc_byte_perm_S (w6[1], w6[0], selector); c3[2] = hc_byte_perm_S (w6[0], w5[3], selector); c3[1] = hc_byte_perm_S (w5[3], w5[2], selector); c3[0] = hc_byte_perm_S (w5[2], w5[1], selector); c2[3] = hc_byte_perm_S (w5[1], w5[0], selector); c2[2] = hc_byte_perm_S (w5[0], w4[3], selector); c2[1] = hc_byte_perm_S (w4[3], w4[2], selector); c2[0] = hc_byte_perm_S (w4[2], w4[1], selector); c1[3] = hc_byte_perm_S (w4[1], w4[0], selector); c1[2] = hc_byte_perm_S (w4[0], w3[3], selector); c1[1] = hc_byte_perm_S (w3[3], w3[2], selector); c1[0] = hc_byte_perm_S (w3[2], w3[1], selector); c0[3] = hc_byte_perm_S (w3[1], w3[0], selector); c0[2] = hc_byte_perm_S (w3[0], w2[3], selector); c0[1] = hc_byte_perm_S (w2[3], w2[2], selector); c0[0] = hc_byte_perm_S (w2[2], w2[1], selector); w7[3] = hc_byte_perm_S (w2[1], w2[0], selector); w7[2] = hc_byte_perm_S (w2[0], w1[3], selector); w7[1] = hc_byte_perm_S (w1[3], w1[2], selector); w7[0] = hc_byte_perm_S (w1[2], w1[1], selector); w6[3] = hc_byte_perm_S (w1[1], w1[0], selector); w6[2] = hc_byte_perm_S (w1[0], w0[3], selector); w6[1] = hc_byte_perm_S (w0[3], w0[2], selector); w6[0] = hc_byte_perm_S (w0[2], w0[1], selector); w5[3] = hc_byte_perm_S (w0[1], w0[0], selector); w5[2] = hc_byte_perm_S (w0[0], 0, selector); w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 23: c5[3] = hc_byte_perm_S ( 0, w7[3], selector); c5[2] = hc_byte_perm_S (w7[3], w7[2], selector); c5[1] = hc_byte_perm_S (w7[2], w7[1], selector); c5[0] = hc_byte_perm_S (w7[1], w7[0], selector); c4[3] = hc_byte_perm_S (w7[0], w6[3], selector); c4[2] = hc_byte_perm_S (w6[3], w6[2], selector); c4[1] = hc_byte_perm_S (w6[2], w6[1], selector); c4[0] = hc_byte_perm_S (w6[1], w6[0], selector); c3[3] = hc_byte_perm_S (w6[0], w5[3], selector); c3[2] = hc_byte_perm_S (w5[3], w5[2], selector); c3[1] = hc_byte_perm_S (w5[2], w5[1], selector); c3[0] = hc_byte_perm_S (w5[1], w5[0], selector); c2[3] = hc_byte_perm_S (w5[0], w4[3], selector); c2[2] = hc_byte_perm_S (w4[3], w4[2], selector); c2[1] = hc_byte_perm_S (w4[2], w4[1], selector); c2[0] = hc_byte_perm_S (w4[1], w4[0], selector); c1[3] = hc_byte_perm_S (w4[0], w3[3], selector); c1[2] = hc_byte_perm_S (w3[3], w3[2], selector); c1[1] = hc_byte_perm_S (w3[2], w3[1], selector); c1[0] = hc_byte_perm_S (w3[1], w3[0], selector); c0[3] = hc_byte_perm_S (w3[0], w2[3], selector); c0[2] = hc_byte_perm_S (w2[3], w2[2], selector); c0[1] = hc_byte_perm_S (w2[2], w2[1], selector); c0[0] = hc_byte_perm_S (w2[1], w2[0], selector); w7[3] = hc_byte_perm_S (w2[0], w1[3], selector); w7[2] = hc_byte_perm_S (w1[3], w1[2], selector); w7[1] = hc_byte_perm_S (w1[2], w1[1], selector); w7[0] = hc_byte_perm_S (w1[1], w1[0], selector); w6[3] = hc_byte_perm_S (w1[0], w0[3], selector); w6[2] = hc_byte_perm_S (w0[3], w0[2], selector); w6[1] = hc_byte_perm_S (w0[2], w0[1], selector); w6[0] = hc_byte_perm_S (w0[1], w0[0], selector); w5[3] = hc_byte_perm_S (w0[0], 0, selector); w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 24: c6[0] = hc_byte_perm_S ( 0, w7[3], selector); c5[3] = hc_byte_perm_S (w7[3], w7[2], selector); c5[2] = hc_byte_perm_S (w7[2], w7[1], selector); c5[1] = hc_byte_perm_S (w7[1], w7[0], selector); c5[0] = hc_byte_perm_S (w7[0], w6[3], selector); c4[3] = hc_byte_perm_S (w6[3], w6[2], selector); c4[2] = hc_byte_perm_S (w6[2], w6[1], selector); c4[1] = hc_byte_perm_S (w6[1], w6[0], selector); c4[0] = hc_byte_perm_S (w6[0], w5[3], selector); c3[3] = hc_byte_perm_S (w5[3], w5[2], selector); c3[2] = hc_byte_perm_S (w5[2], w5[1], selector); c3[1] = hc_byte_perm_S (w5[1], w5[0], selector); c3[0] = hc_byte_perm_S (w5[0], w4[3], selector); c2[3] = hc_byte_perm_S (w4[3], w4[2], selector); c2[2] = hc_byte_perm_S (w4[2], w4[1], selector); c2[1] = hc_byte_perm_S (w4[1], w4[0], selector); c2[0] = hc_byte_perm_S (w4[0], w3[3], selector); c1[3] = hc_byte_perm_S (w3[3], w3[2], selector); c1[2] = hc_byte_perm_S (w3[2], w3[1], selector); c1[1] = hc_byte_perm_S (w3[1], w3[0], selector); c1[0] = hc_byte_perm_S (w3[0], w2[3], selector); c0[3] = hc_byte_perm_S (w2[3], w2[2], selector); c0[2] = hc_byte_perm_S (w2[2], w2[1], selector); c0[1] = hc_byte_perm_S (w2[1], w2[0], selector); c0[0] = hc_byte_perm_S (w2[0], w1[3], selector); w7[3] = hc_byte_perm_S (w1[3], w1[2], selector); w7[2] = hc_byte_perm_S (w1[2], w1[1], selector); w7[1] = hc_byte_perm_S (w1[1], w1[0], selector); w7[0] = hc_byte_perm_S (w1[0], w0[3], selector); w6[3] = hc_byte_perm_S (w0[3], w0[2], selector); w6[2] = hc_byte_perm_S (w0[2], w0[1], selector); w6[1] = hc_byte_perm_S (w0[1], w0[0], selector); w6[0] = hc_byte_perm_S (w0[0], 0, selector); w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 25: c6[1] = hc_byte_perm_S ( 0, w7[3], selector); c6[0] = hc_byte_perm_S (w7[3], w7[2], selector); c5[3] = hc_byte_perm_S (w7[2], w7[1], selector); c5[2] = hc_byte_perm_S (w7[1], w7[0], selector); c5[1] = hc_byte_perm_S (w7[0], w6[3], selector); c5[0] = hc_byte_perm_S (w6[3], w6[2], selector); c4[3] = hc_byte_perm_S (w6[2], w6[1], selector); c4[2] = hc_byte_perm_S (w6[1], w6[0], selector); c4[1] = hc_byte_perm_S (w6[0], w5[3], selector); c4[0] = hc_byte_perm_S (w5[3], w5[2], selector); c3[3] = hc_byte_perm_S (w5[2], w5[1], selector); c3[2] = hc_byte_perm_S (w5[1], w5[0], selector); c3[1] = hc_byte_perm_S (w5[0], w4[3], selector); c3[0] = hc_byte_perm_S (w4[3], w4[2], selector); c2[3] = hc_byte_perm_S (w4[2], w4[1], selector); c2[2] = hc_byte_perm_S (w4[1], w4[0], selector); c2[1] = hc_byte_perm_S (w4[0], w3[3], selector); c2[0] = hc_byte_perm_S (w3[3], w3[2], selector); c1[3] = hc_byte_perm_S (w3[2], w3[1], selector); c1[2] = hc_byte_perm_S (w3[1], w3[0], selector); c1[1] = hc_byte_perm_S (w3[0], w2[3], selector); c1[0] = hc_byte_perm_S (w2[3], w2[2], selector); c0[3] = hc_byte_perm_S (w2[2], w2[1], selector); c0[2] = hc_byte_perm_S (w2[1], w2[0], selector); c0[1] = hc_byte_perm_S (w2[0], w1[3], selector); c0[0] = hc_byte_perm_S (w1[3], w1[2], selector); w7[3] = hc_byte_perm_S (w1[2], w1[1], selector); w7[2] = hc_byte_perm_S (w1[1], w1[0], selector); w7[1] = hc_byte_perm_S (w1[0], w0[3], selector); w7[0] = hc_byte_perm_S (w0[3], w0[2], selector); w6[3] = hc_byte_perm_S (w0[2], w0[1], selector); w6[2] = hc_byte_perm_S (w0[1], w0[0], selector); w6[1] = hc_byte_perm_S (w0[0], 0, selector); w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 26: c6[2] = hc_byte_perm_S ( 0, w7[3], selector); c6[1] = hc_byte_perm_S (w7[3], w7[2], selector); c6[0] = hc_byte_perm_S (w7[2], w7[1], selector); c5[3] = hc_byte_perm_S (w7[1], w7[0], selector); c5[2] = hc_byte_perm_S (w7[0], w6[3], selector); c5[1] = hc_byte_perm_S (w6[3], w6[2], selector); c5[0] = hc_byte_perm_S (w6[2], w6[1], selector); c4[3] = hc_byte_perm_S (w6[1], w6[0], selector); c4[2] = hc_byte_perm_S (w6[0], w5[3], selector); c4[1] = hc_byte_perm_S (w5[3], w5[2], selector); c4[0] = hc_byte_perm_S (w5[2], w5[1], selector); c3[3] = hc_byte_perm_S (w5[1], w5[0], selector); c3[2] = hc_byte_perm_S (w5[0], w4[3], selector); c3[1] = hc_byte_perm_S (w4[3], w4[2], selector); c3[0] = hc_byte_perm_S (w4[2], w4[1], selector); c2[3] = hc_byte_perm_S (w4[1], w4[0], selector); c2[2] = hc_byte_perm_S (w4[0], w3[3], selector); c2[1] = hc_byte_perm_S (w3[3], w3[2], selector); c2[0] = hc_byte_perm_S (w3[2], w3[1], selector); c1[3] = hc_byte_perm_S (w3[1], w3[0], selector); c1[2] = hc_byte_perm_S (w3[0], w2[3], selector); c1[1] = hc_byte_perm_S (w2[3], w2[2], selector); c1[0] = hc_byte_perm_S (w2[2], w2[1], selector); c0[3] = hc_byte_perm_S (w2[1], w2[0], selector); c0[2] = hc_byte_perm_S (w2[0], w1[3], selector); c0[1] = hc_byte_perm_S (w1[3], w1[2], selector); c0[0] = hc_byte_perm_S (w1[2], w1[1], selector); w7[3] = hc_byte_perm_S (w1[1], w1[0], selector); w7[2] = hc_byte_perm_S (w1[0], w0[3], selector); w7[1] = hc_byte_perm_S (w0[3], w0[2], selector); w7[0] = hc_byte_perm_S (w0[2], w0[1], selector); w6[3] = hc_byte_perm_S (w0[1], w0[0], selector); w6[2] = hc_byte_perm_S (w0[0], 0, selector); w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 27: c6[3] = hc_byte_perm_S ( 0, w7[3], selector); c6[2] = hc_byte_perm_S (w7[3], w7[2], selector); c6[1] = hc_byte_perm_S (w7[2], w7[1], selector); c6[0] = hc_byte_perm_S (w7[1], w7[0], selector); c5[3] = hc_byte_perm_S (w7[0], w6[3], selector); c5[2] = hc_byte_perm_S (w6[3], w6[2], selector); c5[1] = hc_byte_perm_S (w6[2], w6[1], selector); c5[0] = hc_byte_perm_S (w6[1], w6[0], selector); c4[3] = hc_byte_perm_S (w6[0], w5[3], selector); c4[2] = hc_byte_perm_S (w5[3], w5[2], selector); c4[1] = hc_byte_perm_S (w5[2], w5[1], selector); c4[0] = hc_byte_perm_S (w5[1], w5[0], selector); c3[3] = hc_byte_perm_S (w5[0], w4[3], selector); c3[2] = hc_byte_perm_S (w4[3], w4[2], selector); c3[1] = hc_byte_perm_S (w4[2], w4[1], selector); c3[0] = hc_byte_perm_S (w4[1], w4[0], selector); c2[3] = hc_byte_perm_S (w4[0], w3[3], selector); c2[2] = hc_byte_perm_S (w3[3], w3[2], selector); c2[1] = hc_byte_perm_S (w3[2], w3[1], selector); c2[0] = hc_byte_perm_S (w3[1], w3[0], selector); c1[3] = hc_byte_perm_S (w3[0], w2[3], selector); c1[2] = hc_byte_perm_S (w2[3], w2[2], selector); c1[1] = hc_byte_perm_S (w2[2], w2[1], selector); c1[0] = hc_byte_perm_S (w2[1], w2[0], selector); c0[3] = hc_byte_perm_S (w2[0], w1[3], selector); c0[2] = hc_byte_perm_S (w1[3], w1[2], selector); c0[1] = hc_byte_perm_S (w1[2], w1[1], selector); c0[0] = hc_byte_perm_S (w1[1], w1[0], selector); w7[3] = hc_byte_perm_S (w1[0], w0[3], selector); w7[2] = hc_byte_perm_S (w0[3], w0[2], selector); w7[1] = hc_byte_perm_S (w0[2], w0[1], selector); w7[0] = hc_byte_perm_S (w0[1], w0[0], selector); w6[3] = hc_byte_perm_S (w0[0], 0, selector); w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 28: c7[0] = hc_byte_perm_S ( 0, w7[3], selector); c6[3] = hc_byte_perm_S (w7[3], w7[2], selector); c6[2] = hc_byte_perm_S (w7[2], w7[1], selector); c6[1] = hc_byte_perm_S (w7[1], w7[0], selector); c6[0] = hc_byte_perm_S (w7[0], w6[3], selector); c5[3] = hc_byte_perm_S (w6[3], w6[2], selector); c5[2] = hc_byte_perm_S (w6[2], w6[1], selector); c5[1] = hc_byte_perm_S (w6[1], w6[0], selector); c5[0] = hc_byte_perm_S (w6[0], w5[3], selector); c4[3] = hc_byte_perm_S (w5[3], w5[2], selector); c4[2] = hc_byte_perm_S (w5[2], w5[1], selector); c4[1] = hc_byte_perm_S (w5[1], w5[0], selector); c4[0] = hc_byte_perm_S (w5[0], w4[3], selector); c3[3] = hc_byte_perm_S (w4[3], w4[2], selector); c3[2] = hc_byte_perm_S (w4[2], w4[1], selector); c3[1] = hc_byte_perm_S (w4[1], w4[0], selector); c3[0] = hc_byte_perm_S (w4[0], w3[3], selector); c2[3] = hc_byte_perm_S (w3[3], w3[2], selector); c2[2] = hc_byte_perm_S (w3[2], w3[1], selector); c2[1] = hc_byte_perm_S (w3[1], w3[0], selector); c2[0] = hc_byte_perm_S (w3[0], w2[3], selector); c1[3] = hc_byte_perm_S (w2[3], w2[2], selector); c1[2] = hc_byte_perm_S (w2[2], w2[1], selector); c1[1] = hc_byte_perm_S (w2[1], w2[0], selector); c1[0] = hc_byte_perm_S (w2[0], w1[3], selector); c0[3] = hc_byte_perm_S (w1[3], w1[2], selector); c0[2] = hc_byte_perm_S (w1[2], w1[1], selector); c0[1] = hc_byte_perm_S (w1[1], w1[0], selector); c0[0] = hc_byte_perm_S (w1[0], w0[3], selector); w7[3] = hc_byte_perm_S (w0[3], w0[2], selector); w7[2] = hc_byte_perm_S (w0[2], w0[1], selector); w7[1] = hc_byte_perm_S (w0[1], w0[0], selector); w7[0] = hc_byte_perm_S (w0[0], 0, selector); w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 29: c7[1] = hc_byte_perm_S ( 0, w7[3], selector); c7[0] = hc_byte_perm_S (w7[3], w7[2], selector); c6[3] = hc_byte_perm_S (w7[2], w7[1], selector); c6[2] = hc_byte_perm_S (w7[1], w7[0], selector); c6[1] = hc_byte_perm_S (w7[0], w6[3], selector); c6[0] = hc_byte_perm_S (w6[3], w6[2], selector); c5[3] = hc_byte_perm_S (w6[2], w6[1], selector); c5[2] = hc_byte_perm_S (w6[1], w6[0], selector); c5[1] = hc_byte_perm_S (w6[0], w5[3], selector); c5[0] = hc_byte_perm_S (w5[3], w5[2], selector); c4[3] = hc_byte_perm_S (w5[2], w5[1], selector); c4[2] = hc_byte_perm_S (w5[1], w5[0], selector); c4[1] = hc_byte_perm_S (w5[0], w4[3], selector); c4[0] = hc_byte_perm_S (w4[3], w4[2], selector); c3[3] = hc_byte_perm_S (w4[2], w4[1], selector); c3[2] = hc_byte_perm_S (w4[1], w4[0], selector); c3[1] = hc_byte_perm_S (w4[0], w3[3], selector); c3[0] = hc_byte_perm_S (w3[3], w3[2], selector); c2[3] = hc_byte_perm_S (w3[2], w3[1], selector); c2[2] = hc_byte_perm_S (w3[1], w3[0], selector); c2[1] = hc_byte_perm_S (w3[0], w2[3], selector); c2[0] = hc_byte_perm_S (w2[3], w2[2], selector); c1[3] = hc_byte_perm_S (w2[2], w2[1], selector); c1[2] = hc_byte_perm_S (w2[1], w2[0], selector); c1[1] = hc_byte_perm_S (w2[0], w1[3], selector); c1[0] = hc_byte_perm_S (w1[3], w1[2], selector); c0[3] = hc_byte_perm_S (w1[2], w1[1], selector); c0[2] = hc_byte_perm_S (w1[1], w1[0], selector); c0[1] = hc_byte_perm_S (w1[0], w0[3], selector); c0[0] = hc_byte_perm_S (w0[3], w0[2], selector); w7[3] = hc_byte_perm_S (w0[2], w0[1], selector); w7[2] = hc_byte_perm_S (w0[1], w0[0], selector); w7[1] = hc_byte_perm_S (w0[0], 0, selector); w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 30: c7[2] = hc_byte_perm_S ( 0, w7[3], selector); c7[1] = hc_byte_perm_S (w7[3], w7[2], selector); c7[0] = hc_byte_perm_S (w7[2], w7[1], selector); c6[3] = hc_byte_perm_S (w7[1], w7[0], selector); c6[2] = hc_byte_perm_S (w7[0], w6[3], selector); c6[1] = hc_byte_perm_S (w6[3], w6[2], selector); c6[0] = hc_byte_perm_S (w6[2], w6[1], selector); c5[3] = hc_byte_perm_S (w6[1], w6[0], selector); c5[2] = hc_byte_perm_S (w6[0], w5[3], selector); c5[1] = hc_byte_perm_S (w5[3], w5[2], selector); c5[0] = hc_byte_perm_S (w5[2], w5[1], selector); c4[3] = hc_byte_perm_S (w5[1], w5[0], selector); c4[2] = hc_byte_perm_S (w5[0], w4[3], selector); c4[1] = hc_byte_perm_S (w4[3], w4[2], selector); c4[0] = hc_byte_perm_S (w4[2], w4[1], selector); c3[3] = hc_byte_perm_S (w4[1], w4[0], selector); c3[2] = hc_byte_perm_S (w4[0], w3[3], selector); c3[1] = hc_byte_perm_S (w3[3], w3[2], selector); c3[0] = hc_byte_perm_S (w3[2], w3[1], selector); c2[3] = hc_byte_perm_S (w3[1], w3[0], selector); c2[2] = hc_byte_perm_S (w3[0], w2[3], selector); c2[1] = hc_byte_perm_S (w2[3], w2[2], selector); c2[0] = hc_byte_perm_S (w2[2], w2[1], selector); c1[3] = hc_byte_perm_S (w2[1], w2[0], selector); c1[2] = hc_byte_perm_S (w2[0], w1[3], selector); c1[1] = hc_byte_perm_S (w1[3], w1[2], selector); c1[0] = hc_byte_perm_S (w1[2], w1[1], selector); c0[3] = hc_byte_perm_S (w1[1], w1[0], selector); c0[2] = hc_byte_perm_S (w1[0], w0[3], selector); c0[1] = hc_byte_perm_S (w0[3], w0[2], selector); c0[0] = hc_byte_perm_S (w0[2], w0[1], selector); w7[3] = hc_byte_perm_S (w0[1], w0[0], selector); w7[2] = hc_byte_perm_S (w0[0], 0, selector); w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; case 31: c7[3] = hc_byte_perm_S ( 0, w7[3], selector); c7[2] = hc_byte_perm_S (w7[3], w7[2], selector); c7[1] = hc_byte_perm_S (w7[2], w7[1], selector); c7[0] = hc_byte_perm_S (w7[1], w7[0], selector); c6[3] = hc_byte_perm_S (w7[0], w6[3], selector); c6[2] = hc_byte_perm_S (w6[3], w6[2], selector); c6[1] = hc_byte_perm_S (w6[2], w6[1], selector); c6[0] = hc_byte_perm_S (w6[1], w6[0], selector); c5[3] = hc_byte_perm_S (w6[0], w5[3], selector); c5[2] = hc_byte_perm_S (w5[3], w5[2], selector); c5[1] = hc_byte_perm_S (w5[2], w5[1], selector); c5[0] = hc_byte_perm_S (w5[1], w5[0], selector); c4[3] = hc_byte_perm_S (w5[0], w4[3], selector); c4[2] = hc_byte_perm_S (w4[3], w4[2], selector); c4[1] = hc_byte_perm_S (w4[2], w4[1], selector); c4[0] = hc_byte_perm_S (w4[1], w4[0], selector); c3[3] = hc_byte_perm_S (w4[0], w3[3], selector); c3[2] = hc_byte_perm_S (w3[3], w3[2], selector); c3[1] = hc_byte_perm_S (w3[2], w3[1], selector); c3[0] = hc_byte_perm_S (w3[1], w3[0], selector); c2[3] = hc_byte_perm_S (w3[0], w2[3], selector); c2[2] = hc_byte_perm_S (w2[3], w2[2], selector); c2[1] = hc_byte_perm_S (w2[2], w2[1], selector); c2[0] = hc_byte_perm_S (w2[1], w2[0], selector); c1[3] = hc_byte_perm_S (w2[0], w1[3], selector); c1[2] = hc_byte_perm_S (w1[3], w1[2], selector); c1[1] = hc_byte_perm_S (w1[2], w1[1], selector); c1[0] = hc_byte_perm_S (w1[1], w1[0], selector); c0[3] = hc_byte_perm_S (w1[0], w0[3], selector); c0[2] = hc_byte_perm_S (w0[3], w0[2], selector); c0[1] = hc_byte_perm_S (w0[2], w0[1], selector); c0[0] = hc_byte_perm_S (w0[1], w0[0], selector); w7[3] = hc_byte_perm_S (w0[0], 0, selector); w7[2] = 0; w7[1] = 0; w7[0] = 0; w6[3] = 0; w6[2] = 0; w6[1] = 0; w6[0] = 0; w5[3] = 0; w5[2] = 0; w5[1] = 0; w5[0] = 0; w4[3] = 0; w4[2] = 0; w4[1] = 0; w4[0] = 0; w3[3] = 0; w3[2] = 0; w3[1] = 0; w3[0] = 0; w2[3] = 0; w2[2] = 0; w2[1] = 0; w2[0] = 0; w1[3] = 0; w1[2] = 0; w1[1] = 0; w1[0] = 0; w0[3] = 0; w0[2] = 0; w0[1] = 0; w0[0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_1x64_le_S (PRIVATE_AS u32 *w, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: w[63] = hc_bytealign_S (w[62], w[63], offset); w[62] = hc_bytealign_S (w[61], w[62], offset); w[61] = hc_bytealign_S (w[60], w[61], offset); w[60] = hc_bytealign_S (w[59], w[60], offset); w[59] = hc_bytealign_S (w[58], w[59], offset); w[58] = hc_bytealign_S (w[57], w[58], offset); w[57] = hc_bytealign_S (w[56], w[57], offset); w[56] = hc_bytealign_S (w[55], w[56], offset); w[55] = hc_bytealign_S (w[54], w[55], offset); w[54] = hc_bytealign_S (w[53], w[54], offset); w[53] = hc_bytealign_S (w[52], w[53], offset); w[52] = hc_bytealign_S (w[51], w[52], offset); w[51] = hc_bytealign_S (w[50], w[51], offset); w[50] = hc_bytealign_S (w[49], w[50], offset); w[49] = hc_bytealign_S (w[48], w[49], offset); w[48] = hc_bytealign_S (w[47], w[48], offset); w[47] = hc_bytealign_S (w[46], w[47], offset); w[46] = hc_bytealign_S (w[45], w[46], offset); w[45] = hc_bytealign_S (w[44], w[45], offset); w[44] = hc_bytealign_S (w[43], w[44], offset); w[43] = hc_bytealign_S (w[42], w[43], offset); w[42] = hc_bytealign_S (w[41], w[42], offset); w[41] = hc_bytealign_S (w[40], w[41], offset); w[40] = hc_bytealign_S (w[39], w[40], offset); w[39] = hc_bytealign_S (w[38], w[39], offset); w[38] = hc_bytealign_S (w[37], w[38], offset); w[37] = hc_bytealign_S (w[36], w[37], offset); w[36] = hc_bytealign_S (w[35], w[36], offset); w[35] = hc_bytealign_S (w[34], w[35], offset); w[34] = hc_bytealign_S (w[33], w[34], offset); w[33] = hc_bytealign_S (w[32], w[33], offset); w[32] = hc_bytealign_S (w[31], w[32], offset); w[31] = hc_bytealign_S (w[30], w[31], offset); w[30] = hc_bytealign_S (w[29], w[30], offset); w[29] = hc_bytealign_S (w[28], w[29], offset); w[28] = hc_bytealign_S (w[27], w[28], offset); w[27] = hc_bytealign_S (w[26], w[27], offset); w[26] = hc_bytealign_S (w[25], w[26], offset); w[25] = hc_bytealign_S (w[24], w[25], offset); w[24] = hc_bytealign_S (w[23], w[24], offset); w[23] = hc_bytealign_S (w[22], w[23], offset); w[22] = hc_bytealign_S (w[21], w[22], offset); w[21] = hc_bytealign_S (w[20], w[21], offset); w[20] = hc_bytealign_S (w[19], w[20], offset); w[19] = hc_bytealign_S (w[18], w[19], offset); w[18] = hc_bytealign_S (w[17], w[18], offset); w[17] = hc_bytealign_S (w[16], w[17], offset); w[16] = hc_bytealign_S (w[15], w[16], offset); w[15] = hc_bytealign_S (w[14], w[15], offset); w[14] = hc_bytealign_S (w[13], w[14], offset); w[13] = hc_bytealign_S (w[12], w[13], offset); w[12] = hc_bytealign_S (w[11], w[12], offset); w[11] = hc_bytealign_S (w[10], w[11], offset); w[10] = hc_bytealign_S (w[ 9], w[10], offset); w[ 9] = hc_bytealign_S (w[ 8], w[ 9], offset); w[ 8] = hc_bytealign_S (w[ 7], w[ 8], offset); w[ 7] = hc_bytealign_S (w[ 6], w[ 7], offset); w[ 6] = hc_bytealign_S (w[ 5], w[ 6], offset); w[ 5] = hc_bytealign_S (w[ 4], w[ 5], offset); w[ 4] = hc_bytealign_S (w[ 3], w[ 4], offset); w[ 3] = hc_bytealign_S (w[ 2], w[ 3], offset); w[ 2] = hc_bytealign_S (w[ 1], w[ 2], offset); w[ 1] = hc_bytealign_S (w[ 0], w[ 1], offset); w[ 0] = hc_bytealign_S ( 0, w[ 0], offset); break; case 1: w[63] = hc_bytealign_S (w[61], w[62], offset); w[62] = hc_bytealign_S (w[60], w[61], offset); w[61] = hc_bytealign_S (w[59], w[60], offset); w[60] = hc_bytealign_S (w[58], w[59], offset); w[59] = hc_bytealign_S (w[57], w[58], offset); w[58] = hc_bytealign_S (w[56], w[57], offset); w[57] = hc_bytealign_S (w[55], w[56], offset); w[56] = hc_bytealign_S (w[54], w[55], offset); w[55] = hc_bytealign_S (w[53], w[54], offset); w[54] = hc_bytealign_S (w[52], w[53], offset); w[53] = hc_bytealign_S (w[51], w[52], offset); w[52] = hc_bytealign_S (w[50], w[51], offset); w[51] = hc_bytealign_S (w[49], w[50], offset); w[50] = hc_bytealign_S (w[48], w[49], offset); w[49] = hc_bytealign_S (w[47], w[48], offset); w[48] = hc_bytealign_S (w[46], w[47], offset); w[47] = hc_bytealign_S (w[45], w[46], offset); w[46] = hc_bytealign_S (w[44], w[45], offset); w[45] = hc_bytealign_S (w[43], w[44], offset); w[44] = hc_bytealign_S (w[42], w[43], offset); w[43] = hc_bytealign_S (w[41], w[42], offset); w[42] = hc_bytealign_S (w[40], w[41], offset); w[41] = hc_bytealign_S (w[39], w[40], offset); w[40] = hc_bytealign_S (w[38], w[39], offset); w[39] = hc_bytealign_S (w[37], w[38], offset); w[38] = hc_bytealign_S (w[36], w[37], offset); w[37] = hc_bytealign_S (w[35], w[36], offset); w[36] = hc_bytealign_S (w[34], w[35], offset); w[35] = hc_bytealign_S (w[33], w[34], offset); w[34] = hc_bytealign_S (w[32], w[33], offset); w[33] = hc_bytealign_S (w[31], w[32], offset); w[32] = hc_bytealign_S (w[30], w[31], offset); w[31] = hc_bytealign_S (w[29], w[30], offset); w[30] = hc_bytealign_S (w[28], w[29], offset); w[29] = hc_bytealign_S (w[27], w[28], offset); w[28] = hc_bytealign_S (w[26], w[27], offset); w[27] = hc_bytealign_S (w[25], w[26], offset); w[26] = hc_bytealign_S (w[24], w[25], offset); w[25] = hc_bytealign_S (w[23], w[24], offset); w[24] = hc_bytealign_S (w[22], w[23], offset); w[23] = hc_bytealign_S (w[21], w[22], offset); w[22] = hc_bytealign_S (w[20], w[21], offset); w[21] = hc_bytealign_S (w[19], w[20], offset); w[20] = hc_bytealign_S (w[18], w[19], offset); w[19] = hc_bytealign_S (w[17], w[18], offset); w[18] = hc_bytealign_S (w[16], w[17], offset); w[17] = hc_bytealign_S (w[15], w[16], offset); w[16] = hc_bytealign_S (w[14], w[15], offset); w[15] = hc_bytealign_S (w[13], w[14], offset); w[14] = hc_bytealign_S (w[12], w[13], offset); w[13] = hc_bytealign_S (w[11], w[12], offset); w[12] = hc_bytealign_S (w[10], w[11], offset); w[11] = hc_bytealign_S (w[ 9], w[10], offset); w[10] = hc_bytealign_S (w[ 8], w[ 9], offset); w[ 9] = hc_bytealign_S (w[ 7], w[ 8], offset); w[ 8] = hc_bytealign_S (w[ 6], w[ 7], offset); w[ 7] = hc_bytealign_S (w[ 5], w[ 6], offset); w[ 6] = hc_bytealign_S (w[ 4], w[ 5], offset); w[ 5] = hc_bytealign_S (w[ 3], w[ 4], offset); w[ 4] = hc_bytealign_S (w[ 2], w[ 3], offset); w[ 3] = hc_bytealign_S (w[ 1], w[ 2], offset); w[ 2] = hc_bytealign_S (w[ 0], w[ 1], offset); w[ 1] = hc_bytealign_S ( 0, w[ 0], offset); w[ 0] = 0; break; case 2: w[63] = hc_bytealign_S (w[60], w[61], offset); w[62] = hc_bytealign_S (w[59], w[60], offset); w[61] = hc_bytealign_S (w[58], w[59], offset); w[60] = hc_bytealign_S (w[57], w[58], offset); w[59] = hc_bytealign_S (w[56], w[57], offset); w[58] = hc_bytealign_S (w[55], w[56], offset); w[57] = hc_bytealign_S (w[54], w[55], offset); w[56] = hc_bytealign_S (w[53], w[54], offset); w[55] = hc_bytealign_S (w[52], w[53], offset); w[54] = hc_bytealign_S (w[51], w[52], offset); w[53] = hc_bytealign_S (w[50], w[51], offset); w[52] = hc_bytealign_S (w[49], w[50], offset); w[51] = hc_bytealign_S (w[48], w[49], offset); w[50] = hc_bytealign_S (w[47], w[48], offset); w[49] = hc_bytealign_S (w[46], w[47], offset); w[48] = hc_bytealign_S (w[45], w[46], offset); w[47] = hc_bytealign_S (w[44], w[45], offset); w[46] = hc_bytealign_S (w[43], w[44], offset); w[45] = hc_bytealign_S (w[42], w[43], offset); w[44] = hc_bytealign_S (w[41], w[42], offset); w[43] = hc_bytealign_S (w[40], w[41], offset); w[42] = hc_bytealign_S (w[39], w[40], offset); w[41] = hc_bytealign_S (w[38], w[39], offset); w[40] = hc_bytealign_S (w[37], w[38], offset); w[39] = hc_bytealign_S (w[36], w[37], offset); w[38] = hc_bytealign_S (w[35], w[36], offset); w[37] = hc_bytealign_S (w[34], w[35], offset); w[36] = hc_bytealign_S (w[33], w[34], offset); w[35] = hc_bytealign_S (w[32], w[33], offset); w[34] = hc_bytealign_S (w[31], w[32], offset); w[33] = hc_bytealign_S (w[30], w[31], offset); w[32] = hc_bytealign_S (w[29], w[30], offset); w[31] = hc_bytealign_S (w[28], w[29], offset); w[30] = hc_bytealign_S (w[27], w[28], offset); w[29] = hc_bytealign_S (w[26], w[27], offset); w[28] = hc_bytealign_S (w[25], w[26], offset); w[27] = hc_bytealign_S (w[24], w[25], offset); w[26] = hc_bytealign_S (w[23], w[24], offset); w[25] = hc_bytealign_S (w[22], w[23], offset); w[24] = hc_bytealign_S (w[21], w[22], offset); w[23] = hc_bytealign_S (w[20], w[21], offset); w[22] = hc_bytealign_S (w[19], w[20], offset); w[21] = hc_bytealign_S (w[18], w[19], offset); w[20] = hc_bytealign_S (w[17], w[18], offset); w[19] = hc_bytealign_S (w[16], w[17], offset); w[18] = hc_bytealign_S (w[15], w[16], offset); w[17] = hc_bytealign_S (w[14], w[15], offset); w[16] = hc_bytealign_S (w[13], w[14], offset); w[15] = hc_bytealign_S (w[12], w[13], offset); w[14] = hc_bytealign_S (w[11], w[12], offset); w[13] = hc_bytealign_S (w[10], w[11], offset); w[12] = hc_bytealign_S (w[ 9], w[10], offset); w[11] = hc_bytealign_S (w[ 8], w[ 9], offset); w[10] = hc_bytealign_S (w[ 7], w[ 8], offset); w[ 9] = hc_bytealign_S (w[ 6], w[ 7], offset); w[ 8] = hc_bytealign_S (w[ 5], w[ 6], offset); w[ 7] = hc_bytealign_S (w[ 4], w[ 5], offset); w[ 6] = hc_bytealign_S (w[ 3], w[ 4], offset); w[ 5] = hc_bytealign_S (w[ 2], w[ 3], offset); w[ 4] = hc_bytealign_S (w[ 1], w[ 2], offset); w[ 3] = hc_bytealign_S (w[ 0], w[ 1], offset); w[ 2] = hc_bytealign_S ( 0, w[ 0], offset); w[ 1] = 0; w[ 0] = 0; break; case 3: w[63] = hc_bytealign_S (w[59], w[60], offset); w[62] = hc_bytealign_S (w[58], w[59], offset); w[61] = hc_bytealign_S (w[57], w[58], offset); w[60] = hc_bytealign_S (w[56], w[57], offset); w[59] = hc_bytealign_S (w[55], w[56], offset); w[58] = hc_bytealign_S (w[54], w[55], offset); w[57] = hc_bytealign_S (w[53], w[54], offset); w[56] = hc_bytealign_S (w[52], w[53], offset); w[55] = hc_bytealign_S (w[51], w[52], offset); w[54] = hc_bytealign_S (w[50], w[51], offset); w[53] = hc_bytealign_S (w[49], w[50], offset); w[52] = hc_bytealign_S (w[48], w[49], offset); w[51] = hc_bytealign_S (w[47], w[48], offset); w[50] = hc_bytealign_S (w[46], w[47], offset); w[49] = hc_bytealign_S (w[45], w[46], offset); w[48] = hc_bytealign_S (w[44], w[45], offset); w[47] = hc_bytealign_S (w[43], w[44], offset); w[46] = hc_bytealign_S (w[42], w[43], offset); w[45] = hc_bytealign_S (w[41], w[42], offset); w[44] = hc_bytealign_S (w[40], w[41], offset); w[43] = hc_bytealign_S (w[39], w[40], offset); w[42] = hc_bytealign_S (w[38], w[39], offset); w[41] = hc_bytealign_S (w[37], w[38], offset); w[40] = hc_bytealign_S (w[36], w[37], offset); w[39] = hc_bytealign_S (w[35], w[36], offset); w[38] = hc_bytealign_S (w[34], w[35], offset); w[37] = hc_bytealign_S (w[33], w[34], offset); w[36] = hc_bytealign_S (w[32], w[33], offset); w[35] = hc_bytealign_S (w[31], w[32], offset); w[34] = hc_bytealign_S (w[30], w[31], offset); w[33] = hc_bytealign_S (w[29], w[30], offset); w[32] = hc_bytealign_S (w[28], w[29], offset); w[31] = hc_bytealign_S (w[27], w[28], offset); w[30] = hc_bytealign_S (w[26], w[27], offset); w[29] = hc_bytealign_S (w[25], w[26], offset); w[28] = hc_bytealign_S (w[24], w[25], offset); w[27] = hc_bytealign_S (w[23], w[24], offset); w[26] = hc_bytealign_S (w[22], w[23], offset); w[25] = hc_bytealign_S (w[21], w[22], offset); w[24] = hc_bytealign_S (w[20], w[21], offset); w[23] = hc_bytealign_S (w[19], w[20], offset); w[22] = hc_bytealign_S (w[18], w[19], offset); w[21] = hc_bytealign_S (w[17], w[18], offset); w[20] = hc_bytealign_S (w[16], w[17], offset); w[19] = hc_bytealign_S (w[15], w[16], offset); w[18] = hc_bytealign_S (w[14], w[15], offset); w[17] = hc_bytealign_S (w[13], w[14], offset); w[16] = hc_bytealign_S (w[12], w[13], offset); w[15] = hc_bytealign_S (w[11], w[12], offset); w[14] = hc_bytealign_S (w[10], w[11], offset); w[13] = hc_bytealign_S (w[ 9], w[10], offset); w[12] = hc_bytealign_S (w[ 8], w[ 9], offset); w[11] = hc_bytealign_S (w[ 7], w[ 8], offset); w[10] = hc_bytealign_S (w[ 6], w[ 7], offset); w[ 9] = hc_bytealign_S (w[ 5], w[ 6], offset); w[ 8] = hc_bytealign_S (w[ 4], w[ 5], offset); w[ 7] = hc_bytealign_S (w[ 3], w[ 4], offset); w[ 6] = hc_bytealign_S (w[ 2], w[ 3], offset); w[ 5] = hc_bytealign_S (w[ 1], w[ 2], offset); w[ 4] = hc_bytealign_S (w[ 0], w[ 1], offset); w[ 3] = hc_bytealign_S ( 0, w[ 0], offset); w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 4: w[63] = hc_bytealign_S (w[58], w[59], offset); w[62] = hc_bytealign_S (w[57], w[58], offset); w[61] = hc_bytealign_S (w[56], w[57], offset); w[60] = hc_bytealign_S (w[55], w[56], offset); w[59] = hc_bytealign_S (w[54], w[55], offset); w[58] = hc_bytealign_S (w[53], w[54], offset); w[57] = hc_bytealign_S (w[52], w[53], offset); w[56] = hc_bytealign_S (w[51], w[52], offset); w[55] = hc_bytealign_S (w[50], w[51], offset); w[54] = hc_bytealign_S (w[49], w[50], offset); w[53] = hc_bytealign_S (w[48], w[49], offset); w[52] = hc_bytealign_S (w[47], w[48], offset); w[51] = hc_bytealign_S (w[46], w[47], offset); w[50] = hc_bytealign_S (w[45], w[46], offset); w[49] = hc_bytealign_S (w[44], w[45], offset); w[48] = hc_bytealign_S (w[43], w[44], offset); w[47] = hc_bytealign_S (w[42], w[43], offset); w[46] = hc_bytealign_S (w[41], w[42], offset); w[45] = hc_bytealign_S (w[40], w[41], offset); w[44] = hc_bytealign_S (w[39], w[40], offset); w[43] = hc_bytealign_S (w[38], w[39], offset); w[42] = hc_bytealign_S (w[37], w[38], offset); w[41] = hc_bytealign_S (w[36], w[37], offset); w[40] = hc_bytealign_S (w[35], w[36], offset); w[39] = hc_bytealign_S (w[34], w[35], offset); w[38] = hc_bytealign_S (w[33], w[34], offset); w[37] = hc_bytealign_S (w[32], w[33], offset); w[36] = hc_bytealign_S (w[31], w[32], offset); w[35] = hc_bytealign_S (w[30], w[31], offset); w[34] = hc_bytealign_S (w[29], w[30], offset); w[33] = hc_bytealign_S (w[28], w[29], offset); w[32] = hc_bytealign_S (w[27], w[28], offset); w[31] = hc_bytealign_S (w[26], w[27], offset); w[30] = hc_bytealign_S (w[25], w[26], offset); w[29] = hc_bytealign_S (w[24], w[25], offset); w[28] = hc_bytealign_S (w[23], w[24], offset); w[27] = hc_bytealign_S (w[22], w[23], offset); w[26] = hc_bytealign_S (w[21], w[22], offset); w[25] = hc_bytealign_S (w[20], w[21], offset); w[24] = hc_bytealign_S (w[19], w[20], offset); w[23] = hc_bytealign_S (w[18], w[19], offset); w[22] = hc_bytealign_S (w[17], w[18], offset); w[21] = hc_bytealign_S (w[16], w[17], offset); w[20] = hc_bytealign_S (w[15], w[16], offset); w[19] = hc_bytealign_S (w[14], w[15], offset); w[18] = hc_bytealign_S (w[13], w[14], offset); w[17] = hc_bytealign_S (w[12], w[13], offset); w[16] = hc_bytealign_S (w[11], w[12], offset); w[15] = hc_bytealign_S (w[10], w[11], offset); w[14] = hc_bytealign_S (w[ 9], w[10], offset); w[13] = hc_bytealign_S (w[ 8], w[ 9], offset); w[12] = hc_bytealign_S (w[ 7], w[ 8], offset); w[11] = hc_bytealign_S (w[ 6], w[ 7], offset); w[10] = hc_bytealign_S (w[ 5], w[ 6], offset); w[ 9] = hc_bytealign_S (w[ 4], w[ 5], offset); w[ 8] = hc_bytealign_S (w[ 3], w[ 4], offset); w[ 7] = hc_bytealign_S (w[ 2], w[ 3], offset); w[ 6] = hc_bytealign_S (w[ 1], w[ 2], offset); w[ 5] = hc_bytealign_S (w[ 0], w[ 1], offset); w[ 4] = hc_bytealign_S ( 0, w[ 0], offset); w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 5: w[63] = hc_bytealign_S (w[57], w[58], offset); w[62] = hc_bytealign_S (w[56], w[57], offset); w[61] = hc_bytealign_S (w[55], w[56], offset); w[60] = hc_bytealign_S (w[54], w[55], offset); w[59] = hc_bytealign_S (w[53], w[54], offset); w[58] = hc_bytealign_S (w[52], w[53], offset); w[57] = hc_bytealign_S (w[51], w[52], offset); w[56] = hc_bytealign_S (w[50], w[51], offset); w[55] = hc_bytealign_S (w[49], w[50], offset); w[54] = hc_bytealign_S (w[48], w[49], offset); w[53] = hc_bytealign_S (w[47], w[48], offset); w[52] = hc_bytealign_S (w[46], w[47], offset); w[51] = hc_bytealign_S (w[45], w[46], offset); w[50] = hc_bytealign_S (w[44], w[45], offset); w[49] = hc_bytealign_S (w[43], w[44], offset); w[48] = hc_bytealign_S (w[42], w[43], offset); w[47] = hc_bytealign_S (w[41], w[42], offset); w[46] = hc_bytealign_S (w[40], w[41], offset); w[45] = hc_bytealign_S (w[39], w[40], offset); w[44] = hc_bytealign_S (w[38], w[39], offset); w[43] = hc_bytealign_S (w[37], w[38], offset); w[42] = hc_bytealign_S (w[36], w[37], offset); w[41] = hc_bytealign_S (w[35], w[36], offset); w[40] = hc_bytealign_S (w[34], w[35], offset); w[39] = hc_bytealign_S (w[33], w[34], offset); w[38] = hc_bytealign_S (w[32], w[33], offset); w[37] = hc_bytealign_S (w[31], w[32], offset); w[36] = hc_bytealign_S (w[30], w[31], offset); w[35] = hc_bytealign_S (w[29], w[30], offset); w[34] = hc_bytealign_S (w[28], w[29], offset); w[33] = hc_bytealign_S (w[27], w[28], offset); w[32] = hc_bytealign_S (w[26], w[27], offset); w[31] = hc_bytealign_S (w[25], w[26], offset); w[30] = hc_bytealign_S (w[24], w[25], offset); w[29] = hc_bytealign_S (w[23], w[24], offset); w[28] = hc_bytealign_S (w[22], w[23], offset); w[27] = hc_bytealign_S (w[21], w[22], offset); w[26] = hc_bytealign_S (w[20], w[21], offset); w[25] = hc_bytealign_S (w[19], w[20], offset); w[24] = hc_bytealign_S (w[18], w[19], offset); w[23] = hc_bytealign_S (w[17], w[18], offset); w[22] = hc_bytealign_S (w[16], w[17], offset); w[21] = hc_bytealign_S (w[15], w[16], offset); w[20] = hc_bytealign_S (w[14], w[15], offset); w[19] = hc_bytealign_S (w[13], w[14], offset); w[18] = hc_bytealign_S (w[12], w[13], offset); w[17] = hc_bytealign_S (w[11], w[12], offset); w[16] = hc_bytealign_S (w[10], w[11], offset); w[15] = hc_bytealign_S (w[ 9], w[10], offset); w[14] = hc_bytealign_S (w[ 8], w[ 9], offset); w[13] = hc_bytealign_S (w[ 7], w[ 8], offset); w[12] = hc_bytealign_S (w[ 6], w[ 7], offset); w[11] = hc_bytealign_S (w[ 5], w[ 6], offset); w[10] = hc_bytealign_S (w[ 4], w[ 5], offset); w[ 9] = hc_bytealign_S (w[ 3], w[ 4], offset); w[ 8] = hc_bytealign_S (w[ 2], w[ 3], offset); w[ 7] = hc_bytealign_S (w[ 1], w[ 2], offset); w[ 6] = hc_bytealign_S (w[ 0], w[ 1], offset); w[ 5] = hc_bytealign_S ( 0, w[ 0], offset); w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 6: w[63] = hc_bytealign_S (w[56], w[57], offset); w[62] = hc_bytealign_S (w[55], w[56], offset); w[61] = hc_bytealign_S (w[54], w[55], offset); w[60] = hc_bytealign_S (w[53], w[54], offset); w[59] = hc_bytealign_S (w[52], w[53], offset); w[58] = hc_bytealign_S (w[51], w[52], offset); w[57] = hc_bytealign_S (w[50], w[51], offset); w[56] = hc_bytealign_S (w[49], w[50], offset); w[55] = hc_bytealign_S (w[48], w[49], offset); w[54] = hc_bytealign_S (w[47], w[48], offset); w[53] = hc_bytealign_S (w[46], w[47], offset); w[52] = hc_bytealign_S (w[45], w[46], offset); w[51] = hc_bytealign_S (w[44], w[45], offset); w[50] = hc_bytealign_S (w[43], w[44], offset); w[49] = hc_bytealign_S (w[42], w[43], offset); w[48] = hc_bytealign_S (w[41], w[42], offset); w[47] = hc_bytealign_S (w[40], w[41], offset); w[46] = hc_bytealign_S (w[39], w[40], offset); w[45] = hc_bytealign_S (w[38], w[39], offset); w[44] = hc_bytealign_S (w[37], w[38], offset); w[43] = hc_bytealign_S (w[36], w[37], offset); w[42] = hc_bytealign_S (w[35], w[36], offset); w[41] = hc_bytealign_S (w[34], w[35], offset); w[40] = hc_bytealign_S (w[33], w[34], offset); w[39] = hc_bytealign_S (w[32], w[33], offset); w[38] = hc_bytealign_S (w[31], w[32], offset); w[37] = hc_bytealign_S (w[30], w[31], offset); w[36] = hc_bytealign_S (w[29], w[30], offset); w[35] = hc_bytealign_S (w[28], w[29], offset); w[34] = hc_bytealign_S (w[27], w[28], offset); w[33] = hc_bytealign_S (w[26], w[27], offset); w[32] = hc_bytealign_S (w[25], w[26], offset); w[31] = hc_bytealign_S (w[24], w[25], offset); w[30] = hc_bytealign_S (w[23], w[24], offset); w[29] = hc_bytealign_S (w[22], w[23], offset); w[28] = hc_bytealign_S (w[21], w[22], offset); w[27] = hc_bytealign_S (w[20], w[21], offset); w[26] = hc_bytealign_S (w[19], w[20], offset); w[25] = hc_bytealign_S (w[18], w[19], offset); w[24] = hc_bytealign_S (w[17], w[18], offset); w[23] = hc_bytealign_S (w[16], w[17], offset); w[22] = hc_bytealign_S (w[15], w[16], offset); w[21] = hc_bytealign_S (w[14], w[15], offset); w[20] = hc_bytealign_S (w[13], w[14], offset); w[19] = hc_bytealign_S (w[12], w[13], offset); w[18] = hc_bytealign_S (w[11], w[12], offset); w[17] = hc_bytealign_S (w[10], w[11], offset); w[16] = hc_bytealign_S (w[ 9], w[10], offset); w[15] = hc_bytealign_S (w[ 8], w[ 9], offset); w[14] = hc_bytealign_S (w[ 7], w[ 8], offset); w[13] = hc_bytealign_S (w[ 6], w[ 7], offset); w[12] = hc_bytealign_S (w[ 5], w[ 6], offset); w[11] = hc_bytealign_S (w[ 4], w[ 5], offset); w[10] = hc_bytealign_S (w[ 3], w[ 4], offset); w[ 9] = hc_bytealign_S (w[ 2], w[ 3], offset); w[ 8] = hc_bytealign_S (w[ 1], w[ 2], offset); w[ 7] = hc_bytealign_S (w[ 0], w[ 1], offset); w[ 6] = hc_bytealign_S ( 0, w[ 0], offset); w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 7: w[63] = hc_bytealign_S (w[55], w[56], offset); w[62] = hc_bytealign_S (w[54], w[55], offset); w[61] = hc_bytealign_S (w[53], w[54], offset); w[60] = hc_bytealign_S (w[52], w[53], offset); w[59] = hc_bytealign_S (w[51], w[52], offset); w[58] = hc_bytealign_S (w[50], w[51], offset); w[57] = hc_bytealign_S (w[49], w[50], offset); w[56] = hc_bytealign_S (w[48], w[49], offset); w[55] = hc_bytealign_S (w[47], w[48], offset); w[54] = hc_bytealign_S (w[46], w[47], offset); w[53] = hc_bytealign_S (w[45], w[46], offset); w[52] = hc_bytealign_S (w[44], w[45], offset); w[51] = hc_bytealign_S (w[43], w[44], offset); w[50] = hc_bytealign_S (w[42], w[43], offset); w[49] = hc_bytealign_S (w[41], w[42], offset); w[48] = hc_bytealign_S (w[40], w[41], offset); w[47] = hc_bytealign_S (w[39], w[40], offset); w[46] = hc_bytealign_S (w[38], w[39], offset); w[45] = hc_bytealign_S (w[37], w[38], offset); w[44] = hc_bytealign_S (w[36], w[37], offset); w[43] = hc_bytealign_S (w[35], w[36], offset); w[42] = hc_bytealign_S (w[34], w[35], offset); w[41] = hc_bytealign_S (w[33], w[34], offset); w[40] = hc_bytealign_S (w[32], w[33], offset); w[39] = hc_bytealign_S (w[31], w[32], offset); w[38] = hc_bytealign_S (w[30], w[31], offset); w[37] = hc_bytealign_S (w[29], w[30], offset); w[36] = hc_bytealign_S (w[28], w[29], offset); w[35] = hc_bytealign_S (w[27], w[28], offset); w[34] = hc_bytealign_S (w[26], w[27], offset); w[33] = hc_bytealign_S (w[25], w[26], offset); w[32] = hc_bytealign_S (w[24], w[25], offset); w[31] = hc_bytealign_S (w[23], w[24], offset); w[30] = hc_bytealign_S (w[22], w[23], offset); w[29] = hc_bytealign_S (w[21], w[22], offset); w[28] = hc_bytealign_S (w[20], w[21], offset); w[27] = hc_bytealign_S (w[19], w[20], offset); w[26] = hc_bytealign_S (w[18], w[19], offset); w[25] = hc_bytealign_S (w[17], w[18], offset); w[24] = hc_bytealign_S (w[16], w[17], offset); w[23] = hc_bytealign_S (w[15], w[16], offset); w[22] = hc_bytealign_S (w[14], w[15], offset); w[21] = hc_bytealign_S (w[13], w[14], offset); w[20] = hc_bytealign_S (w[12], w[13], offset); w[19] = hc_bytealign_S (w[11], w[12], offset); w[18] = hc_bytealign_S (w[10], w[11], offset); w[17] = hc_bytealign_S (w[ 9], w[10], offset); w[16] = hc_bytealign_S (w[ 8], w[ 9], offset); w[15] = hc_bytealign_S (w[ 7], w[ 8], offset); w[14] = hc_bytealign_S (w[ 6], w[ 7], offset); w[13] = hc_bytealign_S (w[ 5], w[ 6], offset); w[12] = hc_bytealign_S (w[ 4], w[ 5], offset); w[11] = hc_bytealign_S (w[ 3], w[ 4], offset); w[10] = hc_bytealign_S (w[ 2], w[ 3], offset); w[ 9] = hc_bytealign_S (w[ 1], w[ 2], offset); w[ 8] = hc_bytealign_S (w[ 0], w[ 1], offset); w[ 7] = hc_bytealign_S ( 0, w[ 0], offset); w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 8: w[63] = hc_bytealign_S (w[54], w[55], offset); w[62] = hc_bytealign_S (w[53], w[54], offset); w[61] = hc_bytealign_S (w[52], w[53], offset); w[60] = hc_bytealign_S (w[51], w[52], offset); w[59] = hc_bytealign_S (w[50], w[51], offset); w[58] = hc_bytealign_S (w[49], w[50], offset); w[57] = hc_bytealign_S (w[48], w[49], offset); w[56] = hc_bytealign_S (w[47], w[48], offset); w[55] = hc_bytealign_S (w[46], w[47], offset); w[54] = hc_bytealign_S (w[45], w[46], offset); w[53] = hc_bytealign_S (w[44], w[45], offset); w[52] = hc_bytealign_S (w[43], w[44], offset); w[51] = hc_bytealign_S (w[42], w[43], offset); w[50] = hc_bytealign_S (w[41], w[42], offset); w[49] = hc_bytealign_S (w[40], w[41], offset); w[48] = hc_bytealign_S (w[39], w[40], offset); w[47] = hc_bytealign_S (w[38], w[39], offset); w[46] = hc_bytealign_S (w[37], w[38], offset); w[45] = hc_bytealign_S (w[36], w[37], offset); w[44] = hc_bytealign_S (w[35], w[36], offset); w[43] = hc_bytealign_S (w[34], w[35], offset); w[42] = hc_bytealign_S (w[33], w[34], offset); w[41] = hc_bytealign_S (w[32], w[33], offset); w[40] = hc_bytealign_S (w[31], w[32], offset); w[39] = hc_bytealign_S (w[30], w[31], offset); w[38] = hc_bytealign_S (w[29], w[30], offset); w[37] = hc_bytealign_S (w[28], w[29], offset); w[36] = hc_bytealign_S (w[27], w[28], offset); w[35] = hc_bytealign_S (w[26], w[27], offset); w[34] = hc_bytealign_S (w[25], w[26], offset); w[33] = hc_bytealign_S (w[24], w[25], offset); w[32] = hc_bytealign_S (w[23], w[24], offset); w[31] = hc_bytealign_S (w[22], w[23], offset); w[30] = hc_bytealign_S (w[21], w[22], offset); w[29] = hc_bytealign_S (w[20], w[21], offset); w[28] = hc_bytealign_S (w[19], w[20], offset); w[27] = hc_bytealign_S (w[18], w[19], offset); w[26] = hc_bytealign_S (w[17], w[18], offset); w[25] = hc_bytealign_S (w[16], w[17], offset); w[24] = hc_bytealign_S (w[15], w[16], offset); w[23] = hc_bytealign_S (w[14], w[15], offset); w[22] = hc_bytealign_S (w[13], w[14], offset); w[21] = hc_bytealign_S (w[12], w[13], offset); w[20] = hc_bytealign_S (w[11], w[12], offset); w[19] = hc_bytealign_S (w[10], w[11], offset); w[18] = hc_bytealign_S (w[ 9], w[10], offset); w[17] = hc_bytealign_S (w[ 8], w[ 9], offset); w[16] = hc_bytealign_S (w[ 7], w[ 8], offset); w[15] = hc_bytealign_S (w[ 6], w[ 7], offset); w[14] = hc_bytealign_S (w[ 5], w[ 6], offset); w[13] = hc_bytealign_S (w[ 4], w[ 5], offset); w[12] = hc_bytealign_S (w[ 3], w[ 4], offset); w[11] = hc_bytealign_S (w[ 2], w[ 3], offset); w[10] = hc_bytealign_S (w[ 1], w[ 2], offset); w[ 9] = hc_bytealign_S (w[ 0], w[ 1], offset); w[ 8] = hc_bytealign_S ( 0, w[ 0], offset); w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 9: w[63] = hc_bytealign_S (w[53], w[54], offset); w[62] = hc_bytealign_S (w[52], w[53], offset); w[61] = hc_bytealign_S (w[51], w[52], offset); w[60] = hc_bytealign_S (w[50], w[51], offset); w[59] = hc_bytealign_S (w[49], w[50], offset); w[58] = hc_bytealign_S (w[48], w[49], offset); w[57] = hc_bytealign_S (w[47], w[48], offset); w[56] = hc_bytealign_S (w[46], w[47], offset); w[55] = hc_bytealign_S (w[45], w[46], offset); w[54] = hc_bytealign_S (w[44], w[45], offset); w[53] = hc_bytealign_S (w[43], w[44], offset); w[52] = hc_bytealign_S (w[42], w[43], offset); w[51] = hc_bytealign_S (w[41], w[42], offset); w[50] = hc_bytealign_S (w[40], w[41], offset); w[49] = hc_bytealign_S (w[39], w[40], offset); w[48] = hc_bytealign_S (w[38], w[39], offset); w[47] = hc_bytealign_S (w[37], w[38], offset); w[46] = hc_bytealign_S (w[36], w[37], offset); w[45] = hc_bytealign_S (w[35], w[36], offset); w[44] = hc_bytealign_S (w[34], w[35], offset); w[43] = hc_bytealign_S (w[33], w[34], offset); w[42] = hc_bytealign_S (w[32], w[33], offset); w[41] = hc_bytealign_S (w[31], w[32], offset); w[40] = hc_bytealign_S (w[30], w[31], offset); w[39] = hc_bytealign_S (w[29], w[30], offset); w[38] = hc_bytealign_S (w[28], w[29], offset); w[37] = hc_bytealign_S (w[27], w[28], offset); w[36] = hc_bytealign_S (w[26], w[27], offset); w[35] = hc_bytealign_S (w[25], w[26], offset); w[34] = hc_bytealign_S (w[24], w[25], offset); w[33] = hc_bytealign_S (w[23], w[24], offset); w[32] = hc_bytealign_S (w[22], w[23], offset); w[31] = hc_bytealign_S (w[21], w[22], offset); w[30] = hc_bytealign_S (w[20], w[21], offset); w[29] = hc_bytealign_S (w[19], w[20], offset); w[28] = hc_bytealign_S (w[18], w[19], offset); w[27] = hc_bytealign_S (w[17], w[18], offset); w[26] = hc_bytealign_S (w[16], w[17], offset); w[25] = hc_bytealign_S (w[15], w[16], offset); w[24] = hc_bytealign_S (w[14], w[15], offset); w[23] = hc_bytealign_S (w[13], w[14], offset); w[22] = hc_bytealign_S (w[12], w[13], offset); w[21] = hc_bytealign_S (w[11], w[12], offset); w[20] = hc_bytealign_S (w[10], w[11], offset); w[19] = hc_bytealign_S (w[ 9], w[10], offset); w[18] = hc_bytealign_S (w[ 8], w[ 9], offset); w[17] = hc_bytealign_S (w[ 7], w[ 8], offset); w[16] = hc_bytealign_S (w[ 6], w[ 7], offset); w[15] = hc_bytealign_S (w[ 5], w[ 6], offset); w[14] = hc_bytealign_S (w[ 4], w[ 5], offset); w[13] = hc_bytealign_S (w[ 3], w[ 4], offset); w[12] = hc_bytealign_S (w[ 2], w[ 3], offset); w[11] = hc_bytealign_S (w[ 1], w[ 2], offset); w[10] = hc_bytealign_S (w[ 0], w[ 1], offset); w[ 9] = hc_bytealign_S ( 0, w[ 0], offset); w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 10: w[63] = hc_bytealign_S (w[52], w[53], offset); w[62] = hc_bytealign_S (w[51], w[52], offset); w[61] = hc_bytealign_S (w[50], w[51], offset); w[60] = hc_bytealign_S (w[49], w[50], offset); w[59] = hc_bytealign_S (w[48], w[49], offset); w[58] = hc_bytealign_S (w[47], w[48], offset); w[57] = hc_bytealign_S (w[46], w[47], offset); w[56] = hc_bytealign_S (w[45], w[46], offset); w[55] = hc_bytealign_S (w[44], w[45], offset); w[54] = hc_bytealign_S (w[43], w[44], offset); w[53] = hc_bytealign_S (w[42], w[43], offset); w[52] = hc_bytealign_S (w[41], w[42], offset); w[51] = hc_bytealign_S (w[40], w[41], offset); w[50] = hc_bytealign_S (w[39], w[40], offset); w[49] = hc_bytealign_S (w[38], w[39], offset); w[48] = hc_bytealign_S (w[37], w[38], offset); w[47] = hc_bytealign_S (w[36], w[37], offset); w[46] = hc_bytealign_S (w[35], w[36], offset); w[45] = hc_bytealign_S (w[34], w[35], offset); w[44] = hc_bytealign_S (w[33], w[34], offset); w[43] = hc_bytealign_S (w[32], w[33], offset); w[42] = hc_bytealign_S (w[31], w[32], offset); w[41] = hc_bytealign_S (w[30], w[31], offset); w[40] = hc_bytealign_S (w[29], w[30], offset); w[39] = hc_bytealign_S (w[28], w[29], offset); w[38] = hc_bytealign_S (w[27], w[28], offset); w[37] = hc_bytealign_S (w[26], w[27], offset); w[36] = hc_bytealign_S (w[25], w[26], offset); w[35] = hc_bytealign_S (w[24], w[25], offset); w[34] = hc_bytealign_S (w[23], w[24], offset); w[33] = hc_bytealign_S (w[22], w[23], offset); w[32] = hc_bytealign_S (w[21], w[22], offset); w[31] = hc_bytealign_S (w[20], w[21], offset); w[30] = hc_bytealign_S (w[19], w[20], offset); w[29] = hc_bytealign_S (w[18], w[19], offset); w[28] = hc_bytealign_S (w[17], w[18], offset); w[27] = hc_bytealign_S (w[16], w[17], offset); w[26] = hc_bytealign_S (w[15], w[16], offset); w[25] = hc_bytealign_S (w[14], w[15], offset); w[24] = hc_bytealign_S (w[13], w[14], offset); w[23] = hc_bytealign_S (w[12], w[13], offset); w[22] = hc_bytealign_S (w[11], w[12], offset); w[21] = hc_bytealign_S (w[10], w[11], offset); w[20] = hc_bytealign_S (w[ 9], w[10], offset); w[19] = hc_bytealign_S (w[ 8], w[ 9], offset); w[18] = hc_bytealign_S (w[ 7], w[ 8], offset); w[17] = hc_bytealign_S (w[ 6], w[ 7], offset); w[16] = hc_bytealign_S (w[ 5], w[ 6], offset); w[15] = hc_bytealign_S (w[ 4], w[ 5], offset); w[14] = hc_bytealign_S (w[ 3], w[ 4], offset); w[13] = hc_bytealign_S (w[ 2], w[ 3], offset); w[12] = hc_bytealign_S (w[ 1], w[ 2], offset); w[11] = hc_bytealign_S (w[ 0], w[ 1], offset); w[10] = hc_bytealign_S ( 0, w[ 0], offset); w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 11: w[63] = hc_bytealign_S (w[51], w[52], offset); w[62] = hc_bytealign_S (w[50], w[51], offset); w[61] = hc_bytealign_S (w[49], w[50], offset); w[60] = hc_bytealign_S (w[48], w[49], offset); w[59] = hc_bytealign_S (w[47], w[48], offset); w[58] = hc_bytealign_S (w[46], w[47], offset); w[57] = hc_bytealign_S (w[45], w[46], offset); w[56] = hc_bytealign_S (w[44], w[45], offset); w[55] = hc_bytealign_S (w[43], w[44], offset); w[54] = hc_bytealign_S (w[42], w[43], offset); w[53] = hc_bytealign_S (w[41], w[42], offset); w[52] = hc_bytealign_S (w[40], w[41], offset); w[51] = hc_bytealign_S (w[39], w[40], offset); w[50] = hc_bytealign_S (w[38], w[39], offset); w[49] = hc_bytealign_S (w[37], w[38], offset); w[48] = hc_bytealign_S (w[36], w[37], offset); w[47] = hc_bytealign_S (w[35], w[36], offset); w[46] = hc_bytealign_S (w[34], w[35], offset); w[45] = hc_bytealign_S (w[33], w[34], offset); w[44] = hc_bytealign_S (w[32], w[33], offset); w[43] = hc_bytealign_S (w[31], w[32], offset); w[42] = hc_bytealign_S (w[30], w[31], offset); w[41] = hc_bytealign_S (w[29], w[30], offset); w[40] = hc_bytealign_S (w[28], w[29], offset); w[39] = hc_bytealign_S (w[27], w[28], offset); w[38] = hc_bytealign_S (w[26], w[27], offset); w[37] = hc_bytealign_S (w[25], w[26], offset); w[36] = hc_bytealign_S (w[24], w[25], offset); w[35] = hc_bytealign_S (w[23], w[24], offset); w[34] = hc_bytealign_S (w[22], w[23], offset); w[33] = hc_bytealign_S (w[21], w[22], offset); w[32] = hc_bytealign_S (w[20], w[21], offset); w[31] = hc_bytealign_S (w[19], w[20], offset); w[30] = hc_bytealign_S (w[18], w[19], offset); w[29] = hc_bytealign_S (w[17], w[18], offset); w[28] = hc_bytealign_S (w[16], w[17], offset); w[27] = hc_bytealign_S (w[15], w[16], offset); w[26] = hc_bytealign_S (w[14], w[15], offset); w[25] = hc_bytealign_S (w[13], w[14], offset); w[24] = hc_bytealign_S (w[12], w[13], offset); w[23] = hc_bytealign_S (w[11], w[12], offset); w[22] = hc_bytealign_S (w[10], w[11], offset); w[21] = hc_bytealign_S (w[ 9], w[10], offset); w[20] = hc_bytealign_S (w[ 8], w[ 9], offset); w[19] = hc_bytealign_S (w[ 7], w[ 8], offset); w[18] = hc_bytealign_S (w[ 6], w[ 7], offset); w[17] = hc_bytealign_S (w[ 5], w[ 6], offset); w[16] = hc_bytealign_S (w[ 4], w[ 5], offset); w[15] = hc_bytealign_S (w[ 3], w[ 4], offset); w[14] = hc_bytealign_S (w[ 2], w[ 3], offset); w[13] = hc_bytealign_S (w[ 1], w[ 2], offset); w[12] = hc_bytealign_S (w[ 0], w[ 1], offset); w[11] = hc_bytealign_S ( 0, w[ 0], offset); w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 12: w[63] = hc_bytealign_S (w[50], w[51], offset); w[62] = hc_bytealign_S (w[49], w[50], offset); w[61] = hc_bytealign_S (w[48], w[49], offset); w[60] = hc_bytealign_S (w[47], w[48], offset); w[59] = hc_bytealign_S (w[46], w[47], offset); w[58] = hc_bytealign_S (w[45], w[46], offset); w[57] = hc_bytealign_S (w[44], w[45], offset); w[56] = hc_bytealign_S (w[43], w[44], offset); w[55] = hc_bytealign_S (w[42], w[43], offset); w[54] = hc_bytealign_S (w[41], w[42], offset); w[53] = hc_bytealign_S (w[40], w[41], offset); w[52] = hc_bytealign_S (w[39], w[40], offset); w[51] = hc_bytealign_S (w[38], w[39], offset); w[50] = hc_bytealign_S (w[37], w[38], offset); w[49] = hc_bytealign_S (w[36], w[37], offset); w[48] = hc_bytealign_S (w[35], w[36], offset); w[47] = hc_bytealign_S (w[34], w[35], offset); w[46] = hc_bytealign_S (w[33], w[34], offset); w[45] = hc_bytealign_S (w[32], w[33], offset); w[44] = hc_bytealign_S (w[31], w[32], offset); w[43] = hc_bytealign_S (w[30], w[31], offset); w[42] = hc_bytealign_S (w[29], w[30], offset); w[41] = hc_bytealign_S (w[28], w[29], offset); w[40] = hc_bytealign_S (w[27], w[28], offset); w[39] = hc_bytealign_S (w[26], w[27], offset); w[38] = hc_bytealign_S (w[25], w[26], offset); w[37] = hc_bytealign_S (w[24], w[25], offset); w[36] = hc_bytealign_S (w[23], w[24], offset); w[35] = hc_bytealign_S (w[22], w[23], offset); w[34] = hc_bytealign_S (w[21], w[22], offset); w[33] = hc_bytealign_S (w[20], w[21], offset); w[32] = hc_bytealign_S (w[19], w[20], offset); w[31] = hc_bytealign_S (w[18], w[19], offset); w[30] = hc_bytealign_S (w[17], w[18], offset); w[29] = hc_bytealign_S (w[16], w[17], offset); w[28] = hc_bytealign_S (w[15], w[16], offset); w[27] = hc_bytealign_S (w[14], w[15], offset); w[26] = hc_bytealign_S (w[13], w[14], offset); w[25] = hc_bytealign_S (w[12], w[13], offset); w[24] = hc_bytealign_S (w[11], w[12], offset); w[23] = hc_bytealign_S (w[10], w[11], offset); w[22] = hc_bytealign_S (w[ 9], w[10], offset); w[21] = hc_bytealign_S (w[ 8], w[ 9], offset); w[20] = hc_bytealign_S (w[ 7], w[ 8], offset); w[19] = hc_bytealign_S (w[ 6], w[ 7], offset); w[18] = hc_bytealign_S (w[ 5], w[ 6], offset); w[17] = hc_bytealign_S (w[ 4], w[ 5], offset); w[16] = hc_bytealign_S (w[ 3], w[ 4], offset); w[15] = hc_bytealign_S (w[ 2], w[ 3], offset); w[14] = hc_bytealign_S (w[ 1], w[ 2], offset); w[13] = hc_bytealign_S (w[ 0], w[ 1], offset); w[12] = hc_bytealign_S ( 0, w[ 0], offset); w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 13: w[63] = hc_bytealign_S (w[49], w[50], offset); w[62] = hc_bytealign_S (w[48], w[49], offset); w[61] = hc_bytealign_S (w[47], w[48], offset); w[60] = hc_bytealign_S (w[46], w[47], offset); w[59] = hc_bytealign_S (w[45], w[46], offset); w[58] = hc_bytealign_S (w[44], w[45], offset); w[57] = hc_bytealign_S (w[43], w[44], offset); w[56] = hc_bytealign_S (w[42], w[43], offset); w[55] = hc_bytealign_S (w[41], w[42], offset); w[54] = hc_bytealign_S (w[40], w[41], offset); w[53] = hc_bytealign_S (w[39], w[40], offset); w[52] = hc_bytealign_S (w[38], w[39], offset); w[51] = hc_bytealign_S (w[37], w[38], offset); w[50] = hc_bytealign_S (w[36], w[37], offset); w[49] = hc_bytealign_S (w[35], w[36], offset); w[48] = hc_bytealign_S (w[34], w[35], offset); w[47] = hc_bytealign_S (w[33], w[34], offset); w[46] = hc_bytealign_S (w[32], w[33], offset); w[45] = hc_bytealign_S (w[31], w[32], offset); w[44] = hc_bytealign_S (w[30], w[31], offset); w[43] = hc_bytealign_S (w[29], w[30], offset); w[42] = hc_bytealign_S (w[28], w[29], offset); w[41] = hc_bytealign_S (w[27], w[28], offset); w[40] = hc_bytealign_S (w[26], w[27], offset); w[39] = hc_bytealign_S (w[25], w[26], offset); w[38] = hc_bytealign_S (w[24], w[25], offset); w[37] = hc_bytealign_S (w[23], w[24], offset); w[36] = hc_bytealign_S (w[22], w[23], offset); w[35] = hc_bytealign_S (w[21], w[22], offset); w[34] = hc_bytealign_S (w[20], w[21], offset); w[33] = hc_bytealign_S (w[19], w[20], offset); w[32] = hc_bytealign_S (w[18], w[19], offset); w[31] = hc_bytealign_S (w[17], w[18], offset); w[30] = hc_bytealign_S (w[16], w[17], offset); w[29] = hc_bytealign_S (w[15], w[16], offset); w[28] = hc_bytealign_S (w[14], w[15], offset); w[27] = hc_bytealign_S (w[13], w[14], offset); w[26] = hc_bytealign_S (w[12], w[13], offset); w[25] = hc_bytealign_S (w[11], w[12], offset); w[24] = hc_bytealign_S (w[10], w[11], offset); w[23] = hc_bytealign_S (w[ 9], w[10], offset); w[22] = hc_bytealign_S (w[ 8], w[ 9], offset); w[21] = hc_bytealign_S (w[ 7], w[ 8], offset); w[20] = hc_bytealign_S (w[ 6], w[ 7], offset); w[19] = hc_bytealign_S (w[ 5], w[ 6], offset); w[18] = hc_bytealign_S (w[ 4], w[ 5], offset); w[17] = hc_bytealign_S (w[ 3], w[ 4], offset); w[16] = hc_bytealign_S (w[ 2], w[ 3], offset); w[15] = hc_bytealign_S (w[ 1], w[ 2], offset); w[14] = hc_bytealign_S (w[ 0], w[ 1], offset); w[13] = hc_bytealign_S ( 0, w[ 0], offset); w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 14: w[63] = hc_bytealign_S (w[48], w[49], offset); w[62] = hc_bytealign_S (w[47], w[48], offset); w[61] = hc_bytealign_S (w[46], w[47], offset); w[60] = hc_bytealign_S (w[45], w[46], offset); w[59] = hc_bytealign_S (w[44], w[45], offset); w[58] = hc_bytealign_S (w[43], w[44], offset); w[57] = hc_bytealign_S (w[42], w[43], offset); w[56] = hc_bytealign_S (w[41], w[42], offset); w[55] = hc_bytealign_S (w[40], w[41], offset); w[54] = hc_bytealign_S (w[39], w[40], offset); w[53] = hc_bytealign_S (w[38], w[39], offset); w[52] = hc_bytealign_S (w[37], w[38], offset); w[51] = hc_bytealign_S (w[36], w[37], offset); w[50] = hc_bytealign_S (w[35], w[36], offset); w[49] = hc_bytealign_S (w[34], w[35], offset); w[48] = hc_bytealign_S (w[33], w[34], offset); w[47] = hc_bytealign_S (w[32], w[33], offset); w[46] = hc_bytealign_S (w[31], w[32], offset); w[45] = hc_bytealign_S (w[30], w[31], offset); w[44] = hc_bytealign_S (w[29], w[30], offset); w[43] = hc_bytealign_S (w[28], w[29], offset); w[42] = hc_bytealign_S (w[27], w[28], offset); w[41] = hc_bytealign_S (w[26], w[27], offset); w[40] = hc_bytealign_S (w[25], w[26], offset); w[39] = hc_bytealign_S (w[24], w[25], offset); w[38] = hc_bytealign_S (w[23], w[24], offset); w[37] = hc_bytealign_S (w[22], w[23], offset); w[36] = hc_bytealign_S (w[21], w[22], offset); w[35] = hc_bytealign_S (w[20], w[21], offset); w[34] = hc_bytealign_S (w[19], w[20], offset); w[33] = hc_bytealign_S (w[18], w[19], offset); w[32] = hc_bytealign_S (w[17], w[18], offset); w[31] = hc_bytealign_S (w[16], w[17], offset); w[30] = hc_bytealign_S (w[15], w[16], offset); w[29] = hc_bytealign_S (w[14], w[15], offset); w[28] = hc_bytealign_S (w[13], w[14], offset); w[27] = hc_bytealign_S (w[12], w[13], offset); w[26] = hc_bytealign_S (w[11], w[12], offset); w[25] = hc_bytealign_S (w[10], w[11], offset); w[24] = hc_bytealign_S (w[ 9], w[10], offset); w[23] = hc_bytealign_S (w[ 8], w[ 9], offset); w[22] = hc_bytealign_S (w[ 7], w[ 8], offset); w[21] = hc_bytealign_S (w[ 6], w[ 7], offset); w[20] = hc_bytealign_S (w[ 5], w[ 6], offset); w[19] = hc_bytealign_S (w[ 4], w[ 5], offset); w[18] = hc_bytealign_S (w[ 3], w[ 4], offset); w[17] = hc_bytealign_S (w[ 2], w[ 3], offset); w[16] = hc_bytealign_S (w[ 1], w[ 2], offset); w[15] = hc_bytealign_S (w[ 0], w[ 1], offset); w[14] = hc_bytealign_S ( 0, w[ 0], offset); w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 15: w[63] = hc_bytealign_S (w[47], w[48], offset); w[62] = hc_bytealign_S (w[46], w[47], offset); w[61] = hc_bytealign_S (w[45], w[46], offset); w[60] = hc_bytealign_S (w[44], w[45], offset); w[59] = hc_bytealign_S (w[43], w[44], offset); w[58] = hc_bytealign_S (w[42], w[43], offset); w[57] = hc_bytealign_S (w[41], w[42], offset); w[56] = hc_bytealign_S (w[40], w[41], offset); w[55] = hc_bytealign_S (w[39], w[40], offset); w[54] = hc_bytealign_S (w[38], w[39], offset); w[53] = hc_bytealign_S (w[37], w[38], offset); w[52] = hc_bytealign_S (w[36], w[37], offset); w[51] = hc_bytealign_S (w[35], w[36], offset); w[50] = hc_bytealign_S (w[34], w[35], offset); w[49] = hc_bytealign_S (w[33], w[34], offset); w[48] = hc_bytealign_S (w[32], w[33], offset); w[47] = hc_bytealign_S (w[31], w[32], offset); w[46] = hc_bytealign_S (w[30], w[31], offset); w[45] = hc_bytealign_S (w[29], w[30], offset); w[44] = hc_bytealign_S (w[28], w[29], offset); w[43] = hc_bytealign_S (w[27], w[28], offset); w[42] = hc_bytealign_S (w[26], w[27], offset); w[41] = hc_bytealign_S (w[25], w[26], offset); w[40] = hc_bytealign_S (w[24], w[25], offset); w[39] = hc_bytealign_S (w[23], w[24], offset); w[38] = hc_bytealign_S (w[22], w[23], offset); w[37] = hc_bytealign_S (w[21], w[22], offset); w[36] = hc_bytealign_S (w[20], w[21], offset); w[35] = hc_bytealign_S (w[19], w[20], offset); w[34] = hc_bytealign_S (w[18], w[19], offset); w[33] = hc_bytealign_S (w[17], w[18], offset); w[32] = hc_bytealign_S (w[16], w[17], offset); w[31] = hc_bytealign_S (w[15], w[16], offset); w[30] = hc_bytealign_S (w[14], w[15], offset); w[29] = hc_bytealign_S (w[13], w[14], offset); w[28] = hc_bytealign_S (w[12], w[13], offset); w[27] = hc_bytealign_S (w[11], w[12], offset); w[26] = hc_bytealign_S (w[10], w[11], offset); w[25] = hc_bytealign_S (w[ 9], w[10], offset); w[24] = hc_bytealign_S (w[ 8], w[ 9], offset); w[23] = hc_bytealign_S (w[ 7], w[ 8], offset); w[22] = hc_bytealign_S (w[ 6], w[ 7], offset); w[21] = hc_bytealign_S (w[ 5], w[ 6], offset); w[20] = hc_bytealign_S (w[ 4], w[ 5], offset); w[19] = hc_bytealign_S (w[ 3], w[ 4], offset); w[18] = hc_bytealign_S (w[ 2], w[ 3], offset); w[17] = hc_bytealign_S (w[ 1], w[ 2], offset); w[16] = hc_bytealign_S (w[ 0], w[ 1], offset); w[15] = hc_bytealign_S ( 0, w[ 0], offset); w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 16: w[63] = hc_bytealign_S (w[46], w[47], offset); w[62] = hc_bytealign_S (w[45], w[46], offset); w[61] = hc_bytealign_S (w[44], w[45], offset); w[60] = hc_bytealign_S (w[43], w[44], offset); w[59] = hc_bytealign_S (w[42], w[43], offset); w[58] = hc_bytealign_S (w[41], w[42], offset); w[57] = hc_bytealign_S (w[40], w[41], offset); w[56] = hc_bytealign_S (w[39], w[40], offset); w[55] = hc_bytealign_S (w[38], w[39], offset); w[54] = hc_bytealign_S (w[37], w[38], offset); w[53] = hc_bytealign_S (w[36], w[37], offset); w[52] = hc_bytealign_S (w[35], w[36], offset); w[51] = hc_bytealign_S (w[34], w[35], offset); w[50] = hc_bytealign_S (w[33], w[34], offset); w[49] = hc_bytealign_S (w[32], w[33], offset); w[48] = hc_bytealign_S (w[31], w[32], offset); w[47] = hc_bytealign_S (w[30], w[31], offset); w[46] = hc_bytealign_S (w[29], w[30], offset); w[45] = hc_bytealign_S (w[28], w[29], offset); w[44] = hc_bytealign_S (w[27], w[28], offset); w[43] = hc_bytealign_S (w[26], w[27], offset); w[42] = hc_bytealign_S (w[25], w[26], offset); w[41] = hc_bytealign_S (w[24], w[25], offset); w[40] = hc_bytealign_S (w[23], w[24], offset); w[39] = hc_bytealign_S (w[22], w[23], offset); w[38] = hc_bytealign_S (w[21], w[22], offset); w[37] = hc_bytealign_S (w[20], w[21], offset); w[36] = hc_bytealign_S (w[19], w[20], offset); w[35] = hc_bytealign_S (w[18], w[19], offset); w[34] = hc_bytealign_S (w[17], w[18], offset); w[33] = hc_bytealign_S (w[16], w[17], offset); w[32] = hc_bytealign_S (w[15], w[16], offset); w[31] = hc_bytealign_S (w[14], w[15], offset); w[30] = hc_bytealign_S (w[13], w[14], offset); w[29] = hc_bytealign_S (w[12], w[13], offset); w[28] = hc_bytealign_S (w[11], w[12], offset); w[27] = hc_bytealign_S (w[10], w[11], offset); w[26] = hc_bytealign_S (w[ 9], w[10], offset); w[25] = hc_bytealign_S (w[ 8], w[ 9], offset); w[24] = hc_bytealign_S (w[ 7], w[ 8], offset); w[23] = hc_bytealign_S (w[ 6], w[ 7], offset); w[22] = hc_bytealign_S (w[ 5], w[ 6], offset); w[21] = hc_bytealign_S (w[ 4], w[ 5], offset); w[20] = hc_bytealign_S (w[ 3], w[ 4], offset); w[19] = hc_bytealign_S (w[ 2], w[ 3], offset); w[18] = hc_bytealign_S (w[ 1], w[ 2], offset); w[17] = hc_bytealign_S (w[ 0], w[ 1], offset); w[16] = hc_bytealign_S ( 0, w[ 0], offset); w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 17: w[63] = hc_bytealign_S (w[45], w[46], offset); w[62] = hc_bytealign_S (w[44], w[45], offset); w[61] = hc_bytealign_S (w[43], w[44], offset); w[60] = hc_bytealign_S (w[42], w[43], offset); w[59] = hc_bytealign_S (w[41], w[42], offset); w[58] = hc_bytealign_S (w[40], w[41], offset); w[57] = hc_bytealign_S (w[39], w[40], offset); w[56] = hc_bytealign_S (w[38], w[39], offset); w[55] = hc_bytealign_S (w[37], w[38], offset); w[54] = hc_bytealign_S (w[36], w[37], offset); w[53] = hc_bytealign_S (w[35], w[36], offset); w[52] = hc_bytealign_S (w[34], w[35], offset); w[51] = hc_bytealign_S (w[33], w[34], offset); w[50] = hc_bytealign_S (w[32], w[33], offset); w[49] = hc_bytealign_S (w[31], w[32], offset); w[48] = hc_bytealign_S (w[30], w[31], offset); w[47] = hc_bytealign_S (w[29], w[30], offset); w[46] = hc_bytealign_S (w[28], w[29], offset); w[45] = hc_bytealign_S (w[27], w[28], offset); w[44] = hc_bytealign_S (w[26], w[27], offset); w[43] = hc_bytealign_S (w[25], w[26], offset); w[42] = hc_bytealign_S (w[24], w[25], offset); w[41] = hc_bytealign_S (w[23], w[24], offset); w[40] = hc_bytealign_S (w[22], w[23], offset); w[39] = hc_bytealign_S (w[21], w[22], offset); w[38] = hc_bytealign_S (w[20], w[21], offset); w[37] = hc_bytealign_S (w[19], w[20], offset); w[36] = hc_bytealign_S (w[18], w[19], offset); w[35] = hc_bytealign_S (w[17], w[18], offset); w[34] = hc_bytealign_S (w[16], w[17], offset); w[33] = hc_bytealign_S (w[15], w[16], offset); w[32] = hc_bytealign_S (w[14], w[15], offset); w[31] = hc_bytealign_S (w[13], w[14], offset); w[30] = hc_bytealign_S (w[12], w[13], offset); w[29] = hc_bytealign_S (w[11], w[12], offset); w[28] = hc_bytealign_S (w[10], w[11], offset); w[27] = hc_bytealign_S (w[ 9], w[10], offset); w[26] = hc_bytealign_S (w[ 8], w[ 9], offset); w[25] = hc_bytealign_S (w[ 7], w[ 8], offset); w[24] = hc_bytealign_S (w[ 6], w[ 7], offset); w[23] = hc_bytealign_S (w[ 5], w[ 6], offset); w[22] = hc_bytealign_S (w[ 4], w[ 5], offset); w[21] = hc_bytealign_S (w[ 3], w[ 4], offset); w[20] = hc_bytealign_S (w[ 2], w[ 3], offset); w[19] = hc_bytealign_S (w[ 1], w[ 2], offset); w[18] = hc_bytealign_S (w[ 0], w[ 1], offset); w[17] = hc_bytealign_S ( 0, w[ 0], offset); w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 18: w[63] = hc_bytealign_S (w[44], w[45], offset); w[62] = hc_bytealign_S (w[43], w[44], offset); w[61] = hc_bytealign_S (w[42], w[43], offset); w[60] = hc_bytealign_S (w[41], w[42], offset); w[59] = hc_bytealign_S (w[40], w[41], offset); w[58] = hc_bytealign_S (w[39], w[40], offset); w[57] = hc_bytealign_S (w[38], w[39], offset); w[56] = hc_bytealign_S (w[37], w[38], offset); w[55] = hc_bytealign_S (w[36], w[37], offset); w[54] = hc_bytealign_S (w[35], w[36], offset); w[53] = hc_bytealign_S (w[34], w[35], offset); w[52] = hc_bytealign_S (w[33], w[34], offset); w[51] = hc_bytealign_S (w[32], w[33], offset); w[50] = hc_bytealign_S (w[31], w[32], offset); w[49] = hc_bytealign_S (w[30], w[31], offset); w[48] = hc_bytealign_S (w[29], w[30], offset); w[47] = hc_bytealign_S (w[28], w[29], offset); w[46] = hc_bytealign_S (w[27], w[28], offset); w[45] = hc_bytealign_S (w[26], w[27], offset); w[44] = hc_bytealign_S (w[25], w[26], offset); w[43] = hc_bytealign_S (w[24], w[25], offset); w[42] = hc_bytealign_S (w[23], w[24], offset); w[41] = hc_bytealign_S (w[22], w[23], offset); w[40] = hc_bytealign_S (w[21], w[22], offset); w[39] = hc_bytealign_S (w[20], w[21], offset); w[38] = hc_bytealign_S (w[19], w[20], offset); w[37] = hc_bytealign_S (w[18], w[19], offset); w[36] = hc_bytealign_S (w[17], w[18], offset); w[35] = hc_bytealign_S (w[16], w[17], offset); w[34] = hc_bytealign_S (w[15], w[16], offset); w[33] = hc_bytealign_S (w[14], w[15], offset); w[32] = hc_bytealign_S (w[13], w[14], offset); w[31] = hc_bytealign_S (w[12], w[13], offset); w[30] = hc_bytealign_S (w[11], w[12], offset); w[29] = hc_bytealign_S (w[10], w[11], offset); w[28] = hc_bytealign_S (w[ 9], w[10], offset); w[27] = hc_bytealign_S (w[ 8], w[ 9], offset); w[26] = hc_bytealign_S (w[ 7], w[ 8], offset); w[25] = hc_bytealign_S (w[ 6], w[ 7], offset); w[24] = hc_bytealign_S (w[ 5], w[ 6], offset); w[23] = hc_bytealign_S (w[ 4], w[ 5], offset); w[22] = hc_bytealign_S (w[ 3], w[ 4], offset); w[21] = hc_bytealign_S (w[ 2], w[ 3], offset); w[20] = hc_bytealign_S (w[ 1], w[ 2], offset); w[19] = hc_bytealign_S (w[ 0], w[ 1], offset); w[18] = hc_bytealign_S ( 0, w[ 0], offset); w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 19: w[63] = hc_bytealign_S (w[43], w[44], offset); w[62] = hc_bytealign_S (w[42], w[43], offset); w[61] = hc_bytealign_S (w[41], w[42], offset); w[60] = hc_bytealign_S (w[40], w[41], offset); w[59] = hc_bytealign_S (w[39], w[40], offset); w[58] = hc_bytealign_S (w[38], w[39], offset); w[57] = hc_bytealign_S (w[37], w[38], offset); w[56] = hc_bytealign_S (w[36], w[37], offset); w[55] = hc_bytealign_S (w[35], w[36], offset); w[54] = hc_bytealign_S (w[34], w[35], offset); w[53] = hc_bytealign_S (w[33], w[34], offset); w[52] = hc_bytealign_S (w[32], w[33], offset); w[51] = hc_bytealign_S (w[31], w[32], offset); w[50] = hc_bytealign_S (w[30], w[31], offset); w[49] = hc_bytealign_S (w[29], w[30], offset); w[48] = hc_bytealign_S (w[28], w[29], offset); w[47] = hc_bytealign_S (w[27], w[28], offset); w[46] = hc_bytealign_S (w[26], w[27], offset); w[45] = hc_bytealign_S (w[25], w[26], offset); w[44] = hc_bytealign_S (w[24], w[25], offset); w[43] = hc_bytealign_S (w[23], w[24], offset); w[42] = hc_bytealign_S (w[22], w[23], offset); w[41] = hc_bytealign_S (w[21], w[22], offset); w[40] = hc_bytealign_S (w[20], w[21], offset); w[39] = hc_bytealign_S (w[19], w[20], offset); w[38] = hc_bytealign_S (w[18], w[19], offset); w[37] = hc_bytealign_S (w[17], w[18], offset); w[36] = hc_bytealign_S (w[16], w[17], offset); w[35] = hc_bytealign_S (w[15], w[16], offset); w[34] = hc_bytealign_S (w[14], w[15], offset); w[33] = hc_bytealign_S (w[13], w[14], offset); w[32] = hc_bytealign_S (w[12], w[13], offset); w[31] = hc_bytealign_S (w[11], w[12], offset); w[30] = hc_bytealign_S (w[10], w[11], offset); w[29] = hc_bytealign_S (w[ 9], w[10], offset); w[28] = hc_bytealign_S (w[ 8], w[ 9], offset); w[27] = hc_bytealign_S (w[ 7], w[ 8], offset); w[26] = hc_bytealign_S (w[ 6], w[ 7], offset); w[25] = hc_bytealign_S (w[ 5], w[ 6], offset); w[24] = hc_bytealign_S (w[ 4], w[ 5], offset); w[23] = hc_bytealign_S (w[ 3], w[ 4], offset); w[22] = hc_bytealign_S (w[ 2], w[ 3], offset); w[21] = hc_bytealign_S (w[ 1], w[ 2], offset); w[20] = hc_bytealign_S (w[ 0], w[ 1], offset); w[19] = hc_bytealign_S ( 0, w[ 0], offset); w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 20: w[63] = hc_bytealign_S (w[42], w[43], offset); w[62] = hc_bytealign_S (w[41], w[42], offset); w[61] = hc_bytealign_S (w[40], w[41], offset); w[60] = hc_bytealign_S (w[39], w[40], offset); w[59] = hc_bytealign_S (w[38], w[39], offset); w[58] = hc_bytealign_S (w[37], w[38], offset); w[57] = hc_bytealign_S (w[36], w[37], offset); w[56] = hc_bytealign_S (w[35], w[36], offset); w[55] = hc_bytealign_S (w[34], w[35], offset); w[54] = hc_bytealign_S (w[33], w[34], offset); w[53] = hc_bytealign_S (w[32], w[33], offset); w[52] = hc_bytealign_S (w[31], w[32], offset); w[51] = hc_bytealign_S (w[30], w[31], offset); w[50] = hc_bytealign_S (w[29], w[30], offset); w[49] = hc_bytealign_S (w[28], w[29], offset); w[48] = hc_bytealign_S (w[27], w[28], offset); w[47] = hc_bytealign_S (w[26], w[27], offset); w[46] = hc_bytealign_S (w[25], w[26], offset); w[45] = hc_bytealign_S (w[24], w[25], offset); w[44] = hc_bytealign_S (w[23], w[24], offset); w[43] = hc_bytealign_S (w[22], w[23], offset); w[42] = hc_bytealign_S (w[21], w[22], offset); w[41] = hc_bytealign_S (w[20], w[21], offset); w[40] = hc_bytealign_S (w[19], w[20], offset); w[39] = hc_bytealign_S (w[18], w[19], offset); w[38] = hc_bytealign_S (w[17], w[18], offset); w[37] = hc_bytealign_S (w[16], w[17], offset); w[36] = hc_bytealign_S (w[15], w[16], offset); w[35] = hc_bytealign_S (w[14], w[15], offset); w[34] = hc_bytealign_S (w[13], w[14], offset); w[33] = hc_bytealign_S (w[12], w[13], offset); w[32] = hc_bytealign_S (w[11], w[12], offset); w[31] = hc_bytealign_S (w[10], w[11], offset); w[30] = hc_bytealign_S (w[ 9], w[10], offset); w[29] = hc_bytealign_S (w[ 8], w[ 9], offset); w[28] = hc_bytealign_S (w[ 7], w[ 8], offset); w[27] = hc_bytealign_S (w[ 6], w[ 7], offset); w[26] = hc_bytealign_S (w[ 5], w[ 6], offset); w[25] = hc_bytealign_S (w[ 4], w[ 5], offset); w[24] = hc_bytealign_S (w[ 3], w[ 4], offset); w[23] = hc_bytealign_S (w[ 2], w[ 3], offset); w[22] = hc_bytealign_S (w[ 1], w[ 2], offset); w[21] = hc_bytealign_S (w[ 0], w[ 1], offset); w[20] = hc_bytealign_S ( 0, w[ 0], offset); w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 21: w[63] = hc_bytealign_S (w[41], w[42], offset); w[62] = hc_bytealign_S (w[40], w[41], offset); w[61] = hc_bytealign_S (w[39], w[40], offset); w[60] = hc_bytealign_S (w[38], w[39], offset); w[59] = hc_bytealign_S (w[37], w[38], offset); w[58] = hc_bytealign_S (w[36], w[37], offset); w[57] = hc_bytealign_S (w[35], w[36], offset); w[56] = hc_bytealign_S (w[34], w[35], offset); w[55] = hc_bytealign_S (w[33], w[34], offset); w[54] = hc_bytealign_S (w[32], w[33], offset); w[53] = hc_bytealign_S (w[31], w[32], offset); w[52] = hc_bytealign_S (w[30], w[31], offset); w[51] = hc_bytealign_S (w[29], w[30], offset); w[50] = hc_bytealign_S (w[28], w[29], offset); w[49] = hc_bytealign_S (w[27], w[28], offset); w[48] = hc_bytealign_S (w[26], w[27], offset); w[47] = hc_bytealign_S (w[25], w[26], offset); w[46] = hc_bytealign_S (w[24], w[25], offset); w[45] = hc_bytealign_S (w[23], w[24], offset); w[44] = hc_bytealign_S (w[22], w[23], offset); w[43] = hc_bytealign_S (w[21], w[22], offset); w[42] = hc_bytealign_S (w[20], w[21], offset); w[41] = hc_bytealign_S (w[19], w[20], offset); w[40] = hc_bytealign_S (w[18], w[19], offset); w[39] = hc_bytealign_S (w[17], w[18], offset); w[38] = hc_bytealign_S (w[16], w[17], offset); w[37] = hc_bytealign_S (w[15], w[16], offset); w[36] = hc_bytealign_S (w[14], w[15], offset); w[35] = hc_bytealign_S (w[13], w[14], offset); w[34] = hc_bytealign_S (w[12], w[13], offset); w[33] = hc_bytealign_S (w[11], w[12], offset); w[32] = hc_bytealign_S (w[10], w[11], offset); w[31] = hc_bytealign_S (w[ 9], w[10], offset); w[30] = hc_bytealign_S (w[ 8], w[ 9], offset); w[29] = hc_bytealign_S (w[ 7], w[ 8], offset); w[28] = hc_bytealign_S (w[ 6], w[ 7], offset); w[27] = hc_bytealign_S (w[ 5], w[ 6], offset); w[26] = hc_bytealign_S (w[ 4], w[ 5], offset); w[25] = hc_bytealign_S (w[ 3], w[ 4], offset); w[24] = hc_bytealign_S (w[ 2], w[ 3], offset); w[23] = hc_bytealign_S (w[ 1], w[ 2], offset); w[22] = hc_bytealign_S (w[ 0], w[ 1], offset); w[21] = hc_bytealign_S ( 0, w[ 0], offset); w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 22: w[63] = hc_bytealign_S (w[40], w[41], offset); w[62] = hc_bytealign_S (w[39], w[40], offset); w[61] = hc_bytealign_S (w[38], w[39], offset); w[60] = hc_bytealign_S (w[37], w[38], offset); w[59] = hc_bytealign_S (w[36], w[37], offset); w[58] = hc_bytealign_S (w[35], w[36], offset); w[57] = hc_bytealign_S (w[34], w[35], offset); w[56] = hc_bytealign_S (w[33], w[34], offset); w[55] = hc_bytealign_S (w[32], w[33], offset); w[54] = hc_bytealign_S (w[31], w[32], offset); w[53] = hc_bytealign_S (w[30], w[31], offset); w[52] = hc_bytealign_S (w[29], w[30], offset); w[51] = hc_bytealign_S (w[28], w[29], offset); w[50] = hc_bytealign_S (w[27], w[28], offset); w[49] = hc_bytealign_S (w[26], w[27], offset); w[48] = hc_bytealign_S (w[25], w[26], offset); w[47] = hc_bytealign_S (w[24], w[25], offset); w[46] = hc_bytealign_S (w[23], w[24], offset); w[45] = hc_bytealign_S (w[22], w[23], offset); w[44] = hc_bytealign_S (w[21], w[22], offset); w[43] = hc_bytealign_S (w[20], w[21], offset); w[42] = hc_bytealign_S (w[19], w[20], offset); w[41] = hc_bytealign_S (w[18], w[19], offset); w[40] = hc_bytealign_S (w[17], w[18], offset); w[39] = hc_bytealign_S (w[16], w[17], offset); w[38] = hc_bytealign_S (w[15], w[16], offset); w[37] = hc_bytealign_S (w[14], w[15], offset); w[36] = hc_bytealign_S (w[13], w[14], offset); w[35] = hc_bytealign_S (w[12], w[13], offset); w[34] = hc_bytealign_S (w[11], w[12], offset); w[33] = hc_bytealign_S (w[10], w[11], offset); w[32] = hc_bytealign_S (w[ 9], w[10], offset); w[31] = hc_bytealign_S (w[ 8], w[ 9], offset); w[30] = hc_bytealign_S (w[ 7], w[ 8], offset); w[29] = hc_bytealign_S (w[ 6], w[ 7], offset); w[28] = hc_bytealign_S (w[ 5], w[ 6], offset); w[27] = hc_bytealign_S (w[ 4], w[ 5], offset); w[26] = hc_bytealign_S (w[ 3], w[ 4], offset); w[25] = hc_bytealign_S (w[ 2], w[ 3], offset); w[24] = hc_bytealign_S (w[ 1], w[ 2], offset); w[23] = hc_bytealign_S (w[ 0], w[ 1], offset); w[22] = hc_bytealign_S ( 0, w[ 0], offset); w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 23: w[63] = hc_bytealign_S (w[39], w[40], offset); w[62] = hc_bytealign_S (w[38], w[39], offset); w[61] = hc_bytealign_S (w[37], w[38], offset); w[60] = hc_bytealign_S (w[36], w[37], offset); w[59] = hc_bytealign_S (w[35], w[36], offset); w[58] = hc_bytealign_S (w[34], w[35], offset); w[57] = hc_bytealign_S (w[33], w[34], offset); w[56] = hc_bytealign_S (w[32], w[33], offset); w[55] = hc_bytealign_S (w[31], w[32], offset); w[54] = hc_bytealign_S (w[30], w[31], offset); w[53] = hc_bytealign_S (w[29], w[30], offset); w[52] = hc_bytealign_S (w[28], w[29], offset); w[51] = hc_bytealign_S (w[27], w[28], offset); w[50] = hc_bytealign_S (w[26], w[27], offset); w[49] = hc_bytealign_S (w[25], w[26], offset); w[48] = hc_bytealign_S (w[24], w[25], offset); w[47] = hc_bytealign_S (w[23], w[24], offset); w[46] = hc_bytealign_S (w[22], w[23], offset); w[45] = hc_bytealign_S (w[21], w[22], offset); w[44] = hc_bytealign_S (w[20], w[21], offset); w[43] = hc_bytealign_S (w[19], w[20], offset); w[42] = hc_bytealign_S (w[18], w[19], offset); w[41] = hc_bytealign_S (w[17], w[18], offset); w[40] = hc_bytealign_S (w[16], w[17], offset); w[39] = hc_bytealign_S (w[15], w[16], offset); w[38] = hc_bytealign_S (w[14], w[15], offset); w[37] = hc_bytealign_S (w[13], w[14], offset); w[36] = hc_bytealign_S (w[12], w[13], offset); w[35] = hc_bytealign_S (w[11], w[12], offset); w[34] = hc_bytealign_S (w[10], w[11], offset); w[33] = hc_bytealign_S (w[ 9], w[10], offset); w[32] = hc_bytealign_S (w[ 8], w[ 9], offset); w[31] = hc_bytealign_S (w[ 7], w[ 8], offset); w[30] = hc_bytealign_S (w[ 6], w[ 7], offset); w[29] = hc_bytealign_S (w[ 5], w[ 6], offset); w[28] = hc_bytealign_S (w[ 4], w[ 5], offset); w[27] = hc_bytealign_S (w[ 3], w[ 4], offset); w[26] = hc_bytealign_S (w[ 2], w[ 3], offset); w[25] = hc_bytealign_S (w[ 1], w[ 2], offset); w[24] = hc_bytealign_S (w[ 0], w[ 1], offset); w[23] = hc_bytealign_S ( 0, w[ 0], offset); w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 24: w[63] = hc_bytealign_S (w[38], w[39], offset); w[62] = hc_bytealign_S (w[37], w[38], offset); w[61] = hc_bytealign_S (w[36], w[37], offset); w[60] = hc_bytealign_S (w[35], w[36], offset); w[59] = hc_bytealign_S (w[34], w[35], offset); w[58] = hc_bytealign_S (w[33], w[34], offset); w[57] = hc_bytealign_S (w[32], w[33], offset); w[56] = hc_bytealign_S (w[31], w[32], offset); w[55] = hc_bytealign_S (w[30], w[31], offset); w[54] = hc_bytealign_S (w[29], w[30], offset); w[53] = hc_bytealign_S (w[28], w[29], offset); w[52] = hc_bytealign_S (w[27], w[28], offset); w[51] = hc_bytealign_S (w[26], w[27], offset); w[50] = hc_bytealign_S (w[25], w[26], offset); w[49] = hc_bytealign_S (w[24], w[25], offset); w[48] = hc_bytealign_S (w[23], w[24], offset); w[47] = hc_bytealign_S (w[22], w[23], offset); w[46] = hc_bytealign_S (w[21], w[22], offset); w[45] = hc_bytealign_S (w[20], w[21], offset); w[44] = hc_bytealign_S (w[19], w[20], offset); w[43] = hc_bytealign_S (w[18], w[19], offset); w[42] = hc_bytealign_S (w[17], w[18], offset); w[41] = hc_bytealign_S (w[16], w[17], offset); w[40] = hc_bytealign_S (w[15], w[16], offset); w[39] = hc_bytealign_S (w[14], w[15], offset); w[38] = hc_bytealign_S (w[13], w[14], offset); w[37] = hc_bytealign_S (w[12], w[13], offset); w[36] = hc_bytealign_S (w[11], w[12], offset); w[35] = hc_bytealign_S (w[10], w[11], offset); w[34] = hc_bytealign_S (w[ 9], w[10], offset); w[33] = hc_bytealign_S (w[ 8], w[ 9], offset); w[32] = hc_bytealign_S (w[ 7], w[ 8], offset); w[31] = hc_bytealign_S (w[ 6], w[ 7], offset); w[30] = hc_bytealign_S (w[ 5], w[ 6], offset); w[29] = hc_bytealign_S (w[ 4], w[ 5], offset); w[28] = hc_bytealign_S (w[ 3], w[ 4], offset); w[27] = hc_bytealign_S (w[ 2], w[ 3], offset); w[26] = hc_bytealign_S (w[ 1], w[ 2], offset); w[25] = hc_bytealign_S (w[ 0], w[ 1], offset); w[24] = hc_bytealign_S ( 0, w[ 0], offset); w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 25: w[63] = hc_bytealign_S (w[37], w[38], offset); w[62] = hc_bytealign_S (w[36], w[37], offset); w[61] = hc_bytealign_S (w[35], w[36], offset); w[60] = hc_bytealign_S (w[34], w[35], offset); w[59] = hc_bytealign_S (w[33], w[34], offset); w[58] = hc_bytealign_S (w[32], w[33], offset); w[57] = hc_bytealign_S (w[31], w[32], offset); w[56] = hc_bytealign_S (w[30], w[31], offset); w[55] = hc_bytealign_S (w[29], w[30], offset); w[54] = hc_bytealign_S (w[28], w[29], offset); w[53] = hc_bytealign_S (w[27], w[28], offset); w[52] = hc_bytealign_S (w[26], w[27], offset); w[51] = hc_bytealign_S (w[25], w[26], offset); w[50] = hc_bytealign_S (w[24], w[25], offset); w[49] = hc_bytealign_S (w[23], w[24], offset); w[48] = hc_bytealign_S (w[22], w[23], offset); w[47] = hc_bytealign_S (w[21], w[22], offset); w[46] = hc_bytealign_S (w[20], w[21], offset); w[45] = hc_bytealign_S (w[19], w[20], offset); w[44] = hc_bytealign_S (w[18], w[19], offset); w[43] = hc_bytealign_S (w[17], w[18], offset); w[42] = hc_bytealign_S (w[16], w[17], offset); w[41] = hc_bytealign_S (w[15], w[16], offset); w[40] = hc_bytealign_S (w[14], w[15], offset); w[39] = hc_bytealign_S (w[13], w[14], offset); w[38] = hc_bytealign_S (w[12], w[13], offset); w[37] = hc_bytealign_S (w[11], w[12], offset); w[36] = hc_bytealign_S (w[10], w[11], offset); w[35] = hc_bytealign_S (w[ 9], w[10], offset); w[34] = hc_bytealign_S (w[ 8], w[ 9], offset); w[33] = hc_bytealign_S (w[ 7], w[ 8], offset); w[32] = hc_bytealign_S (w[ 6], w[ 7], offset); w[31] = hc_bytealign_S (w[ 5], w[ 6], offset); w[30] = hc_bytealign_S (w[ 4], w[ 5], offset); w[29] = hc_bytealign_S (w[ 3], w[ 4], offset); w[28] = hc_bytealign_S (w[ 2], w[ 3], offset); w[27] = hc_bytealign_S (w[ 1], w[ 2], offset); w[26] = hc_bytealign_S (w[ 0], w[ 1], offset); w[25] = hc_bytealign_S ( 0, w[ 0], offset); w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 26: w[63] = hc_bytealign_S (w[36], w[37], offset); w[62] = hc_bytealign_S (w[35], w[36], offset); w[61] = hc_bytealign_S (w[34], w[35], offset); w[60] = hc_bytealign_S (w[33], w[34], offset); w[59] = hc_bytealign_S (w[32], w[33], offset); w[58] = hc_bytealign_S (w[31], w[32], offset); w[57] = hc_bytealign_S (w[30], w[31], offset); w[56] = hc_bytealign_S (w[29], w[30], offset); w[55] = hc_bytealign_S (w[28], w[29], offset); w[54] = hc_bytealign_S (w[27], w[28], offset); w[53] = hc_bytealign_S (w[26], w[27], offset); w[52] = hc_bytealign_S (w[25], w[26], offset); w[51] = hc_bytealign_S (w[24], w[25], offset); w[50] = hc_bytealign_S (w[23], w[24], offset); w[49] = hc_bytealign_S (w[22], w[23], offset); w[48] = hc_bytealign_S (w[21], w[22], offset); w[47] = hc_bytealign_S (w[20], w[21], offset); w[46] = hc_bytealign_S (w[19], w[20], offset); w[45] = hc_bytealign_S (w[18], w[19], offset); w[44] = hc_bytealign_S (w[17], w[18], offset); w[43] = hc_bytealign_S (w[16], w[17], offset); w[42] = hc_bytealign_S (w[15], w[16], offset); w[41] = hc_bytealign_S (w[14], w[15], offset); w[40] = hc_bytealign_S (w[13], w[14], offset); w[39] = hc_bytealign_S (w[12], w[13], offset); w[38] = hc_bytealign_S (w[11], w[12], offset); w[37] = hc_bytealign_S (w[10], w[11], offset); w[36] = hc_bytealign_S (w[ 9], w[10], offset); w[35] = hc_bytealign_S (w[ 8], w[ 9], offset); w[34] = hc_bytealign_S (w[ 7], w[ 8], offset); w[33] = hc_bytealign_S (w[ 6], w[ 7], offset); w[32] = hc_bytealign_S (w[ 5], w[ 6], offset); w[31] = hc_bytealign_S (w[ 4], w[ 5], offset); w[30] = hc_bytealign_S (w[ 3], w[ 4], offset); w[29] = hc_bytealign_S (w[ 2], w[ 3], offset); w[28] = hc_bytealign_S (w[ 1], w[ 2], offset); w[27] = hc_bytealign_S (w[ 0], w[ 1], offset); w[26] = hc_bytealign_S ( 0, w[ 0], offset); w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 27: w[63] = hc_bytealign_S (w[35], w[36], offset); w[62] = hc_bytealign_S (w[34], w[35], offset); w[61] = hc_bytealign_S (w[33], w[34], offset); w[60] = hc_bytealign_S (w[32], w[33], offset); w[59] = hc_bytealign_S (w[31], w[32], offset); w[58] = hc_bytealign_S (w[30], w[31], offset); w[57] = hc_bytealign_S (w[29], w[30], offset); w[56] = hc_bytealign_S (w[28], w[29], offset); w[55] = hc_bytealign_S (w[27], w[28], offset); w[54] = hc_bytealign_S (w[26], w[27], offset); w[53] = hc_bytealign_S (w[25], w[26], offset); w[52] = hc_bytealign_S (w[24], w[25], offset); w[51] = hc_bytealign_S (w[23], w[24], offset); w[50] = hc_bytealign_S (w[22], w[23], offset); w[49] = hc_bytealign_S (w[21], w[22], offset); w[48] = hc_bytealign_S (w[20], w[21], offset); w[47] = hc_bytealign_S (w[19], w[20], offset); w[46] = hc_bytealign_S (w[18], w[19], offset); w[45] = hc_bytealign_S (w[17], w[18], offset); w[44] = hc_bytealign_S (w[16], w[17], offset); w[43] = hc_bytealign_S (w[15], w[16], offset); w[42] = hc_bytealign_S (w[14], w[15], offset); w[41] = hc_bytealign_S (w[13], w[14], offset); w[40] = hc_bytealign_S (w[12], w[13], offset); w[39] = hc_bytealign_S (w[11], w[12], offset); w[38] = hc_bytealign_S (w[10], w[11], offset); w[37] = hc_bytealign_S (w[ 9], w[10], offset); w[36] = hc_bytealign_S (w[ 8], w[ 9], offset); w[35] = hc_bytealign_S (w[ 7], w[ 8], offset); w[34] = hc_bytealign_S (w[ 6], w[ 7], offset); w[33] = hc_bytealign_S (w[ 5], w[ 6], offset); w[32] = hc_bytealign_S (w[ 4], w[ 5], offset); w[31] = hc_bytealign_S (w[ 3], w[ 4], offset); w[30] = hc_bytealign_S (w[ 2], w[ 3], offset); w[29] = hc_bytealign_S (w[ 1], w[ 2], offset); w[28] = hc_bytealign_S (w[ 0], w[ 1], offset); w[27] = hc_bytealign_S ( 0, w[ 0], offset); w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 28: w[63] = hc_bytealign_S (w[34], w[35], offset); w[62] = hc_bytealign_S (w[33], w[34], offset); w[61] = hc_bytealign_S (w[32], w[33], offset); w[60] = hc_bytealign_S (w[31], w[32], offset); w[59] = hc_bytealign_S (w[30], w[31], offset); w[58] = hc_bytealign_S (w[29], w[30], offset); w[57] = hc_bytealign_S (w[28], w[29], offset); w[56] = hc_bytealign_S (w[27], w[28], offset); w[55] = hc_bytealign_S (w[26], w[27], offset); w[54] = hc_bytealign_S (w[25], w[26], offset); w[53] = hc_bytealign_S (w[24], w[25], offset); w[52] = hc_bytealign_S (w[23], w[24], offset); w[51] = hc_bytealign_S (w[22], w[23], offset); w[50] = hc_bytealign_S (w[21], w[22], offset); w[49] = hc_bytealign_S (w[20], w[21], offset); w[48] = hc_bytealign_S (w[19], w[20], offset); w[47] = hc_bytealign_S (w[18], w[19], offset); w[46] = hc_bytealign_S (w[17], w[18], offset); w[45] = hc_bytealign_S (w[16], w[17], offset); w[44] = hc_bytealign_S (w[15], w[16], offset); w[43] = hc_bytealign_S (w[14], w[15], offset); w[42] = hc_bytealign_S (w[13], w[14], offset); w[41] = hc_bytealign_S (w[12], w[13], offset); w[40] = hc_bytealign_S (w[11], w[12], offset); w[39] = hc_bytealign_S (w[10], w[11], offset); w[38] = hc_bytealign_S (w[ 9], w[10], offset); w[37] = hc_bytealign_S (w[ 8], w[ 9], offset); w[36] = hc_bytealign_S (w[ 7], w[ 8], offset); w[35] = hc_bytealign_S (w[ 6], w[ 7], offset); w[34] = hc_bytealign_S (w[ 5], w[ 6], offset); w[33] = hc_bytealign_S (w[ 4], w[ 5], offset); w[32] = hc_bytealign_S (w[ 3], w[ 4], offset); w[31] = hc_bytealign_S (w[ 2], w[ 3], offset); w[30] = hc_bytealign_S (w[ 1], w[ 2], offset); w[29] = hc_bytealign_S (w[ 0], w[ 1], offset); w[28] = hc_bytealign_S ( 0, w[ 0], offset); w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 29: w[63] = hc_bytealign_S (w[33], w[34], offset); w[62] = hc_bytealign_S (w[32], w[33], offset); w[61] = hc_bytealign_S (w[31], w[32], offset); w[60] = hc_bytealign_S (w[30], w[31], offset); w[59] = hc_bytealign_S (w[29], w[30], offset); w[58] = hc_bytealign_S (w[28], w[29], offset); w[57] = hc_bytealign_S (w[27], w[28], offset); w[56] = hc_bytealign_S (w[26], w[27], offset); w[55] = hc_bytealign_S (w[25], w[26], offset); w[54] = hc_bytealign_S (w[24], w[25], offset); w[53] = hc_bytealign_S (w[23], w[24], offset); w[52] = hc_bytealign_S (w[22], w[23], offset); w[51] = hc_bytealign_S (w[21], w[22], offset); w[50] = hc_bytealign_S (w[20], w[21], offset); w[49] = hc_bytealign_S (w[19], w[20], offset); w[48] = hc_bytealign_S (w[18], w[19], offset); w[47] = hc_bytealign_S (w[17], w[18], offset); w[46] = hc_bytealign_S (w[16], w[17], offset); w[45] = hc_bytealign_S (w[15], w[16], offset); w[44] = hc_bytealign_S (w[14], w[15], offset); w[43] = hc_bytealign_S (w[13], w[14], offset); w[42] = hc_bytealign_S (w[12], w[13], offset); w[41] = hc_bytealign_S (w[11], w[12], offset); w[40] = hc_bytealign_S (w[10], w[11], offset); w[39] = hc_bytealign_S (w[ 9], w[10], offset); w[38] = hc_bytealign_S (w[ 8], w[ 9], offset); w[37] = hc_bytealign_S (w[ 7], w[ 8], offset); w[36] = hc_bytealign_S (w[ 6], w[ 7], offset); w[35] = hc_bytealign_S (w[ 5], w[ 6], offset); w[34] = hc_bytealign_S (w[ 4], w[ 5], offset); w[33] = hc_bytealign_S (w[ 3], w[ 4], offset); w[32] = hc_bytealign_S (w[ 2], w[ 3], offset); w[31] = hc_bytealign_S (w[ 1], w[ 2], offset); w[30] = hc_bytealign_S (w[ 0], w[ 1], offset); w[29] = hc_bytealign_S ( 0, w[ 0], offset); w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 30: w[63] = hc_bytealign_S (w[32], w[33], offset); w[62] = hc_bytealign_S (w[31], w[32], offset); w[61] = hc_bytealign_S (w[30], w[31], offset); w[60] = hc_bytealign_S (w[29], w[30], offset); w[59] = hc_bytealign_S (w[28], w[29], offset); w[58] = hc_bytealign_S (w[27], w[28], offset); w[57] = hc_bytealign_S (w[26], w[27], offset); w[56] = hc_bytealign_S (w[25], w[26], offset); w[55] = hc_bytealign_S (w[24], w[25], offset); w[54] = hc_bytealign_S (w[23], w[24], offset); w[53] = hc_bytealign_S (w[22], w[23], offset); w[52] = hc_bytealign_S (w[21], w[22], offset); w[51] = hc_bytealign_S (w[20], w[21], offset); w[50] = hc_bytealign_S (w[19], w[20], offset); w[49] = hc_bytealign_S (w[18], w[19], offset); w[48] = hc_bytealign_S (w[17], w[18], offset); w[47] = hc_bytealign_S (w[16], w[17], offset); w[46] = hc_bytealign_S (w[15], w[16], offset); w[45] = hc_bytealign_S (w[14], w[15], offset); w[44] = hc_bytealign_S (w[13], w[14], offset); w[43] = hc_bytealign_S (w[12], w[13], offset); w[42] = hc_bytealign_S (w[11], w[12], offset); w[41] = hc_bytealign_S (w[10], w[11], offset); w[40] = hc_bytealign_S (w[ 9], w[10], offset); w[39] = hc_bytealign_S (w[ 8], w[ 9], offset); w[38] = hc_bytealign_S (w[ 7], w[ 8], offset); w[37] = hc_bytealign_S (w[ 6], w[ 7], offset); w[36] = hc_bytealign_S (w[ 5], w[ 6], offset); w[35] = hc_bytealign_S (w[ 4], w[ 5], offset); w[34] = hc_bytealign_S (w[ 3], w[ 4], offset); w[33] = hc_bytealign_S (w[ 2], w[ 3], offset); w[32] = hc_bytealign_S (w[ 1], w[ 2], offset); w[31] = hc_bytealign_S (w[ 0], w[ 1], offset); w[30] = hc_bytealign_S ( 0, w[ 0], offset); w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 31: w[63] = hc_bytealign_S (w[31], w[32], offset); w[62] = hc_bytealign_S (w[30], w[31], offset); w[61] = hc_bytealign_S (w[29], w[30], offset); w[60] = hc_bytealign_S (w[28], w[29], offset); w[59] = hc_bytealign_S (w[27], w[28], offset); w[58] = hc_bytealign_S (w[26], w[27], offset); w[57] = hc_bytealign_S (w[25], w[26], offset); w[56] = hc_bytealign_S (w[24], w[25], offset); w[55] = hc_bytealign_S (w[23], w[24], offset); w[54] = hc_bytealign_S (w[22], w[23], offset); w[53] = hc_bytealign_S (w[21], w[22], offset); w[52] = hc_bytealign_S (w[20], w[21], offset); w[51] = hc_bytealign_S (w[19], w[20], offset); w[50] = hc_bytealign_S (w[18], w[19], offset); w[49] = hc_bytealign_S (w[17], w[18], offset); w[48] = hc_bytealign_S (w[16], w[17], offset); w[47] = hc_bytealign_S (w[15], w[16], offset); w[46] = hc_bytealign_S (w[14], w[15], offset); w[45] = hc_bytealign_S (w[13], w[14], offset); w[44] = hc_bytealign_S (w[12], w[13], offset); w[43] = hc_bytealign_S (w[11], w[12], offset); w[42] = hc_bytealign_S (w[10], w[11], offset); w[41] = hc_bytealign_S (w[ 9], w[10], offset); w[40] = hc_bytealign_S (w[ 8], w[ 9], offset); w[39] = hc_bytealign_S (w[ 7], w[ 8], offset); w[38] = hc_bytealign_S (w[ 6], w[ 7], offset); w[37] = hc_bytealign_S (w[ 5], w[ 6], offset); w[36] = hc_bytealign_S (w[ 4], w[ 5], offset); w[35] = hc_bytealign_S (w[ 3], w[ 4], offset); w[34] = hc_bytealign_S (w[ 2], w[ 3], offset); w[33] = hc_bytealign_S (w[ 1], w[ 2], offset); w[32] = hc_bytealign_S (w[ 0], w[ 1], offset); w[31] = hc_bytealign_S ( 0, w[ 0], offset); w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 32: w[63] = hc_bytealign_S (w[30], w[31], offset); w[62] = hc_bytealign_S (w[29], w[30], offset); w[61] = hc_bytealign_S (w[28], w[29], offset); w[60] = hc_bytealign_S (w[27], w[28], offset); w[59] = hc_bytealign_S (w[26], w[27], offset); w[58] = hc_bytealign_S (w[25], w[26], offset); w[57] = hc_bytealign_S (w[24], w[25], offset); w[56] = hc_bytealign_S (w[23], w[24], offset); w[55] = hc_bytealign_S (w[22], w[23], offset); w[54] = hc_bytealign_S (w[21], w[22], offset); w[53] = hc_bytealign_S (w[20], w[21], offset); w[52] = hc_bytealign_S (w[19], w[20], offset); w[51] = hc_bytealign_S (w[18], w[19], offset); w[50] = hc_bytealign_S (w[17], w[18], offset); w[49] = hc_bytealign_S (w[16], w[17], offset); w[48] = hc_bytealign_S (w[15], w[16], offset); w[47] = hc_bytealign_S (w[14], w[15], offset); w[46] = hc_bytealign_S (w[13], w[14], offset); w[45] = hc_bytealign_S (w[12], w[13], offset); w[44] = hc_bytealign_S (w[11], w[12], offset); w[43] = hc_bytealign_S (w[10], w[11], offset); w[42] = hc_bytealign_S (w[ 9], w[10], offset); w[41] = hc_bytealign_S (w[ 8], w[ 9], offset); w[40] = hc_bytealign_S (w[ 7], w[ 8], offset); w[39] = hc_bytealign_S (w[ 6], w[ 7], offset); w[38] = hc_bytealign_S (w[ 5], w[ 6], offset); w[37] = hc_bytealign_S (w[ 4], w[ 5], offset); w[36] = hc_bytealign_S (w[ 3], w[ 4], offset); w[35] = hc_bytealign_S (w[ 2], w[ 3], offset); w[34] = hc_bytealign_S (w[ 1], w[ 2], offset); w[33] = hc_bytealign_S (w[ 0], w[ 1], offset); w[32] = hc_bytealign_S ( 0, w[ 0], offset); w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 33: w[63] = hc_bytealign_S (w[29], w[30], offset); w[62] = hc_bytealign_S (w[28], w[29], offset); w[61] = hc_bytealign_S (w[27], w[28], offset); w[60] = hc_bytealign_S (w[26], w[27], offset); w[59] = hc_bytealign_S (w[25], w[26], offset); w[58] = hc_bytealign_S (w[24], w[25], offset); w[57] = hc_bytealign_S (w[23], w[24], offset); w[56] = hc_bytealign_S (w[22], w[23], offset); w[55] = hc_bytealign_S (w[21], w[22], offset); w[54] = hc_bytealign_S (w[20], w[21], offset); w[53] = hc_bytealign_S (w[19], w[20], offset); w[52] = hc_bytealign_S (w[18], w[19], offset); w[51] = hc_bytealign_S (w[17], w[18], offset); w[50] = hc_bytealign_S (w[16], w[17], offset); w[49] = hc_bytealign_S (w[15], w[16], offset); w[48] = hc_bytealign_S (w[14], w[15], offset); w[47] = hc_bytealign_S (w[13], w[14], offset); w[46] = hc_bytealign_S (w[12], w[13], offset); w[45] = hc_bytealign_S (w[11], w[12], offset); w[44] = hc_bytealign_S (w[10], w[11], offset); w[43] = hc_bytealign_S (w[ 9], w[10], offset); w[42] = hc_bytealign_S (w[ 8], w[ 9], offset); w[41] = hc_bytealign_S (w[ 7], w[ 8], offset); w[40] = hc_bytealign_S (w[ 6], w[ 7], offset); w[39] = hc_bytealign_S (w[ 5], w[ 6], offset); w[38] = hc_bytealign_S (w[ 4], w[ 5], offset); w[37] = hc_bytealign_S (w[ 3], w[ 4], offset); w[36] = hc_bytealign_S (w[ 2], w[ 3], offset); w[35] = hc_bytealign_S (w[ 1], w[ 2], offset); w[34] = hc_bytealign_S (w[ 0], w[ 1], offset); w[33] = hc_bytealign_S ( 0, w[ 0], offset); w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 34: w[63] = hc_bytealign_S (w[28], w[29], offset); w[62] = hc_bytealign_S (w[27], w[28], offset); w[61] = hc_bytealign_S (w[26], w[27], offset); w[60] = hc_bytealign_S (w[25], w[26], offset); w[59] = hc_bytealign_S (w[24], w[25], offset); w[58] = hc_bytealign_S (w[23], w[24], offset); w[57] = hc_bytealign_S (w[22], w[23], offset); w[56] = hc_bytealign_S (w[21], w[22], offset); w[55] = hc_bytealign_S (w[20], w[21], offset); w[54] = hc_bytealign_S (w[19], w[20], offset); w[53] = hc_bytealign_S (w[18], w[19], offset); w[52] = hc_bytealign_S (w[17], w[18], offset); w[51] = hc_bytealign_S (w[16], w[17], offset); w[50] = hc_bytealign_S (w[15], w[16], offset); w[49] = hc_bytealign_S (w[14], w[15], offset); w[48] = hc_bytealign_S (w[13], w[14], offset); w[47] = hc_bytealign_S (w[12], w[13], offset); w[46] = hc_bytealign_S (w[11], w[12], offset); w[45] = hc_bytealign_S (w[10], w[11], offset); w[44] = hc_bytealign_S (w[ 9], w[10], offset); w[43] = hc_bytealign_S (w[ 8], w[ 9], offset); w[42] = hc_bytealign_S (w[ 7], w[ 8], offset); w[41] = hc_bytealign_S (w[ 6], w[ 7], offset); w[40] = hc_bytealign_S (w[ 5], w[ 6], offset); w[39] = hc_bytealign_S (w[ 4], w[ 5], offset); w[38] = hc_bytealign_S (w[ 3], w[ 4], offset); w[37] = hc_bytealign_S (w[ 2], w[ 3], offset); w[36] = hc_bytealign_S (w[ 1], w[ 2], offset); w[35] = hc_bytealign_S (w[ 0], w[ 1], offset); w[34] = hc_bytealign_S ( 0, w[ 0], offset); w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 35: w[63] = hc_bytealign_S (w[27], w[28], offset); w[62] = hc_bytealign_S (w[26], w[27], offset); w[61] = hc_bytealign_S (w[25], w[26], offset); w[60] = hc_bytealign_S (w[24], w[25], offset); w[59] = hc_bytealign_S (w[23], w[24], offset); w[58] = hc_bytealign_S (w[22], w[23], offset); w[57] = hc_bytealign_S (w[21], w[22], offset); w[56] = hc_bytealign_S (w[20], w[21], offset); w[55] = hc_bytealign_S (w[19], w[20], offset); w[54] = hc_bytealign_S (w[18], w[19], offset); w[53] = hc_bytealign_S (w[17], w[18], offset); w[52] = hc_bytealign_S (w[16], w[17], offset); w[51] = hc_bytealign_S (w[15], w[16], offset); w[50] = hc_bytealign_S (w[14], w[15], offset); w[49] = hc_bytealign_S (w[13], w[14], offset); w[48] = hc_bytealign_S (w[12], w[13], offset); w[47] = hc_bytealign_S (w[11], w[12], offset); w[46] = hc_bytealign_S (w[10], w[11], offset); w[45] = hc_bytealign_S (w[ 9], w[10], offset); w[44] = hc_bytealign_S (w[ 8], w[ 9], offset); w[43] = hc_bytealign_S (w[ 7], w[ 8], offset); w[42] = hc_bytealign_S (w[ 6], w[ 7], offset); w[41] = hc_bytealign_S (w[ 5], w[ 6], offset); w[40] = hc_bytealign_S (w[ 4], w[ 5], offset); w[39] = hc_bytealign_S (w[ 3], w[ 4], offset); w[38] = hc_bytealign_S (w[ 2], w[ 3], offset); w[37] = hc_bytealign_S (w[ 1], w[ 2], offset); w[36] = hc_bytealign_S (w[ 0], w[ 1], offset); w[35] = hc_bytealign_S ( 0, w[ 0], offset); w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 36: w[63] = hc_bytealign_S (w[26], w[27], offset); w[62] = hc_bytealign_S (w[25], w[26], offset); w[61] = hc_bytealign_S (w[24], w[25], offset); w[60] = hc_bytealign_S (w[23], w[24], offset); w[59] = hc_bytealign_S (w[22], w[23], offset); w[58] = hc_bytealign_S (w[21], w[22], offset); w[57] = hc_bytealign_S (w[20], w[21], offset); w[56] = hc_bytealign_S (w[19], w[20], offset); w[55] = hc_bytealign_S (w[18], w[19], offset); w[54] = hc_bytealign_S (w[17], w[18], offset); w[53] = hc_bytealign_S (w[16], w[17], offset); w[52] = hc_bytealign_S (w[15], w[16], offset); w[51] = hc_bytealign_S (w[14], w[15], offset); w[50] = hc_bytealign_S (w[13], w[14], offset); w[49] = hc_bytealign_S (w[12], w[13], offset); w[48] = hc_bytealign_S (w[11], w[12], offset); w[47] = hc_bytealign_S (w[10], w[11], offset); w[46] = hc_bytealign_S (w[ 9], w[10], offset); w[45] = hc_bytealign_S (w[ 8], w[ 9], offset); w[44] = hc_bytealign_S (w[ 7], w[ 8], offset); w[43] = hc_bytealign_S (w[ 6], w[ 7], offset); w[42] = hc_bytealign_S (w[ 5], w[ 6], offset); w[41] = hc_bytealign_S (w[ 4], w[ 5], offset); w[40] = hc_bytealign_S (w[ 3], w[ 4], offset); w[39] = hc_bytealign_S (w[ 2], w[ 3], offset); w[38] = hc_bytealign_S (w[ 1], w[ 2], offset); w[37] = hc_bytealign_S (w[ 0], w[ 1], offset); w[36] = hc_bytealign_S ( 0, w[ 0], offset); w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 37: w[63] = hc_bytealign_S (w[25], w[26], offset); w[62] = hc_bytealign_S (w[24], w[25], offset); w[61] = hc_bytealign_S (w[23], w[24], offset); w[60] = hc_bytealign_S (w[22], w[23], offset); w[59] = hc_bytealign_S (w[21], w[22], offset); w[58] = hc_bytealign_S (w[20], w[21], offset); w[57] = hc_bytealign_S (w[19], w[20], offset); w[56] = hc_bytealign_S (w[18], w[19], offset); w[55] = hc_bytealign_S (w[17], w[18], offset); w[54] = hc_bytealign_S (w[16], w[17], offset); w[53] = hc_bytealign_S (w[15], w[16], offset); w[52] = hc_bytealign_S (w[14], w[15], offset); w[51] = hc_bytealign_S (w[13], w[14], offset); w[50] = hc_bytealign_S (w[12], w[13], offset); w[49] = hc_bytealign_S (w[11], w[12], offset); w[48] = hc_bytealign_S (w[10], w[11], offset); w[47] = hc_bytealign_S (w[ 9], w[10], offset); w[46] = hc_bytealign_S (w[ 8], w[ 9], offset); w[45] = hc_bytealign_S (w[ 7], w[ 8], offset); w[44] = hc_bytealign_S (w[ 6], w[ 7], offset); w[43] = hc_bytealign_S (w[ 5], w[ 6], offset); w[42] = hc_bytealign_S (w[ 4], w[ 5], offset); w[41] = hc_bytealign_S (w[ 3], w[ 4], offset); w[40] = hc_bytealign_S (w[ 2], w[ 3], offset); w[39] = hc_bytealign_S (w[ 1], w[ 2], offset); w[38] = hc_bytealign_S (w[ 0], w[ 1], offset); w[37] = hc_bytealign_S ( 0, w[ 0], offset); w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 38: w[63] = hc_bytealign_S (w[24], w[25], offset); w[62] = hc_bytealign_S (w[23], w[24], offset); w[61] = hc_bytealign_S (w[22], w[23], offset); w[60] = hc_bytealign_S (w[21], w[22], offset); w[59] = hc_bytealign_S (w[20], w[21], offset); w[58] = hc_bytealign_S (w[19], w[20], offset); w[57] = hc_bytealign_S (w[18], w[19], offset); w[56] = hc_bytealign_S (w[17], w[18], offset); w[55] = hc_bytealign_S (w[16], w[17], offset); w[54] = hc_bytealign_S (w[15], w[16], offset); w[53] = hc_bytealign_S (w[14], w[15], offset); w[52] = hc_bytealign_S (w[13], w[14], offset); w[51] = hc_bytealign_S (w[12], w[13], offset); w[50] = hc_bytealign_S (w[11], w[12], offset); w[49] = hc_bytealign_S (w[10], w[11], offset); w[48] = hc_bytealign_S (w[ 9], w[10], offset); w[47] = hc_bytealign_S (w[ 8], w[ 9], offset); w[46] = hc_bytealign_S (w[ 7], w[ 8], offset); w[45] = hc_bytealign_S (w[ 6], w[ 7], offset); w[44] = hc_bytealign_S (w[ 5], w[ 6], offset); w[43] = hc_bytealign_S (w[ 4], w[ 5], offset); w[42] = hc_bytealign_S (w[ 3], w[ 4], offset); w[41] = hc_bytealign_S (w[ 2], w[ 3], offset); w[40] = hc_bytealign_S (w[ 1], w[ 2], offset); w[39] = hc_bytealign_S (w[ 0], w[ 1], offset); w[38] = hc_bytealign_S ( 0, w[ 0], offset); w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 39: w[63] = hc_bytealign_S (w[23], w[24], offset); w[62] = hc_bytealign_S (w[22], w[23], offset); w[61] = hc_bytealign_S (w[21], w[22], offset); w[60] = hc_bytealign_S (w[20], w[21], offset); w[59] = hc_bytealign_S (w[19], w[20], offset); w[58] = hc_bytealign_S (w[18], w[19], offset); w[57] = hc_bytealign_S (w[17], w[18], offset); w[56] = hc_bytealign_S (w[16], w[17], offset); w[55] = hc_bytealign_S (w[15], w[16], offset); w[54] = hc_bytealign_S (w[14], w[15], offset); w[53] = hc_bytealign_S (w[13], w[14], offset); w[52] = hc_bytealign_S (w[12], w[13], offset); w[51] = hc_bytealign_S (w[11], w[12], offset); w[50] = hc_bytealign_S (w[10], w[11], offset); w[49] = hc_bytealign_S (w[ 9], w[10], offset); w[48] = hc_bytealign_S (w[ 8], w[ 9], offset); w[47] = hc_bytealign_S (w[ 7], w[ 8], offset); w[46] = hc_bytealign_S (w[ 6], w[ 7], offset); w[45] = hc_bytealign_S (w[ 5], w[ 6], offset); w[44] = hc_bytealign_S (w[ 4], w[ 5], offset); w[43] = hc_bytealign_S (w[ 3], w[ 4], offset); w[42] = hc_bytealign_S (w[ 2], w[ 3], offset); w[41] = hc_bytealign_S (w[ 1], w[ 2], offset); w[40] = hc_bytealign_S (w[ 0], w[ 1], offset); w[39] = hc_bytealign_S ( 0, w[ 0], offset); w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 40: w[63] = hc_bytealign_S (w[22], w[23], offset); w[62] = hc_bytealign_S (w[21], w[22], offset); w[61] = hc_bytealign_S (w[20], w[21], offset); w[60] = hc_bytealign_S (w[19], w[20], offset); w[59] = hc_bytealign_S (w[18], w[19], offset); w[58] = hc_bytealign_S (w[17], w[18], offset); w[57] = hc_bytealign_S (w[16], w[17], offset); w[56] = hc_bytealign_S (w[15], w[16], offset); w[55] = hc_bytealign_S (w[14], w[15], offset); w[54] = hc_bytealign_S (w[13], w[14], offset); w[53] = hc_bytealign_S (w[12], w[13], offset); w[52] = hc_bytealign_S (w[11], w[12], offset); w[51] = hc_bytealign_S (w[10], w[11], offset); w[50] = hc_bytealign_S (w[ 9], w[10], offset); w[49] = hc_bytealign_S (w[ 8], w[ 9], offset); w[48] = hc_bytealign_S (w[ 7], w[ 8], offset); w[47] = hc_bytealign_S (w[ 6], w[ 7], offset); w[46] = hc_bytealign_S (w[ 5], w[ 6], offset); w[45] = hc_bytealign_S (w[ 4], w[ 5], offset); w[44] = hc_bytealign_S (w[ 3], w[ 4], offset); w[43] = hc_bytealign_S (w[ 2], w[ 3], offset); w[42] = hc_bytealign_S (w[ 1], w[ 2], offset); w[41] = hc_bytealign_S (w[ 0], w[ 1], offset); w[40] = hc_bytealign_S ( 0, w[ 0], offset); w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 41: w[63] = hc_bytealign_S (w[21], w[22], offset); w[62] = hc_bytealign_S (w[20], w[21], offset); w[61] = hc_bytealign_S (w[19], w[20], offset); w[60] = hc_bytealign_S (w[18], w[19], offset); w[59] = hc_bytealign_S (w[17], w[18], offset); w[58] = hc_bytealign_S (w[16], w[17], offset); w[57] = hc_bytealign_S (w[15], w[16], offset); w[56] = hc_bytealign_S (w[14], w[15], offset); w[55] = hc_bytealign_S (w[13], w[14], offset); w[54] = hc_bytealign_S (w[12], w[13], offset); w[53] = hc_bytealign_S (w[11], w[12], offset); w[52] = hc_bytealign_S (w[10], w[11], offset); w[51] = hc_bytealign_S (w[ 9], w[10], offset); w[50] = hc_bytealign_S (w[ 8], w[ 9], offset); w[49] = hc_bytealign_S (w[ 7], w[ 8], offset); w[48] = hc_bytealign_S (w[ 6], w[ 7], offset); w[47] = hc_bytealign_S (w[ 5], w[ 6], offset); w[46] = hc_bytealign_S (w[ 4], w[ 5], offset); w[45] = hc_bytealign_S (w[ 3], w[ 4], offset); w[44] = hc_bytealign_S (w[ 2], w[ 3], offset); w[43] = hc_bytealign_S (w[ 1], w[ 2], offset); w[42] = hc_bytealign_S (w[ 0], w[ 1], offset); w[41] = hc_bytealign_S ( 0, w[ 0], offset); w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 42: w[63] = hc_bytealign_S (w[20], w[21], offset); w[62] = hc_bytealign_S (w[19], w[20], offset); w[61] = hc_bytealign_S (w[18], w[19], offset); w[60] = hc_bytealign_S (w[17], w[18], offset); w[59] = hc_bytealign_S (w[16], w[17], offset); w[58] = hc_bytealign_S (w[15], w[16], offset); w[57] = hc_bytealign_S (w[14], w[15], offset); w[56] = hc_bytealign_S (w[13], w[14], offset); w[55] = hc_bytealign_S (w[12], w[13], offset); w[54] = hc_bytealign_S (w[11], w[12], offset); w[53] = hc_bytealign_S (w[10], w[11], offset); w[52] = hc_bytealign_S (w[ 9], w[10], offset); w[51] = hc_bytealign_S (w[ 8], w[ 9], offset); w[50] = hc_bytealign_S (w[ 7], w[ 8], offset); w[49] = hc_bytealign_S (w[ 6], w[ 7], offset); w[48] = hc_bytealign_S (w[ 5], w[ 6], offset); w[47] = hc_bytealign_S (w[ 4], w[ 5], offset); w[46] = hc_bytealign_S (w[ 3], w[ 4], offset); w[45] = hc_bytealign_S (w[ 2], w[ 3], offset); w[44] = hc_bytealign_S (w[ 1], w[ 2], offset); w[43] = hc_bytealign_S (w[ 0], w[ 1], offset); w[42] = hc_bytealign_S ( 0, w[ 0], offset); w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 43: w[63] = hc_bytealign_S (w[19], w[20], offset); w[62] = hc_bytealign_S (w[18], w[19], offset); w[61] = hc_bytealign_S (w[17], w[18], offset); w[60] = hc_bytealign_S (w[16], w[17], offset); w[59] = hc_bytealign_S (w[15], w[16], offset); w[58] = hc_bytealign_S (w[14], w[15], offset); w[57] = hc_bytealign_S (w[13], w[14], offset); w[56] = hc_bytealign_S (w[12], w[13], offset); w[55] = hc_bytealign_S (w[11], w[12], offset); w[54] = hc_bytealign_S (w[10], w[11], offset); w[53] = hc_bytealign_S (w[ 9], w[10], offset); w[52] = hc_bytealign_S (w[ 8], w[ 9], offset); w[51] = hc_bytealign_S (w[ 7], w[ 8], offset); w[50] = hc_bytealign_S (w[ 6], w[ 7], offset); w[49] = hc_bytealign_S (w[ 5], w[ 6], offset); w[48] = hc_bytealign_S (w[ 4], w[ 5], offset); w[47] = hc_bytealign_S (w[ 3], w[ 4], offset); w[46] = hc_bytealign_S (w[ 2], w[ 3], offset); w[45] = hc_bytealign_S (w[ 1], w[ 2], offset); w[44] = hc_bytealign_S (w[ 0], w[ 1], offset); w[43] = hc_bytealign_S ( 0, w[ 0], offset); w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 44: w[63] = hc_bytealign_S (w[18], w[19], offset); w[62] = hc_bytealign_S (w[17], w[18], offset); w[61] = hc_bytealign_S (w[16], w[17], offset); w[60] = hc_bytealign_S (w[15], w[16], offset); w[59] = hc_bytealign_S (w[14], w[15], offset); w[58] = hc_bytealign_S (w[13], w[14], offset); w[57] = hc_bytealign_S (w[12], w[13], offset); w[56] = hc_bytealign_S (w[11], w[12], offset); w[55] = hc_bytealign_S (w[10], w[11], offset); w[54] = hc_bytealign_S (w[ 9], w[10], offset); w[53] = hc_bytealign_S (w[ 8], w[ 9], offset); w[52] = hc_bytealign_S (w[ 7], w[ 8], offset); w[51] = hc_bytealign_S (w[ 6], w[ 7], offset); w[50] = hc_bytealign_S (w[ 5], w[ 6], offset); w[49] = hc_bytealign_S (w[ 4], w[ 5], offset); w[48] = hc_bytealign_S (w[ 3], w[ 4], offset); w[47] = hc_bytealign_S (w[ 2], w[ 3], offset); w[46] = hc_bytealign_S (w[ 1], w[ 2], offset); w[45] = hc_bytealign_S (w[ 0], w[ 1], offset); w[44] = hc_bytealign_S ( 0, w[ 0], offset); w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 45: w[63] = hc_bytealign_S (w[17], w[18], offset); w[62] = hc_bytealign_S (w[16], w[17], offset); w[61] = hc_bytealign_S (w[15], w[16], offset); w[60] = hc_bytealign_S (w[14], w[15], offset); w[59] = hc_bytealign_S (w[13], w[14], offset); w[58] = hc_bytealign_S (w[12], w[13], offset); w[57] = hc_bytealign_S (w[11], w[12], offset); w[56] = hc_bytealign_S (w[10], w[11], offset); w[55] = hc_bytealign_S (w[ 9], w[10], offset); w[54] = hc_bytealign_S (w[ 8], w[ 9], offset); w[53] = hc_bytealign_S (w[ 7], w[ 8], offset); w[52] = hc_bytealign_S (w[ 6], w[ 7], offset); w[51] = hc_bytealign_S (w[ 5], w[ 6], offset); w[50] = hc_bytealign_S (w[ 4], w[ 5], offset); w[49] = hc_bytealign_S (w[ 3], w[ 4], offset); w[48] = hc_bytealign_S (w[ 2], w[ 3], offset); w[47] = hc_bytealign_S (w[ 1], w[ 2], offset); w[46] = hc_bytealign_S (w[ 0], w[ 1], offset); w[45] = hc_bytealign_S ( 0, w[ 0], offset); w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 46: w[63] = hc_bytealign_S (w[16], w[17], offset); w[62] = hc_bytealign_S (w[15], w[16], offset); w[61] = hc_bytealign_S (w[14], w[15], offset); w[60] = hc_bytealign_S (w[13], w[14], offset); w[59] = hc_bytealign_S (w[12], w[13], offset); w[58] = hc_bytealign_S (w[11], w[12], offset); w[57] = hc_bytealign_S (w[10], w[11], offset); w[56] = hc_bytealign_S (w[ 9], w[10], offset); w[55] = hc_bytealign_S (w[ 8], w[ 9], offset); w[54] = hc_bytealign_S (w[ 7], w[ 8], offset); w[53] = hc_bytealign_S (w[ 6], w[ 7], offset); w[52] = hc_bytealign_S (w[ 5], w[ 6], offset); w[51] = hc_bytealign_S (w[ 4], w[ 5], offset); w[50] = hc_bytealign_S (w[ 3], w[ 4], offset); w[49] = hc_bytealign_S (w[ 2], w[ 3], offset); w[48] = hc_bytealign_S (w[ 1], w[ 2], offset); w[47] = hc_bytealign_S (w[ 0], w[ 1], offset); w[46] = hc_bytealign_S ( 0, w[ 0], offset); w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 47: w[63] = hc_bytealign_S (w[15], w[16], offset); w[62] = hc_bytealign_S (w[14], w[15], offset); w[61] = hc_bytealign_S (w[13], w[14], offset); w[60] = hc_bytealign_S (w[12], w[13], offset); w[59] = hc_bytealign_S (w[11], w[12], offset); w[58] = hc_bytealign_S (w[10], w[11], offset); w[57] = hc_bytealign_S (w[ 9], w[10], offset); w[56] = hc_bytealign_S (w[ 8], w[ 9], offset); w[55] = hc_bytealign_S (w[ 7], w[ 8], offset); w[54] = hc_bytealign_S (w[ 6], w[ 7], offset); w[53] = hc_bytealign_S (w[ 5], w[ 6], offset); w[52] = hc_bytealign_S (w[ 4], w[ 5], offset); w[51] = hc_bytealign_S (w[ 3], w[ 4], offset); w[50] = hc_bytealign_S (w[ 2], w[ 3], offset); w[49] = hc_bytealign_S (w[ 1], w[ 2], offset); w[48] = hc_bytealign_S (w[ 0], w[ 1], offset); w[47] = hc_bytealign_S ( 0, w[ 0], offset); w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 48: w[63] = hc_bytealign_S (w[14], w[15], offset); w[62] = hc_bytealign_S (w[13], w[14], offset); w[61] = hc_bytealign_S (w[12], w[13], offset); w[60] = hc_bytealign_S (w[11], w[12], offset); w[59] = hc_bytealign_S (w[10], w[11], offset); w[58] = hc_bytealign_S (w[ 9], w[10], offset); w[57] = hc_bytealign_S (w[ 8], w[ 9], offset); w[56] = hc_bytealign_S (w[ 7], w[ 8], offset); w[55] = hc_bytealign_S (w[ 6], w[ 7], offset); w[54] = hc_bytealign_S (w[ 5], w[ 6], offset); w[53] = hc_bytealign_S (w[ 4], w[ 5], offset); w[52] = hc_bytealign_S (w[ 3], w[ 4], offset); w[51] = hc_bytealign_S (w[ 2], w[ 3], offset); w[50] = hc_bytealign_S (w[ 1], w[ 2], offset); w[49] = hc_bytealign_S (w[ 0], w[ 1], offset); w[48] = hc_bytealign_S ( 0, w[ 0], offset); w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 49: w[63] = hc_bytealign_S (w[13], w[14], offset); w[62] = hc_bytealign_S (w[12], w[13], offset); w[61] = hc_bytealign_S (w[11], w[12], offset); w[60] = hc_bytealign_S (w[10], w[11], offset); w[59] = hc_bytealign_S (w[ 9], w[10], offset); w[58] = hc_bytealign_S (w[ 8], w[ 9], offset); w[57] = hc_bytealign_S (w[ 7], w[ 8], offset); w[56] = hc_bytealign_S (w[ 6], w[ 7], offset); w[55] = hc_bytealign_S (w[ 5], w[ 6], offset); w[54] = hc_bytealign_S (w[ 4], w[ 5], offset); w[53] = hc_bytealign_S (w[ 3], w[ 4], offset); w[52] = hc_bytealign_S (w[ 2], w[ 3], offset); w[51] = hc_bytealign_S (w[ 1], w[ 2], offset); w[50] = hc_bytealign_S (w[ 0], w[ 1], offset); w[49] = hc_bytealign_S ( 0, w[ 0], offset); w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 50: w[63] = hc_bytealign_S (w[12], w[13], offset); w[62] = hc_bytealign_S (w[11], w[12], offset); w[61] = hc_bytealign_S (w[10], w[11], offset); w[60] = hc_bytealign_S (w[ 9], w[10], offset); w[59] = hc_bytealign_S (w[ 8], w[ 9], offset); w[58] = hc_bytealign_S (w[ 7], w[ 8], offset); w[57] = hc_bytealign_S (w[ 6], w[ 7], offset); w[56] = hc_bytealign_S (w[ 5], w[ 6], offset); w[55] = hc_bytealign_S (w[ 4], w[ 5], offset); w[54] = hc_bytealign_S (w[ 3], w[ 4], offset); w[53] = hc_bytealign_S (w[ 2], w[ 3], offset); w[52] = hc_bytealign_S (w[ 1], w[ 2], offset); w[51] = hc_bytealign_S (w[ 0], w[ 1], offset); w[50] = hc_bytealign_S ( 0, w[ 0], offset); w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 51: w[63] = hc_bytealign_S (w[11], w[12], offset); w[62] = hc_bytealign_S (w[10], w[11], offset); w[61] = hc_bytealign_S (w[ 9], w[10], offset); w[60] = hc_bytealign_S (w[ 8], w[ 9], offset); w[59] = hc_bytealign_S (w[ 7], w[ 8], offset); w[58] = hc_bytealign_S (w[ 6], w[ 7], offset); w[57] = hc_bytealign_S (w[ 5], w[ 6], offset); w[56] = hc_bytealign_S (w[ 4], w[ 5], offset); w[55] = hc_bytealign_S (w[ 3], w[ 4], offset); w[54] = hc_bytealign_S (w[ 2], w[ 3], offset); w[53] = hc_bytealign_S (w[ 1], w[ 2], offset); w[52] = hc_bytealign_S (w[ 0], w[ 1], offset); w[51] = hc_bytealign_S ( 0, w[ 0], offset); w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 52: w[63] = hc_bytealign_S (w[10], w[11], offset); w[62] = hc_bytealign_S (w[ 9], w[10], offset); w[61] = hc_bytealign_S (w[ 8], w[ 9], offset); w[60] = hc_bytealign_S (w[ 7], w[ 8], offset); w[59] = hc_bytealign_S (w[ 6], w[ 7], offset); w[58] = hc_bytealign_S (w[ 5], w[ 6], offset); w[57] = hc_bytealign_S (w[ 4], w[ 5], offset); w[56] = hc_bytealign_S (w[ 3], w[ 4], offset); w[55] = hc_bytealign_S (w[ 2], w[ 3], offset); w[54] = hc_bytealign_S (w[ 1], w[ 2], offset); w[53] = hc_bytealign_S (w[ 0], w[ 1], offset); w[52] = hc_bytealign_S ( 0, w[ 0], offset); w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 53: w[63] = hc_bytealign_S (w[ 9], w[10], offset); w[62] = hc_bytealign_S (w[ 8], w[ 9], offset); w[61] = hc_bytealign_S (w[ 7], w[ 8], offset); w[60] = hc_bytealign_S (w[ 6], w[ 7], offset); w[59] = hc_bytealign_S (w[ 5], w[ 6], offset); w[58] = hc_bytealign_S (w[ 4], w[ 5], offset); w[57] = hc_bytealign_S (w[ 3], w[ 4], offset); w[56] = hc_bytealign_S (w[ 2], w[ 3], offset); w[55] = hc_bytealign_S (w[ 1], w[ 2], offset); w[54] = hc_bytealign_S (w[ 0], w[ 1], offset); w[53] = hc_bytealign_S ( 0, w[ 0], offset); w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 54: w[63] = hc_bytealign_S (w[ 8], w[ 9], offset); w[62] = hc_bytealign_S (w[ 7], w[ 8], offset); w[61] = hc_bytealign_S (w[ 6], w[ 7], offset); w[60] = hc_bytealign_S (w[ 5], w[ 6], offset); w[59] = hc_bytealign_S (w[ 4], w[ 5], offset); w[58] = hc_bytealign_S (w[ 3], w[ 4], offset); w[57] = hc_bytealign_S (w[ 2], w[ 3], offset); w[56] = hc_bytealign_S (w[ 1], w[ 2], offset); w[55] = hc_bytealign_S (w[ 0], w[ 1], offset); w[54] = hc_bytealign_S ( 0, w[ 0], offset); w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 55: w[63] = hc_bytealign_S (w[ 7], w[ 8], offset); w[62] = hc_bytealign_S (w[ 6], w[ 7], offset); w[61] = hc_bytealign_S (w[ 5], w[ 6], offset); w[60] = hc_bytealign_S (w[ 4], w[ 5], offset); w[59] = hc_bytealign_S (w[ 3], w[ 4], offset); w[58] = hc_bytealign_S (w[ 2], w[ 3], offset); w[57] = hc_bytealign_S (w[ 1], w[ 2], offset); w[56] = hc_bytealign_S (w[ 0], w[ 1], offset); w[55] = hc_bytealign_S ( 0, w[ 0], offset); w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 56: w[63] = hc_bytealign_S (w[ 6], w[ 7], offset); w[62] = hc_bytealign_S (w[ 5], w[ 6], offset); w[61] = hc_bytealign_S (w[ 4], w[ 5], offset); w[60] = hc_bytealign_S (w[ 3], w[ 4], offset); w[59] = hc_bytealign_S (w[ 2], w[ 3], offset); w[58] = hc_bytealign_S (w[ 1], w[ 2], offset); w[57] = hc_bytealign_S (w[ 0], w[ 1], offset); w[56] = hc_bytealign_S ( 0, w[ 0], offset); w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 57: w[63] = hc_bytealign_S (w[ 5], w[ 6], offset); w[62] = hc_bytealign_S (w[ 4], w[ 5], offset); w[61] = hc_bytealign_S (w[ 3], w[ 4], offset); w[60] = hc_bytealign_S (w[ 2], w[ 3], offset); w[59] = hc_bytealign_S (w[ 1], w[ 2], offset); w[58] = hc_bytealign_S (w[ 0], w[ 1], offset); w[57] = hc_bytealign_S ( 0, w[ 0], offset); w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 58: w[63] = hc_bytealign_S (w[ 4], w[ 5], offset); w[62] = hc_bytealign_S (w[ 3], w[ 4], offset); w[61] = hc_bytealign_S (w[ 2], w[ 3], offset); w[60] = hc_bytealign_S (w[ 1], w[ 2], offset); w[59] = hc_bytealign_S (w[ 0], w[ 1], offset); w[58] = hc_bytealign_S ( 0, w[ 0], offset); w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 59: w[63] = hc_bytealign_S (w[ 3], w[ 4], offset); w[62] = hc_bytealign_S (w[ 2], w[ 3], offset); w[61] = hc_bytealign_S (w[ 1], w[ 2], offset); w[60] = hc_bytealign_S (w[ 0], w[ 1], offset); w[59] = hc_bytealign_S ( 0, w[ 0], offset); w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 60: w[63] = hc_bytealign_S (w[ 2], w[ 3], offset); w[62] = hc_bytealign_S (w[ 1], w[ 2], offset); w[61] = hc_bytealign_S (w[ 0], w[ 1], offset); w[60] = hc_bytealign_S ( 0, w[ 0], offset); w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 61: w[63] = hc_bytealign_S (w[ 1], w[ 2], offset); w[62] = hc_bytealign_S (w[ 0], w[ 1], offset); w[61] = hc_bytealign_S ( 0, w[ 0], offset); w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 62: w[63] = hc_bytealign_S (w[ 0], w[ 1], offset); w[62] = hc_bytealign_S ( 0, w[ 0], offset); w[61] = 0; w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 63: w[63] = hc_bytealign_S ( 0, w[ 0], offset); w[62] = 0; w[61] = 0; w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV const int offset_mod_4 = offset & 3; const int offset_minus_4 = 4 - offset_mod_4; #if defined IS_NV const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> (offset_minus_4 * 8)); #endif switch (offset_switch) { case 0: w[63] = hc_byte_perm_S (w[62], w[63], selector); w[62] = hc_byte_perm_S (w[61], w[62], selector); w[61] = hc_byte_perm_S (w[60], w[61], selector); w[60] = hc_byte_perm_S (w[59], w[60], selector); w[59] = hc_byte_perm_S (w[58], w[59], selector); w[58] = hc_byte_perm_S (w[57], w[58], selector); w[57] = hc_byte_perm_S (w[56], w[57], selector); w[56] = hc_byte_perm_S (w[55], w[56], selector); w[55] = hc_byte_perm_S (w[54], w[55], selector); w[54] = hc_byte_perm_S (w[53], w[54], selector); w[53] = hc_byte_perm_S (w[52], w[53], selector); w[52] = hc_byte_perm_S (w[51], w[52], selector); w[51] = hc_byte_perm_S (w[50], w[51], selector); w[50] = hc_byte_perm_S (w[49], w[50], selector); w[49] = hc_byte_perm_S (w[48], w[49], selector); w[48] = hc_byte_perm_S (w[47], w[48], selector); w[47] = hc_byte_perm_S (w[46], w[47], selector); w[46] = hc_byte_perm_S (w[45], w[46], selector); w[45] = hc_byte_perm_S (w[44], w[45], selector); w[44] = hc_byte_perm_S (w[43], w[44], selector); w[43] = hc_byte_perm_S (w[42], w[43], selector); w[42] = hc_byte_perm_S (w[41], w[42], selector); w[41] = hc_byte_perm_S (w[40], w[41], selector); w[40] = hc_byte_perm_S (w[39], w[40], selector); w[39] = hc_byte_perm_S (w[38], w[39], selector); w[38] = hc_byte_perm_S (w[37], w[38], selector); w[37] = hc_byte_perm_S (w[36], w[37], selector); w[36] = hc_byte_perm_S (w[35], w[36], selector); w[35] = hc_byte_perm_S (w[34], w[35], selector); w[34] = hc_byte_perm_S (w[33], w[34], selector); w[33] = hc_byte_perm_S (w[32], w[33], selector); w[32] = hc_byte_perm_S (w[31], w[32], selector); w[31] = hc_byte_perm_S (w[30], w[31], selector); w[30] = hc_byte_perm_S (w[29], w[30], selector); w[29] = hc_byte_perm_S (w[28], w[29], selector); w[28] = hc_byte_perm_S (w[27], w[28], selector); w[27] = hc_byte_perm_S (w[26], w[27], selector); w[26] = hc_byte_perm_S (w[25], w[26], selector); w[25] = hc_byte_perm_S (w[24], w[25], selector); w[24] = hc_byte_perm_S (w[23], w[24], selector); w[23] = hc_byte_perm_S (w[22], w[23], selector); w[22] = hc_byte_perm_S (w[21], w[22], selector); w[21] = hc_byte_perm_S (w[20], w[21], selector); w[20] = hc_byte_perm_S (w[19], w[20], selector); w[19] = hc_byte_perm_S (w[18], w[19], selector); w[18] = hc_byte_perm_S (w[17], w[18], selector); w[17] = hc_byte_perm_S (w[16], w[17], selector); w[16] = hc_byte_perm_S (w[15], w[16], selector); w[15] = hc_byte_perm_S (w[14], w[15], selector); w[14] = hc_byte_perm_S (w[13], w[14], selector); w[13] = hc_byte_perm_S (w[12], w[13], selector); w[12] = hc_byte_perm_S (w[11], w[12], selector); w[11] = hc_byte_perm_S (w[10], w[11], selector); w[10] = hc_byte_perm_S (w[ 9], w[10], selector); w[ 9] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[ 8] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[ 7] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[ 6] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[ 5] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[ 4] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[ 3] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[ 2] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[ 1] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[ 0] = hc_byte_perm_S ( 0, w[ 0], selector); break; case 1: w[63] = hc_byte_perm_S (w[61], w[62], selector); w[62] = hc_byte_perm_S (w[60], w[61], selector); w[61] = hc_byte_perm_S (w[59], w[60], selector); w[60] = hc_byte_perm_S (w[58], w[59], selector); w[59] = hc_byte_perm_S (w[57], w[58], selector); w[58] = hc_byte_perm_S (w[56], w[57], selector); w[57] = hc_byte_perm_S (w[55], w[56], selector); w[56] = hc_byte_perm_S (w[54], w[55], selector); w[55] = hc_byte_perm_S (w[53], w[54], selector); w[54] = hc_byte_perm_S (w[52], w[53], selector); w[53] = hc_byte_perm_S (w[51], w[52], selector); w[52] = hc_byte_perm_S (w[50], w[51], selector); w[51] = hc_byte_perm_S (w[49], w[50], selector); w[50] = hc_byte_perm_S (w[48], w[49], selector); w[49] = hc_byte_perm_S (w[47], w[48], selector); w[48] = hc_byte_perm_S (w[46], w[47], selector); w[47] = hc_byte_perm_S (w[45], w[46], selector); w[46] = hc_byte_perm_S (w[44], w[45], selector); w[45] = hc_byte_perm_S (w[43], w[44], selector); w[44] = hc_byte_perm_S (w[42], w[43], selector); w[43] = hc_byte_perm_S (w[41], w[42], selector); w[42] = hc_byte_perm_S (w[40], w[41], selector); w[41] = hc_byte_perm_S (w[39], w[40], selector); w[40] = hc_byte_perm_S (w[38], w[39], selector); w[39] = hc_byte_perm_S (w[37], w[38], selector); w[38] = hc_byte_perm_S (w[36], w[37], selector); w[37] = hc_byte_perm_S (w[35], w[36], selector); w[36] = hc_byte_perm_S (w[34], w[35], selector); w[35] = hc_byte_perm_S (w[33], w[34], selector); w[34] = hc_byte_perm_S (w[32], w[33], selector); w[33] = hc_byte_perm_S (w[31], w[32], selector); w[32] = hc_byte_perm_S (w[30], w[31], selector); w[31] = hc_byte_perm_S (w[29], w[30], selector); w[30] = hc_byte_perm_S (w[28], w[29], selector); w[29] = hc_byte_perm_S (w[27], w[28], selector); w[28] = hc_byte_perm_S (w[26], w[27], selector); w[27] = hc_byte_perm_S (w[25], w[26], selector); w[26] = hc_byte_perm_S (w[24], w[25], selector); w[25] = hc_byte_perm_S (w[23], w[24], selector); w[24] = hc_byte_perm_S (w[22], w[23], selector); w[23] = hc_byte_perm_S (w[21], w[22], selector); w[22] = hc_byte_perm_S (w[20], w[21], selector); w[21] = hc_byte_perm_S (w[19], w[20], selector); w[20] = hc_byte_perm_S (w[18], w[19], selector); w[19] = hc_byte_perm_S (w[17], w[18], selector); w[18] = hc_byte_perm_S (w[16], w[17], selector); w[17] = hc_byte_perm_S (w[15], w[16], selector); w[16] = hc_byte_perm_S (w[14], w[15], selector); w[15] = hc_byte_perm_S (w[13], w[14], selector); w[14] = hc_byte_perm_S (w[12], w[13], selector); w[13] = hc_byte_perm_S (w[11], w[12], selector); w[12] = hc_byte_perm_S (w[10], w[11], selector); w[11] = hc_byte_perm_S (w[ 9], w[10], selector); w[10] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[ 9] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[ 8] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[ 7] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[ 6] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[ 5] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[ 4] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[ 3] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[ 2] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[ 1] = hc_byte_perm_S ( 0, w[ 0], selector); w[ 0] = 0; break; case 2: w[63] = hc_byte_perm_S (w[60], w[61], selector); w[62] = hc_byte_perm_S (w[59], w[60], selector); w[61] = hc_byte_perm_S (w[58], w[59], selector); w[60] = hc_byte_perm_S (w[57], w[58], selector); w[59] = hc_byte_perm_S (w[56], w[57], selector); w[58] = hc_byte_perm_S (w[55], w[56], selector); w[57] = hc_byte_perm_S (w[54], w[55], selector); w[56] = hc_byte_perm_S (w[53], w[54], selector); w[55] = hc_byte_perm_S (w[52], w[53], selector); w[54] = hc_byte_perm_S (w[51], w[52], selector); w[53] = hc_byte_perm_S (w[50], w[51], selector); w[52] = hc_byte_perm_S (w[49], w[50], selector); w[51] = hc_byte_perm_S (w[48], w[49], selector); w[50] = hc_byte_perm_S (w[47], w[48], selector); w[49] = hc_byte_perm_S (w[46], w[47], selector); w[48] = hc_byte_perm_S (w[45], w[46], selector); w[47] = hc_byte_perm_S (w[44], w[45], selector); w[46] = hc_byte_perm_S (w[43], w[44], selector); w[45] = hc_byte_perm_S (w[42], w[43], selector); w[44] = hc_byte_perm_S (w[41], w[42], selector); w[43] = hc_byte_perm_S (w[40], w[41], selector); w[42] = hc_byte_perm_S (w[39], w[40], selector); w[41] = hc_byte_perm_S (w[38], w[39], selector); w[40] = hc_byte_perm_S (w[37], w[38], selector); w[39] = hc_byte_perm_S (w[36], w[37], selector); w[38] = hc_byte_perm_S (w[35], w[36], selector); w[37] = hc_byte_perm_S (w[34], w[35], selector); w[36] = hc_byte_perm_S (w[33], w[34], selector); w[35] = hc_byte_perm_S (w[32], w[33], selector); w[34] = hc_byte_perm_S (w[31], w[32], selector); w[33] = hc_byte_perm_S (w[30], w[31], selector); w[32] = hc_byte_perm_S (w[29], w[30], selector); w[31] = hc_byte_perm_S (w[28], w[29], selector); w[30] = hc_byte_perm_S (w[27], w[28], selector); w[29] = hc_byte_perm_S (w[26], w[27], selector); w[28] = hc_byte_perm_S (w[25], w[26], selector); w[27] = hc_byte_perm_S (w[24], w[25], selector); w[26] = hc_byte_perm_S (w[23], w[24], selector); w[25] = hc_byte_perm_S (w[22], w[23], selector); w[24] = hc_byte_perm_S (w[21], w[22], selector); w[23] = hc_byte_perm_S (w[20], w[21], selector); w[22] = hc_byte_perm_S (w[19], w[20], selector); w[21] = hc_byte_perm_S (w[18], w[19], selector); w[20] = hc_byte_perm_S (w[17], w[18], selector); w[19] = hc_byte_perm_S (w[16], w[17], selector); w[18] = hc_byte_perm_S (w[15], w[16], selector); w[17] = hc_byte_perm_S (w[14], w[15], selector); w[16] = hc_byte_perm_S (w[13], w[14], selector); w[15] = hc_byte_perm_S (w[12], w[13], selector); w[14] = hc_byte_perm_S (w[11], w[12], selector); w[13] = hc_byte_perm_S (w[10], w[11], selector); w[12] = hc_byte_perm_S (w[ 9], w[10], selector); w[11] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[10] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[ 9] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[ 8] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[ 7] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[ 6] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[ 5] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[ 4] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[ 3] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[ 2] = hc_byte_perm_S ( 0, w[ 0], selector); w[ 1] = 0; w[ 0] = 0; break; case 3: w[63] = hc_byte_perm_S (w[59], w[60], selector); w[62] = hc_byte_perm_S (w[58], w[59], selector); w[61] = hc_byte_perm_S (w[57], w[58], selector); w[60] = hc_byte_perm_S (w[56], w[57], selector); w[59] = hc_byte_perm_S (w[55], w[56], selector); w[58] = hc_byte_perm_S (w[54], w[55], selector); w[57] = hc_byte_perm_S (w[53], w[54], selector); w[56] = hc_byte_perm_S (w[52], w[53], selector); w[55] = hc_byte_perm_S (w[51], w[52], selector); w[54] = hc_byte_perm_S (w[50], w[51], selector); w[53] = hc_byte_perm_S (w[49], w[50], selector); w[52] = hc_byte_perm_S (w[48], w[49], selector); w[51] = hc_byte_perm_S (w[47], w[48], selector); w[50] = hc_byte_perm_S (w[46], w[47], selector); w[49] = hc_byte_perm_S (w[45], w[46], selector); w[48] = hc_byte_perm_S (w[44], w[45], selector); w[47] = hc_byte_perm_S (w[43], w[44], selector); w[46] = hc_byte_perm_S (w[42], w[43], selector); w[45] = hc_byte_perm_S (w[41], w[42], selector); w[44] = hc_byte_perm_S (w[40], w[41], selector); w[43] = hc_byte_perm_S (w[39], w[40], selector); w[42] = hc_byte_perm_S (w[38], w[39], selector); w[41] = hc_byte_perm_S (w[37], w[38], selector); w[40] = hc_byte_perm_S (w[36], w[37], selector); w[39] = hc_byte_perm_S (w[35], w[36], selector); w[38] = hc_byte_perm_S (w[34], w[35], selector); w[37] = hc_byte_perm_S (w[33], w[34], selector); w[36] = hc_byte_perm_S (w[32], w[33], selector); w[35] = hc_byte_perm_S (w[31], w[32], selector); w[34] = hc_byte_perm_S (w[30], w[31], selector); w[33] = hc_byte_perm_S (w[29], w[30], selector); w[32] = hc_byte_perm_S (w[28], w[29], selector); w[31] = hc_byte_perm_S (w[27], w[28], selector); w[30] = hc_byte_perm_S (w[26], w[27], selector); w[29] = hc_byte_perm_S (w[25], w[26], selector); w[28] = hc_byte_perm_S (w[24], w[25], selector); w[27] = hc_byte_perm_S (w[23], w[24], selector); w[26] = hc_byte_perm_S (w[22], w[23], selector); w[25] = hc_byte_perm_S (w[21], w[22], selector); w[24] = hc_byte_perm_S (w[20], w[21], selector); w[23] = hc_byte_perm_S (w[19], w[20], selector); w[22] = hc_byte_perm_S (w[18], w[19], selector); w[21] = hc_byte_perm_S (w[17], w[18], selector); w[20] = hc_byte_perm_S (w[16], w[17], selector); w[19] = hc_byte_perm_S (w[15], w[16], selector); w[18] = hc_byte_perm_S (w[14], w[15], selector); w[17] = hc_byte_perm_S (w[13], w[14], selector); w[16] = hc_byte_perm_S (w[12], w[13], selector); w[15] = hc_byte_perm_S (w[11], w[12], selector); w[14] = hc_byte_perm_S (w[10], w[11], selector); w[13] = hc_byte_perm_S (w[ 9], w[10], selector); w[12] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[11] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[10] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[ 9] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[ 8] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[ 7] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[ 6] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[ 5] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[ 4] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[ 3] = hc_byte_perm_S ( 0, w[ 0], selector); w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 4: w[63] = hc_byte_perm_S (w[58], w[59], selector); w[62] = hc_byte_perm_S (w[57], w[58], selector); w[61] = hc_byte_perm_S (w[56], w[57], selector); w[60] = hc_byte_perm_S (w[55], w[56], selector); w[59] = hc_byte_perm_S (w[54], w[55], selector); w[58] = hc_byte_perm_S (w[53], w[54], selector); w[57] = hc_byte_perm_S (w[52], w[53], selector); w[56] = hc_byte_perm_S (w[51], w[52], selector); w[55] = hc_byte_perm_S (w[50], w[51], selector); w[54] = hc_byte_perm_S (w[49], w[50], selector); w[53] = hc_byte_perm_S (w[48], w[49], selector); w[52] = hc_byte_perm_S (w[47], w[48], selector); w[51] = hc_byte_perm_S (w[46], w[47], selector); w[50] = hc_byte_perm_S (w[45], w[46], selector); w[49] = hc_byte_perm_S (w[44], w[45], selector); w[48] = hc_byte_perm_S (w[43], w[44], selector); w[47] = hc_byte_perm_S (w[42], w[43], selector); w[46] = hc_byte_perm_S (w[41], w[42], selector); w[45] = hc_byte_perm_S (w[40], w[41], selector); w[44] = hc_byte_perm_S (w[39], w[40], selector); w[43] = hc_byte_perm_S (w[38], w[39], selector); w[42] = hc_byte_perm_S (w[37], w[38], selector); w[41] = hc_byte_perm_S (w[36], w[37], selector); w[40] = hc_byte_perm_S (w[35], w[36], selector); w[39] = hc_byte_perm_S (w[34], w[35], selector); w[38] = hc_byte_perm_S (w[33], w[34], selector); w[37] = hc_byte_perm_S (w[32], w[33], selector); w[36] = hc_byte_perm_S (w[31], w[32], selector); w[35] = hc_byte_perm_S (w[30], w[31], selector); w[34] = hc_byte_perm_S (w[29], w[30], selector); w[33] = hc_byte_perm_S (w[28], w[29], selector); w[32] = hc_byte_perm_S (w[27], w[28], selector); w[31] = hc_byte_perm_S (w[26], w[27], selector); w[30] = hc_byte_perm_S (w[25], w[26], selector); w[29] = hc_byte_perm_S (w[24], w[25], selector); w[28] = hc_byte_perm_S (w[23], w[24], selector); w[27] = hc_byte_perm_S (w[22], w[23], selector); w[26] = hc_byte_perm_S (w[21], w[22], selector); w[25] = hc_byte_perm_S (w[20], w[21], selector); w[24] = hc_byte_perm_S (w[19], w[20], selector); w[23] = hc_byte_perm_S (w[18], w[19], selector); w[22] = hc_byte_perm_S (w[17], w[18], selector); w[21] = hc_byte_perm_S (w[16], w[17], selector); w[20] = hc_byte_perm_S (w[15], w[16], selector); w[19] = hc_byte_perm_S (w[14], w[15], selector); w[18] = hc_byte_perm_S (w[13], w[14], selector); w[17] = hc_byte_perm_S (w[12], w[13], selector); w[16] = hc_byte_perm_S (w[11], w[12], selector); w[15] = hc_byte_perm_S (w[10], w[11], selector); w[14] = hc_byte_perm_S (w[ 9], w[10], selector); w[13] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[12] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[11] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[10] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[ 9] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[ 8] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[ 7] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[ 6] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[ 5] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[ 4] = hc_byte_perm_S ( 0, w[ 0], selector); w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 5: w[63] = hc_byte_perm_S (w[57], w[58], selector); w[62] = hc_byte_perm_S (w[56], w[57], selector); w[61] = hc_byte_perm_S (w[55], w[56], selector); w[60] = hc_byte_perm_S (w[54], w[55], selector); w[59] = hc_byte_perm_S (w[53], w[54], selector); w[58] = hc_byte_perm_S (w[52], w[53], selector); w[57] = hc_byte_perm_S (w[51], w[52], selector); w[56] = hc_byte_perm_S (w[50], w[51], selector); w[55] = hc_byte_perm_S (w[49], w[50], selector); w[54] = hc_byte_perm_S (w[48], w[49], selector); w[53] = hc_byte_perm_S (w[47], w[48], selector); w[52] = hc_byte_perm_S (w[46], w[47], selector); w[51] = hc_byte_perm_S (w[45], w[46], selector); w[50] = hc_byte_perm_S (w[44], w[45], selector); w[49] = hc_byte_perm_S (w[43], w[44], selector); w[48] = hc_byte_perm_S (w[42], w[43], selector); w[47] = hc_byte_perm_S (w[41], w[42], selector); w[46] = hc_byte_perm_S (w[40], w[41], selector); w[45] = hc_byte_perm_S (w[39], w[40], selector); w[44] = hc_byte_perm_S (w[38], w[39], selector); w[43] = hc_byte_perm_S (w[37], w[38], selector); w[42] = hc_byte_perm_S (w[36], w[37], selector); w[41] = hc_byte_perm_S (w[35], w[36], selector); w[40] = hc_byte_perm_S (w[34], w[35], selector); w[39] = hc_byte_perm_S (w[33], w[34], selector); w[38] = hc_byte_perm_S (w[32], w[33], selector); w[37] = hc_byte_perm_S (w[31], w[32], selector); w[36] = hc_byte_perm_S (w[30], w[31], selector); w[35] = hc_byte_perm_S (w[29], w[30], selector); w[34] = hc_byte_perm_S (w[28], w[29], selector); w[33] = hc_byte_perm_S (w[27], w[28], selector); w[32] = hc_byte_perm_S (w[26], w[27], selector); w[31] = hc_byte_perm_S (w[25], w[26], selector); w[30] = hc_byte_perm_S (w[24], w[25], selector); w[29] = hc_byte_perm_S (w[23], w[24], selector); w[28] = hc_byte_perm_S (w[22], w[23], selector); w[27] = hc_byte_perm_S (w[21], w[22], selector); w[26] = hc_byte_perm_S (w[20], w[21], selector); w[25] = hc_byte_perm_S (w[19], w[20], selector); w[24] = hc_byte_perm_S (w[18], w[19], selector); w[23] = hc_byte_perm_S (w[17], w[18], selector); w[22] = hc_byte_perm_S (w[16], w[17], selector); w[21] = hc_byte_perm_S (w[15], w[16], selector); w[20] = hc_byte_perm_S (w[14], w[15], selector); w[19] = hc_byte_perm_S (w[13], w[14], selector); w[18] = hc_byte_perm_S (w[12], w[13], selector); w[17] = hc_byte_perm_S (w[11], w[12], selector); w[16] = hc_byte_perm_S (w[10], w[11], selector); w[15] = hc_byte_perm_S (w[ 9], w[10], selector); w[14] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[13] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[12] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[11] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[10] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[ 9] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[ 8] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[ 7] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[ 6] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[ 5] = hc_byte_perm_S ( 0, w[ 0], selector); w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 6: w[63] = hc_byte_perm_S (w[56], w[57], selector); w[62] = hc_byte_perm_S (w[55], w[56], selector); w[61] = hc_byte_perm_S (w[54], w[55], selector); w[60] = hc_byte_perm_S (w[53], w[54], selector); w[59] = hc_byte_perm_S (w[52], w[53], selector); w[58] = hc_byte_perm_S (w[51], w[52], selector); w[57] = hc_byte_perm_S (w[50], w[51], selector); w[56] = hc_byte_perm_S (w[49], w[50], selector); w[55] = hc_byte_perm_S (w[48], w[49], selector); w[54] = hc_byte_perm_S (w[47], w[48], selector); w[53] = hc_byte_perm_S (w[46], w[47], selector); w[52] = hc_byte_perm_S (w[45], w[46], selector); w[51] = hc_byte_perm_S (w[44], w[45], selector); w[50] = hc_byte_perm_S (w[43], w[44], selector); w[49] = hc_byte_perm_S (w[42], w[43], selector); w[48] = hc_byte_perm_S (w[41], w[42], selector); w[47] = hc_byte_perm_S (w[40], w[41], selector); w[46] = hc_byte_perm_S (w[39], w[40], selector); w[45] = hc_byte_perm_S (w[38], w[39], selector); w[44] = hc_byte_perm_S (w[37], w[38], selector); w[43] = hc_byte_perm_S (w[36], w[37], selector); w[42] = hc_byte_perm_S (w[35], w[36], selector); w[41] = hc_byte_perm_S (w[34], w[35], selector); w[40] = hc_byte_perm_S (w[33], w[34], selector); w[39] = hc_byte_perm_S (w[32], w[33], selector); w[38] = hc_byte_perm_S (w[31], w[32], selector); w[37] = hc_byte_perm_S (w[30], w[31], selector); w[36] = hc_byte_perm_S (w[29], w[30], selector); w[35] = hc_byte_perm_S (w[28], w[29], selector); w[34] = hc_byte_perm_S (w[27], w[28], selector); w[33] = hc_byte_perm_S (w[26], w[27], selector); w[32] = hc_byte_perm_S (w[25], w[26], selector); w[31] = hc_byte_perm_S (w[24], w[25], selector); w[30] = hc_byte_perm_S (w[23], w[24], selector); w[29] = hc_byte_perm_S (w[22], w[23], selector); w[28] = hc_byte_perm_S (w[21], w[22], selector); w[27] = hc_byte_perm_S (w[20], w[21], selector); w[26] = hc_byte_perm_S (w[19], w[20], selector); w[25] = hc_byte_perm_S (w[18], w[19], selector); w[24] = hc_byte_perm_S (w[17], w[18], selector); w[23] = hc_byte_perm_S (w[16], w[17], selector); w[22] = hc_byte_perm_S (w[15], w[16], selector); w[21] = hc_byte_perm_S (w[14], w[15], selector); w[20] = hc_byte_perm_S (w[13], w[14], selector); w[19] = hc_byte_perm_S (w[12], w[13], selector); w[18] = hc_byte_perm_S (w[11], w[12], selector); w[17] = hc_byte_perm_S (w[10], w[11], selector); w[16] = hc_byte_perm_S (w[ 9], w[10], selector); w[15] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[14] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[13] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[12] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[11] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[10] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[ 9] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[ 8] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[ 7] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[ 6] = hc_byte_perm_S ( 0, w[ 0], selector); w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 7: w[63] = hc_byte_perm_S (w[55], w[56], selector); w[62] = hc_byte_perm_S (w[54], w[55], selector); w[61] = hc_byte_perm_S (w[53], w[54], selector); w[60] = hc_byte_perm_S (w[52], w[53], selector); w[59] = hc_byte_perm_S (w[51], w[52], selector); w[58] = hc_byte_perm_S (w[50], w[51], selector); w[57] = hc_byte_perm_S (w[49], w[50], selector); w[56] = hc_byte_perm_S (w[48], w[49], selector); w[55] = hc_byte_perm_S (w[47], w[48], selector); w[54] = hc_byte_perm_S (w[46], w[47], selector); w[53] = hc_byte_perm_S (w[45], w[46], selector); w[52] = hc_byte_perm_S (w[44], w[45], selector); w[51] = hc_byte_perm_S (w[43], w[44], selector); w[50] = hc_byte_perm_S (w[42], w[43], selector); w[49] = hc_byte_perm_S (w[41], w[42], selector); w[48] = hc_byte_perm_S (w[40], w[41], selector); w[47] = hc_byte_perm_S (w[39], w[40], selector); w[46] = hc_byte_perm_S (w[38], w[39], selector); w[45] = hc_byte_perm_S (w[37], w[38], selector); w[44] = hc_byte_perm_S (w[36], w[37], selector); w[43] = hc_byte_perm_S (w[35], w[36], selector); w[42] = hc_byte_perm_S (w[34], w[35], selector); w[41] = hc_byte_perm_S (w[33], w[34], selector); w[40] = hc_byte_perm_S (w[32], w[33], selector); w[39] = hc_byte_perm_S (w[31], w[32], selector); w[38] = hc_byte_perm_S (w[30], w[31], selector); w[37] = hc_byte_perm_S (w[29], w[30], selector); w[36] = hc_byte_perm_S (w[28], w[29], selector); w[35] = hc_byte_perm_S (w[27], w[28], selector); w[34] = hc_byte_perm_S (w[26], w[27], selector); w[33] = hc_byte_perm_S (w[25], w[26], selector); w[32] = hc_byte_perm_S (w[24], w[25], selector); w[31] = hc_byte_perm_S (w[23], w[24], selector); w[30] = hc_byte_perm_S (w[22], w[23], selector); w[29] = hc_byte_perm_S (w[21], w[22], selector); w[28] = hc_byte_perm_S (w[20], w[21], selector); w[27] = hc_byte_perm_S (w[19], w[20], selector); w[26] = hc_byte_perm_S (w[18], w[19], selector); w[25] = hc_byte_perm_S (w[17], w[18], selector); w[24] = hc_byte_perm_S (w[16], w[17], selector); w[23] = hc_byte_perm_S (w[15], w[16], selector); w[22] = hc_byte_perm_S (w[14], w[15], selector); w[21] = hc_byte_perm_S (w[13], w[14], selector); w[20] = hc_byte_perm_S (w[12], w[13], selector); w[19] = hc_byte_perm_S (w[11], w[12], selector); w[18] = hc_byte_perm_S (w[10], w[11], selector); w[17] = hc_byte_perm_S (w[ 9], w[10], selector); w[16] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[15] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[14] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[13] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[12] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[11] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[10] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[ 9] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[ 8] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[ 7] = hc_byte_perm_S ( 0, w[ 0], selector); w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 8: w[63] = hc_byte_perm_S (w[54], w[55], selector); w[62] = hc_byte_perm_S (w[53], w[54], selector); w[61] = hc_byte_perm_S (w[52], w[53], selector); w[60] = hc_byte_perm_S (w[51], w[52], selector); w[59] = hc_byte_perm_S (w[50], w[51], selector); w[58] = hc_byte_perm_S (w[49], w[50], selector); w[57] = hc_byte_perm_S (w[48], w[49], selector); w[56] = hc_byte_perm_S (w[47], w[48], selector); w[55] = hc_byte_perm_S (w[46], w[47], selector); w[54] = hc_byte_perm_S (w[45], w[46], selector); w[53] = hc_byte_perm_S (w[44], w[45], selector); w[52] = hc_byte_perm_S (w[43], w[44], selector); w[51] = hc_byte_perm_S (w[42], w[43], selector); w[50] = hc_byte_perm_S (w[41], w[42], selector); w[49] = hc_byte_perm_S (w[40], w[41], selector); w[48] = hc_byte_perm_S (w[39], w[40], selector); w[47] = hc_byte_perm_S (w[38], w[39], selector); w[46] = hc_byte_perm_S (w[37], w[38], selector); w[45] = hc_byte_perm_S (w[36], w[37], selector); w[44] = hc_byte_perm_S (w[35], w[36], selector); w[43] = hc_byte_perm_S (w[34], w[35], selector); w[42] = hc_byte_perm_S (w[33], w[34], selector); w[41] = hc_byte_perm_S (w[32], w[33], selector); w[40] = hc_byte_perm_S (w[31], w[32], selector); w[39] = hc_byte_perm_S (w[30], w[31], selector); w[38] = hc_byte_perm_S (w[29], w[30], selector); w[37] = hc_byte_perm_S (w[28], w[29], selector); w[36] = hc_byte_perm_S (w[27], w[28], selector); w[35] = hc_byte_perm_S (w[26], w[27], selector); w[34] = hc_byte_perm_S (w[25], w[26], selector); w[33] = hc_byte_perm_S (w[24], w[25], selector); w[32] = hc_byte_perm_S (w[23], w[24], selector); w[31] = hc_byte_perm_S (w[22], w[23], selector); w[30] = hc_byte_perm_S (w[21], w[22], selector); w[29] = hc_byte_perm_S (w[20], w[21], selector); w[28] = hc_byte_perm_S (w[19], w[20], selector); w[27] = hc_byte_perm_S (w[18], w[19], selector); w[26] = hc_byte_perm_S (w[17], w[18], selector); w[25] = hc_byte_perm_S (w[16], w[17], selector); w[24] = hc_byte_perm_S (w[15], w[16], selector); w[23] = hc_byte_perm_S (w[14], w[15], selector); w[22] = hc_byte_perm_S (w[13], w[14], selector); w[21] = hc_byte_perm_S (w[12], w[13], selector); w[20] = hc_byte_perm_S (w[11], w[12], selector); w[19] = hc_byte_perm_S (w[10], w[11], selector); w[18] = hc_byte_perm_S (w[ 9], w[10], selector); w[17] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[16] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[15] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[14] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[13] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[12] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[11] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[10] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[ 9] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[ 8] = hc_byte_perm_S ( 0, w[ 0], selector); w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 9: w[63] = hc_byte_perm_S (w[53], w[54], selector); w[62] = hc_byte_perm_S (w[52], w[53], selector); w[61] = hc_byte_perm_S (w[51], w[52], selector); w[60] = hc_byte_perm_S (w[50], w[51], selector); w[59] = hc_byte_perm_S (w[49], w[50], selector); w[58] = hc_byte_perm_S (w[48], w[49], selector); w[57] = hc_byte_perm_S (w[47], w[48], selector); w[56] = hc_byte_perm_S (w[46], w[47], selector); w[55] = hc_byte_perm_S (w[45], w[46], selector); w[54] = hc_byte_perm_S (w[44], w[45], selector); w[53] = hc_byte_perm_S (w[43], w[44], selector); w[52] = hc_byte_perm_S (w[42], w[43], selector); w[51] = hc_byte_perm_S (w[41], w[42], selector); w[50] = hc_byte_perm_S (w[40], w[41], selector); w[49] = hc_byte_perm_S (w[39], w[40], selector); w[48] = hc_byte_perm_S (w[38], w[39], selector); w[47] = hc_byte_perm_S (w[37], w[38], selector); w[46] = hc_byte_perm_S (w[36], w[37], selector); w[45] = hc_byte_perm_S (w[35], w[36], selector); w[44] = hc_byte_perm_S (w[34], w[35], selector); w[43] = hc_byte_perm_S (w[33], w[34], selector); w[42] = hc_byte_perm_S (w[32], w[33], selector); w[41] = hc_byte_perm_S (w[31], w[32], selector); w[40] = hc_byte_perm_S (w[30], w[31], selector); w[39] = hc_byte_perm_S (w[29], w[30], selector); w[38] = hc_byte_perm_S (w[28], w[29], selector); w[37] = hc_byte_perm_S (w[27], w[28], selector); w[36] = hc_byte_perm_S (w[26], w[27], selector); w[35] = hc_byte_perm_S (w[25], w[26], selector); w[34] = hc_byte_perm_S (w[24], w[25], selector); w[33] = hc_byte_perm_S (w[23], w[24], selector); w[32] = hc_byte_perm_S (w[22], w[23], selector); w[31] = hc_byte_perm_S (w[21], w[22], selector); w[30] = hc_byte_perm_S (w[20], w[21], selector); w[29] = hc_byte_perm_S (w[19], w[20], selector); w[28] = hc_byte_perm_S (w[18], w[19], selector); w[27] = hc_byte_perm_S (w[17], w[18], selector); w[26] = hc_byte_perm_S (w[16], w[17], selector); w[25] = hc_byte_perm_S (w[15], w[16], selector); w[24] = hc_byte_perm_S (w[14], w[15], selector); w[23] = hc_byte_perm_S (w[13], w[14], selector); w[22] = hc_byte_perm_S (w[12], w[13], selector); w[21] = hc_byte_perm_S (w[11], w[12], selector); w[20] = hc_byte_perm_S (w[10], w[11], selector); w[19] = hc_byte_perm_S (w[ 9], w[10], selector); w[18] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[17] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[16] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[15] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[14] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[13] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[12] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[11] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[10] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[ 9] = hc_byte_perm_S ( 0, w[ 0], selector); w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 10: w[63] = hc_byte_perm_S (w[52], w[53], selector); w[62] = hc_byte_perm_S (w[51], w[52], selector); w[61] = hc_byte_perm_S (w[50], w[51], selector); w[60] = hc_byte_perm_S (w[49], w[50], selector); w[59] = hc_byte_perm_S (w[48], w[49], selector); w[58] = hc_byte_perm_S (w[47], w[48], selector); w[57] = hc_byte_perm_S (w[46], w[47], selector); w[56] = hc_byte_perm_S (w[45], w[46], selector); w[55] = hc_byte_perm_S (w[44], w[45], selector); w[54] = hc_byte_perm_S (w[43], w[44], selector); w[53] = hc_byte_perm_S (w[42], w[43], selector); w[52] = hc_byte_perm_S (w[41], w[42], selector); w[51] = hc_byte_perm_S (w[40], w[41], selector); w[50] = hc_byte_perm_S (w[39], w[40], selector); w[49] = hc_byte_perm_S (w[38], w[39], selector); w[48] = hc_byte_perm_S (w[37], w[38], selector); w[47] = hc_byte_perm_S (w[36], w[37], selector); w[46] = hc_byte_perm_S (w[35], w[36], selector); w[45] = hc_byte_perm_S (w[34], w[35], selector); w[44] = hc_byte_perm_S (w[33], w[34], selector); w[43] = hc_byte_perm_S (w[32], w[33], selector); w[42] = hc_byte_perm_S (w[31], w[32], selector); w[41] = hc_byte_perm_S (w[30], w[31], selector); w[40] = hc_byte_perm_S (w[29], w[30], selector); w[39] = hc_byte_perm_S (w[28], w[29], selector); w[38] = hc_byte_perm_S (w[27], w[28], selector); w[37] = hc_byte_perm_S (w[26], w[27], selector); w[36] = hc_byte_perm_S (w[25], w[26], selector); w[35] = hc_byte_perm_S (w[24], w[25], selector); w[34] = hc_byte_perm_S (w[23], w[24], selector); w[33] = hc_byte_perm_S (w[22], w[23], selector); w[32] = hc_byte_perm_S (w[21], w[22], selector); w[31] = hc_byte_perm_S (w[20], w[21], selector); w[30] = hc_byte_perm_S (w[19], w[20], selector); w[29] = hc_byte_perm_S (w[18], w[19], selector); w[28] = hc_byte_perm_S (w[17], w[18], selector); w[27] = hc_byte_perm_S (w[16], w[17], selector); w[26] = hc_byte_perm_S (w[15], w[16], selector); w[25] = hc_byte_perm_S (w[14], w[15], selector); w[24] = hc_byte_perm_S (w[13], w[14], selector); w[23] = hc_byte_perm_S (w[12], w[13], selector); w[22] = hc_byte_perm_S (w[11], w[12], selector); w[21] = hc_byte_perm_S (w[10], w[11], selector); w[20] = hc_byte_perm_S (w[ 9], w[10], selector); w[19] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[18] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[17] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[16] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[15] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[14] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[13] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[12] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[11] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[10] = hc_byte_perm_S ( 0, w[ 0], selector); w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 11: w[63] = hc_byte_perm_S (w[51], w[52], selector); w[62] = hc_byte_perm_S (w[50], w[51], selector); w[61] = hc_byte_perm_S (w[49], w[50], selector); w[60] = hc_byte_perm_S (w[48], w[49], selector); w[59] = hc_byte_perm_S (w[47], w[48], selector); w[58] = hc_byte_perm_S (w[46], w[47], selector); w[57] = hc_byte_perm_S (w[45], w[46], selector); w[56] = hc_byte_perm_S (w[44], w[45], selector); w[55] = hc_byte_perm_S (w[43], w[44], selector); w[54] = hc_byte_perm_S (w[42], w[43], selector); w[53] = hc_byte_perm_S (w[41], w[42], selector); w[52] = hc_byte_perm_S (w[40], w[41], selector); w[51] = hc_byte_perm_S (w[39], w[40], selector); w[50] = hc_byte_perm_S (w[38], w[39], selector); w[49] = hc_byte_perm_S (w[37], w[38], selector); w[48] = hc_byte_perm_S (w[36], w[37], selector); w[47] = hc_byte_perm_S (w[35], w[36], selector); w[46] = hc_byte_perm_S (w[34], w[35], selector); w[45] = hc_byte_perm_S (w[33], w[34], selector); w[44] = hc_byte_perm_S (w[32], w[33], selector); w[43] = hc_byte_perm_S (w[31], w[32], selector); w[42] = hc_byte_perm_S (w[30], w[31], selector); w[41] = hc_byte_perm_S (w[29], w[30], selector); w[40] = hc_byte_perm_S (w[28], w[29], selector); w[39] = hc_byte_perm_S (w[27], w[28], selector); w[38] = hc_byte_perm_S (w[26], w[27], selector); w[37] = hc_byte_perm_S (w[25], w[26], selector); w[36] = hc_byte_perm_S (w[24], w[25], selector); w[35] = hc_byte_perm_S (w[23], w[24], selector); w[34] = hc_byte_perm_S (w[22], w[23], selector); w[33] = hc_byte_perm_S (w[21], w[22], selector); w[32] = hc_byte_perm_S (w[20], w[21], selector); w[31] = hc_byte_perm_S (w[19], w[20], selector); w[30] = hc_byte_perm_S (w[18], w[19], selector); w[29] = hc_byte_perm_S (w[17], w[18], selector); w[28] = hc_byte_perm_S (w[16], w[17], selector); w[27] = hc_byte_perm_S (w[15], w[16], selector); w[26] = hc_byte_perm_S (w[14], w[15], selector); w[25] = hc_byte_perm_S (w[13], w[14], selector); w[24] = hc_byte_perm_S (w[12], w[13], selector); w[23] = hc_byte_perm_S (w[11], w[12], selector); w[22] = hc_byte_perm_S (w[10], w[11], selector); w[21] = hc_byte_perm_S (w[ 9], w[10], selector); w[20] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[19] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[18] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[17] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[16] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[15] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[14] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[13] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[12] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[11] = hc_byte_perm_S ( 0, w[ 0], selector); w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 12: w[63] = hc_byte_perm_S (w[50], w[51], selector); w[62] = hc_byte_perm_S (w[49], w[50], selector); w[61] = hc_byte_perm_S (w[48], w[49], selector); w[60] = hc_byte_perm_S (w[47], w[48], selector); w[59] = hc_byte_perm_S (w[46], w[47], selector); w[58] = hc_byte_perm_S (w[45], w[46], selector); w[57] = hc_byte_perm_S (w[44], w[45], selector); w[56] = hc_byte_perm_S (w[43], w[44], selector); w[55] = hc_byte_perm_S (w[42], w[43], selector); w[54] = hc_byte_perm_S (w[41], w[42], selector); w[53] = hc_byte_perm_S (w[40], w[41], selector); w[52] = hc_byte_perm_S (w[39], w[40], selector); w[51] = hc_byte_perm_S (w[38], w[39], selector); w[50] = hc_byte_perm_S (w[37], w[38], selector); w[49] = hc_byte_perm_S (w[36], w[37], selector); w[48] = hc_byte_perm_S (w[35], w[36], selector); w[47] = hc_byte_perm_S (w[34], w[35], selector); w[46] = hc_byte_perm_S (w[33], w[34], selector); w[45] = hc_byte_perm_S (w[32], w[33], selector); w[44] = hc_byte_perm_S (w[31], w[32], selector); w[43] = hc_byte_perm_S (w[30], w[31], selector); w[42] = hc_byte_perm_S (w[29], w[30], selector); w[41] = hc_byte_perm_S (w[28], w[29], selector); w[40] = hc_byte_perm_S (w[27], w[28], selector); w[39] = hc_byte_perm_S (w[26], w[27], selector); w[38] = hc_byte_perm_S (w[25], w[26], selector); w[37] = hc_byte_perm_S (w[24], w[25], selector); w[36] = hc_byte_perm_S (w[23], w[24], selector); w[35] = hc_byte_perm_S (w[22], w[23], selector); w[34] = hc_byte_perm_S (w[21], w[22], selector); w[33] = hc_byte_perm_S (w[20], w[21], selector); w[32] = hc_byte_perm_S (w[19], w[20], selector); w[31] = hc_byte_perm_S (w[18], w[19], selector); w[30] = hc_byte_perm_S (w[17], w[18], selector); w[29] = hc_byte_perm_S (w[16], w[17], selector); w[28] = hc_byte_perm_S (w[15], w[16], selector); w[27] = hc_byte_perm_S (w[14], w[15], selector); w[26] = hc_byte_perm_S (w[13], w[14], selector); w[25] = hc_byte_perm_S (w[12], w[13], selector); w[24] = hc_byte_perm_S (w[11], w[12], selector); w[23] = hc_byte_perm_S (w[10], w[11], selector); w[22] = hc_byte_perm_S (w[ 9], w[10], selector); w[21] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[20] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[19] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[18] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[17] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[16] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[15] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[14] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[13] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[12] = hc_byte_perm_S ( 0, w[ 0], selector); w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 13: w[63] = hc_byte_perm_S (w[49], w[50], selector); w[62] = hc_byte_perm_S (w[48], w[49], selector); w[61] = hc_byte_perm_S (w[47], w[48], selector); w[60] = hc_byte_perm_S (w[46], w[47], selector); w[59] = hc_byte_perm_S (w[45], w[46], selector); w[58] = hc_byte_perm_S (w[44], w[45], selector); w[57] = hc_byte_perm_S (w[43], w[44], selector); w[56] = hc_byte_perm_S (w[42], w[43], selector); w[55] = hc_byte_perm_S (w[41], w[42], selector); w[54] = hc_byte_perm_S (w[40], w[41], selector); w[53] = hc_byte_perm_S (w[39], w[40], selector); w[52] = hc_byte_perm_S (w[38], w[39], selector); w[51] = hc_byte_perm_S (w[37], w[38], selector); w[50] = hc_byte_perm_S (w[36], w[37], selector); w[49] = hc_byte_perm_S (w[35], w[36], selector); w[48] = hc_byte_perm_S (w[34], w[35], selector); w[47] = hc_byte_perm_S (w[33], w[34], selector); w[46] = hc_byte_perm_S (w[32], w[33], selector); w[45] = hc_byte_perm_S (w[31], w[32], selector); w[44] = hc_byte_perm_S (w[30], w[31], selector); w[43] = hc_byte_perm_S (w[29], w[30], selector); w[42] = hc_byte_perm_S (w[28], w[29], selector); w[41] = hc_byte_perm_S (w[27], w[28], selector); w[40] = hc_byte_perm_S (w[26], w[27], selector); w[39] = hc_byte_perm_S (w[25], w[26], selector); w[38] = hc_byte_perm_S (w[24], w[25], selector); w[37] = hc_byte_perm_S (w[23], w[24], selector); w[36] = hc_byte_perm_S (w[22], w[23], selector); w[35] = hc_byte_perm_S (w[21], w[22], selector); w[34] = hc_byte_perm_S (w[20], w[21], selector); w[33] = hc_byte_perm_S (w[19], w[20], selector); w[32] = hc_byte_perm_S (w[18], w[19], selector); w[31] = hc_byte_perm_S (w[17], w[18], selector); w[30] = hc_byte_perm_S (w[16], w[17], selector); w[29] = hc_byte_perm_S (w[15], w[16], selector); w[28] = hc_byte_perm_S (w[14], w[15], selector); w[27] = hc_byte_perm_S (w[13], w[14], selector); w[26] = hc_byte_perm_S (w[12], w[13], selector); w[25] = hc_byte_perm_S (w[11], w[12], selector); w[24] = hc_byte_perm_S (w[10], w[11], selector); w[23] = hc_byte_perm_S (w[ 9], w[10], selector); w[22] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[21] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[20] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[19] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[18] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[17] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[16] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[15] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[14] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[13] = hc_byte_perm_S ( 0, w[ 0], selector); w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 14: w[63] = hc_byte_perm_S (w[48], w[49], selector); w[62] = hc_byte_perm_S (w[47], w[48], selector); w[61] = hc_byte_perm_S (w[46], w[47], selector); w[60] = hc_byte_perm_S (w[45], w[46], selector); w[59] = hc_byte_perm_S (w[44], w[45], selector); w[58] = hc_byte_perm_S (w[43], w[44], selector); w[57] = hc_byte_perm_S (w[42], w[43], selector); w[56] = hc_byte_perm_S (w[41], w[42], selector); w[55] = hc_byte_perm_S (w[40], w[41], selector); w[54] = hc_byte_perm_S (w[39], w[40], selector); w[53] = hc_byte_perm_S (w[38], w[39], selector); w[52] = hc_byte_perm_S (w[37], w[38], selector); w[51] = hc_byte_perm_S (w[36], w[37], selector); w[50] = hc_byte_perm_S (w[35], w[36], selector); w[49] = hc_byte_perm_S (w[34], w[35], selector); w[48] = hc_byte_perm_S (w[33], w[34], selector); w[47] = hc_byte_perm_S (w[32], w[33], selector); w[46] = hc_byte_perm_S (w[31], w[32], selector); w[45] = hc_byte_perm_S (w[30], w[31], selector); w[44] = hc_byte_perm_S (w[29], w[30], selector); w[43] = hc_byte_perm_S (w[28], w[29], selector); w[42] = hc_byte_perm_S (w[27], w[28], selector); w[41] = hc_byte_perm_S (w[26], w[27], selector); w[40] = hc_byte_perm_S (w[25], w[26], selector); w[39] = hc_byte_perm_S (w[24], w[25], selector); w[38] = hc_byte_perm_S (w[23], w[24], selector); w[37] = hc_byte_perm_S (w[22], w[23], selector); w[36] = hc_byte_perm_S (w[21], w[22], selector); w[35] = hc_byte_perm_S (w[20], w[21], selector); w[34] = hc_byte_perm_S (w[19], w[20], selector); w[33] = hc_byte_perm_S (w[18], w[19], selector); w[32] = hc_byte_perm_S (w[17], w[18], selector); w[31] = hc_byte_perm_S (w[16], w[17], selector); w[30] = hc_byte_perm_S (w[15], w[16], selector); w[29] = hc_byte_perm_S (w[14], w[15], selector); w[28] = hc_byte_perm_S (w[13], w[14], selector); w[27] = hc_byte_perm_S (w[12], w[13], selector); w[26] = hc_byte_perm_S (w[11], w[12], selector); w[25] = hc_byte_perm_S (w[10], w[11], selector); w[24] = hc_byte_perm_S (w[ 9], w[10], selector); w[23] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[22] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[21] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[20] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[19] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[18] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[17] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[16] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[15] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[14] = hc_byte_perm_S ( 0, w[ 0], selector); w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 15: w[63] = hc_byte_perm_S (w[47], w[48], selector); w[62] = hc_byte_perm_S (w[46], w[47], selector); w[61] = hc_byte_perm_S (w[45], w[46], selector); w[60] = hc_byte_perm_S (w[44], w[45], selector); w[59] = hc_byte_perm_S (w[43], w[44], selector); w[58] = hc_byte_perm_S (w[42], w[43], selector); w[57] = hc_byte_perm_S (w[41], w[42], selector); w[56] = hc_byte_perm_S (w[40], w[41], selector); w[55] = hc_byte_perm_S (w[39], w[40], selector); w[54] = hc_byte_perm_S (w[38], w[39], selector); w[53] = hc_byte_perm_S (w[37], w[38], selector); w[52] = hc_byte_perm_S (w[36], w[37], selector); w[51] = hc_byte_perm_S (w[35], w[36], selector); w[50] = hc_byte_perm_S (w[34], w[35], selector); w[49] = hc_byte_perm_S (w[33], w[34], selector); w[48] = hc_byte_perm_S (w[32], w[33], selector); w[47] = hc_byte_perm_S (w[31], w[32], selector); w[46] = hc_byte_perm_S (w[30], w[31], selector); w[45] = hc_byte_perm_S (w[29], w[30], selector); w[44] = hc_byte_perm_S (w[28], w[29], selector); w[43] = hc_byte_perm_S (w[27], w[28], selector); w[42] = hc_byte_perm_S (w[26], w[27], selector); w[41] = hc_byte_perm_S (w[25], w[26], selector); w[40] = hc_byte_perm_S (w[24], w[25], selector); w[39] = hc_byte_perm_S (w[23], w[24], selector); w[38] = hc_byte_perm_S (w[22], w[23], selector); w[37] = hc_byte_perm_S (w[21], w[22], selector); w[36] = hc_byte_perm_S (w[20], w[21], selector); w[35] = hc_byte_perm_S (w[19], w[20], selector); w[34] = hc_byte_perm_S (w[18], w[19], selector); w[33] = hc_byte_perm_S (w[17], w[18], selector); w[32] = hc_byte_perm_S (w[16], w[17], selector); w[31] = hc_byte_perm_S (w[15], w[16], selector); w[30] = hc_byte_perm_S (w[14], w[15], selector); w[29] = hc_byte_perm_S (w[13], w[14], selector); w[28] = hc_byte_perm_S (w[12], w[13], selector); w[27] = hc_byte_perm_S (w[11], w[12], selector); w[26] = hc_byte_perm_S (w[10], w[11], selector); w[25] = hc_byte_perm_S (w[ 9], w[10], selector); w[24] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[23] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[22] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[21] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[20] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[19] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[18] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[17] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[16] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[15] = hc_byte_perm_S ( 0, w[ 0], selector); w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 16: w[63] = hc_byte_perm_S (w[46], w[47], selector); w[62] = hc_byte_perm_S (w[45], w[46], selector); w[61] = hc_byte_perm_S (w[44], w[45], selector); w[60] = hc_byte_perm_S (w[43], w[44], selector); w[59] = hc_byte_perm_S (w[42], w[43], selector); w[58] = hc_byte_perm_S (w[41], w[42], selector); w[57] = hc_byte_perm_S (w[40], w[41], selector); w[56] = hc_byte_perm_S (w[39], w[40], selector); w[55] = hc_byte_perm_S (w[38], w[39], selector); w[54] = hc_byte_perm_S (w[37], w[38], selector); w[53] = hc_byte_perm_S (w[36], w[37], selector); w[52] = hc_byte_perm_S (w[35], w[36], selector); w[51] = hc_byte_perm_S (w[34], w[35], selector); w[50] = hc_byte_perm_S (w[33], w[34], selector); w[49] = hc_byte_perm_S (w[32], w[33], selector); w[48] = hc_byte_perm_S (w[31], w[32], selector); w[47] = hc_byte_perm_S (w[30], w[31], selector); w[46] = hc_byte_perm_S (w[29], w[30], selector); w[45] = hc_byte_perm_S (w[28], w[29], selector); w[44] = hc_byte_perm_S (w[27], w[28], selector); w[43] = hc_byte_perm_S (w[26], w[27], selector); w[42] = hc_byte_perm_S (w[25], w[26], selector); w[41] = hc_byte_perm_S (w[24], w[25], selector); w[40] = hc_byte_perm_S (w[23], w[24], selector); w[39] = hc_byte_perm_S (w[22], w[23], selector); w[38] = hc_byte_perm_S (w[21], w[22], selector); w[37] = hc_byte_perm_S (w[20], w[21], selector); w[36] = hc_byte_perm_S (w[19], w[20], selector); w[35] = hc_byte_perm_S (w[18], w[19], selector); w[34] = hc_byte_perm_S (w[17], w[18], selector); w[33] = hc_byte_perm_S (w[16], w[17], selector); w[32] = hc_byte_perm_S (w[15], w[16], selector); w[31] = hc_byte_perm_S (w[14], w[15], selector); w[30] = hc_byte_perm_S (w[13], w[14], selector); w[29] = hc_byte_perm_S (w[12], w[13], selector); w[28] = hc_byte_perm_S (w[11], w[12], selector); w[27] = hc_byte_perm_S (w[10], w[11], selector); w[26] = hc_byte_perm_S (w[ 9], w[10], selector); w[25] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[24] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[23] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[22] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[21] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[20] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[19] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[18] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[17] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[16] = hc_byte_perm_S ( 0, w[ 0], selector); w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 17: w[63] = hc_byte_perm_S (w[45], w[46], selector); w[62] = hc_byte_perm_S (w[44], w[45], selector); w[61] = hc_byte_perm_S (w[43], w[44], selector); w[60] = hc_byte_perm_S (w[42], w[43], selector); w[59] = hc_byte_perm_S (w[41], w[42], selector); w[58] = hc_byte_perm_S (w[40], w[41], selector); w[57] = hc_byte_perm_S (w[39], w[40], selector); w[56] = hc_byte_perm_S (w[38], w[39], selector); w[55] = hc_byte_perm_S (w[37], w[38], selector); w[54] = hc_byte_perm_S (w[36], w[37], selector); w[53] = hc_byte_perm_S (w[35], w[36], selector); w[52] = hc_byte_perm_S (w[34], w[35], selector); w[51] = hc_byte_perm_S (w[33], w[34], selector); w[50] = hc_byte_perm_S (w[32], w[33], selector); w[49] = hc_byte_perm_S (w[31], w[32], selector); w[48] = hc_byte_perm_S (w[30], w[31], selector); w[47] = hc_byte_perm_S (w[29], w[30], selector); w[46] = hc_byte_perm_S (w[28], w[29], selector); w[45] = hc_byte_perm_S (w[27], w[28], selector); w[44] = hc_byte_perm_S (w[26], w[27], selector); w[43] = hc_byte_perm_S (w[25], w[26], selector); w[42] = hc_byte_perm_S (w[24], w[25], selector); w[41] = hc_byte_perm_S (w[23], w[24], selector); w[40] = hc_byte_perm_S (w[22], w[23], selector); w[39] = hc_byte_perm_S (w[21], w[22], selector); w[38] = hc_byte_perm_S (w[20], w[21], selector); w[37] = hc_byte_perm_S (w[19], w[20], selector); w[36] = hc_byte_perm_S (w[18], w[19], selector); w[35] = hc_byte_perm_S (w[17], w[18], selector); w[34] = hc_byte_perm_S (w[16], w[17], selector); w[33] = hc_byte_perm_S (w[15], w[16], selector); w[32] = hc_byte_perm_S (w[14], w[15], selector); w[31] = hc_byte_perm_S (w[13], w[14], selector); w[30] = hc_byte_perm_S (w[12], w[13], selector); w[29] = hc_byte_perm_S (w[11], w[12], selector); w[28] = hc_byte_perm_S (w[10], w[11], selector); w[27] = hc_byte_perm_S (w[ 9], w[10], selector); w[26] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[25] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[24] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[23] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[22] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[21] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[20] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[19] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[18] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[17] = hc_byte_perm_S ( 0, w[ 0], selector); w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 18: w[63] = hc_byte_perm_S (w[44], w[45], selector); w[62] = hc_byte_perm_S (w[43], w[44], selector); w[61] = hc_byte_perm_S (w[42], w[43], selector); w[60] = hc_byte_perm_S (w[41], w[42], selector); w[59] = hc_byte_perm_S (w[40], w[41], selector); w[58] = hc_byte_perm_S (w[39], w[40], selector); w[57] = hc_byte_perm_S (w[38], w[39], selector); w[56] = hc_byte_perm_S (w[37], w[38], selector); w[55] = hc_byte_perm_S (w[36], w[37], selector); w[54] = hc_byte_perm_S (w[35], w[36], selector); w[53] = hc_byte_perm_S (w[34], w[35], selector); w[52] = hc_byte_perm_S (w[33], w[34], selector); w[51] = hc_byte_perm_S (w[32], w[33], selector); w[50] = hc_byte_perm_S (w[31], w[32], selector); w[49] = hc_byte_perm_S (w[30], w[31], selector); w[48] = hc_byte_perm_S (w[29], w[30], selector); w[47] = hc_byte_perm_S (w[28], w[29], selector); w[46] = hc_byte_perm_S (w[27], w[28], selector); w[45] = hc_byte_perm_S (w[26], w[27], selector); w[44] = hc_byte_perm_S (w[25], w[26], selector); w[43] = hc_byte_perm_S (w[24], w[25], selector); w[42] = hc_byte_perm_S (w[23], w[24], selector); w[41] = hc_byte_perm_S (w[22], w[23], selector); w[40] = hc_byte_perm_S (w[21], w[22], selector); w[39] = hc_byte_perm_S (w[20], w[21], selector); w[38] = hc_byte_perm_S (w[19], w[20], selector); w[37] = hc_byte_perm_S (w[18], w[19], selector); w[36] = hc_byte_perm_S (w[17], w[18], selector); w[35] = hc_byte_perm_S (w[16], w[17], selector); w[34] = hc_byte_perm_S (w[15], w[16], selector); w[33] = hc_byte_perm_S (w[14], w[15], selector); w[32] = hc_byte_perm_S (w[13], w[14], selector); w[31] = hc_byte_perm_S (w[12], w[13], selector); w[30] = hc_byte_perm_S (w[11], w[12], selector); w[29] = hc_byte_perm_S (w[10], w[11], selector); w[28] = hc_byte_perm_S (w[ 9], w[10], selector); w[27] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[26] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[25] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[24] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[23] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[22] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[21] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[20] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[19] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[18] = hc_byte_perm_S ( 0, w[ 0], selector); w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 19: w[63] = hc_byte_perm_S (w[43], w[44], selector); w[62] = hc_byte_perm_S (w[42], w[43], selector); w[61] = hc_byte_perm_S (w[41], w[42], selector); w[60] = hc_byte_perm_S (w[40], w[41], selector); w[59] = hc_byte_perm_S (w[39], w[40], selector); w[58] = hc_byte_perm_S (w[38], w[39], selector); w[57] = hc_byte_perm_S (w[37], w[38], selector); w[56] = hc_byte_perm_S (w[36], w[37], selector); w[55] = hc_byte_perm_S (w[35], w[36], selector); w[54] = hc_byte_perm_S (w[34], w[35], selector); w[53] = hc_byte_perm_S (w[33], w[34], selector); w[52] = hc_byte_perm_S (w[32], w[33], selector); w[51] = hc_byte_perm_S (w[31], w[32], selector); w[50] = hc_byte_perm_S (w[30], w[31], selector); w[49] = hc_byte_perm_S (w[29], w[30], selector); w[48] = hc_byte_perm_S (w[28], w[29], selector); w[47] = hc_byte_perm_S (w[27], w[28], selector); w[46] = hc_byte_perm_S (w[26], w[27], selector); w[45] = hc_byte_perm_S (w[25], w[26], selector); w[44] = hc_byte_perm_S (w[24], w[25], selector); w[43] = hc_byte_perm_S (w[23], w[24], selector); w[42] = hc_byte_perm_S (w[22], w[23], selector); w[41] = hc_byte_perm_S (w[21], w[22], selector); w[40] = hc_byte_perm_S (w[20], w[21], selector); w[39] = hc_byte_perm_S (w[19], w[20], selector); w[38] = hc_byte_perm_S (w[18], w[19], selector); w[37] = hc_byte_perm_S (w[17], w[18], selector); w[36] = hc_byte_perm_S (w[16], w[17], selector); w[35] = hc_byte_perm_S (w[15], w[16], selector); w[34] = hc_byte_perm_S (w[14], w[15], selector); w[33] = hc_byte_perm_S (w[13], w[14], selector); w[32] = hc_byte_perm_S (w[12], w[13], selector); w[31] = hc_byte_perm_S (w[11], w[12], selector); w[30] = hc_byte_perm_S (w[10], w[11], selector); w[29] = hc_byte_perm_S (w[ 9], w[10], selector); w[28] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[27] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[26] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[25] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[24] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[23] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[22] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[21] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[20] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[19] = hc_byte_perm_S ( 0, w[ 0], selector); w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 20: w[63] = hc_byte_perm_S (w[42], w[43], selector); w[62] = hc_byte_perm_S (w[41], w[42], selector); w[61] = hc_byte_perm_S (w[40], w[41], selector); w[60] = hc_byte_perm_S (w[39], w[40], selector); w[59] = hc_byte_perm_S (w[38], w[39], selector); w[58] = hc_byte_perm_S (w[37], w[38], selector); w[57] = hc_byte_perm_S (w[36], w[37], selector); w[56] = hc_byte_perm_S (w[35], w[36], selector); w[55] = hc_byte_perm_S (w[34], w[35], selector); w[54] = hc_byte_perm_S (w[33], w[34], selector); w[53] = hc_byte_perm_S (w[32], w[33], selector); w[52] = hc_byte_perm_S (w[31], w[32], selector); w[51] = hc_byte_perm_S (w[30], w[31], selector); w[50] = hc_byte_perm_S (w[29], w[30], selector); w[49] = hc_byte_perm_S (w[28], w[29], selector); w[48] = hc_byte_perm_S (w[27], w[28], selector); w[47] = hc_byte_perm_S (w[26], w[27], selector); w[46] = hc_byte_perm_S (w[25], w[26], selector); w[45] = hc_byte_perm_S (w[24], w[25], selector); w[44] = hc_byte_perm_S (w[23], w[24], selector); w[43] = hc_byte_perm_S (w[22], w[23], selector); w[42] = hc_byte_perm_S (w[21], w[22], selector); w[41] = hc_byte_perm_S (w[20], w[21], selector); w[40] = hc_byte_perm_S (w[19], w[20], selector); w[39] = hc_byte_perm_S (w[18], w[19], selector); w[38] = hc_byte_perm_S (w[17], w[18], selector); w[37] = hc_byte_perm_S (w[16], w[17], selector); w[36] = hc_byte_perm_S (w[15], w[16], selector); w[35] = hc_byte_perm_S (w[14], w[15], selector); w[34] = hc_byte_perm_S (w[13], w[14], selector); w[33] = hc_byte_perm_S (w[12], w[13], selector); w[32] = hc_byte_perm_S (w[11], w[12], selector); w[31] = hc_byte_perm_S (w[10], w[11], selector); w[30] = hc_byte_perm_S (w[ 9], w[10], selector); w[29] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[28] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[27] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[26] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[25] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[24] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[23] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[22] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[21] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[20] = hc_byte_perm_S ( 0, w[ 0], selector); w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 21: w[63] = hc_byte_perm_S (w[41], w[42], selector); w[62] = hc_byte_perm_S (w[40], w[41], selector); w[61] = hc_byte_perm_S (w[39], w[40], selector); w[60] = hc_byte_perm_S (w[38], w[39], selector); w[59] = hc_byte_perm_S (w[37], w[38], selector); w[58] = hc_byte_perm_S (w[36], w[37], selector); w[57] = hc_byte_perm_S (w[35], w[36], selector); w[56] = hc_byte_perm_S (w[34], w[35], selector); w[55] = hc_byte_perm_S (w[33], w[34], selector); w[54] = hc_byte_perm_S (w[32], w[33], selector); w[53] = hc_byte_perm_S (w[31], w[32], selector); w[52] = hc_byte_perm_S (w[30], w[31], selector); w[51] = hc_byte_perm_S (w[29], w[30], selector); w[50] = hc_byte_perm_S (w[28], w[29], selector); w[49] = hc_byte_perm_S (w[27], w[28], selector); w[48] = hc_byte_perm_S (w[26], w[27], selector); w[47] = hc_byte_perm_S (w[25], w[26], selector); w[46] = hc_byte_perm_S (w[24], w[25], selector); w[45] = hc_byte_perm_S (w[23], w[24], selector); w[44] = hc_byte_perm_S (w[22], w[23], selector); w[43] = hc_byte_perm_S (w[21], w[22], selector); w[42] = hc_byte_perm_S (w[20], w[21], selector); w[41] = hc_byte_perm_S (w[19], w[20], selector); w[40] = hc_byte_perm_S (w[18], w[19], selector); w[39] = hc_byte_perm_S (w[17], w[18], selector); w[38] = hc_byte_perm_S (w[16], w[17], selector); w[37] = hc_byte_perm_S (w[15], w[16], selector); w[36] = hc_byte_perm_S (w[14], w[15], selector); w[35] = hc_byte_perm_S (w[13], w[14], selector); w[34] = hc_byte_perm_S (w[12], w[13], selector); w[33] = hc_byte_perm_S (w[11], w[12], selector); w[32] = hc_byte_perm_S (w[10], w[11], selector); w[31] = hc_byte_perm_S (w[ 9], w[10], selector); w[30] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[29] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[28] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[27] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[26] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[25] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[24] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[23] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[22] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[21] = hc_byte_perm_S ( 0, w[ 0], selector); w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 22: w[63] = hc_byte_perm_S (w[40], w[41], selector); w[62] = hc_byte_perm_S (w[39], w[40], selector); w[61] = hc_byte_perm_S (w[38], w[39], selector); w[60] = hc_byte_perm_S (w[37], w[38], selector); w[59] = hc_byte_perm_S (w[36], w[37], selector); w[58] = hc_byte_perm_S (w[35], w[36], selector); w[57] = hc_byte_perm_S (w[34], w[35], selector); w[56] = hc_byte_perm_S (w[33], w[34], selector); w[55] = hc_byte_perm_S (w[32], w[33], selector); w[54] = hc_byte_perm_S (w[31], w[32], selector); w[53] = hc_byte_perm_S (w[30], w[31], selector); w[52] = hc_byte_perm_S (w[29], w[30], selector); w[51] = hc_byte_perm_S (w[28], w[29], selector); w[50] = hc_byte_perm_S (w[27], w[28], selector); w[49] = hc_byte_perm_S (w[26], w[27], selector); w[48] = hc_byte_perm_S (w[25], w[26], selector); w[47] = hc_byte_perm_S (w[24], w[25], selector); w[46] = hc_byte_perm_S (w[23], w[24], selector); w[45] = hc_byte_perm_S (w[22], w[23], selector); w[44] = hc_byte_perm_S (w[21], w[22], selector); w[43] = hc_byte_perm_S (w[20], w[21], selector); w[42] = hc_byte_perm_S (w[19], w[20], selector); w[41] = hc_byte_perm_S (w[18], w[19], selector); w[40] = hc_byte_perm_S (w[17], w[18], selector); w[39] = hc_byte_perm_S (w[16], w[17], selector); w[38] = hc_byte_perm_S (w[15], w[16], selector); w[37] = hc_byte_perm_S (w[14], w[15], selector); w[36] = hc_byte_perm_S (w[13], w[14], selector); w[35] = hc_byte_perm_S (w[12], w[13], selector); w[34] = hc_byte_perm_S (w[11], w[12], selector); w[33] = hc_byte_perm_S (w[10], w[11], selector); w[32] = hc_byte_perm_S (w[ 9], w[10], selector); w[31] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[30] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[29] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[28] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[27] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[26] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[25] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[24] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[23] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[22] = hc_byte_perm_S ( 0, w[ 0], selector); w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 23: w[63] = hc_byte_perm_S (w[39], w[40], selector); w[62] = hc_byte_perm_S (w[38], w[39], selector); w[61] = hc_byte_perm_S (w[37], w[38], selector); w[60] = hc_byte_perm_S (w[36], w[37], selector); w[59] = hc_byte_perm_S (w[35], w[36], selector); w[58] = hc_byte_perm_S (w[34], w[35], selector); w[57] = hc_byte_perm_S (w[33], w[34], selector); w[56] = hc_byte_perm_S (w[32], w[33], selector); w[55] = hc_byte_perm_S (w[31], w[32], selector); w[54] = hc_byte_perm_S (w[30], w[31], selector); w[53] = hc_byte_perm_S (w[29], w[30], selector); w[52] = hc_byte_perm_S (w[28], w[29], selector); w[51] = hc_byte_perm_S (w[27], w[28], selector); w[50] = hc_byte_perm_S (w[26], w[27], selector); w[49] = hc_byte_perm_S (w[25], w[26], selector); w[48] = hc_byte_perm_S (w[24], w[25], selector); w[47] = hc_byte_perm_S (w[23], w[24], selector); w[46] = hc_byte_perm_S (w[22], w[23], selector); w[45] = hc_byte_perm_S (w[21], w[22], selector); w[44] = hc_byte_perm_S (w[20], w[21], selector); w[43] = hc_byte_perm_S (w[19], w[20], selector); w[42] = hc_byte_perm_S (w[18], w[19], selector); w[41] = hc_byte_perm_S (w[17], w[18], selector); w[40] = hc_byte_perm_S (w[16], w[17], selector); w[39] = hc_byte_perm_S (w[15], w[16], selector); w[38] = hc_byte_perm_S (w[14], w[15], selector); w[37] = hc_byte_perm_S (w[13], w[14], selector); w[36] = hc_byte_perm_S (w[12], w[13], selector); w[35] = hc_byte_perm_S (w[11], w[12], selector); w[34] = hc_byte_perm_S (w[10], w[11], selector); w[33] = hc_byte_perm_S (w[ 9], w[10], selector); w[32] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[31] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[30] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[29] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[28] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[27] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[26] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[25] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[24] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[23] = hc_byte_perm_S ( 0, w[ 0], selector); w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 24: w[63] = hc_byte_perm_S (w[38], w[39], selector); w[62] = hc_byte_perm_S (w[37], w[38], selector); w[61] = hc_byte_perm_S (w[36], w[37], selector); w[60] = hc_byte_perm_S (w[35], w[36], selector); w[59] = hc_byte_perm_S (w[34], w[35], selector); w[58] = hc_byte_perm_S (w[33], w[34], selector); w[57] = hc_byte_perm_S (w[32], w[33], selector); w[56] = hc_byte_perm_S (w[31], w[32], selector); w[55] = hc_byte_perm_S (w[30], w[31], selector); w[54] = hc_byte_perm_S (w[29], w[30], selector); w[53] = hc_byte_perm_S (w[28], w[29], selector); w[52] = hc_byte_perm_S (w[27], w[28], selector); w[51] = hc_byte_perm_S (w[26], w[27], selector); w[50] = hc_byte_perm_S (w[25], w[26], selector); w[49] = hc_byte_perm_S (w[24], w[25], selector); w[48] = hc_byte_perm_S (w[23], w[24], selector); w[47] = hc_byte_perm_S (w[22], w[23], selector); w[46] = hc_byte_perm_S (w[21], w[22], selector); w[45] = hc_byte_perm_S (w[20], w[21], selector); w[44] = hc_byte_perm_S (w[19], w[20], selector); w[43] = hc_byte_perm_S (w[18], w[19], selector); w[42] = hc_byte_perm_S (w[17], w[18], selector); w[41] = hc_byte_perm_S (w[16], w[17], selector); w[40] = hc_byte_perm_S (w[15], w[16], selector); w[39] = hc_byte_perm_S (w[14], w[15], selector); w[38] = hc_byte_perm_S (w[13], w[14], selector); w[37] = hc_byte_perm_S (w[12], w[13], selector); w[36] = hc_byte_perm_S (w[11], w[12], selector); w[35] = hc_byte_perm_S (w[10], w[11], selector); w[34] = hc_byte_perm_S (w[ 9], w[10], selector); w[33] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[32] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[31] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[30] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[29] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[28] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[27] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[26] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[25] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[24] = hc_byte_perm_S ( 0, w[ 0], selector); w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 25: w[63] = hc_byte_perm_S (w[37], w[38], selector); w[62] = hc_byte_perm_S (w[36], w[37], selector); w[61] = hc_byte_perm_S (w[35], w[36], selector); w[60] = hc_byte_perm_S (w[34], w[35], selector); w[59] = hc_byte_perm_S (w[33], w[34], selector); w[58] = hc_byte_perm_S (w[32], w[33], selector); w[57] = hc_byte_perm_S (w[31], w[32], selector); w[56] = hc_byte_perm_S (w[30], w[31], selector); w[55] = hc_byte_perm_S (w[29], w[30], selector); w[54] = hc_byte_perm_S (w[28], w[29], selector); w[53] = hc_byte_perm_S (w[27], w[28], selector); w[52] = hc_byte_perm_S (w[26], w[27], selector); w[51] = hc_byte_perm_S (w[25], w[26], selector); w[50] = hc_byte_perm_S (w[24], w[25], selector); w[49] = hc_byte_perm_S (w[23], w[24], selector); w[48] = hc_byte_perm_S (w[22], w[23], selector); w[47] = hc_byte_perm_S (w[21], w[22], selector); w[46] = hc_byte_perm_S (w[20], w[21], selector); w[45] = hc_byte_perm_S (w[19], w[20], selector); w[44] = hc_byte_perm_S (w[18], w[19], selector); w[43] = hc_byte_perm_S (w[17], w[18], selector); w[42] = hc_byte_perm_S (w[16], w[17], selector); w[41] = hc_byte_perm_S (w[15], w[16], selector); w[40] = hc_byte_perm_S (w[14], w[15], selector); w[39] = hc_byte_perm_S (w[13], w[14], selector); w[38] = hc_byte_perm_S (w[12], w[13], selector); w[37] = hc_byte_perm_S (w[11], w[12], selector); w[36] = hc_byte_perm_S (w[10], w[11], selector); w[35] = hc_byte_perm_S (w[ 9], w[10], selector); w[34] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[33] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[32] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[31] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[30] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[29] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[28] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[27] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[26] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[25] = hc_byte_perm_S ( 0, w[ 0], selector); w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 26: w[63] = hc_byte_perm_S (w[36], w[37], selector); w[62] = hc_byte_perm_S (w[35], w[36], selector); w[61] = hc_byte_perm_S (w[34], w[35], selector); w[60] = hc_byte_perm_S (w[33], w[34], selector); w[59] = hc_byte_perm_S (w[32], w[33], selector); w[58] = hc_byte_perm_S (w[31], w[32], selector); w[57] = hc_byte_perm_S (w[30], w[31], selector); w[56] = hc_byte_perm_S (w[29], w[30], selector); w[55] = hc_byte_perm_S (w[28], w[29], selector); w[54] = hc_byte_perm_S (w[27], w[28], selector); w[53] = hc_byte_perm_S (w[26], w[27], selector); w[52] = hc_byte_perm_S (w[25], w[26], selector); w[51] = hc_byte_perm_S (w[24], w[25], selector); w[50] = hc_byte_perm_S (w[23], w[24], selector); w[49] = hc_byte_perm_S (w[22], w[23], selector); w[48] = hc_byte_perm_S (w[21], w[22], selector); w[47] = hc_byte_perm_S (w[20], w[21], selector); w[46] = hc_byte_perm_S (w[19], w[20], selector); w[45] = hc_byte_perm_S (w[18], w[19], selector); w[44] = hc_byte_perm_S (w[17], w[18], selector); w[43] = hc_byte_perm_S (w[16], w[17], selector); w[42] = hc_byte_perm_S (w[15], w[16], selector); w[41] = hc_byte_perm_S (w[14], w[15], selector); w[40] = hc_byte_perm_S (w[13], w[14], selector); w[39] = hc_byte_perm_S (w[12], w[13], selector); w[38] = hc_byte_perm_S (w[11], w[12], selector); w[37] = hc_byte_perm_S (w[10], w[11], selector); w[36] = hc_byte_perm_S (w[ 9], w[10], selector); w[35] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[34] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[33] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[32] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[31] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[30] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[29] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[28] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[27] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[26] = hc_byte_perm_S ( 0, w[ 0], selector); w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 27: w[63] = hc_byte_perm_S (w[35], w[36], selector); w[62] = hc_byte_perm_S (w[34], w[35], selector); w[61] = hc_byte_perm_S (w[33], w[34], selector); w[60] = hc_byte_perm_S (w[32], w[33], selector); w[59] = hc_byte_perm_S (w[31], w[32], selector); w[58] = hc_byte_perm_S (w[30], w[31], selector); w[57] = hc_byte_perm_S (w[29], w[30], selector); w[56] = hc_byte_perm_S (w[28], w[29], selector); w[55] = hc_byte_perm_S (w[27], w[28], selector); w[54] = hc_byte_perm_S (w[26], w[27], selector); w[53] = hc_byte_perm_S (w[25], w[26], selector); w[52] = hc_byte_perm_S (w[24], w[25], selector); w[51] = hc_byte_perm_S (w[23], w[24], selector); w[50] = hc_byte_perm_S (w[22], w[23], selector); w[49] = hc_byte_perm_S (w[21], w[22], selector); w[48] = hc_byte_perm_S (w[20], w[21], selector); w[47] = hc_byte_perm_S (w[19], w[20], selector); w[46] = hc_byte_perm_S (w[18], w[19], selector); w[45] = hc_byte_perm_S (w[17], w[18], selector); w[44] = hc_byte_perm_S (w[16], w[17], selector); w[43] = hc_byte_perm_S (w[15], w[16], selector); w[42] = hc_byte_perm_S (w[14], w[15], selector); w[41] = hc_byte_perm_S (w[13], w[14], selector); w[40] = hc_byte_perm_S (w[12], w[13], selector); w[39] = hc_byte_perm_S (w[11], w[12], selector); w[38] = hc_byte_perm_S (w[10], w[11], selector); w[37] = hc_byte_perm_S (w[ 9], w[10], selector); w[36] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[35] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[34] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[33] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[32] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[31] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[30] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[29] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[28] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[27] = hc_byte_perm_S ( 0, w[ 0], selector); w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 28: w[63] = hc_byte_perm_S (w[34], w[35], selector); w[62] = hc_byte_perm_S (w[33], w[34], selector); w[61] = hc_byte_perm_S (w[32], w[33], selector); w[60] = hc_byte_perm_S (w[31], w[32], selector); w[59] = hc_byte_perm_S (w[30], w[31], selector); w[58] = hc_byte_perm_S (w[29], w[30], selector); w[57] = hc_byte_perm_S (w[28], w[29], selector); w[56] = hc_byte_perm_S (w[27], w[28], selector); w[55] = hc_byte_perm_S (w[26], w[27], selector); w[54] = hc_byte_perm_S (w[25], w[26], selector); w[53] = hc_byte_perm_S (w[24], w[25], selector); w[52] = hc_byte_perm_S (w[23], w[24], selector); w[51] = hc_byte_perm_S (w[22], w[23], selector); w[50] = hc_byte_perm_S (w[21], w[22], selector); w[49] = hc_byte_perm_S (w[20], w[21], selector); w[48] = hc_byte_perm_S (w[19], w[20], selector); w[47] = hc_byte_perm_S (w[18], w[19], selector); w[46] = hc_byte_perm_S (w[17], w[18], selector); w[45] = hc_byte_perm_S (w[16], w[17], selector); w[44] = hc_byte_perm_S (w[15], w[16], selector); w[43] = hc_byte_perm_S (w[14], w[15], selector); w[42] = hc_byte_perm_S (w[13], w[14], selector); w[41] = hc_byte_perm_S (w[12], w[13], selector); w[40] = hc_byte_perm_S (w[11], w[12], selector); w[39] = hc_byte_perm_S (w[10], w[11], selector); w[38] = hc_byte_perm_S (w[ 9], w[10], selector); w[37] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[36] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[35] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[34] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[33] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[32] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[31] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[30] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[29] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[28] = hc_byte_perm_S ( 0, w[ 0], selector); w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 29: w[63] = hc_byte_perm_S (w[33], w[34], selector); w[62] = hc_byte_perm_S (w[32], w[33], selector); w[61] = hc_byte_perm_S (w[31], w[32], selector); w[60] = hc_byte_perm_S (w[30], w[31], selector); w[59] = hc_byte_perm_S (w[29], w[30], selector); w[58] = hc_byte_perm_S (w[28], w[29], selector); w[57] = hc_byte_perm_S (w[27], w[28], selector); w[56] = hc_byte_perm_S (w[26], w[27], selector); w[55] = hc_byte_perm_S (w[25], w[26], selector); w[54] = hc_byte_perm_S (w[24], w[25], selector); w[53] = hc_byte_perm_S (w[23], w[24], selector); w[52] = hc_byte_perm_S (w[22], w[23], selector); w[51] = hc_byte_perm_S (w[21], w[22], selector); w[50] = hc_byte_perm_S (w[20], w[21], selector); w[49] = hc_byte_perm_S (w[19], w[20], selector); w[48] = hc_byte_perm_S (w[18], w[19], selector); w[47] = hc_byte_perm_S (w[17], w[18], selector); w[46] = hc_byte_perm_S (w[16], w[17], selector); w[45] = hc_byte_perm_S (w[15], w[16], selector); w[44] = hc_byte_perm_S (w[14], w[15], selector); w[43] = hc_byte_perm_S (w[13], w[14], selector); w[42] = hc_byte_perm_S (w[12], w[13], selector); w[41] = hc_byte_perm_S (w[11], w[12], selector); w[40] = hc_byte_perm_S (w[10], w[11], selector); w[39] = hc_byte_perm_S (w[ 9], w[10], selector); w[38] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[37] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[36] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[35] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[34] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[33] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[32] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[31] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[30] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[29] = hc_byte_perm_S ( 0, w[ 0], selector); w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 30: w[63] = hc_byte_perm_S (w[32], w[33], selector); w[62] = hc_byte_perm_S (w[31], w[32], selector); w[61] = hc_byte_perm_S (w[30], w[31], selector); w[60] = hc_byte_perm_S (w[29], w[30], selector); w[59] = hc_byte_perm_S (w[28], w[29], selector); w[58] = hc_byte_perm_S (w[27], w[28], selector); w[57] = hc_byte_perm_S (w[26], w[27], selector); w[56] = hc_byte_perm_S (w[25], w[26], selector); w[55] = hc_byte_perm_S (w[24], w[25], selector); w[54] = hc_byte_perm_S (w[23], w[24], selector); w[53] = hc_byte_perm_S (w[22], w[23], selector); w[52] = hc_byte_perm_S (w[21], w[22], selector); w[51] = hc_byte_perm_S (w[20], w[21], selector); w[50] = hc_byte_perm_S (w[19], w[20], selector); w[49] = hc_byte_perm_S (w[18], w[19], selector); w[48] = hc_byte_perm_S (w[17], w[18], selector); w[47] = hc_byte_perm_S (w[16], w[17], selector); w[46] = hc_byte_perm_S (w[15], w[16], selector); w[45] = hc_byte_perm_S (w[14], w[15], selector); w[44] = hc_byte_perm_S (w[13], w[14], selector); w[43] = hc_byte_perm_S (w[12], w[13], selector); w[42] = hc_byte_perm_S (w[11], w[12], selector); w[41] = hc_byte_perm_S (w[10], w[11], selector); w[40] = hc_byte_perm_S (w[ 9], w[10], selector); w[39] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[38] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[37] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[36] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[35] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[34] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[33] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[32] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[31] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[30] = hc_byte_perm_S ( 0, w[ 0], selector); w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 31: w[63] = hc_byte_perm_S (w[31], w[32], selector); w[62] = hc_byte_perm_S (w[30], w[31], selector); w[61] = hc_byte_perm_S (w[29], w[30], selector); w[60] = hc_byte_perm_S (w[28], w[29], selector); w[59] = hc_byte_perm_S (w[27], w[28], selector); w[58] = hc_byte_perm_S (w[26], w[27], selector); w[57] = hc_byte_perm_S (w[25], w[26], selector); w[56] = hc_byte_perm_S (w[24], w[25], selector); w[55] = hc_byte_perm_S (w[23], w[24], selector); w[54] = hc_byte_perm_S (w[22], w[23], selector); w[53] = hc_byte_perm_S (w[21], w[22], selector); w[52] = hc_byte_perm_S (w[20], w[21], selector); w[51] = hc_byte_perm_S (w[19], w[20], selector); w[50] = hc_byte_perm_S (w[18], w[19], selector); w[49] = hc_byte_perm_S (w[17], w[18], selector); w[48] = hc_byte_perm_S (w[16], w[17], selector); w[47] = hc_byte_perm_S (w[15], w[16], selector); w[46] = hc_byte_perm_S (w[14], w[15], selector); w[45] = hc_byte_perm_S (w[13], w[14], selector); w[44] = hc_byte_perm_S (w[12], w[13], selector); w[43] = hc_byte_perm_S (w[11], w[12], selector); w[42] = hc_byte_perm_S (w[10], w[11], selector); w[41] = hc_byte_perm_S (w[ 9], w[10], selector); w[40] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[39] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[38] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[37] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[36] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[35] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[34] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[33] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[32] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[31] = hc_byte_perm_S ( 0, w[ 0], selector); w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 32: w[63] = hc_byte_perm_S (w[30], w[31], selector); w[62] = hc_byte_perm_S (w[29], w[30], selector); w[61] = hc_byte_perm_S (w[28], w[29], selector); w[60] = hc_byte_perm_S (w[27], w[28], selector); w[59] = hc_byte_perm_S (w[26], w[27], selector); w[58] = hc_byte_perm_S (w[25], w[26], selector); w[57] = hc_byte_perm_S (w[24], w[25], selector); w[56] = hc_byte_perm_S (w[23], w[24], selector); w[55] = hc_byte_perm_S (w[22], w[23], selector); w[54] = hc_byte_perm_S (w[21], w[22], selector); w[53] = hc_byte_perm_S (w[20], w[21], selector); w[52] = hc_byte_perm_S (w[19], w[20], selector); w[51] = hc_byte_perm_S (w[18], w[19], selector); w[50] = hc_byte_perm_S (w[17], w[18], selector); w[49] = hc_byte_perm_S (w[16], w[17], selector); w[48] = hc_byte_perm_S (w[15], w[16], selector); w[47] = hc_byte_perm_S (w[14], w[15], selector); w[46] = hc_byte_perm_S (w[13], w[14], selector); w[45] = hc_byte_perm_S (w[12], w[13], selector); w[44] = hc_byte_perm_S (w[11], w[12], selector); w[43] = hc_byte_perm_S (w[10], w[11], selector); w[42] = hc_byte_perm_S (w[ 9], w[10], selector); w[41] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[40] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[39] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[38] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[37] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[36] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[35] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[34] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[33] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[32] = hc_byte_perm_S ( 0, w[ 0], selector); w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 33: w[63] = hc_byte_perm_S (w[29], w[30], selector); w[62] = hc_byte_perm_S (w[28], w[29], selector); w[61] = hc_byte_perm_S (w[27], w[28], selector); w[60] = hc_byte_perm_S (w[26], w[27], selector); w[59] = hc_byte_perm_S (w[25], w[26], selector); w[58] = hc_byte_perm_S (w[24], w[25], selector); w[57] = hc_byte_perm_S (w[23], w[24], selector); w[56] = hc_byte_perm_S (w[22], w[23], selector); w[55] = hc_byte_perm_S (w[21], w[22], selector); w[54] = hc_byte_perm_S (w[20], w[21], selector); w[53] = hc_byte_perm_S (w[19], w[20], selector); w[52] = hc_byte_perm_S (w[18], w[19], selector); w[51] = hc_byte_perm_S (w[17], w[18], selector); w[50] = hc_byte_perm_S (w[16], w[17], selector); w[49] = hc_byte_perm_S (w[15], w[16], selector); w[48] = hc_byte_perm_S (w[14], w[15], selector); w[47] = hc_byte_perm_S (w[13], w[14], selector); w[46] = hc_byte_perm_S (w[12], w[13], selector); w[45] = hc_byte_perm_S (w[11], w[12], selector); w[44] = hc_byte_perm_S (w[10], w[11], selector); w[43] = hc_byte_perm_S (w[ 9], w[10], selector); w[42] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[41] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[40] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[39] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[38] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[37] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[36] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[35] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[34] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[33] = hc_byte_perm_S ( 0, w[ 0], selector); w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 34: w[63] = hc_byte_perm_S (w[28], w[29], selector); w[62] = hc_byte_perm_S (w[27], w[28], selector); w[61] = hc_byte_perm_S (w[26], w[27], selector); w[60] = hc_byte_perm_S (w[25], w[26], selector); w[59] = hc_byte_perm_S (w[24], w[25], selector); w[58] = hc_byte_perm_S (w[23], w[24], selector); w[57] = hc_byte_perm_S (w[22], w[23], selector); w[56] = hc_byte_perm_S (w[21], w[22], selector); w[55] = hc_byte_perm_S (w[20], w[21], selector); w[54] = hc_byte_perm_S (w[19], w[20], selector); w[53] = hc_byte_perm_S (w[18], w[19], selector); w[52] = hc_byte_perm_S (w[17], w[18], selector); w[51] = hc_byte_perm_S (w[16], w[17], selector); w[50] = hc_byte_perm_S (w[15], w[16], selector); w[49] = hc_byte_perm_S (w[14], w[15], selector); w[48] = hc_byte_perm_S (w[13], w[14], selector); w[47] = hc_byte_perm_S (w[12], w[13], selector); w[46] = hc_byte_perm_S (w[11], w[12], selector); w[45] = hc_byte_perm_S (w[10], w[11], selector); w[44] = hc_byte_perm_S (w[ 9], w[10], selector); w[43] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[42] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[41] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[40] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[39] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[38] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[37] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[36] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[35] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[34] = hc_byte_perm_S ( 0, w[ 0], selector); w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 35: w[63] = hc_byte_perm_S (w[27], w[28], selector); w[62] = hc_byte_perm_S (w[26], w[27], selector); w[61] = hc_byte_perm_S (w[25], w[26], selector); w[60] = hc_byte_perm_S (w[24], w[25], selector); w[59] = hc_byte_perm_S (w[23], w[24], selector); w[58] = hc_byte_perm_S (w[22], w[23], selector); w[57] = hc_byte_perm_S (w[21], w[22], selector); w[56] = hc_byte_perm_S (w[20], w[21], selector); w[55] = hc_byte_perm_S (w[19], w[20], selector); w[54] = hc_byte_perm_S (w[18], w[19], selector); w[53] = hc_byte_perm_S (w[17], w[18], selector); w[52] = hc_byte_perm_S (w[16], w[17], selector); w[51] = hc_byte_perm_S (w[15], w[16], selector); w[50] = hc_byte_perm_S (w[14], w[15], selector); w[49] = hc_byte_perm_S (w[13], w[14], selector); w[48] = hc_byte_perm_S (w[12], w[13], selector); w[47] = hc_byte_perm_S (w[11], w[12], selector); w[46] = hc_byte_perm_S (w[10], w[11], selector); w[45] = hc_byte_perm_S (w[ 9], w[10], selector); w[44] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[43] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[42] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[41] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[40] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[39] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[38] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[37] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[36] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[35] = hc_byte_perm_S ( 0, w[ 0], selector); w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 36: w[63] = hc_byte_perm_S (w[26], w[27], selector); w[62] = hc_byte_perm_S (w[25], w[26], selector); w[61] = hc_byte_perm_S (w[24], w[25], selector); w[60] = hc_byte_perm_S (w[23], w[24], selector); w[59] = hc_byte_perm_S (w[22], w[23], selector); w[58] = hc_byte_perm_S (w[21], w[22], selector); w[57] = hc_byte_perm_S (w[20], w[21], selector); w[56] = hc_byte_perm_S (w[19], w[20], selector); w[55] = hc_byte_perm_S (w[18], w[19], selector); w[54] = hc_byte_perm_S (w[17], w[18], selector); w[53] = hc_byte_perm_S (w[16], w[17], selector); w[52] = hc_byte_perm_S (w[15], w[16], selector); w[51] = hc_byte_perm_S (w[14], w[15], selector); w[50] = hc_byte_perm_S (w[13], w[14], selector); w[49] = hc_byte_perm_S (w[12], w[13], selector); w[48] = hc_byte_perm_S (w[11], w[12], selector); w[47] = hc_byte_perm_S (w[10], w[11], selector); w[46] = hc_byte_perm_S (w[ 9], w[10], selector); w[45] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[44] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[43] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[42] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[41] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[40] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[39] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[38] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[37] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[36] = hc_byte_perm_S ( 0, w[ 0], selector); w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 37: w[63] = hc_byte_perm_S (w[25], w[26], selector); w[62] = hc_byte_perm_S (w[24], w[25], selector); w[61] = hc_byte_perm_S (w[23], w[24], selector); w[60] = hc_byte_perm_S (w[22], w[23], selector); w[59] = hc_byte_perm_S (w[21], w[22], selector); w[58] = hc_byte_perm_S (w[20], w[21], selector); w[57] = hc_byte_perm_S (w[19], w[20], selector); w[56] = hc_byte_perm_S (w[18], w[19], selector); w[55] = hc_byte_perm_S (w[17], w[18], selector); w[54] = hc_byte_perm_S (w[16], w[17], selector); w[53] = hc_byte_perm_S (w[15], w[16], selector); w[52] = hc_byte_perm_S (w[14], w[15], selector); w[51] = hc_byte_perm_S (w[13], w[14], selector); w[50] = hc_byte_perm_S (w[12], w[13], selector); w[49] = hc_byte_perm_S (w[11], w[12], selector); w[48] = hc_byte_perm_S (w[10], w[11], selector); w[47] = hc_byte_perm_S (w[ 9], w[10], selector); w[46] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[45] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[44] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[43] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[42] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[41] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[40] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[39] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[38] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[37] = hc_byte_perm_S ( 0, w[ 0], selector); w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 38: w[63] = hc_byte_perm_S (w[24], w[25], selector); w[62] = hc_byte_perm_S (w[23], w[24], selector); w[61] = hc_byte_perm_S (w[22], w[23], selector); w[60] = hc_byte_perm_S (w[21], w[22], selector); w[59] = hc_byte_perm_S (w[20], w[21], selector); w[58] = hc_byte_perm_S (w[19], w[20], selector); w[57] = hc_byte_perm_S (w[18], w[19], selector); w[56] = hc_byte_perm_S (w[17], w[18], selector); w[55] = hc_byte_perm_S (w[16], w[17], selector); w[54] = hc_byte_perm_S (w[15], w[16], selector); w[53] = hc_byte_perm_S (w[14], w[15], selector); w[52] = hc_byte_perm_S (w[13], w[14], selector); w[51] = hc_byte_perm_S (w[12], w[13], selector); w[50] = hc_byte_perm_S (w[11], w[12], selector); w[49] = hc_byte_perm_S (w[10], w[11], selector); w[48] = hc_byte_perm_S (w[ 9], w[10], selector); w[47] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[46] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[45] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[44] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[43] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[42] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[41] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[40] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[39] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[38] = hc_byte_perm_S ( 0, w[ 0], selector); w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 39: w[63] = hc_byte_perm_S (w[23], w[24], selector); w[62] = hc_byte_perm_S (w[22], w[23], selector); w[61] = hc_byte_perm_S (w[21], w[22], selector); w[60] = hc_byte_perm_S (w[20], w[21], selector); w[59] = hc_byte_perm_S (w[19], w[20], selector); w[58] = hc_byte_perm_S (w[18], w[19], selector); w[57] = hc_byte_perm_S (w[17], w[18], selector); w[56] = hc_byte_perm_S (w[16], w[17], selector); w[55] = hc_byte_perm_S (w[15], w[16], selector); w[54] = hc_byte_perm_S (w[14], w[15], selector); w[53] = hc_byte_perm_S (w[13], w[14], selector); w[52] = hc_byte_perm_S (w[12], w[13], selector); w[51] = hc_byte_perm_S (w[11], w[12], selector); w[50] = hc_byte_perm_S (w[10], w[11], selector); w[49] = hc_byte_perm_S (w[ 9], w[10], selector); w[48] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[47] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[46] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[45] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[44] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[43] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[42] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[41] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[40] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[39] = hc_byte_perm_S ( 0, w[ 0], selector); w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 40: w[63] = hc_byte_perm_S (w[22], w[23], selector); w[62] = hc_byte_perm_S (w[21], w[22], selector); w[61] = hc_byte_perm_S (w[20], w[21], selector); w[60] = hc_byte_perm_S (w[19], w[20], selector); w[59] = hc_byte_perm_S (w[18], w[19], selector); w[58] = hc_byte_perm_S (w[17], w[18], selector); w[57] = hc_byte_perm_S (w[16], w[17], selector); w[56] = hc_byte_perm_S (w[15], w[16], selector); w[55] = hc_byte_perm_S (w[14], w[15], selector); w[54] = hc_byte_perm_S (w[13], w[14], selector); w[53] = hc_byte_perm_S (w[12], w[13], selector); w[52] = hc_byte_perm_S (w[11], w[12], selector); w[51] = hc_byte_perm_S (w[10], w[11], selector); w[50] = hc_byte_perm_S (w[ 9], w[10], selector); w[49] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[48] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[47] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[46] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[45] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[44] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[43] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[42] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[41] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[40] = hc_byte_perm_S ( 0, w[ 0], selector); w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 41: w[63] = hc_byte_perm_S (w[21], w[22], selector); w[62] = hc_byte_perm_S (w[20], w[21], selector); w[61] = hc_byte_perm_S (w[19], w[20], selector); w[60] = hc_byte_perm_S (w[18], w[19], selector); w[59] = hc_byte_perm_S (w[17], w[18], selector); w[58] = hc_byte_perm_S (w[16], w[17], selector); w[57] = hc_byte_perm_S (w[15], w[16], selector); w[56] = hc_byte_perm_S (w[14], w[15], selector); w[55] = hc_byte_perm_S (w[13], w[14], selector); w[54] = hc_byte_perm_S (w[12], w[13], selector); w[53] = hc_byte_perm_S (w[11], w[12], selector); w[52] = hc_byte_perm_S (w[10], w[11], selector); w[51] = hc_byte_perm_S (w[ 9], w[10], selector); w[50] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[49] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[48] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[47] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[46] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[45] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[44] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[43] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[42] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[41] = hc_byte_perm_S ( 0, w[ 0], selector); w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 42: w[63] = hc_byte_perm_S (w[20], w[21], selector); w[62] = hc_byte_perm_S (w[19], w[20], selector); w[61] = hc_byte_perm_S (w[18], w[19], selector); w[60] = hc_byte_perm_S (w[17], w[18], selector); w[59] = hc_byte_perm_S (w[16], w[17], selector); w[58] = hc_byte_perm_S (w[15], w[16], selector); w[57] = hc_byte_perm_S (w[14], w[15], selector); w[56] = hc_byte_perm_S (w[13], w[14], selector); w[55] = hc_byte_perm_S (w[12], w[13], selector); w[54] = hc_byte_perm_S (w[11], w[12], selector); w[53] = hc_byte_perm_S (w[10], w[11], selector); w[52] = hc_byte_perm_S (w[ 9], w[10], selector); w[51] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[50] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[49] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[48] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[47] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[46] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[45] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[44] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[43] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[42] = hc_byte_perm_S ( 0, w[ 0], selector); w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 43: w[63] = hc_byte_perm_S (w[19], w[20], selector); w[62] = hc_byte_perm_S (w[18], w[19], selector); w[61] = hc_byte_perm_S (w[17], w[18], selector); w[60] = hc_byte_perm_S (w[16], w[17], selector); w[59] = hc_byte_perm_S (w[15], w[16], selector); w[58] = hc_byte_perm_S (w[14], w[15], selector); w[57] = hc_byte_perm_S (w[13], w[14], selector); w[56] = hc_byte_perm_S (w[12], w[13], selector); w[55] = hc_byte_perm_S (w[11], w[12], selector); w[54] = hc_byte_perm_S (w[10], w[11], selector); w[53] = hc_byte_perm_S (w[ 9], w[10], selector); w[52] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[51] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[50] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[49] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[48] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[47] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[46] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[45] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[44] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[43] = hc_byte_perm_S ( 0, w[ 0], selector); w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 44: w[63] = hc_byte_perm_S (w[18], w[19], selector); w[62] = hc_byte_perm_S (w[17], w[18], selector); w[61] = hc_byte_perm_S (w[16], w[17], selector); w[60] = hc_byte_perm_S (w[15], w[16], selector); w[59] = hc_byte_perm_S (w[14], w[15], selector); w[58] = hc_byte_perm_S (w[13], w[14], selector); w[57] = hc_byte_perm_S (w[12], w[13], selector); w[56] = hc_byte_perm_S (w[11], w[12], selector); w[55] = hc_byte_perm_S (w[10], w[11], selector); w[54] = hc_byte_perm_S (w[ 9], w[10], selector); w[53] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[52] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[51] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[50] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[49] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[48] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[47] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[46] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[45] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[44] = hc_byte_perm_S ( 0, w[ 0], selector); w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 45: w[63] = hc_byte_perm_S (w[17], w[18], selector); w[62] = hc_byte_perm_S (w[16], w[17], selector); w[61] = hc_byte_perm_S (w[15], w[16], selector); w[60] = hc_byte_perm_S (w[14], w[15], selector); w[59] = hc_byte_perm_S (w[13], w[14], selector); w[58] = hc_byte_perm_S (w[12], w[13], selector); w[57] = hc_byte_perm_S (w[11], w[12], selector); w[56] = hc_byte_perm_S (w[10], w[11], selector); w[55] = hc_byte_perm_S (w[ 9], w[10], selector); w[54] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[53] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[52] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[51] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[50] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[49] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[48] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[47] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[46] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[45] = hc_byte_perm_S ( 0, w[ 0], selector); w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 46: w[63] = hc_byte_perm_S (w[16], w[17], selector); w[62] = hc_byte_perm_S (w[15], w[16], selector); w[61] = hc_byte_perm_S (w[14], w[15], selector); w[60] = hc_byte_perm_S (w[13], w[14], selector); w[59] = hc_byte_perm_S (w[12], w[13], selector); w[58] = hc_byte_perm_S (w[11], w[12], selector); w[57] = hc_byte_perm_S (w[10], w[11], selector); w[56] = hc_byte_perm_S (w[ 9], w[10], selector); w[55] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[54] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[53] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[52] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[51] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[50] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[49] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[48] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[47] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[46] = hc_byte_perm_S ( 0, w[ 0], selector); w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 47: w[63] = hc_byte_perm_S (w[15], w[16], selector); w[62] = hc_byte_perm_S (w[14], w[15], selector); w[61] = hc_byte_perm_S (w[13], w[14], selector); w[60] = hc_byte_perm_S (w[12], w[13], selector); w[59] = hc_byte_perm_S (w[11], w[12], selector); w[58] = hc_byte_perm_S (w[10], w[11], selector); w[57] = hc_byte_perm_S (w[ 9], w[10], selector); w[56] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[55] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[54] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[53] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[52] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[51] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[50] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[49] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[48] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[47] = hc_byte_perm_S ( 0, w[ 0], selector); w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 48: w[63] = hc_byte_perm_S (w[14], w[15], selector); w[62] = hc_byte_perm_S (w[13], w[14], selector); w[61] = hc_byte_perm_S (w[12], w[13], selector); w[60] = hc_byte_perm_S (w[11], w[12], selector); w[59] = hc_byte_perm_S (w[10], w[11], selector); w[58] = hc_byte_perm_S (w[ 9], w[10], selector); w[57] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[56] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[55] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[54] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[53] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[52] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[51] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[50] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[49] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[48] = hc_byte_perm_S ( 0, w[ 0], selector); w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 49: w[63] = hc_byte_perm_S (w[13], w[14], selector); w[62] = hc_byte_perm_S (w[12], w[13], selector); w[61] = hc_byte_perm_S (w[11], w[12], selector); w[60] = hc_byte_perm_S (w[10], w[11], selector); w[59] = hc_byte_perm_S (w[ 9], w[10], selector); w[58] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[57] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[56] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[55] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[54] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[53] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[52] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[51] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[50] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[49] = hc_byte_perm_S ( 0, w[ 0], selector); w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 50: w[63] = hc_byte_perm_S (w[12], w[13], selector); w[62] = hc_byte_perm_S (w[11], w[12], selector); w[61] = hc_byte_perm_S (w[10], w[11], selector); w[60] = hc_byte_perm_S (w[ 9], w[10], selector); w[59] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[58] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[57] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[56] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[55] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[54] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[53] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[52] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[51] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[50] = hc_byte_perm_S ( 0, w[ 0], selector); w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 51: w[63] = hc_byte_perm_S (w[11], w[12], selector); w[62] = hc_byte_perm_S (w[10], w[11], selector); w[61] = hc_byte_perm_S (w[ 9], w[10], selector); w[60] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[59] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[58] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[57] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[56] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[55] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[54] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[53] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[52] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[51] = hc_byte_perm_S ( 0, w[ 0], selector); w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 52: w[63] = hc_byte_perm_S (w[10], w[11], selector); w[62] = hc_byte_perm_S (w[ 9], w[10], selector); w[61] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[60] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[59] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[58] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[57] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[56] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[55] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[54] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[53] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[52] = hc_byte_perm_S ( 0, w[ 0], selector); w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 53: w[63] = hc_byte_perm_S (w[ 9], w[10], selector); w[62] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[61] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[60] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[59] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[58] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[57] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[56] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[55] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[54] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[53] = hc_byte_perm_S ( 0, w[ 0], selector); w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 54: w[63] = hc_byte_perm_S (w[ 8], w[ 9], selector); w[62] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[61] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[60] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[59] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[58] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[57] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[56] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[55] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[54] = hc_byte_perm_S ( 0, w[ 0], selector); w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 55: w[63] = hc_byte_perm_S (w[ 7], w[ 8], selector); w[62] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[61] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[60] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[59] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[58] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[57] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[56] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[55] = hc_byte_perm_S ( 0, w[ 0], selector); w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 56: w[63] = hc_byte_perm_S (w[ 6], w[ 7], selector); w[62] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[61] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[60] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[59] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[58] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[57] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[56] = hc_byte_perm_S ( 0, w[ 0], selector); w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 57: w[63] = hc_byte_perm_S (w[ 5], w[ 6], selector); w[62] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[61] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[60] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[59] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[58] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[57] = hc_byte_perm_S ( 0, w[ 0], selector); w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 58: w[63] = hc_byte_perm_S (w[ 4], w[ 5], selector); w[62] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[61] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[60] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[59] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[58] = hc_byte_perm_S ( 0, w[ 0], selector); w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 59: w[63] = hc_byte_perm_S (w[ 3], w[ 4], selector); w[62] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[61] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[60] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[59] = hc_byte_perm_S ( 0, w[ 0], selector); w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 60: w[63] = hc_byte_perm_S (w[ 2], w[ 3], selector); w[62] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[61] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[60] = hc_byte_perm_S ( 0, w[ 0], selector); w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 61: w[63] = hc_byte_perm_S (w[ 1], w[ 2], selector); w[62] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[61] = hc_byte_perm_S ( 0, w[ 0], selector); w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 62: w[63] = hc_byte_perm_S (w[ 0], w[ 1], selector); w[62] = hc_byte_perm_S ( 0, w[ 0], selector); w[61] = 0; w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 63: w[63] = hc_byte_perm_S ( 0, w[ 0], selector); w[62] = 0; w[61] = 0; w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; } #endif } DECLSPEC void switch_buffer_by_offset_1x64_be_S (PRIVATE_AS u32 *w, const u32 offset) { const int offset_switch = offset / 4; #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 0) || defined IS_GENERIC switch (offset_switch) { case 0: w[63] = hc_bytealign_be_S (w[62], w[63], offset); w[62] = hc_bytealign_be_S (w[61], w[62], offset); w[61] = hc_bytealign_be_S (w[60], w[61], offset); w[60] = hc_bytealign_be_S (w[59], w[60], offset); w[59] = hc_bytealign_be_S (w[58], w[59], offset); w[58] = hc_bytealign_be_S (w[57], w[58], offset); w[57] = hc_bytealign_be_S (w[56], w[57], offset); w[56] = hc_bytealign_be_S (w[55], w[56], offset); w[55] = hc_bytealign_be_S (w[54], w[55], offset); w[54] = hc_bytealign_be_S (w[53], w[54], offset); w[53] = hc_bytealign_be_S (w[52], w[53], offset); w[52] = hc_bytealign_be_S (w[51], w[52], offset); w[51] = hc_bytealign_be_S (w[50], w[51], offset); w[50] = hc_bytealign_be_S (w[49], w[50], offset); w[49] = hc_bytealign_be_S (w[48], w[49], offset); w[48] = hc_bytealign_be_S (w[47], w[48], offset); w[47] = hc_bytealign_be_S (w[46], w[47], offset); w[46] = hc_bytealign_be_S (w[45], w[46], offset); w[45] = hc_bytealign_be_S (w[44], w[45], offset); w[44] = hc_bytealign_be_S (w[43], w[44], offset); w[43] = hc_bytealign_be_S (w[42], w[43], offset); w[42] = hc_bytealign_be_S (w[41], w[42], offset); w[41] = hc_bytealign_be_S (w[40], w[41], offset); w[40] = hc_bytealign_be_S (w[39], w[40], offset); w[39] = hc_bytealign_be_S (w[38], w[39], offset); w[38] = hc_bytealign_be_S (w[37], w[38], offset); w[37] = hc_bytealign_be_S (w[36], w[37], offset); w[36] = hc_bytealign_be_S (w[35], w[36], offset); w[35] = hc_bytealign_be_S (w[34], w[35], offset); w[34] = hc_bytealign_be_S (w[33], w[34], offset); w[33] = hc_bytealign_be_S (w[32], w[33], offset); w[32] = hc_bytealign_be_S (w[31], w[32], offset); w[31] = hc_bytealign_be_S (w[30], w[31], offset); w[30] = hc_bytealign_be_S (w[29], w[30], offset); w[29] = hc_bytealign_be_S (w[28], w[29], offset); w[28] = hc_bytealign_be_S (w[27], w[28], offset); w[27] = hc_bytealign_be_S (w[26], w[27], offset); w[26] = hc_bytealign_be_S (w[25], w[26], offset); w[25] = hc_bytealign_be_S (w[24], w[25], offset); w[24] = hc_bytealign_be_S (w[23], w[24], offset); w[23] = hc_bytealign_be_S (w[22], w[23], offset); w[22] = hc_bytealign_be_S (w[21], w[22], offset); w[21] = hc_bytealign_be_S (w[20], w[21], offset); w[20] = hc_bytealign_be_S (w[19], w[20], offset); w[19] = hc_bytealign_be_S (w[18], w[19], offset); w[18] = hc_bytealign_be_S (w[17], w[18], offset); w[17] = hc_bytealign_be_S (w[16], w[17], offset); w[16] = hc_bytealign_be_S (w[15], w[16], offset); w[15] = hc_bytealign_be_S (w[14], w[15], offset); w[14] = hc_bytealign_be_S (w[13], w[14], offset); w[13] = hc_bytealign_be_S (w[12], w[13], offset); w[12] = hc_bytealign_be_S (w[11], w[12], offset); w[11] = hc_bytealign_be_S (w[10], w[11], offset); w[10] = hc_bytealign_be_S (w[ 9], w[10], offset); w[ 9] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[ 8] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[ 7] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[ 6] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[ 5] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[ 4] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[ 3] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[ 2] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[ 1] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[ 0] = hc_bytealign_be_S ( 0, w[ 0], offset); break; case 1: w[63] = hc_bytealign_be_S (w[61], w[62], offset); w[62] = hc_bytealign_be_S (w[60], w[61], offset); w[61] = hc_bytealign_be_S (w[59], w[60], offset); w[60] = hc_bytealign_be_S (w[58], w[59], offset); w[59] = hc_bytealign_be_S (w[57], w[58], offset); w[58] = hc_bytealign_be_S (w[56], w[57], offset); w[57] = hc_bytealign_be_S (w[55], w[56], offset); w[56] = hc_bytealign_be_S (w[54], w[55], offset); w[55] = hc_bytealign_be_S (w[53], w[54], offset); w[54] = hc_bytealign_be_S (w[52], w[53], offset); w[53] = hc_bytealign_be_S (w[51], w[52], offset); w[52] = hc_bytealign_be_S (w[50], w[51], offset); w[51] = hc_bytealign_be_S (w[49], w[50], offset); w[50] = hc_bytealign_be_S (w[48], w[49], offset); w[49] = hc_bytealign_be_S (w[47], w[48], offset); w[48] = hc_bytealign_be_S (w[46], w[47], offset); w[47] = hc_bytealign_be_S (w[45], w[46], offset); w[46] = hc_bytealign_be_S (w[44], w[45], offset); w[45] = hc_bytealign_be_S (w[43], w[44], offset); w[44] = hc_bytealign_be_S (w[42], w[43], offset); w[43] = hc_bytealign_be_S (w[41], w[42], offset); w[42] = hc_bytealign_be_S (w[40], w[41], offset); w[41] = hc_bytealign_be_S (w[39], w[40], offset); w[40] = hc_bytealign_be_S (w[38], w[39], offset); w[39] = hc_bytealign_be_S (w[37], w[38], offset); w[38] = hc_bytealign_be_S (w[36], w[37], offset); w[37] = hc_bytealign_be_S (w[35], w[36], offset); w[36] = hc_bytealign_be_S (w[34], w[35], offset); w[35] = hc_bytealign_be_S (w[33], w[34], offset); w[34] = hc_bytealign_be_S (w[32], w[33], offset); w[33] = hc_bytealign_be_S (w[31], w[32], offset); w[32] = hc_bytealign_be_S (w[30], w[31], offset); w[31] = hc_bytealign_be_S (w[29], w[30], offset); w[30] = hc_bytealign_be_S (w[28], w[29], offset); w[29] = hc_bytealign_be_S (w[27], w[28], offset); w[28] = hc_bytealign_be_S (w[26], w[27], offset); w[27] = hc_bytealign_be_S (w[25], w[26], offset); w[26] = hc_bytealign_be_S (w[24], w[25], offset); w[25] = hc_bytealign_be_S (w[23], w[24], offset); w[24] = hc_bytealign_be_S (w[22], w[23], offset); w[23] = hc_bytealign_be_S (w[21], w[22], offset); w[22] = hc_bytealign_be_S (w[20], w[21], offset); w[21] = hc_bytealign_be_S (w[19], w[20], offset); w[20] = hc_bytealign_be_S (w[18], w[19], offset); w[19] = hc_bytealign_be_S (w[17], w[18], offset); w[18] = hc_bytealign_be_S (w[16], w[17], offset); w[17] = hc_bytealign_be_S (w[15], w[16], offset); w[16] = hc_bytealign_be_S (w[14], w[15], offset); w[15] = hc_bytealign_be_S (w[13], w[14], offset); w[14] = hc_bytealign_be_S (w[12], w[13], offset); w[13] = hc_bytealign_be_S (w[11], w[12], offset); w[12] = hc_bytealign_be_S (w[10], w[11], offset); w[11] = hc_bytealign_be_S (w[ 9], w[10], offset); w[10] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[ 9] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[ 8] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[ 7] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[ 6] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[ 5] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[ 4] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[ 3] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[ 2] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[ 1] = hc_bytealign_be_S ( 0, w[ 0], offset); w[ 0] = 0; break; case 2: w[63] = hc_bytealign_be_S (w[60], w[61], offset); w[62] = hc_bytealign_be_S (w[59], w[60], offset); w[61] = hc_bytealign_be_S (w[58], w[59], offset); w[60] = hc_bytealign_be_S (w[57], w[58], offset); w[59] = hc_bytealign_be_S (w[56], w[57], offset); w[58] = hc_bytealign_be_S (w[55], w[56], offset); w[57] = hc_bytealign_be_S (w[54], w[55], offset); w[56] = hc_bytealign_be_S (w[53], w[54], offset); w[55] = hc_bytealign_be_S (w[52], w[53], offset); w[54] = hc_bytealign_be_S (w[51], w[52], offset); w[53] = hc_bytealign_be_S (w[50], w[51], offset); w[52] = hc_bytealign_be_S (w[49], w[50], offset); w[51] = hc_bytealign_be_S (w[48], w[49], offset); w[50] = hc_bytealign_be_S (w[47], w[48], offset); w[49] = hc_bytealign_be_S (w[46], w[47], offset); w[48] = hc_bytealign_be_S (w[45], w[46], offset); w[47] = hc_bytealign_be_S (w[44], w[45], offset); w[46] = hc_bytealign_be_S (w[43], w[44], offset); w[45] = hc_bytealign_be_S (w[42], w[43], offset); w[44] = hc_bytealign_be_S (w[41], w[42], offset); w[43] = hc_bytealign_be_S (w[40], w[41], offset); w[42] = hc_bytealign_be_S (w[39], w[40], offset); w[41] = hc_bytealign_be_S (w[38], w[39], offset); w[40] = hc_bytealign_be_S (w[37], w[38], offset); w[39] = hc_bytealign_be_S (w[36], w[37], offset); w[38] = hc_bytealign_be_S (w[35], w[36], offset); w[37] = hc_bytealign_be_S (w[34], w[35], offset); w[36] = hc_bytealign_be_S (w[33], w[34], offset); w[35] = hc_bytealign_be_S (w[32], w[33], offset); w[34] = hc_bytealign_be_S (w[31], w[32], offset); w[33] = hc_bytealign_be_S (w[30], w[31], offset); w[32] = hc_bytealign_be_S (w[29], w[30], offset); w[31] = hc_bytealign_be_S (w[28], w[29], offset); w[30] = hc_bytealign_be_S (w[27], w[28], offset); w[29] = hc_bytealign_be_S (w[26], w[27], offset); w[28] = hc_bytealign_be_S (w[25], w[26], offset); w[27] = hc_bytealign_be_S (w[24], w[25], offset); w[26] = hc_bytealign_be_S (w[23], w[24], offset); w[25] = hc_bytealign_be_S (w[22], w[23], offset); w[24] = hc_bytealign_be_S (w[21], w[22], offset); w[23] = hc_bytealign_be_S (w[20], w[21], offset); w[22] = hc_bytealign_be_S (w[19], w[20], offset); w[21] = hc_bytealign_be_S (w[18], w[19], offset); w[20] = hc_bytealign_be_S (w[17], w[18], offset); w[19] = hc_bytealign_be_S (w[16], w[17], offset); w[18] = hc_bytealign_be_S (w[15], w[16], offset); w[17] = hc_bytealign_be_S (w[14], w[15], offset); w[16] = hc_bytealign_be_S (w[13], w[14], offset); w[15] = hc_bytealign_be_S (w[12], w[13], offset); w[14] = hc_bytealign_be_S (w[11], w[12], offset); w[13] = hc_bytealign_be_S (w[10], w[11], offset); w[12] = hc_bytealign_be_S (w[ 9], w[10], offset); w[11] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[10] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[ 9] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[ 8] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[ 7] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[ 6] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[ 5] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[ 4] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[ 3] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[ 2] = hc_bytealign_be_S ( 0, w[ 0], offset); w[ 1] = 0; w[ 0] = 0; break; case 3: w[63] = hc_bytealign_be_S (w[59], w[60], offset); w[62] = hc_bytealign_be_S (w[58], w[59], offset); w[61] = hc_bytealign_be_S (w[57], w[58], offset); w[60] = hc_bytealign_be_S (w[56], w[57], offset); w[59] = hc_bytealign_be_S (w[55], w[56], offset); w[58] = hc_bytealign_be_S (w[54], w[55], offset); w[57] = hc_bytealign_be_S (w[53], w[54], offset); w[56] = hc_bytealign_be_S (w[52], w[53], offset); w[55] = hc_bytealign_be_S (w[51], w[52], offset); w[54] = hc_bytealign_be_S (w[50], w[51], offset); w[53] = hc_bytealign_be_S (w[49], w[50], offset); w[52] = hc_bytealign_be_S (w[48], w[49], offset); w[51] = hc_bytealign_be_S (w[47], w[48], offset); w[50] = hc_bytealign_be_S (w[46], w[47], offset); w[49] = hc_bytealign_be_S (w[45], w[46], offset); w[48] = hc_bytealign_be_S (w[44], w[45], offset); w[47] = hc_bytealign_be_S (w[43], w[44], offset); w[46] = hc_bytealign_be_S (w[42], w[43], offset); w[45] = hc_bytealign_be_S (w[41], w[42], offset); w[44] = hc_bytealign_be_S (w[40], w[41], offset); w[43] = hc_bytealign_be_S (w[39], w[40], offset); w[42] = hc_bytealign_be_S (w[38], w[39], offset); w[41] = hc_bytealign_be_S (w[37], w[38], offset); w[40] = hc_bytealign_be_S (w[36], w[37], offset); w[39] = hc_bytealign_be_S (w[35], w[36], offset); w[38] = hc_bytealign_be_S (w[34], w[35], offset); w[37] = hc_bytealign_be_S (w[33], w[34], offset); w[36] = hc_bytealign_be_S (w[32], w[33], offset); w[35] = hc_bytealign_be_S (w[31], w[32], offset); w[34] = hc_bytealign_be_S (w[30], w[31], offset); w[33] = hc_bytealign_be_S (w[29], w[30], offset); w[32] = hc_bytealign_be_S (w[28], w[29], offset); w[31] = hc_bytealign_be_S (w[27], w[28], offset); w[30] = hc_bytealign_be_S (w[26], w[27], offset); w[29] = hc_bytealign_be_S (w[25], w[26], offset); w[28] = hc_bytealign_be_S (w[24], w[25], offset); w[27] = hc_bytealign_be_S (w[23], w[24], offset); w[26] = hc_bytealign_be_S (w[22], w[23], offset); w[25] = hc_bytealign_be_S (w[21], w[22], offset); w[24] = hc_bytealign_be_S (w[20], w[21], offset); w[23] = hc_bytealign_be_S (w[19], w[20], offset); w[22] = hc_bytealign_be_S (w[18], w[19], offset); w[21] = hc_bytealign_be_S (w[17], w[18], offset); w[20] = hc_bytealign_be_S (w[16], w[17], offset); w[19] = hc_bytealign_be_S (w[15], w[16], offset); w[18] = hc_bytealign_be_S (w[14], w[15], offset); w[17] = hc_bytealign_be_S (w[13], w[14], offset); w[16] = hc_bytealign_be_S (w[12], w[13], offset); w[15] = hc_bytealign_be_S (w[11], w[12], offset); w[14] = hc_bytealign_be_S (w[10], w[11], offset); w[13] = hc_bytealign_be_S (w[ 9], w[10], offset); w[12] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[11] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[10] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[ 9] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[ 8] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[ 7] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[ 6] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[ 5] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[ 4] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[ 3] = hc_bytealign_be_S ( 0, w[ 0], offset); w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 4: w[63] = hc_bytealign_be_S (w[58], w[59], offset); w[62] = hc_bytealign_be_S (w[57], w[58], offset); w[61] = hc_bytealign_be_S (w[56], w[57], offset); w[60] = hc_bytealign_be_S (w[55], w[56], offset); w[59] = hc_bytealign_be_S (w[54], w[55], offset); w[58] = hc_bytealign_be_S (w[53], w[54], offset); w[57] = hc_bytealign_be_S (w[52], w[53], offset); w[56] = hc_bytealign_be_S (w[51], w[52], offset); w[55] = hc_bytealign_be_S (w[50], w[51], offset); w[54] = hc_bytealign_be_S (w[49], w[50], offset); w[53] = hc_bytealign_be_S (w[48], w[49], offset); w[52] = hc_bytealign_be_S (w[47], w[48], offset); w[51] = hc_bytealign_be_S (w[46], w[47], offset); w[50] = hc_bytealign_be_S (w[45], w[46], offset); w[49] = hc_bytealign_be_S (w[44], w[45], offset); w[48] = hc_bytealign_be_S (w[43], w[44], offset); w[47] = hc_bytealign_be_S (w[42], w[43], offset); w[46] = hc_bytealign_be_S (w[41], w[42], offset); w[45] = hc_bytealign_be_S (w[40], w[41], offset); w[44] = hc_bytealign_be_S (w[39], w[40], offset); w[43] = hc_bytealign_be_S (w[38], w[39], offset); w[42] = hc_bytealign_be_S (w[37], w[38], offset); w[41] = hc_bytealign_be_S (w[36], w[37], offset); w[40] = hc_bytealign_be_S (w[35], w[36], offset); w[39] = hc_bytealign_be_S (w[34], w[35], offset); w[38] = hc_bytealign_be_S (w[33], w[34], offset); w[37] = hc_bytealign_be_S (w[32], w[33], offset); w[36] = hc_bytealign_be_S (w[31], w[32], offset); w[35] = hc_bytealign_be_S (w[30], w[31], offset); w[34] = hc_bytealign_be_S (w[29], w[30], offset); w[33] = hc_bytealign_be_S (w[28], w[29], offset); w[32] = hc_bytealign_be_S (w[27], w[28], offset); w[31] = hc_bytealign_be_S (w[26], w[27], offset); w[30] = hc_bytealign_be_S (w[25], w[26], offset); w[29] = hc_bytealign_be_S (w[24], w[25], offset); w[28] = hc_bytealign_be_S (w[23], w[24], offset); w[27] = hc_bytealign_be_S (w[22], w[23], offset); w[26] = hc_bytealign_be_S (w[21], w[22], offset); w[25] = hc_bytealign_be_S (w[20], w[21], offset); w[24] = hc_bytealign_be_S (w[19], w[20], offset); w[23] = hc_bytealign_be_S (w[18], w[19], offset); w[22] = hc_bytealign_be_S (w[17], w[18], offset); w[21] = hc_bytealign_be_S (w[16], w[17], offset); w[20] = hc_bytealign_be_S (w[15], w[16], offset); w[19] = hc_bytealign_be_S (w[14], w[15], offset); w[18] = hc_bytealign_be_S (w[13], w[14], offset); w[17] = hc_bytealign_be_S (w[12], w[13], offset); w[16] = hc_bytealign_be_S (w[11], w[12], offset); w[15] = hc_bytealign_be_S (w[10], w[11], offset); w[14] = hc_bytealign_be_S (w[ 9], w[10], offset); w[13] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[12] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[11] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[10] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[ 9] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[ 8] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[ 7] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[ 6] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[ 5] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[ 4] = hc_bytealign_be_S ( 0, w[ 0], offset); w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 5: w[63] = hc_bytealign_be_S (w[57], w[58], offset); w[62] = hc_bytealign_be_S (w[56], w[57], offset); w[61] = hc_bytealign_be_S (w[55], w[56], offset); w[60] = hc_bytealign_be_S (w[54], w[55], offset); w[59] = hc_bytealign_be_S (w[53], w[54], offset); w[58] = hc_bytealign_be_S (w[52], w[53], offset); w[57] = hc_bytealign_be_S (w[51], w[52], offset); w[56] = hc_bytealign_be_S (w[50], w[51], offset); w[55] = hc_bytealign_be_S (w[49], w[50], offset); w[54] = hc_bytealign_be_S (w[48], w[49], offset); w[53] = hc_bytealign_be_S (w[47], w[48], offset); w[52] = hc_bytealign_be_S (w[46], w[47], offset); w[51] = hc_bytealign_be_S (w[45], w[46], offset); w[50] = hc_bytealign_be_S (w[44], w[45], offset); w[49] = hc_bytealign_be_S (w[43], w[44], offset); w[48] = hc_bytealign_be_S (w[42], w[43], offset); w[47] = hc_bytealign_be_S (w[41], w[42], offset); w[46] = hc_bytealign_be_S (w[40], w[41], offset); w[45] = hc_bytealign_be_S (w[39], w[40], offset); w[44] = hc_bytealign_be_S (w[38], w[39], offset); w[43] = hc_bytealign_be_S (w[37], w[38], offset); w[42] = hc_bytealign_be_S (w[36], w[37], offset); w[41] = hc_bytealign_be_S (w[35], w[36], offset); w[40] = hc_bytealign_be_S (w[34], w[35], offset); w[39] = hc_bytealign_be_S (w[33], w[34], offset); w[38] = hc_bytealign_be_S (w[32], w[33], offset); w[37] = hc_bytealign_be_S (w[31], w[32], offset); w[36] = hc_bytealign_be_S (w[30], w[31], offset); w[35] = hc_bytealign_be_S (w[29], w[30], offset); w[34] = hc_bytealign_be_S (w[28], w[29], offset); w[33] = hc_bytealign_be_S (w[27], w[28], offset); w[32] = hc_bytealign_be_S (w[26], w[27], offset); w[31] = hc_bytealign_be_S (w[25], w[26], offset); w[30] = hc_bytealign_be_S (w[24], w[25], offset); w[29] = hc_bytealign_be_S (w[23], w[24], offset); w[28] = hc_bytealign_be_S (w[22], w[23], offset); w[27] = hc_bytealign_be_S (w[21], w[22], offset); w[26] = hc_bytealign_be_S (w[20], w[21], offset); w[25] = hc_bytealign_be_S (w[19], w[20], offset); w[24] = hc_bytealign_be_S (w[18], w[19], offset); w[23] = hc_bytealign_be_S (w[17], w[18], offset); w[22] = hc_bytealign_be_S (w[16], w[17], offset); w[21] = hc_bytealign_be_S (w[15], w[16], offset); w[20] = hc_bytealign_be_S (w[14], w[15], offset); w[19] = hc_bytealign_be_S (w[13], w[14], offset); w[18] = hc_bytealign_be_S (w[12], w[13], offset); w[17] = hc_bytealign_be_S (w[11], w[12], offset); w[16] = hc_bytealign_be_S (w[10], w[11], offset); w[15] = hc_bytealign_be_S (w[ 9], w[10], offset); w[14] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[13] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[12] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[11] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[10] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[ 9] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[ 8] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[ 7] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[ 6] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[ 5] = hc_bytealign_be_S ( 0, w[ 0], offset); w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 6: w[63] = hc_bytealign_be_S (w[56], w[57], offset); w[62] = hc_bytealign_be_S (w[55], w[56], offset); w[61] = hc_bytealign_be_S (w[54], w[55], offset); w[60] = hc_bytealign_be_S (w[53], w[54], offset); w[59] = hc_bytealign_be_S (w[52], w[53], offset); w[58] = hc_bytealign_be_S (w[51], w[52], offset); w[57] = hc_bytealign_be_S (w[50], w[51], offset); w[56] = hc_bytealign_be_S (w[49], w[50], offset); w[55] = hc_bytealign_be_S (w[48], w[49], offset); w[54] = hc_bytealign_be_S (w[47], w[48], offset); w[53] = hc_bytealign_be_S (w[46], w[47], offset); w[52] = hc_bytealign_be_S (w[45], w[46], offset); w[51] = hc_bytealign_be_S (w[44], w[45], offset); w[50] = hc_bytealign_be_S (w[43], w[44], offset); w[49] = hc_bytealign_be_S (w[42], w[43], offset); w[48] = hc_bytealign_be_S (w[41], w[42], offset); w[47] = hc_bytealign_be_S (w[40], w[41], offset); w[46] = hc_bytealign_be_S (w[39], w[40], offset); w[45] = hc_bytealign_be_S (w[38], w[39], offset); w[44] = hc_bytealign_be_S (w[37], w[38], offset); w[43] = hc_bytealign_be_S (w[36], w[37], offset); w[42] = hc_bytealign_be_S (w[35], w[36], offset); w[41] = hc_bytealign_be_S (w[34], w[35], offset); w[40] = hc_bytealign_be_S (w[33], w[34], offset); w[39] = hc_bytealign_be_S (w[32], w[33], offset); w[38] = hc_bytealign_be_S (w[31], w[32], offset); w[37] = hc_bytealign_be_S (w[30], w[31], offset); w[36] = hc_bytealign_be_S (w[29], w[30], offset); w[35] = hc_bytealign_be_S (w[28], w[29], offset); w[34] = hc_bytealign_be_S (w[27], w[28], offset); w[33] = hc_bytealign_be_S (w[26], w[27], offset); w[32] = hc_bytealign_be_S (w[25], w[26], offset); w[31] = hc_bytealign_be_S (w[24], w[25], offset); w[30] = hc_bytealign_be_S (w[23], w[24], offset); w[29] = hc_bytealign_be_S (w[22], w[23], offset); w[28] = hc_bytealign_be_S (w[21], w[22], offset); w[27] = hc_bytealign_be_S (w[20], w[21], offset); w[26] = hc_bytealign_be_S (w[19], w[20], offset); w[25] = hc_bytealign_be_S (w[18], w[19], offset); w[24] = hc_bytealign_be_S (w[17], w[18], offset); w[23] = hc_bytealign_be_S (w[16], w[17], offset); w[22] = hc_bytealign_be_S (w[15], w[16], offset); w[21] = hc_bytealign_be_S (w[14], w[15], offset); w[20] = hc_bytealign_be_S (w[13], w[14], offset); w[19] = hc_bytealign_be_S (w[12], w[13], offset); w[18] = hc_bytealign_be_S (w[11], w[12], offset); w[17] = hc_bytealign_be_S (w[10], w[11], offset); w[16] = hc_bytealign_be_S (w[ 9], w[10], offset); w[15] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[14] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[13] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[12] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[11] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[10] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[ 9] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[ 8] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[ 7] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[ 6] = hc_bytealign_be_S ( 0, w[ 0], offset); w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 7: w[63] = hc_bytealign_be_S (w[55], w[56], offset); w[62] = hc_bytealign_be_S (w[54], w[55], offset); w[61] = hc_bytealign_be_S (w[53], w[54], offset); w[60] = hc_bytealign_be_S (w[52], w[53], offset); w[59] = hc_bytealign_be_S (w[51], w[52], offset); w[58] = hc_bytealign_be_S (w[50], w[51], offset); w[57] = hc_bytealign_be_S (w[49], w[50], offset); w[56] = hc_bytealign_be_S (w[48], w[49], offset); w[55] = hc_bytealign_be_S (w[47], w[48], offset); w[54] = hc_bytealign_be_S (w[46], w[47], offset); w[53] = hc_bytealign_be_S (w[45], w[46], offset); w[52] = hc_bytealign_be_S (w[44], w[45], offset); w[51] = hc_bytealign_be_S (w[43], w[44], offset); w[50] = hc_bytealign_be_S (w[42], w[43], offset); w[49] = hc_bytealign_be_S (w[41], w[42], offset); w[48] = hc_bytealign_be_S (w[40], w[41], offset); w[47] = hc_bytealign_be_S (w[39], w[40], offset); w[46] = hc_bytealign_be_S (w[38], w[39], offset); w[45] = hc_bytealign_be_S (w[37], w[38], offset); w[44] = hc_bytealign_be_S (w[36], w[37], offset); w[43] = hc_bytealign_be_S (w[35], w[36], offset); w[42] = hc_bytealign_be_S (w[34], w[35], offset); w[41] = hc_bytealign_be_S (w[33], w[34], offset); w[40] = hc_bytealign_be_S (w[32], w[33], offset); w[39] = hc_bytealign_be_S (w[31], w[32], offset); w[38] = hc_bytealign_be_S (w[30], w[31], offset); w[37] = hc_bytealign_be_S (w[29], w[30], offset); w[36] = hc_bytealign_be_S (w[28], w[29], offset); w[35] = hc_bytealign_be_S (w[27], w[28], offset); w[34] = hc_bytealign_be_S (w[26], w[27], offset); w[33] = hc_bytealign_be_S (w[25], w[26], offset); w[32] = hc_bytealign_be_S (w[24], w[25], offset); w[31] = hc_bytealign_be_S (w[23], w[24], offset); w[30] = hc_bytealign_be_S (w[22], w[23], offset); w[29] = hc_bytealign_be_S (w[21], w[22], offset); w[28] = hc_bytealign_be_S (w[20], w[21], offset); w[27] = hc_bytealign_be_S (w[19], w[20], offset); w[26] = hc_bytealign_be_S (w[18], w[19], offset); w[25] = hc_bytealign_be_S (w[17], w[18], offset); w[24] = hc_bytealign_be_S (w[16], w[17], offset); w[23] = hc_bytealign_be_S (w[15], w[16], offset); w[22] = hc_bytealign_be_S (w[14], w[15], offset); w[21] = hc_bytealign_be_S (w[13], w[14], offset); w[20] = hc_bytealign_be_S (w[12], w[13], offset); w[19] = hc_bytealign_be_S (w[11], w[12], offset); w[18] = hc_bytealign_be_S (w[10], w[11], offset); w[17] = hc_bytealign_be_S (w[ 9], w[10], offset); w[16] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[15] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[14] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[13] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[12] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[11] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[10] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[ 9] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[ 8] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[ 7] = hc_bytealign_be_S ( 0, w[ 0], offset); w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 8: w[63] = hc_bytealign_be_S (w[54], w[55], offset); w[62] = hc_bytealign_be_S (w[53], w[54], offset); w[61] = hc_bytealign_be_S (w[52], w[53], offset); w[60] = hc_bytealign_be_S (w[51], w[52], offset); w[59] = hc_bytealign_be_S (w[50], w[51], offset); w[58] = hc_bytealign_be_S (w[49], w[50], offset); w[57] = hc_bytealign_be_S (w[48], w[49], offset); w[56] = hc_bytealign_be_S (w[47], w[48], offset); w[55] = hc_bytealign_be_S (w[46], w[47], offset); w[54] = hc_bytealign_be_S (w[45], w[46], offset); w[53] = hc_bytealign_be_S (w[44], w[45], offset); w[52] = hc_bytealign_be_S (w[43], w[44], offset); w[51] = hc_bytealign_be_S (w[42], w[43], offset); w[50] = hc_bytealign_be_S (w[41], w[42], offset); w[49] = hc_bytealign_be_S (w[40], w[41], offset); w[48] = hc_bytealign_be_S (w[39], w[40], offset); w[47] = hc_bytealign_be_S (w[38], w[39], offset); w[46] = hc_bytealign_be_S (w[37], w[38], offset); w[45] = hc_bytealign_be_S (w[36], w[37], offset); w[44] = hc_bytealign_be_S (w[35], w[36], offset); w[43] = hc_bytealign_be_S (w[34], w[35], offset); w[42] = hc_bytealign_be_S (w[33], w[34], offset); w[41] = hc_bytealign_be_S (w[32], w[33], offset); w[40] = hc_bytealign_be_S (w[31], w[32], offset); w[39] = hc_bytealign_be_S (w[30], w[31], offset); w[38] = hc_bytealign_be_S (w[29], w[30], offset); w[37] = hc_bytealign_be_S (w[28], w[29], offset); w[36] = hc_bytealign_be_S (w[27], w[28], offset); w[35] = hc_bytealign_be_S (w[26], w[27], offset); w[34] = hc_bytealign_be_S (w[25], w[26], offset); w[33] = hc_bytealign_be_S (w[24], w[25], offset); w[32] = hc_bytealign_be_S (w[23], w[24], offset); w[31] = hc_bytealign_be_S (w[22], w[23], offset); w[30] = hc_bytealign_be_S (w[21], w[22], offset); w[29] = hc_bytealign_be_S (w[20], w[21], offset); w[28] = hc_bytealign_be_S (w[19], w[20], offset); w[27] = hc_bytealign_be_S (w[18], w[19], offset); w[26] = hc_bytealign_be_S (w[17], w[18], offset); w[25] = hc_bytealign_be_S (w[16], w[17], offset); w[24] = hc_bytealign_be_S (w[15], w[16], offset); w[23] = hc_bytealign_be_S (w[14], w[15], offset); w[22] = hc_bytealign_be_S (w[13], w[14], offset); w[21] = hc_bytealign_be_S (w[12], w[13], offset); w[20] = hc_bytealign_be_S (w[11], w[12], offset); w[19] = hc_bytealign_be_S (w[10], w[11], offset); w[18] = hc_bytealign_be_S (w[ 9], w[10], offset); w[17] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[16] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[15] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[14] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[13] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[12] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[11] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[10] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[ 9] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[ 8] = hc_bytealign_be_S ( 0, w[ 0], offset); w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 9: w[63] = hc_bytealign_be_S (w[53], w[54], offset); w[62] = hc_bytealign_be_S (w[52], w[53], offset); w[61] = hc_bytealign_be_S (w[51], w[52], offset); w[60] = hc_bytealign_be_S (w[50], w[51], offset); w[59] = hc_bytealign_be_S (w[49], w[50], offset); w[58] = hc_bytealign_be_S (w[48], w[49], offset); w[57] = hc_bytealign_be_S (w[47], w[48], offset); w[56] = hc_bytealign_be_S (w[46], w[47], offset); w[55] = hc_bytealign_be_S (w[45], w[46], offset); w[54] = hc_bytealign_be_S (w[44], w[45], offset); w[53] = hc_bytealign_be_S (w[43], w[44], offset); w[52] = hc_bytealign_be_S (w[42], w[43], offset); w[51] = hc_bytealign_be_S (w[41], w[42], offset); w[50] = hc_bytealign_be_S (w[40], w[41], offset); w[49] = hc_bytealign_be_S (w[39], w[40], offset); w[48] = hc_bytealign_be_S (w[38], w[39], offset); w[47] = hc_bytealign_be_S (w[37], w[38], offset); w[46] = hc_bytealign_be_S (w[36], w[37], offset); w[45] = hc_bytealign_be_S (w[35], w[36], offset); w[44] = hc_bytealign_be_S (w[34], w[35], offset); w[43] = hc_bytealign_be_S (w[33], w[34], offset); w[42] = hc_bytealign_be_S (w[32], w[33], offset); w[41] = hc_bytealign_be_S (w[31], w[32], offset); w[40] = hc_bytealign_be_S (w[30], w[31], offset); w[39] = hc_bytealign_be_S (w[29], w[30], offset); w[38] = hc_bytealign_be_S (w[28], w[29], offset); w[37] = hc_bytealign_be_S (w[27], w[28], offset); w[36] = hc_bytealign_be_S (w[26], w[27], offset); w[35] = hc_bytealign_be_S (w[25], w[26], offset); w[34] = hc_bytealign_be_S (w[24], w[25], offset); w[33] = hc_bytealign_be_S (w[23], w[24], offset); w[32] = hc_bytealign_be_S (w[22], w[23], offset); w[31] = hc_bytealign_be_S (w[21], w[22], offset); w[30] = hc_bytealign_be_S (w[20], w[21], offset); w[29] = hc_bytealign_be_S (w[19], w[20], offset); w[28] = hc_bytealign_be_S (w[18], w[19], offset); w[27] = hc_bytealign_be_S (w[17], w[18], offset); w[26] = hc_bytealign_be_S (w[16], w[17], offset); w[25] = hc_bytealign_be_S (w[15], w[16], offset); w[24] = hc_bytealign_be_S (w[14], w[15], offset); w[23] = hc_bytealign_be_S (w[13], w[14], offset); w[22] = hc_bytealign_be_S (w[12], w[13], offset); w[21] = hc_bytealign_be_S (w[11], w[12], offset); w[20] = hc_bytealign_be_S (w[10], w[11], offset); w[19] = hc_bytealign_be_S (w[ 9], w[10], offset); w[18] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[17] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[16] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[15] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[14] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[13] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[12] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[11] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[10] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[ 9] = hc_bytealign_be_S ( 0, w[ 0], offset); w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 10: w[63] = hc_bytealign_be_S (w[52], w[53], offset); w[62] = hc_bytealign_be_S (w[51], w[52], offset); w[61] = hc_bytealign_be_S (w[50], w[51], offset); w[60] = hc_bytealign_be_S (w[49], w[50], offset); w[59] = hc_bytealign_be_S (w[48], w[49], offset); w[58] = hc_bytealign_be_S (w[47], w[48], offset); w[57] = hc_bytealign_be_S (w[46], w[47], offset); w[56] = hc_bytealign_be_S (w[45], w[46], offset); w[55] = hc_bytealign_be_S (w[44], w[45], offset); w[54] = hc_bytealign_be_S (w[43], w[44], offset); w[53] = hc_bytealign_be_S (w[42], w[43], offset); w[52] = hc_bytealign_be_S (w[41], w[42], offset); w[51] = hc_bytealign_be_S (w[40], w[41], offset); w[50] = hc_bytealign_be_S (w[39], w[40], offset); w[49] = hc_bytealign_be_S (w[38], w[39], offset); w[48] = hc_bytealign_be_S (w[37], w[38], offset); w[47] = hc_bytealign_be_S (w[36], w[37], offset); w[46] = hc_bytealign_be_S (w[35], w[36], offset); w[45] = hc_bytealign_be_S (w[34], w[35], offset); w[44] = hc_bytealign_be_S (w[33], w[34], offset); w[43] = hc_bytealign_be_S (w[32], w[33], offset); w[42] = hc_bytealign_be_S (w[31], w[32], offset); w[41] = hc_bytealign_be_S (w[30], w[31], offset); w[40] = hc_bytealign_be_S (w[29], w[30], offset); w[39] = hc_bytealign_be_S (w[28], w[29], offset); w[38] = hc_bytealign_be_S (w[27], w[28], offset); w[37] = hc_bytealign_be_S (w[26], w[27], offset); w[36] = hc_bytealign_be_S (w[25], w[26], offset); w[35] = hc_bytealign_be_S (w[24], w[25], offset); w[34] = hc_bytealign_be_S (w[23], w[24], offset); w[33] = hc_bytealign_be_S (w[22], w[23], offset); w[32] = hc_bytealign_be_S (w[21], w[22], offset); w[31] = hc_bytealign_be_S (w[20], w[21], offset); w[30] = hc_bytealign_be_S (w[19], w[20], offset); w[29] = hc_bytealign_be_S (w[18], w[19], offset); w[28] = hc_bytealign_be_S (w[17], w[18], offset); w[27] = hc_bytealign_be_S (w[16], w[17], offset); w[26] = hc_bytealign_be_S (w[15], w[16], offset); w[25] = hc_bytealign_be_S (w[14], w[15], offset); w[24] = hc_bytealign_be_S (w[13], w[14], offset); w[23] = hc_bytealign_be_S (w[12], w[13], offset); w[22] = hc_bytealign_be_S (w[11], w[12], offset); w[21] = hc_bytealign_be_S (w[10], w[11], offset); w[20] = hc_bytealign_be_S (w[ 9], w[10], offset); w[19] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[18] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[17] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[16] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[15] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[14] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[13] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[12] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[11] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[10] = hc_bytealign_be_S ( 0, w[ 0], offset); w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 11: w[63] = hc_bytealign_be_S (w[51], w[52], offset); w[62] = hc_bytealign_be_S (w[50], w[51], offset); w[61] = hc_bytealign_be_S (w[49], w[50], offset); w[60] = hc_bytealign_be_S (w[48], w[49], offset); w[59] = hc_bytealign_be_S (w[47], w[48], offset); w[58] = hc_bytealign_be_S (w[46], w[47], offset); w[57] = hc_bytealign_be_S (w[45], w[46], offset); w[56] = hc_bytealign_be_S (w[44], w[45], offset); w[55] = hc_bytealign_be_S (w[43], w[44], offset); w[54] = hc_bytealign_be_S (w[42], w[43], offset); w[53] = hc_bytealign_be_S (w[41], w[42], offset); w[52] = hc_bytealign_be_S (w[40], w[41], offset); w[51] = hc_bytealign_be_S (w[39], w[40], offset); w[50] = hc_bytealign_be_S (w[38], w[39], offset); w[49] = hc_bytealign_be_S (w[37], w[38], offset); w[48] = hc_bytealign_be_S (w[36], w[37], offset); w[47] = hc_bytealign_be_S (w[35], w[36], offset); w[46] = hc_bytealign_be_S (w[34], w[35], offset); w[45] = hc_bytealign_be_S (w[33], w[34], offset); w[44] = hc_bytealign_be_S (w[32], w[33], offset); w[43] = hc_bytealign_be_S (w[31], w[32], offset); w[42] = hc_bytealign_be_S (w[30], w[31], offset); w[41] = hc_bytealign_be_S (w[29], w[30], offset); w[40] = hc_bytealign_be_S (w[28], w[29], offset); w[39] = hc_bytealign_be_S (w[27], w[28], offset); w[38] = hc_bytealign_be_S (w[26], w[27], offset); w[37] = hc_bytealign_be_S (w[25], w[26], offset); w[36] = hc_bytealign_be_S (w[24], w[25], offset); w[35] = hc_bytealign_be_S (w[23], w[24], offset); w[34] = hc_bytealign_be_S (w[22], w[23], offset); w[33] = hc_bytealign_be_S (w[21], w[22], offset); w[32] = hc_bytealign_be_S (w[20], w[21], offset); w[31] = hc_bytealign_be_S (w[19], w[20], offset); w[30] = hc_bytealign_be_S (w[18], w[19], offset); w[29] = hc_bytealign_be_S (w[17], w[18], offset); w[28] = hc_bytealign_be_S (w[16], w[17], offset); w[27] = hc_bytealign_be_S (w[15], w[16], offset); w[26] = hc_bytealign_be_S (w[14], w[15], offset); w[25] = hc_bytealign_be_S (w[13], w[14], offset); w[24] = hc_bytealign_be_S (w[12], w[13], offset); w[23] = hc_bytealign_be_S (w[11], w[12], offset); w[22] = hc_bytealign_be_S (w[10], w[11], offset); w[21] = hc_bytealign_be_S (w[ 9], w[10], offset); w[20] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[19] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[18] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[17] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[16] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[15] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[14] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[13] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[12] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[11] = hc_bytealign_be_S ( 0, w[ 0], offset); w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 12: w[63] = hc_bytealign_be_S (w[50], w[51], offset); w[62] = hc_bytealign_be_S (w[49], w[50], offset); w[61] = hc_bytealign_be_S (w[48], w[49], offset); w[60] = hc_bytealign_be_S (w[47], w[48], offset); w[59] = hc_bytealign_be_S (w[46], w[47], offset); w[58] = hc_bytealign_be_S (w[45], w[46], offset); w[57] = hc_bytealign_be_S (w[44], w[45], offset); w[56] = hc_bytealign_be_S (w[43], w[44], offset); w[55] = hc_bytealign_be_S (w[42], w[43], offset); w[54] = hc_bytealign_be_S (w[41], w[42], offset); w[53] = hc_bytealign_be_S (w[40], w[41], offset); w[52] = hc_bytealign_be_S (w[39], w[40], offset); w[51] = hc_bytealign_be_S (w[38], w[39], offset); w[50] = hc_bytealign_be_S (w[37], w[38], offset); w[49] = hc_bytealign_be_S (w[36], w[37], offset); w[48] = hc_bytealign_be_S (w[35], w[36], offset); w[47] = hc_bytealign_be_S (w[34], w[35], offset); w[46] = hc_bytealign_be_S (w[33], w[34], offset); w[45] = hc_bytealign_be_S (w[32], w[33], offset); w[44] = hc_bytealign_be_S (w[31], w[32], offset); w[43] = hc_bytealign_be_S (w[30], w[31], offset); w[42] = hc_bytealign_be_S (w[29], w[30], offset); w[41] = hc_bytealign_be_S (w[28], w[29], offset); w[40] = hc_bytealign_be_S (w[27], w[28], offset); w[39] = hc_bytealign_be_S (w[26], w[27], offset); w[38] = hc_bytealign_be_S (w[25], w[26], offset); w[37] = hc_bytealign_be_S (w[24], w[25], offset); w[36] = hc_bytealign_be_S (w[23], w[24], offset); w[35] = hc_bytealign_be_S (w[22], w[23], offset); w[34] = hc_bytealign_be_S (w[21], w[22], offset); w[33] = hc_bytealign_be_S (w[20], w[21], offset); w[32] = hc_bytealign_be_S (w[19], w[20], offset); w[31] = hc_bytealign_be_S (w[18], w[19], offset); w[30] = hc_bytealign_be_S (w[17], w[18], offset); w[29] = hc_bytealign_be_S (w[16], w[17], offset); w[28] = hc_bytealign_be_S (w[15], w[16], offset); w[27] = hc_bytealign_be_S (w[14], w[15], offset); w[26] = hc_bytealign_be_S (w[13], w[14], offset); w[25] = hc_bytealign_be_S (w[12], w[13], offset); w[24] = hc_bytealign_be_S (w[11], w[12], offset); w[23] = hc_bytealign_be_S (w[10], w[11], offset); w[22] = hc_bytealign_be_S (w[ 9], w[10], offset); w[21] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[20] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[19] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[18] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[17] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[16] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[15] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[14] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[13] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[12] = hc_bytealign_be_S ( 0, w[ 0], offset); w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 13: w[63] = hc_bytealign_be_S (w[49], w[50], offset); w[62] = hc_bytealign_be_S (w[48], w[49], offset); w[61] = hc_bytealign_be_S (w[47], w[48], offset); w[60] = hc_bytealign_be_S (w[46], w[47], offset); w[59] = hc_bytealign_be_S (w[45], w[46], offset); w[58] = hc_bytealign_be_S (w[44], w[45], offset); w[57] = hc_bytealign_be_S (w[43], w[44], offset); w[56] = hc_bytealign_be_S (w[42], w[43], offset); w[55] = hc_bytealign_be_S (w[41], w[42], offset); w[54] = hc_bytealign_be_S (w[40], w[41], offset); w[53] = hc_bytealign_be_S (w[39], w[40], offset); w[52] = hc_bytealign_be_S (w[38], w[39], offset); w[51] = hc_bytealign_be_S (w[37], w[38], offset); w[50] = hc_bytealign_be_S (w[36], w[37], offset); w[49] = hc_bytealign_be_S (w[35], w[36], offset); w[48] = hc_bytealign_be_S (w[34], w[35], offset); w[47] = hc_bytealign_be_S (w[33], w[34], offset); w[46] = hc_bytealign_be_S (w[32], w[33], offset); w[45] = hc_bytealign_be_S (w[31], w[32], offset); w[44] = hc_bytealign_be_S (w[30], w[31], offset); w[43] = hc_bytealign_be_S (w[29], w[30], offset); w[42] = hc_bytealign_be_S (w[28], w[29], offset); w[41] = hc_bytealign_be_S (w[27], w[28], offset); w[40] = hc_bytealign_be_S (w[26], w[27], offset); w[39] = hc_bytealign_be_S (w[25], w[26], offset); w[38] = hc_bytealign_be_S (w[24], w[25], offset); w[37] = hc_bytealign_be_S (w[23], w[24], offset); w[36] = hc_bytealign_be_S (w[22], w[23], offset); w[35] = hc_bytealign_be_S (w[21], w[22], offset); w[34] = hc_bytealign_be_S (w[20], w[21], offset); w[33] = hc_bytealign_be_S (w[19], w[20], offset); w[32] = hc_bytealign_be_S (w[18], w[19], offset); w[31] = hc_bytealign_be_S (w[17], w[18], offset); w[30] = hc_bytealign_be_S (w[16], w[17], offset); w[29] = hc_bytealign_be_S (w[15], w[16], offset); w[28] = hc_bytealign_be_S (w[14], w[15], offset); w[27] = hc_bytealign_be_S (w[13], w[14], offset); w[26] = hc_bytealign_be_S (w[12], w[13], offset); w[25] = hc_bytealign_be_S (w[11], w[12], offset); w[24] = hc_bytealign_be_S (w[10], w[11], offset); w[23] = hc_bytealign_be_S (w[ 9], w[10], offset); w[22] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[21] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[20] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[19] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[18] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[17] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[16] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[15] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[14] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[13] = hc_bytealign_be_S ( 0, w[ 0], offset); w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 14: w[63] = hc_bytealign_be_S (w[48], w[49], offset); w[62] = hc_bytealign_be_S (w[47], w[48], offset); w[61] = hc_bytealign_be_S (w[46], w[47], offset); w[60] = hc_bytealign_be_S (w[45], w[46], offset); w[59] = hc_bytealign_be_S (w[44], w[45], offset); w[58] = hc_bytealign_be_S (w[43], w[44], offset); w[57] = hc_bytealign_be_S (w[42], w[43], offset); w[56] = hc_bytealign_be_S (w[41], w[42], offset); w[55] = hc_bytealign_be_S (w[40], w[41], offset); w[54] = hc_bytealign_be_S (w[39], w[40], offset); w[53] = hc_bytealign_be_S (w[38], w[39], offset); w[52] = hc_bytealign_be_S (w[37], w[38], offset); w[51] = hc_bytealign_be_S (w[36], w[37], offset); w[50] = hc_bytealign_be_S (w[35], w[36], offset); w[49] = hc_bytealign_be_S (w[34], w[35], offset); w[48] = hc_bytealign_be_S (w[33], w[34], offset); w[47] = hc_bytealign_be_S (w[32], w[33], offset); w[46] = hc_bytealign_be_S (w[31], w[32], offset); w[45] = hc_bytealign_be_S (w[30], w[31], offset); w[44] = hc_bytealign_be_S (w[29], w[30], offset); w[43] = hc_bytealign_be_S (w[28], w[29], offset); w[42] = hc_bytealign_be_S (w[27], w[28], offset); w[41] = hc_bytealign_be_S (w[26], w[27], offset); w[40] = hc_bytealign_be_S (w[25], w[26], offset); w[39] = hc_bytealign_be_S (w[24], w[25], offset); w[38] = hc_bytealign_be_S (w[23], w[24], offset); w[37] = hc_bytealign_be_S (w[22], w[23], offset); w[36] = hc_bytealign_be_S (w[21], w[22], offset); w[35] = hc_bytealign_be_S (w[20], w[21], offset); w[34] = hc_bytealign_be_S (w[19], w[20], offset); w[33] = hc_bytealign_be_S (w[18], w[19], offset); w[32] = hc_bytealign_be_S (w[17], w[18], offset); w[31] = hc_bytealign_be_S (w[16], w[17], offset); w[30] = hc_bytealign_be_S (w[15], w[16], offset); w[29] = hc_bytealign_be_S (w[14], w[15], offset); w[28] = hc_bytealign_be_S (w[13], w[14], offset); w[27] = hc_bytealign_be_S (w[12], w[13], offset); w[26] = hc_bytealign_be_S (w[11], w[12], offset); w[25] = hc_bytealign_be_S (w[10], w[11], offset); w[24] = hc_bytealign_be_S (w[ 9], w[10], offset); w[23] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[22] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[21] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[20] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[19] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[18] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[17] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[16] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[15] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[14] = hc_bytealign_be_S ( 0, w[ 0], offset); w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 15: w[63] = hc_bytealign_be_S (w[47], w[48], offset); w[62] = hc_bytealign_be_S (w[46], w[47], offset); w[61] = hc_bytealign_be_S (w[45], w[46], offset); w[60] = hc_bytealign_be_S (w[44], w[45], offset); w[59] = hc_bytealign_be_S (w[43], w[44], offset); w[58] = hc_bytealign_be_S (w[42], w[43], offset); w[57] = hc_bytealign_be_S (w[41], w[42], offset); w[56] = hc_bytealign_be_S (w[40], w[41], offset); w[55] = hc_bytealign_be_S (w[39], w[40], offset); w[54] = hc_bytealign_be_S (w[38], w[39], offset); w[53] = hc_bytealign_be_S (w[37], w[38], offset); w[52] = hc_bytealign_be_S (w[36], w[37], offset); w[51] = hc_bytealign_be_S (w[35], w[36], offset); w[50] = hc_bytealign_be_S (w[34], w[35], offset); w[49] = hc_bytealign_be_S (w[33], w[34], offset); w[48] = hc_bytealign_be_S (w[32], w[33], offset); w[47] = hc_bytealign_be_S (w[31], w[32], offset); w[46] = hc_bytealign_be_S (w[30], w[31], offset); w[45] = hc_bytealign_be_S (w[29], w[30], offset); w[44] = hc_bytealign_be_S (w[28], w[29], offset); w[43] = hc_bytealign_be_S (w[27], w[28], offset); w[42] = hc_bytealign_be_S (w[26], w[27], offset); w[41] = hc_bytealign_be_S (w[25], w[26], offset); w[40] = hc_bytealign_be_S (w[24], w[25], offset); w[39] = hc_bytealign_be_S (w[23], w[24], offset); w[38] = hc_bytealign_be_S (w[22], w[23], offset); w[37] = hc_bytealign_be_S (w[21], w[22], offset); w[36] = hc_bytealign_be_S (w[20], w[21], offset); w[35] = hc_bytealign_be_S (w[19], w[20], offset); w[34] = hc_bytealign_be_S (w[18], w[19], offset); w[33] = hc_bytealign_be_S (w[17], w[18], offset); w[32] = hc_bytealign_be_S (w[16], w[17], offset); w[31] = hc_bytealign_be_S (w[15], w[16], offset); w[30] = hc_bytealign_be_S (w[14], w[15], offset); w[29] = hc_bytealign_be_S (w[13], w[14], offset); w[28] = hc_bytealign_be_S (w[12], w[13], offset); w[27] = hc_bytealign_be_S (w[11], w[12], offset); w[26] = hc_bytealign_be_S (w[10], w[11], offset); w[25] = hc_bytealign_be_S (w[ 9], w[10], offset); w[24] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[23] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[22] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[21] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[20] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[19] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[18] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[17] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[16] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[15] = hc_bytealign_be_S ( 0, w[ 0], offset); w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 16: w[63] = hc_bytealign_be_S (w[46], w[47], offset); w[62] = hc_bytealign_be_S (w[45], w[46], offset); w[61] = hc_bytealign_be_S (w[44], w[45], offset); w[60] = hc_bytealign_be_S (w[43], w[44], offset); w[59] = hc_bytealign_be_S (w[42], w[43], offset); w[58] = hc_bytealign_be_S (w[41], w[42], offset); w[57] = hc_bytealign_be_S (w[40], w[41], offset); w[56] = hc_bytealign_be_S (w[39], w[40], offset); w[55] = hc_bytealign_be_S (w[38], w[39], offset); w[54] = hc_bytealign_be_S (w[37], w[38], offset); w[53] = hc_bytealign_be_S (w[36], w[37], offset); w[52] = hc_bytealign_be_S (w[35], w[36], offset); w[51] = hc_bytealign_be_S (w[34], w[35], offset); w[50] = hc_bytealign_be_S (w[33], w[34], offset); w[49] = hc_bytealign_be_S (w[32], w[33], offset); w[48] = hc_bytealign_be_S (w[31], w[32], offset); w[47] = hc_bytealign_be_S (w[30], w[31], offset); w[46] = hc_bytealign_be_S (w[29], w[30], offset); w[45] = hc_bytealign_be_S (w[28], w[29], offset); w[44] = hc_bytealign_be_S (w[27], w[28], offset); w[43] = hc_bytealign_be_S (w[26], w[27], offset); w[42] = hc_bytealign_be_S (w[25], w[26], offset); w[41] = hc_bytealign_be_S (w[24], w[25], offset); w[40] = hc_bytealign_be_S (w[23], w[24], offset); w[39] = hc_bytealign_be_S (w[22], w[23], offset); w[38] = hc_bytealign_be_S (w[21], w[22], offset); w[37] = hc_bytealign_be_S (w[20], w[21], offset); w[36] = hc_bytealign_be_S (w[19], w[20], offset); w[35] = hc_bytealign_be_S (w[18], w[19], offset); w[34] = hc_bytealign_be_S (w[17], w[18], offset); w[33] = hc_bytealign_be_S (w[16], w[17], offset); w[32] = hc_bytealign_be_S (w[15], w[16], offset); w[31] = hc_bytealign_be_S (w[14], w[15], offset); w[30] = hc_bytealign_be_S (w[13], w[14], offset); w[29] = hc_bytealign_be_S (w[12], w[13], offset); w[28] = hc_bytealign_be_S (w[11], w[12], offset); w[27] = hc_bytealign_be_S (w[10], w[11], offset); w[26] = hc_bytealign_be_S (w[ 9], w[10], offset); w[25] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[24] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[23] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[22] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[21] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[20] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[19] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[18] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[17] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[16] = hc_bytealign_be_S ( 0, w[ 0], offset); w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 17: w[63] = hc_bytealign_be_S (w[45], w[46], offset); w[62] = hc_bytealign_be_S (w[44], w[45], offset); w[61] = hc_bytealign_be_S (w[43], w[44], offset); w[60] = hc_bytealign_be_S (w[42], w[43], offset); w[59] = hc_bytealign_be_S (w[41], w[42], offset); w[58] = hc_bytealign_be_S (w[40], w[41], offset); w[57] = hc_bytealign_be_S (w[39], w[40], offset); w[56] = hc_bytealign_be_S (w[38], w[39], offset); w[55] = hc_bytealign_be_S (w[37], w[38], offset); w[54] = hc_bytealign_be_S (w[36], w[37], offset); w[53] = hc_bytealign_be_S (w[35], w[36], offset); w[52] = hc_bytealign_be_S (w[34], w[35], offset); w[51] = hc_bytealign_be_S (w[33], w[34], offset); w[50] = hc_bytealign_be_S (w[32], w[33], offset); w[49] = hc_bytealign_be_S (w[31], w[32], offset); w[48] = hc_bytealign_be_S (w[30], w[31], offset); w[47] = hc_bytealign_be_S (w[29], w[30], offset); w[46] = hc_bytealign_be_S (w[28], w[29], offset); w[45] = hc_bytealign_be_S (w[27], w[28], offset); w[44] = hc_bytealign_be_S (w[26], w[27], offset); w[43] = hc_bytealign_be_S (w[25], w[26], offset); w[42] = hc_bytealign_be_S (w[24], w[25], offset); w[41] = hc_bytealign_be_S (w[23], w[24], offset); w[40] = hc_bytealign_be_S (w[22], w[23], offset); w[39] = hc_bytealign_be_S (w[21], w[22], offset); w[38] = hc_bytealign_be_S (w[20], w[21], offset); w[37] = hc_bytealign_be_S (w[19], w[20], offset); w[36] = hc_bytealign_be_S (w[18], w[19], offset); w[35] = hc_bytealign_be_S (w[17], w[18], offset); w[34] = hc_bytealign_be_S (w[16], w[17], offset); w[33] = hc_bytealign_be_S (w[15], w[16], offset); w[32] = hc_bytealign_be_S (w[14], w[15], offset); w[31] = hc_bytealign_be_S (w[13], w[14], offset); w[30] = hc_bytealign_be_S (w[12], w[13], offset); w[29] = hc_bytealign_be_S (w[11], w[12], offset); w[28] = hc_bytealign_be_S (w[10], w[11], offset); w[27] = hc_bytealign_be_S (w[ 9], w[10], offset); w[26] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[25] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[24] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[23] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[22] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[21] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[20] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[19] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[18] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[17] = hc_bytealign_be_S ( 0, w[ 0], offset); w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 18: w[63] = hc_bytealign_be_S (w[44], w[45], offset); w[62] = hc_bytealign_be_S (w[43], w[44], offset); w[61] = hc_bytealign_be_S (w[42], w[43], offset); w[60] = hc_bytealign_be_S (w[41], w[42], offset); w[59] = hc_bytealign_be_S (w[40], w[41], offset); w[58] = hc_bytealign_be_S (w[39], w[40], offset); w[57] = hc_bytealign_be_S (w[38], w[39], offset); w[56] = hc_bytealign_be_S (w[37], w[38], offset); w[55] = hc_bytealign_be_S (w[36], w[37], offset); w[54] = hc_bytealign_be_S (w[35], w[36], offset); w[53] = hc_bytealign_be_S (w[34], w[35], offset); w[52] = hc_bytealign_be_S (w[33], w[34], offset); w[51] = hc_bytealign_be_S (w[32], w[33], offset); w[50] = hc_bytealign_be_S (w[31], w[32], offset); w[49] = hc_bytealign_be_S (w[30], w[31], offset); w[48] = hc_bytealign_be_S (w[29], w[30], offset); w[47] = hc_bytealign_be_S (w[28], w[29], offset); w[46] = hc_bytealign_be_S (w[27], w[28], offset); w[45] = hc_bytealign_be_S (w[26], w[27], offset); w[44] = hc_bytealign_be_S (w[25], w[26], offset); w[43] = hc_bytealign_be_S (w[24], w[25], offset); w[42] = hc_bytealign_be_S (w[23], w[24], offset); w[41] = hc_bytealign_be_S (w[22], w[23], offset); w[40] = hc_bytealign_be_S (w[21], w[22], offset); w[39] = hc_bytealign_be_S (w[20], w[21], offset); w[38] = hc_bytealign_be_S (w[19], w[20], offset); w[37] = hc_bytealign_be_S (w[18], w[19], offset); w[36] = hc_bytealign_be_S (w[17], w[18], offset); w[35] = hc_bytealign_be_S (w[16], w[17], offset); w[34] = hc_bytealign_be_S (w[15], w[16], offset); w[33] = hc_bytealign_be_S (w[14], w[15], offset); w[32] = hc_bytealign_be_S (w[13], w[14], offset); w[31] = hc_bytealign_be_S (w[12], w[13], offset); w[30] = hc_bytealign_be_S (w[11], w[12], offset); w[29] = hc_bytealign_be_S (w[10], w[11], offset); w[28] = hc_bytealign_be_S (w[ 9], w[10], offset); w[27] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[26] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[25] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[24] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[23] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[22] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[21] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[20] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[19] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[18] = hc_bytealign_be_S ( 0, w[ 0], offset); w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 19: w[63] = hc_bytealign_be_S (w[43], w[44], offset); w[62] = hc_bytealign_be_S (w[42], w[43], offset); w[61] = hc_bytealign_be_S (w[41], w[42], offset); w[60] = hc_bytealign_be_S (w[40], w[41], offset); w[59] = hc_bytealign_be_S (w[39], w[40], offset); w[58] = hc_bytealign_be_S (w[38], w[39], offset); w[57] = hc_bytealign_be_S (w[37], w[38], offset); w[56] = hc_bytealign_be_S (w[36], w[37], offset); w[55] = hc_bytealign_be_S (w[35], w[36], offset); w[54] = hc_bytealign_be_S (w[34], w[35], offset); w[53] = hc_bytealign_be_S (w[33], w[34], offset); w[52] = hc_bytealign_be_S (w[32], w[33], offset); w[51] = hc_bytealign_be_S (w[31], w[32], offset); w[50] = hc_bytealign_be_S (w[30], w[31], offset); w[49] = hc_bytealign_be_S (w[29], w[30], offset); w[48] = hc_bytealign_be_S (w[28], w[29], offset); w[47] = hc_bytealign_be_S (w[27], w[28], offset); w[46] = hc_bytealign_be_S (w[26], w[27], offset); w[45] = hc_bytealign_be_S (w[25], w[26], offset); w[44] = hc_bytealign_be_S (w[24], w[25], offset); w[43] = hc_bytealign_be_S (w[23], w[24], offset); w[42] = hc_bytealign_be_S (w[22], w[23], offset); w[41] = hc_bytealign_be_S (w[21], w[22], offset); w[40] = hc_bytealign_be_S (w[20], w[21], offset); w[39] = hc_bytealign_be_S (w[19], w[20], offset); w[38] = hc_bytealign_be_S (w[18], w[19], offset); w[37] = hc_bytealign_be_S (w[17], w[18], offset); w[36] = hc_bytealign_be_S (w[16], w[17], offset); w[35] = hc_bytealign_be_S (w[15], w[16], offset); w[34] = hc_bytealign_be_S (w[14], w[15], offset); w[33] = hc_bytealign_be_S (w[13], w[14], offset); w[32] = hc_bytealign_be_S (w[12], w[13], offset); w[31] = hc_bytealign_be_S (w[11], w[12], offset); w[30] = hc_bytealign_be_S (w[10], w[11], offset); w[29] = hc_bytealign_be_S (w[ 9], w[10], offset); w[28] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[27] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[26] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[25] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[24] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[23] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[22] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[21] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[20] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[19] = hc_bytealign_be_S ( 0, w[ 0], offset); w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 20: w[63] = hc_bytealign_be_S (w[42], w[43], offset); w[62] = hc_bytealign_be_S (w[41], w[42], offset); w[61] = hc_bytealign_be_S (w[40], w[41], offset); w[60] = hc_bytealign_be_S (w[39], w[40], offset); w[59] = hc_bytealign_be_S (w[38], w[39], offset); w[58] = hc_bytealign_be_S (w[37], w[38], offset); w[57] = hc_bytealign_be_S (w[36], w[37], offset); w[56] = hc_bytealign_be_S (w[35], w[36], offset); w[55] = hc_bytealign_be_S (w[34], w[35], offset); w[54] = hc_bytealign_be_S (w[33], w[34], offset); w[53] = hc_bytealign_be_S (w[32], w[33], offset); w[52] = hc_bytealign_be_S (w[31], w[32], offset); w[51] = hc_bytealign_be_S (w[30], w[31], offset); w[50] = hc_bytealign_be_S (w[29], w[30], offset); w[49] = hc_bytealign_be_S (w[28], w[29], offset); w[48] = hc_bytealign_be_S (w[27], w[28], offset); w[47] = hc_bytealign_be_S (w[26], w[27], offset); w[46] = hc_bytealign_be_S (w[25], w[26], offset); w[45] = hc_bytealign_be_S (w[24], w[25], offset); w[44] = hc_bytealign_be_S (w[23], w[24], offset); w[43] = hc_bytealign_be_S (w[22], w[23], offset); w[42] = hc_bytealign_be_S (w[21], w[22], offset); w[41] = hc_bytealign_be_S (w[20], w[21], offset); w[40] = hc_bytealign_be_S (w[19], w[20], offset); w[39] = hc_bytealign_be_S (w[18], w[19], offset); w[38] = hc_bytealign_be_S (w[17], w[18], offset); w[37] = hc_bytealign_be_S (w[16], w[17], offset); w[36] = hc_bytealign_be_S (w[15], w[16], offset); w[35] = hc_bytealign_be_S (w[14], w[15], offset); w[34] = hc_bytealign_be_S (w[13], w[14], offset); w[33] = hc_bytealign_be_S (w[12], w[13], offset); w[32] = hc_bytealign_be_S (w[11], w[12], offset); w[31] = hc_bytealign_be_S (w[10], w[11], offset); w[30] = hc_bytealign_be_S (w[ 9], w[10], offset); w[29] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[28] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[27] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[26] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[25] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[24] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[23] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[22] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[21] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[20] = hc_bytealign_be_S ( 0, w[ 0], offset); w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 21: w[63] = hc_bytealign_be_S (w[41], w[42], offset); w[62] = hc_bytealign_be_S (w[40], w[41], offset); w[61] = hc_bytealign_be_S (w[39], w[40], offset); w[60] = hc_bytealign_be_S (w[38], w[39], offset); w[59] = hc_bytealign_be_S (w[37], w[38], offset); w[58] = hc_bytealign_be_S (w[36], w[37], offset); w[57] = hc_bytealign_be_S (w[35], w[36], offset); w[56] = hc_bytealign_be_S (w[34], w[35], offset); w[55] = hc_bytealign_be_S (w[33], w[34], offset); w[54] = hc_bytealign_be_S (w[32], w[33], offset); w[53] = hc_bytealign_be_S (w[31], w[32], offset); w[52] = hc_bytealign_be_S (w[30], w[31], offset); w[51] = hc_bytealign_be_S (w[29], w[30], offset); w[50] = hc_bytealign_be_S (w[28], w[29], offset); w[49] = hc_bytealign_be_S (w[27], w[28], offset); w[48] = hc_bytealign_be_S (w[26], w[27], offset); w[47] = hc_bytealign_be_S (w[25], w[26], offset); w[46] = hc_bytealign_be_S (w[24], w[25], offset); w[45] = hc_bytealign_be_S (w[23], w[24], offset); w[44] = hc_bytealign_be_S (w[22], w[23], offset); w[43] = hc_bytealign_be_S (w[21], w[22], offset); w[42] = hc_bytealign_be_S (w[20], w[21], offset); w[41] = hc_bytealign_be_S (w[19], w[20], offset); w[40] = hc_bytealign_be_S (w[18], w[19], offset); w[39] = hc_bytealign_be_S (w[17], w[18], offset); w[38] = hc_bytealign_be_S (w[16], w[17], offset); w[37] = hc_bytealign_be_S (w[15], w[16], offset); w[36] = hc_bytealign_be_S (w[14], w[15], offset); w[35] = hc_bytealign_be_S (w[13], w[14], offset); w[34] = hc_bytealign_be_S (w[12], w[13], offset); w[33] = hc_bytealign_be_S (w[11], w[12], offset); w[32] = hc_bytealign_be_S (w[10], w[11], offset); w[31] = hc_bytealign_be_S (w[ 9], w[10], offset); w[30] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[29] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[28] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[27] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[26] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[25] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[24] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[23] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[22] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[21] = hc_bytealign_be_S ( 0, w[ 0], offset); w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 22: w[63] = hc_bytealign_be_S (w[40], w[41], offset); w[62] = hc_bytealign_be_S (w[39], w[40], offset); w[61] = hc_bytealign_be_S (w[38], w[39], offset); w[60] = hc_bytealign_be_S (w[37], w[38], offset); w[59] = hc_bytealign_be_S (w[36], w[37], offset); w[58] = hc_bytealign_be_S (w[35], w[36], offset); w[57] = hc_bytealign_be_S (w[34], w[35], offset); w[56] = hc_bytealign_be_S (w[33], w[34], offset); w[55] = hc_bytealign_be_S (w[32], w[33], offset); w[54] = hc_bytealign_be_S (w[31], w[32], offset); w[53] = hc_bytealign_be_S (w[30], w[31], offset); w[52] = hc_bytealign_be_S (w[29], w[30], offset); w[51] = hc_bytealign_be_S (w[28], w[29], offset); w[50] = hc_bytealign_be_S (w[27], w[28], offset); w[49] = hc_bytealign_be_S (w[26], w[27], offset); w[48] = hc_bytealign_be_S (w[25], w[26], offset); w[47] = hc_bytealign_be_S (w[24], w[25], offset); w[46] = hc_bytealign_be_S (w[23], w[24], offset); w[45] = hc_bytealign_be_S (w[22], w[23], offset); w[44] = hc_bytealign_be_S (w[21], w[22], offset); w[43] = hc_bytealign_be_S (w[20], w[21], offset); w[42] = hc_bytealign_be_S (w[19], w[20], offset); w[41] = hc_bytealign_be_S (w[18], w[19], offset); w[40] = hc_bytealign_be_S (w[17], w[18], offset); w[39] = hc_bytealign_be_S (w[16], w[17], offset); w[38] = hc_bytealign_be_S (w[15], w[16], offset); w[37] = hc_bytealign_be_S (w[14], w[15], offset); w[36] = hc_bytealign_be_S (w[13], w[14], offset); w[35] = hc_bytealign_be_S (w[12], w[13], offset); w[34] = hc_bytealign_be_S (w[11], w[12], offset); w[33] = hc_bytealign_be_S (w[10], w[11], offset); w[32] = hc_bytealign_be_S (w[ 9], w[10], offset); w[31] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[30] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[29] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[28] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[27] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[26] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[25] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[24] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[23] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[22] = hc_bytealign_be_S ( 0, w[ 0], offset); w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 23: w[63] = hc_bytealign_be_S (w[39], w[40], offset); w[62] = hc_bytealign_be_S (w[38], w[39], offset); w[61] = hc_bytealign_be_S (w[37], w[38], offset); w[60] = hc_bytealign_be_S (w[36], w[37], offset); w[59] = hc_bytealign_be_S (w[35], w[36], offset); w[58] = hc_bytealign_be_S (w[34], w[35], offset); w[57] = hc_bytealign_be_S (w[33], w[34], offset); w[56] = hc_bytealign_be_S (w[32], w[33], offset); w[55] = hc_bytealign_be_S (w[31], w[32], offset); w[54] = hc_bytealign_be_S (w[30], w[31], offset); w[53] = hc_bytealign_be_S (w[29], w[30], offset); w[52] = hc_bytealign_be_S (w[28], w[29], offset); w[51] = hc_bytealign_be_S (w[27], w[28], offset); w[50] = hc_bytealign_be_S (w[26], w[27], offset); w[49] = hc_bytealign_be_S (w[25], w[26], offset); w[48] = hc_bytealign_be_S (w[24], w[25], offset); w[47] = hc_bytealign_be_S (w[23], w[24], offset); w[46] = hc_bytealign_be_S (w[22], w[23], offset); w[45] = hc_bytealign_be_S (w[21], w[22], offset); w[44] = hc_bytealign_be_S (w[20], w[21], offset); w[43] = hc_bytealign_be_S (w[19], w[20], offset); w[42] = hc_bytealign_be_S (w[18], w[19], offset); w[41] = hc_bytealign_be_S (w[17], w[18], offset); w[40] = hc_bytealign_be_S (w[16], w[17], offset); w[39] = hc_bytealign_be_S (w[15], w[16], offset); w[38] = hc_bytealign_be_S (w[14], w[15], offset); w[37] = hc_bytealign_be_S (w[13], w[14], offset); w[36] = hc_bytealign_be_S (w[12], w[13], offset); w[35] = hc_bytealign_be_S (w[11], w[12], offset); w[34] = hc_bytealign_be_S (w[10], w[11], offset); w[33] = hc_bytealign_be_S (w[ 9], w[10], offset); w[32] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[31] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[30] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[29] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[28] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[27] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[26] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[25] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[24] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[23] = hc_bytealign_be_S ( 0, w[ 0], offset); w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 24: w[63] = hc_bytealign_be_S (w[38], w[39], offset); w[62] = hc_bytealign_be_S (w[37], w[38], offset); w[61] = hc_bytealign_be_S (w[36], w[37], offset); w[60] = hc_bytealign_be_S (w[35], w[36], offset); w[59] = hc_bytealign_be_S (w[34], w[35], offset); w[58] = hc_bytealign_be_S (w[33], w[34], offset); w[57] = hc_bytealign_be_S (w[32], w[33], offset); w[56] = hc_bytealign_be_S (w[31], w[32], offset); w[55] = hc_bytealign_be_S (w[30], w[31], offset); w[54] = hc_bytealign_be_S (w[29], w[30], offset); w[53] = hc_bytealign_be_S (w[28], w[29], offset); w[52] = hc_bytealign_be_S (w[27], w[28], offset); w[51] = hc_bytealign_be_S (w[26], w[27], offset); w[50] = hc_bytealign_be_S (w[25], w[26], offset); w[49] = hc_bytealign_be_S (w[24], w[25], offset); w[48] = hc_bytealign_be_S (w[23], w[24], offset); w[47] = hc_bytealign_be_S (w[22], w[23], offset); w[46] = hc_bytealign_be_S (w[21], w[22], offset); w[45] = hc_bytealign_be_S (w[20], w[21], offset); w[44] = hc_bytealign_be_S (w[19], w[20], offset); w[43] = hc_bytealign_be_S (w[18], w[19], offset); w[42] = hc_bytealign_be_S (w[17], w[18], offset); w[41] = hc_bytealign_be_S (w[16], w[17], offset); w[40] = hc_bytealign_be_S (w[15], w[16], offset); w[39] = hc_bytealign_be_S (w[14], w[15], offset); w[38] = hc_bytealign_be_S (w[13], w[14], offset); w[37] = hc_bytealign_be_S (w[12], w[13], offset); w[36] = hc_bytealign_be_S (w[11], w[12], offset); w[35] = hc_bytealign_be_S (w[10], w[11], offset); w[34] = hc_bytealign_be_S (w[ 9], w[10], offset); w[33] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[32] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[31] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[30] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[29] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[28] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[27] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[26] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[25] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[24] = hc_bytealign_be_S ( 0, w[ 0], offset); w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 25: w[63] = hc_bytealign_be_S (w[37], w[38], offset); w[62] = hc_bytealign_be_S (w[36], w[37], offset); w[61] = hc_bytealign_be_S (w[35], w[36], offset); w[60] = hc_bytealign_be_S (w[34], w[35], offset); w[59] = hc_bytealign_be_S (w[33], w[34], offset); w[58] = hc_bytealign_be_S (w[32], w[33], offset); w[57] = hc_bytealign_be_S (w[31], w[32], offset); w[56] = hc_bytealign_be_S (w[30], w[31], offset); w[55] = hc_bytealign_be_S (w[29], w[30], offset); w[54] = hc_bytealign_be_S (w[28], w[29], offset); w[53] = hc_bytealign_be_S (w[27], w[28], offset); w[52] = hc_bytealign_be_S (w[26], w[27], offset); w[51] = hc_bytealign_be_S (w[25], w[26], offset); w[50] = hc_bytealign_be_S (w[24], w[25], offset); w[49] = hc_bytealign_be_S (w[23], w[24], offset); w[48] = hc_bytealign_be_S (w[22], w[23], offset); w[47] = hc_bytealign_be_S (w[21], w[22], offset); w[46] = hc_bytealign_be_S (w[20], w[21], offset); w[45] = hc_bytealign_be_S (w[19], w[20], offset); w[44] = hc_bytealign_be_S (w[18], w[19], offset); w[43] = hc_bytealign_be_S (w[17], w[18], offset); w[42] = hc_bytealign_be_S (w[16], w[17], offset); w[41] = hc_bytealign_be_S (w[15], w[16], offset); w[40] = hc_bytealign_be_S (w[14], w[15], offset); w[39] = hc_bytealign_be_S (w[13], w[14], offset); w[38] = hc_bytealign_be_S (w[12], w[13], offset); w[37] = hc_bytealign_be_S (w[11], w[12], offset); w[36] = hc_bytealign_be_S (w[10], w[11], offset); w[35] = hc_bytealign_be_S (w[ 9], w[10], offset); w[34] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[33] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[32] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[31] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[30] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[29] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[28] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[27] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[26] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[25] = hc_bytealign_be_S ( 0, w[ 0], offset); w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 26: w[63] = hc_bytealign_be_S (w[36], w[37], offset); w[62] = hc_bytealign_be_S (w[35], w[36], offset); w[61] = hc_bytealign_be_S (w[34], w[35], offset); w[60] = hc_bytealign_be_S (w[33], w[34], offset); w[59] = hc_bytealign_be_S (w[32], w[33], offset); w[58] = hc_bytealign_be_S (w[31], w[32], offset); w[57] = hc_bytealign_be_S (w[30], w[31], offset); w[56] = hc_bytealign_be_S (w[29], w[30], offset); w[55] = hc_bytealign_be_S (w[28], w[29], offset); w[54] = hc_bytealign_be_S (w[27], w[28], offset); w[53] = hc_bytealign_be_S (w[26], w[27], offset); w[52] = hc_bytealign_be_S (w[25], w[26], offset); w[51] = hc_bytealign_be_S (w[24], w[25], offset); w[50] = hc_bytealign_be_S (w[23], w[24], offset); w[49] = hc_bytealign_be_S (w[22], w[23], offset); w[48] = hc_bytealign_be_S (w[21], w[22], offset); w[47] = hc_bytealign_be_S (w[20], w[21], offset); w[46] = hc_bytealign_be_S (w[19], w[20], offset); w[45] = hc_bytealign_be_S (w[18], w[19], offset); w[44] = hc_bytealign_be_S (w[17], w[18], offset); w[43] = hc_bytealign_be_S (w[16], w[17], offset); w[42] = hc_bytealign_be_S (w[15], w[16], offset); w[41] = hc_bytealign_be_S (w[14], w[15], offset); w[40] = hc_bytealign_be_S (w[13], w[14], offset); w[39] = hc_bytealign_be_S (w[12], w[13], offset); w[38] = hc_bytealign_be_S (w[11], w[12], offset); w[37] = hc_bytealign_be_S (w[10], w[11], offset); w[36] = hc_bytealign_be_S (w[ 9], w[10], offset); w[35] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[34] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[33] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[32] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[31] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[30] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[29] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[28] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[27] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[26] = hc_bytealign_be_S ( 0, w[ 0], offset); w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 27: w[63] = hc_bytealign_be_S (w[35], w[36], offset); w[62] = hc_bytealign_be_S (w[34], w[35], offset); w[61] = hc_bytealign_be_S (w[33], w[34], offset); w[60] = hc_bytealign_be_S (w[32], w[33], offset); w[59] = hc_bytealign_be_S (w[31], w[32], offset); w[58] = hc_bytealign_be_S (w[30], w[31], offset); w[57] = hc_bytealign_be_S (w[29], w[30], offset); w[56] = hc_bytealign_be_S (w[28], w[29], offset); w[55] = hc_bytealign_be_S (w[27], w[28], offset); w[54] = hc_bytealign_be_S (w[26], w[27], offset); w[53] = hc_bytealign_be_S (w[25], w[26], offset); w[52] = hc_bytealign_be_S (w[24], w[25], offset); w[51] = hc_bytealign_be_S (w[23], w[24], offset); w[50] = hc_bytealign_be_S (w[22], w[23], offset); w[49] = hc_bytealign_be_S (w[21], w[22], offset); w[48] = hc_bytealign_be_S (w[20], w[21], offset); w[47] = hc_bytealign_be_S (w[19], w[20], offset); w[46] = hc_bytealign_be_S (w[18], w[19], offset); w[45] = hc_bytealign_be_S (w[17], w[18], offset); w[44] = hc_bytealign_be_S (w[16], w[17], offset); w[43] = hc_bytealign_be_S (w[15], w[16], offset); w[42] = hc_bytealign_be_S (w[14], w[15], offset); w[41] = hc_bytealign_be_S (w[13], w[14], offset); w[40] = hc_bytealign_be_S (w[12], w[13], offset); w[39] = hc_bytealign_be_S (w[11], w[12], offset); w[38] = hc_bytealign_be_S (w[10], w[11], offset); w[37] = hc_bytealign_be_S (w[ 9], w[10], offset); w[36] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[35] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[34] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[33] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[32] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[31] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[30] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[29] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[28] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[27] = hc_bytealign_be_S ( 0, w[ 0], offset); w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 28: w[63] = hc_bytealign_be_S (w[34], w[35], offset); w[62] = hc_bytealign_be_S (w[33], w[34], offset); w[61] = hc_bytealign_be_S (w[32], w[33], offset); w[60] = hc_bytealign_be_S (w[31], w[32], offset); w[59] = hc_bytealign_be_S (w[30], w[31], offset); w[58] = hc_bytealign_be_S (w[29], w[30], offset); w[57] = hc_bytealign_be_S (w[28], w[29], offset); w[56] = hc_bytealign_be_S (w[27], w[28], offset); w[55] = hc_bytealign_be_S (w[26], w[27], offset); w[54] = hc_bytealign_be_S (w[25], w[26], offset); w[53] = hc_bytealign_be_S (w[24], w[25], offset); w[52] = hc_bytealign_be_S (w[23], w[24], offset); w[51] = hc_bytealign_be_S (w[22], w[23], offset); w[50] = hc_bytealign_be_S (w[21], w[22], offset); w[49] = hc_bytealign_be_S (w[20], w[21], offset); w[48] = hc_bytealign_be_S (w[19], w[20], offset); w[47] = hc_bytealign_be_S (w[18], w[19], offset); w[46] = hc_bytealign_be_S (w[17], w[18], offset); w[45] = hc_bytealign_be_S (w[16], w[17], offset); w[44] = hc_bytealign_be_S (w[15], w[16], offset); w[43] = hc_bytealign_be_S (w[14], w[15], offset); w[42] = hc_bytealign_be_S (w[13], w[14], offset); w[41] = hc_bytealign_be_S (w[12], w[13], offset); w[40] = hc_bytealign_be_S (w[11], w[12], offset); w[39] = hc_bytealign_be_S (w[10], w[11], offset); w[38] = hc_bytealign_be_S (w[ 9], w[10], offset); w[37] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[36] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[35] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[34] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[33] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[32] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[31] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[30] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[29] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[28] = hc_bytealign_be_S ( 0, w[ 0], offset); w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 29: w[63] = hc_bytealign_be_S (w[33], w[34], offset); w[62] = hc_bytealign_be_S (w[32], w[33], offset); w[61] = hc_bytealign_be_S (w[31], w[32], offset); w[60] = hc_bytealign_be_S (w[30], w[31], offset); w[59] = hc_bytealign_be_S (w[29], w[30], offset); w[58] = hc_bytealign_be_S (w[28], w[29], offset); w[57] = hc_bytealign_be_S (w[27], w[28], offset); w[56] = hc_bytealign_be_S (w[26], w[27], offset); w[55] = hc_bytealign_be_S (w[25], w[26], offset); w[54] = hc_bytealign_be_S (w[24], w[25], offset); w[53] = hc_bytealign_be_S (w[23], w[24], offset); w[52] = hc_bytealign_be_S (w[22], w[23], offset); w[51] = hc_bytealign_be_S (w[21], w[22], offset); w[50] = hc_bytealign_be_S (w[20], w[21], offset); w[49] = hc_bytealign_be_S (w[19], w[20], offset); w[48] = hc_bytealign_be_S (w[18], w[19], offset); w[47] = hc_bytealign_be_S (w[17], w[18], offset); w[46] = hc_bytealign_be_S (w[16], w[17], offset); w[45] = hc_bytealign_be_S (w[15], w[16], offset); w[44] = hc_bytealign_be_S (w[14], w[15], offset); w[43] = hc_bytealign_be_S (w[13], w[14], offset); w[42] = hc_bytealign_be_S (w[12], w[13], offset); w[41] = hc_bytealign_be_S (w[11], w[12], offset); w[40] = hc_bytealign_be_S (w[10], w[11], offset); w[39] = hc_bytealign_be_S (w[ 9], w[10], offset); w[38] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[37] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[36] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[35] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[34] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[33] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[32] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[31] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[30] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[29] = hc_bytealign_be_S ( 0, w[ 0], offset); w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 30: w[63] = hc_bytealign_be_S (w[32], w[33], offset); w[62] = hc_bytealign_be_S (w[31], w[32], offset); w[61] = hc_bytealign_be_S (w[30], w[31], offset); w[60] = hc_bytealign_be_S (w[29], w[30], offset); w[59] = hc_bytealign_be_S (w[28], w[29], offset); w[58] = hc_bytealign_be_S (w[27], w[28], offset); w[57] = hc_bytealign_be_S (w[26], w[27], offset); w[56] = hc_bytealign_be_S (w[25], w[26], offset); w[55] = hc_bytealign_be_S (w[24], w[25], offset); w[54] = hc_bytealign_be_S (w[23], w[24], offset); w[53] = hc_bytealign_be_S (w[22], w[23], offset); w[52] = hc_bytealign_be_S (w[21], w[22], offset); w[51] = hc_bytealign_be_S (w[20], w[21], offset); w[50] = hc_bytealign_be_S (w[19], w[20], offset); w[49] = hc_bytealign_be_S (w[18], w[19], offset); w[48] = hc_bytealign_be_S (w[17], w[18], offset); w[47] = hc_bytealign_be_S (w[16], w[17], offset); w[46] = hc_bytealign_be_S (w[15], w[16], offset); w[45] = hc_bytealign_be_S (w[14], w[15], offset); w[44] = hc_bytealign_be_S (w[13], w[14], offset); w[43] = hc_bytealign_be_S (w[12], w[13], offset); w[42] = hc_bytealign_be_S (w[11], w[12], offset); w[41] = hc_bytealign_be_S (w[10], w[11], offset); w[40] = hc_bytealign_be_S (w[ 9], w[10], offset); w[39] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[38] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[37] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[36] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[35] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[34] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[33] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[32] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[31] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[30] = hc_bytealign_be_S ( 0, w[ 0], offset); w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 31: w[63] = hc_bytealign_be_S (w[31], w[32], offset); w[62] = hc_bytealign_be_S (w[30], w[31], offset); w[61] = hc_bytealign_be_S (w[29], w[30], offset); w[60] = hc_bytealign_be_S (w[28], w[29], offset); w[59] = hc_bytealign_be_S (w[27], w[28], offset); w[58] = hc_bytealign_be_S (w[26], w[27], offset); w[57] = hc_bytealign_be_S (w[25], w[26], offset); w[56] = hc_bytealign_be_S (w[24], w[25], offset); w[55] = hc_bytealign_be_S (w[23], w[24], offset); w[54] = hc_bytealign_be_S (w[22], w[23], offset); w[53] = hc_bytealign_be_S (w[21], w[22], offset); w[52] = hc_bytealign_be_S (w[20], w[21], offset); w[51] = hc_bytealign_be_S (w[19], w[20], offset); w[50] = hc_bytealign_be_S (w[18], w[19], offset); w[49] = hc_bytealign_be_S (w[17], w[18], offset); w[48] = hc_bytealign_be_S (w[16], w[17], offset); w[47] = hc_bytealign_be_S (w[15], w[16], offset); w[46] = hc_bytealign_be_S (w[14], w[15], offset); w[45] = hc_bytealign_be_S (w[13], w[14], offset); w[44] = hc_bytealign_be_S (w[12], w[13], offset); w[43] = hc_bytealign_be_S (w[11], w[12], offset); w[42] = hc_bytealign_be_S (w[10], w[11], offset); w[41] = hc_bytealign_be_S (w[ 9], w[10], offset); w[40] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[39] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[38] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[37] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[36] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[35] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[34] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[33] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[32] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[31] = hc_bytealign_be_S ( 0, w[ 0], offset); w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 32: w[63] = hc_bytealign_be_S (w[30], w[31], offset); w[62] = hc_bytealign_be_S (w[29], w[30], offset); w[61] = hc_bytealign_be_S (w[28], w[29], offset); w[60] = hc_bytealign_be_S (w[27], w[28], offset); w[59] = hc_bytealign_be_S (w[26], w[27], offset); w[58] = hc_bytealign_be_S (w[25], w[26], offset); w[57] = hc_bytealign_be_S (w[24], w[25], offset); w[56] = hc_bytealign_be_S (w[23], w[24], offset); w[55] = hc_bytealign_be_S (w[22], w[23], offset); w[54] = hc_bytealign_be_S (w[21], w[22], offset); w[53] = hc_bytealign_be_S (w[20], w[21], offset); w[52] = hc_bytealign_be_S (w[19], w[20], offset); w[51] = hc_bytealign_be_S (w[18], w[19], offset); w[50] = hc_bytealign_be_S (w[17], w[18], offset); w[49] = hc_bytealign_be_S (w[16], w[17], offset); w[48] = hc_bytealign_be_S (w[15], w[16], offset); w[47] = hc_bytealign_be_S (w[14], w[15], offset); w[46] = hc_bytealign_be_S (w[13], w[14], offset); w[45] = hc_bytealign_be_S (w[12], w[13], offset); w[44] = hc_bytealign_be_S (w[11], w[12], offset); w[43] = hc_bytealign_be_S (w[10], w[11], offset); w[42] = hc_bytealign_be_S (w[ 9], w[10], offset); w[41] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[40] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[39] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[38] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[37] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[36] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[35] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[34] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[33] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[32] = hc_bytealign_be_S ( 0, w[ 0], offset); w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 33: w[63] = hc_bytealign_be_S (w[29], w[30], offset); w[62] = hc_bytealign_be_S (w[28], w[29], offset); w[61] = hc_bytealign_be_S (w[27], w[28], offset); w[60] = hc_bytealign_be_S (w[26], w[27], offset); w[59] = hc_bytealign_be_S (w[25], w[26], offset); w[58] = hc_bytealign_be_S (w[24], w[25], offset); w[57] = hc_bytealign_be_S (w[23], w[24], offset); w[56] = hc_bytealign_be_S (w[22], w[23], offset); w[55] = hc_bytealign_be_S (w[21], w[22], offset); w[54] = hc_bytealign_be_S (w[20], w[21], offset); w[53] = hc_bytealign_be_S (w[19], w[20], offset); w[52] = hc_bytealign_be_S (w[18], w[19], offset); w[51] = hc_bytealign_be_S (w[17], w[18], offset); w[50] = hc_bytealign_be_S (w[16], w[17], offset); w[49] = hc_bytealign_be_S (w[15], w[16], offset); w[48] = hc_bytealign_be_S (w[14], w[15], offset); w[47] = hc_bytealign_be_S (w[13], w[14], offset); w[46] = hc_bytealign_be_S (w[12], w[13], offset); w[45] = hc_bytealign_be_S (w[11], w[12], offset); w[44] = hc_bytealign_be_S (w[10], w[11], offset); w[43] = hc_bytealign_be_S (w[ 9], w[10], offset); w[42] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[41] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[40] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[39] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[38] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[37] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[36] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[35] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[34] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[33] = hc_bytealign_be_S ( 0, w[ 0], offset); w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 34: w[63] = hc_bytealign_be_S (w[28], w[29], offset); w[62] = hc_bytealign_be_S (w[27], w[28], offset); w[61] = hc_bytealign_be_S (w[26], w[27], offset); w[60] = hc_bytealign_be_S (w[25], w[26], offset); w[59] = hc_bytealign_be_S (w[24], w[25], offset); w[58] = hc_bytealign_be_S (w[23], w[24], offset); w[57] = hc_bytealign_be_S (w[22], w[23], offset); w[56] = hc_bytealign_be_S (w[21], w[22], offset); w[55] = hc_bytealign_be_S (w[20], w[21], offset); w[54] = hc_bytealign_be_S (w[19], w[20], offset); w[53] = hc_bytealign_be_S (w[18], w[19], offset); w[52] = hc_bytealign_be_S (w[17], w[18], offset); w[51] = hc_bytealign_be_S (w[16], w[17], offset); w[50] = hc_bytealign_be_S (w[15], w[16], offset); w[49] = hc_bytealign_be_S (w[14], w[15], offset); w[48] = hc_bytealign_be_S (w[13], w[14], offset); w[47] = hc_bytealign_be_S (w[12], w[13], offset); w[46] = hc_bytealign_be_S (w[11], w[12], offset); w[45] = hc_bytealign_be_S (w[10], w[11], offset); w[44] = hc_bytealign_be_S (w[ 9], w[10], offset); w[43] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[42] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[41] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[40] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[39] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[38] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[37] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[36] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[35] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[34] = hc_bytealign_be_S ( 0, w[ 0], offset); w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 35: w[63] = hc_bytealign_be_S (w[27], w[28], offset); w[62] = hc_bytealign_be_S (w[26], w[27], offset); w[61] = hc_bytealign_be_S (w[25], w[26], offset); w[60] = hc_bytealign_be_S (w[24], w[25], offset); w[59] = hc_bytealign_be_S (w[23], w[24], offset); w[58] = hc_bytealign_be_S (w[22], w[23], offset); w[57] = hc_bytealign_be_S (w[21], w[22], offset); w[56] = hc_bytealign_be_S (w[20], w[21], offset); w[55] = hc_bytealign_be_S (w[19], w[20], offset); w[54] = hc_bytealign_be_S (w[18], w[19], offset); w[53] = hc_bytealign_be_S (w[17], w[18], offset); w[52] = hc_bytealign_be_S (w[16], w[17], offset); w[51] = hc_bytealign_be_S (w[15], w[16], offset); w[50] = hc_bytealign_be_S (w[14], w[15], offset); w[49] = hc_bytealign_be_S (w[13], w[14], offset); w[48] = hc_bytealign_be_S (w[12], w[13], offset); w[47] = hc_bytealign_be_S (w[11], w[12], offset); w[46] = hc_bytealign_be_S (w[10], w[11], offset); w[45] = hc_bytealign_be_S (w[ 9], w[10], offset); w[44] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[43] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[42] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[41] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[40] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[39] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[38] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[37] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[36] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[35] = hc_bytealign_be_S ( 0, w[ 0], offset); w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 36: w[63] = hc_bytealign_be_S (w[26], w[27], offset); w[62] = hc_bytealign_be_S (w[25], w[26], offset); w[61] = hc_bytealign_be_S (w[24], w[25], offset); w[60] = hc_bytealign_be_S (w[23], w[24], offset); w[59] = hc_bytealign_be_S (w[22], w[23], offset); w[58] = hc_bytealign_be_S (w[21], w[22], offset); w[57] = hc_bytealign_be_S (w[20], w[21], offset); w[56] = hc_bytealign_be_S (w[19], w[20], offset); w[55] = hc_bytealign_be_S (w[18], w[19], offset); w[54] = hc_bytealign_be_S (w[17], w[18], offset); w[53] = hc_bytealign_be_S (w[16], w[17], offset); w[52] = hc_bytealign_be_S (w[15], w[16], offset); w[51] = hc_bytealign_be_S (w[14], w[15], offset); w[50] = hc_bytealign_be_S (w[13], w[14], offset); w[49] = hc_bytealign_be_S (w[12], w[13], offset); w[48] = hc_bytealign_be_S (w[11], w[12], offset); w[47] = hc_bytealign_be_S (w[10], w[11], offset); w[46] = hc_bytealign_be_S (w[ 9], w[10], offset); w[45] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[44] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[43] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[42] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[41] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[40] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[39] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[38] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[37] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[36] = hc_bytealign_be_S ( 0, w[ 0], offset); w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 37: w[63] = hc_bytealign_be_S (w[25], w[26], offset); w[62] = hc_bytealign_be_S (w[24], w[25], offset); w[61] = hc_bytealign_be_S (w[23], w[24], offset); w[60] = hc_bytealign_be_S (w[22], w[23], offset); w[59] = hc_bytealign_be_S (w[21], w[22], offset); w[58] = hc_bytealign_be_S (w[20], w[21], offset); w[57] = hc_bytealign_be_S (w[19], w[20], offset); w[56] = hc_bytealign_be_S (w[18], w[19], offset); w[55] = hc_bytealign_be_S (w[17], w[18], offset); w[54] = hc_bytealign_be_S (w[16], w[17], offset); w[53] = hc_bytealign_be_S (w[15], w[16], offset); w[52] = hc_bytealign_be_S (w[14], w[15], offset); w[51] = hc_bytealign_be_S (w[13], w[14], offset); w[50] = hc_bytealign_be_S (w[12], w[13], offset); w[49] = hc_bytealign_be_S (w[11], w[12], offset); w[48] = hc_bytealign_be_S (w[10], w[11], offset); w[47] = hc_bytealign_be_S (w[ 9], w[10], offset); w[46] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[45] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[44] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[43] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[42] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[41] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[40] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[39] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[38] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[37] = hc_bytealign_be_S ( 0, w[ 0], offset); w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 38: w[63] = hc_bytealign_be_S (w[24], w[25], offset); w[62] = hc_bytealign_be_S (w[23], w[24], offset); w[61] = hc_bytealign_be_S (w[22], w[23], offset); w[60] = hc_bytealign_be_S (w[21], w[22], offset); w[59] = hc_bytealign_be_S (w[20], w[21], offset); w[58] = hc_bytealign_be_S (w[19], w[20], offset); w[57] = hc_bytealign_be_S (w[18], w[19], offset); w[56] = hc_bytealign_be_S (w[17], w[18], offset); w[55] = hc_bytealign_be_S (w[16], w[17], offset); w[54] = hc_bytealign_be_S (w[15], w[16], offset); w[53] = hc_bytealign_be_S (w[14], w[15], offset); w[52] = hc_bytealign_be_S (w[13], w[14], offset); w[51] = hc_bytealign_be_S (w[12], w[13], offset); w[50] = hc_bytealign_be_S (w[11], w[12], offset); w[49] = hc_bytealign_be_S (w[10], w[11], offset); w[48] = hc_bytealign_be_S (w[ 9], w[10], offset); w[47] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[46] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[45] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[44] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[43] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[42] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[41] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[40] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[39] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[38] = hc_bytealign_be_S ( 0, w[ 0], offset); w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 39: w[63] = hc_bytealign_be_S (w[23], w[24], offset); w[62] = hc_bytealign_be_S (w[22], w[23], offset); w[61] = hc_bytealign_be_S (w[21], w[22], offset); w[60] = hc_bytealign_be_S (w[20], w[21], offset); w[59] = hc_bytealign_be_S (w[19], w[20], offset); w[58] = hc_bytealign_be_S (w[18], w[19], offset); w[57] = hc_bytealign_be_S (w[17], w[18], offset); w[56] = hc_bytealign_be_S (w[16], w[17], offset); w[55] = hc_bytealign_be_S (w[15], w[16], offset); w[54] = hc_bytealign_be_S (w[14], w[15], offset); w[53] = hc_bytealign_be_S (w[13], w[14], offset); w[52] = hc_bytealign_be_S (w[12], w[13], offset); w[51] = hc_bytealign_be_S (w[11], w[12], offset); w[50] = hc_bytealign_be_S (w[10], w[11], offset); w[49] = hc_bytealign_be_S (w[ 9], w[10], offset); w[48] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[47] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[46] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[45] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[44] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[43] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[42] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[41] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[40] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[39] = hc_bytealign_be_S ( 0, w[ 0], offset); w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 40: w[63] = hc_bytealign_be_S (w[22], w[23], offset); w[62] = hc_bytealign_be_S (w[21], w[22], offset); w[61] = hc_bytealign_be_S (w[20], w[21], offset); w[60] = hc_bytealign_be_S (w[19], w[20], offset); w[59] = hc_bytealign_be_S (w[18], w[19], offset); w[58] = hc_bytealign_be_S (w[17], w[18], offset); w[57] = hc_bytealign_be_S (w[16], w[17], offset); w[56] = hc_bytealign_be_S (w[15], w[16], offset); w[55] = hc_bytealign_be_S (w[14], w[15], offset); w[54] = hc_bytealign_be_S (w[13], w[14], offset); w[53] = hc_bytealign_be_S (w[12], w[13], offset); w[52] = hc_bytealign_be_S (w[11], w[12], offset); w[51] = hc_bytealign_be_S (w[10], w[11], offset); w[50] = hc_bytealign_be_S (w[ 9], w[10], offset); w[49] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[48] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[47] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[46] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[45] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[44] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[43] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[42] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[41] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[40] = hc_bytealign_be_S ( 0, w[ 0], offset); w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 41: w[63] = hc_bytealign_be_S (w[21], w[22], offset); w[62] = hc_bytealign_be_S (w[20], w[21], offset); w[61] = hc_bytealign_be_S (w[19], w[20], offset); w[60] = hc_bytealign_be_S (w[18], w[19], offset); w[59] = hc_bytealign_be_S (w[17], w[18], offset); w[58] = hc_bytealign_be_S (w[16], w[17], offset); w[57] = hc_bytealign_be_S (w[15], w[16], offset); w[56] = hc_bytealign_be_S (w[14], w[15], offset); w[55] = hc_bytealign_be_S (w[13], w[14], offset); w[54] = hc_bytealign_be_S (w[12], w[13], offset); w[53] = hc_bytealign_be_S (w[11], w[12], offset); w[52] = hc_bytealign_be_S (w[10], w[11], offset); w[51] = hc_bytealign_be_S (w[ 9], w[10], offset); w[50] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[49] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[48] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[47] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[46] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[45] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[44] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[43] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[42] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[41] = hc_bytealign_be_S ( 0, w[ 0], offset); w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 42: w[63] = hc_bytealign_be_S (w[20], w[21], offset); w[62] = hc_bytealign_be_S (w[19], w[20], offset); w[61] = hc_bytealign_be_S (w[18], w[19], offset); w[60] = hc_bytealign_be_S (w[17], w[18], offset); w[59] = hc_bytealign_be_S (w[16], w[17], offset); w[58] = hc_bytealign_be_S (w[15], w[16], offset); w[57] = hc_bytealign_be_S (w[14], w[15], offset); w[56] = hc_bytealign_be_S (w[13], w[14], offset); w[55] = hc_bytealign_be_S (w[12], w[13], offset); w[54] = hc_bytealign_be_S (w[11], w[12], offset); w[53] = hc_bytealign_be_S (w[10], w[11], offset); w[52] = hc_bytealign_be_S (w[ 9], w[10], offset); w[51] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[50] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[49] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[48] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[47] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[46] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[45] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[44] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[43] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[42] = hc_bytealign_be_S ( 0, w[ 0], offset); w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 43: w[63] = hc_bytealign_be_S (w[19], w[20], offset); w[62] = hc_bytealign_be_S (w[18], w[19], offset); w[61] = hc_bytealign_be_S (w[17], w[18], offset); w[60] = hc_bytealign_be_S (w[16], w[17], offset); w[59] = hc_bytealign_be_S (w[15], w[16], offset); w[58] = hc_bytealign_be_S (w[14], w[15], offset); w[57] = hc_bytealign_be_S (w[13], w[14], offset); w[56] = hc_bytealign_be_S (w[12], w[13], offset); w[55] = hc_bytealign_be_S (w[11], w[12], offset); w[54] = hc_bytealign_be_S (w[10], w[11], offset); w[53] = hc_bytealign_be_S (w[ 9], w[10], offset); w[52] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[51] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[50] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[49] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[48] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[47] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[46] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[45] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[44] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[43] = hc_bytealign_be_S ( 0, w[ 0], offset); w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 44: w[63] = hc_bytealign_be_S (w[18], w[19], offset); w[62] = hc_bytealign_be_S (w[17], w[18], offset); w[61] = hc_bytealign_be_S (w[16], w[17], offset); w[60] = hc_bytealign_be_S (w[15], w[16], offset); w[59] = hc_bytealign_be_S (w[14], w[15], offset); w[58] = hc_bytealign_be_S (w[13], w[14], offset); w[57] = hc_bytealign_be_S (w[12], w[13], offset); w[56] = hc_bytealign_be_S (w[11], w[12], offset); w[55] = hc_bytealign_be_S (w[10], w[11], offset); w[54] = hc_bytealign_be_S (w[ 9], w[10], offset); w[53] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[52] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[51] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[50] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[49] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[48] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[47] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[46] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[45] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[44] = hc_bytealign_be_S ( 0, w[ 0], offset); w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 45: w[63] = hc_bytealign_be_S (w[17], w[18], offset); w[62] = hc_bytealign_be_S (w[16], w[17], offset); w[61] = hc_bytealign_be_S (w[15], w[16], offset); w[60] = hc_bytealign_be_S (w[14], w[15], offset); w[59] = hc_bytealign_be_S (w[13], w[14], offset); w[58] = hc_bytealign_be_S (w[12], w[13], offset); w[57] = hc_bytealign_be_S (w[11], w[12], offset); w[56] = hc_bytealign_be_S (w[10], w[11], offset); w[55] = hc_bytealign_be_S (w[ 9], w[10], offset); w[54] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[53] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[52] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[51] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[50] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[49] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[48] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[47] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[46] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[45] = hc_bytealign_be_S ( 0, w[ 0], offset); w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 46: w[63] = hc_bytealign_be_S (w[16], w[17], offset); w[62] = hc_bytealign_be_S (w[15], w[16], offset); w[61] = hc_bytealign_be_S (w[14], w[15], offset); w[60] = hc_bytealign_be_S (w[13], w[14], offset); w[59] = hc_bytealign_be_S (w[12], w[13], offset); w[58] = hc_bytealign_be_S (w[11], w[12], offset); w[57] = hc_bytealign_be_S (w[10], w[11], offset); w[56] = hc_bytealign_be_S (w[ 9], w[10], offset); w[55] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[54] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[53] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[52] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[51] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[50] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[49] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[48] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[47] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[46] = hc_bytealign_be_S ( 0, w[ 0], offset); w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 47: w[63] = hc_bytealign_be_S (w[15], w[16], offset); w[62] = hc_bytealign_be_S (w[14], w[15], offset); w[61] = hc_bytealign_be_S (w[13], w[14], offset); w[60] = hc_bytealign_be_S (w[12], w[13], offset); w[59] = hc_bytealign_be_S (w[11], w[12], offset); w[58] = hc_bytealign_be_S (w[10], w[11], offset); w[57] = hc_bytealign_be_S (w[ 9], w[10], offset); w[56] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[55] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[54] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[53] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[52] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[51] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[50] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[49] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[48] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[47] = hc_bytealign_be_S ( 0, w[ 0], offset); w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 48: w[63] = hc_bytealign_be_S (w[14], w[15], offset); w[62] = hc_bytealign_be_S (w[13], w[14], offset); w[61] = hc_bytealign_be_S (w[12], w[13], offset); w[60] = hc_bytealign_be_S (w[11], w[12], offset); w[59] = hc_bytealign_be_S (w[10], w[11], offset); w[58] = hc_bytealign_be_S (w[ 9], w[10], offset); w[57] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[56] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[55] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[54] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[53] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[52] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[51] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[50] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[49] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[48] = hc_bytealign_be_S ( 0, w[ 0], offset); w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 49: w[63] = hc_bytealign_be_S (w[13], w[14], offset); w[62] = hc_bytealign_be_S (w[12], w[13], offset); w[61] = hc_bytealign_be_S (w[11], w[12], offset); w[60] = hc_bytealign_be_S (w[10], w[11], offset); w[59] = hc_bytealign_be_S (w[ 9], w[10], offset); w[58] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[57] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[56] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[55] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[54] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[53] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[52] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[51] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[50] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[49] = hc_bytealign_be_S ( 0, w[ 0], offset); w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 50: w[63] = hc_bytealign_be_S (w[12], w[13], offset); w[62] = hc_bytealign_be_S (w[11], w[12], offset); w[61] = hc_bytealign_be_S (w[10], w[11], offset); w[60] = hc_bytealign_be_S (w[ 9], w[10], offset); w[59] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[58] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[57] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[56] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[55] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[54] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[53] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[52] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[51] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[50] = hc_bytealign_be_S ( 0, w[ 0], offset); w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 51: w[63] = hc_bytealign_be_S (w[11], w[12], offset); w[62] = hc_bytealign_be_S (w[10], w[11], offset); w[61] = hc_bytealign_be_S (w[ 9], w[10], offset); w[60] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[59] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[58] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[57] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[56] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[55] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[54] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[53] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[52] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[51] = hc_bytealign_be_S ( 0, w[ 0], offset); w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 52: w[63] = hc_bytealign_be_S (w[10], w[11], offset); w[62] = hc_bytealign_be_S (w[ 9], w[10], offset); w[61] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[60] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[59] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[58] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[57] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[56] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[55] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[54] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[53] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[52] = hc_bytealign_be_S ( 0, w[ 0], offset); w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 53: w[63] = hc_bytealign_be_S (w[ 9], w[10], offset); w[62] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[61] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[60] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[59] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[58] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[57] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[56] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[55] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[54] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[53] = hc_bytealign_be_S ( 0, w[ 0], offset); w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 54: w[63] = hc_bytealign_be_S (w[ 8], w[ 9], offset); w[62] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[61] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[60] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[59] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[58] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[57] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[56] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[55] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[54] = hc_bytealign_be_S ( 0, w[ 0], offset); w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 55: w[63] = hc_bytealign_be_S (w[ 7], w[ 8], offset); w[62] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[61] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[60] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[59] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[58] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[57] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[56] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[55] = hc_bytealign_be_S ( 0, w[ 0], offset); w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 56: w[63] = hc_bytealign_be_S (w[ 6], w[ 7], offset); w[62] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[61] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[60] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[59] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[58] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[57] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[56] = hc_bytealign_be_S ( 0, w[ 0], offset); w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 57: w[63] = hc_bytealign_be_S (w[ 5], w[ 6], offset); w[62] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[61] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[60] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[59] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[58] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[57] = hc_bytealign_be_S ( 0, w[ 0], offset); w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 58: w[63] = hc_bytealign_be_S (w[ 4], w[ 5], offset); w[62] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[61] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[60] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[59] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[58] = hc_bytealign_be_S ( 0, w[ 0], offset); w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 59: w[63] = hc_bytealign_be_S (w[ 3], w[ 4], offset); w[62] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[61] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[60] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[59] = hc_bytealign_be_S ( 0, w[ 0], offset); w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 60: w[63] = hc_bytealign_be_S (w[ 2], w[ 3], offset); w[62] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[61] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[60] = hc_bytealign_be_S ( 0, w[ 0], offset); w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 61: w[63] = hc_bytealign_be_S (w[ 1], w[ 2], offset); w[62] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[61] = hc_bytealign_be_S ( 0, w[ 0], offset); w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 62: w[63] = hc_bytealign_be_S (w[ 0], w[ 1], offset); w[62] = hc_bytealign_be_S ( 0, w[ 0], offset); w[61] = 0; w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 63: w[63] = hc_bytealign_be_S ( 0, w[ 0], offset); w[62] = 0; w[61] = 0; w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; } #endif #if ((defined IS_AMD || defined IS_HIP) && HAS_VPERM == 1) || defined IS_NV #if defined IS_NV const int selector = (0x76543210 >> ((offset & 3) * 4)) & 0xffff; #endif #if (defined IS_AMD || defined IS_HIP) const int selector = l32_from_64_S (0x0706050403020100UL >> ((offset & 3) * 8)); #endif switch (offset_switch) { case 0: w[63] = hc_byte_perm_S (w[63], w[62], selector); w[62] = hc_byte_perm_S (w[62], w[61], selector); w[61] = hc_byte_perm_S (w[61], w[60], selector); w[60] = hc_byte_perm_S (w[60], w[59], selector); w[59] = hc_byte_perm_S (w[59], w[58], selector); w[58] = hc_byte_perm_S (w[58], w[57], selector); w[57] = hc_byte_perm_S (w[57], w[56], selector); w[56] = hc_byte_perm_S (w[56], w[55], selector); w[55] = hc_byte_perm_S (w[55], w[54], selector); w[54] = hc_byte_perm_S (w[54], w[53], selector); w[53] = hc_byte_perm_S (w[53], w[52], selector); w[52] = hc_byte_perm_S (w[52], w[51], selector); w[51] = hc_byte_perm_S (w[51], w[50], selector); w[50] = hc_byte_perm_S (w[50], w[49], selector); w[49] = hc_byte_perm_S (w[49], w[48], selector); w[48] = hc_byte_perm_S (w[48], w[47], selector); w[47] = hc_byte_perm_S (w[47], w[46], selector); w[46] = hc_byte_perm_S (w[46], w[45], selector); w[45] = hc_byte_perm_S (w[45], w[44], selector); w[44] = hc_byte_perm_S (w[44], w[43], selector); w[43] = hc_byte_perm_S (w[43], w[42], selector); w[42] = hc_byte_perm_S (w[42], w[41], selector); w[41] = hc_byte_perm_S (w[41], w[40], selector); w[40] = hc_byte_perm_S (w[40], w[39], selector); w[39] = hc_byte_perm_S (w[39], w[38], selector); w[38] = hc_byte_perm_S (w[38], w[37], selector); w[37] = hc_byte_perm_S (w[37], w[36], selector); w[36] = hc_byte_perm_S (w[36], w[35], selector); w[35] = hc_byte_perm_S (w[35], w[34], selector); w[34] = hc_byte_perm_S (w[34], w[33], selector); w[33] = hc_byte_perm_S (w[33], w[32], selector); w[32] = hc_byte_perm_S (w[32], w[31], selector); w[31] = hc_byte_perm_S (w[31], w[30], selector); w[30] = hc_byte_perm_S (w[30], w[29], selector); w[29] = hc_byte_perm_S (w[29], w[28], selector); w[28] = hc_byte_perm_S (w[28], w[27], selector); w[27] = hc_byte_perm_S (w[27], w[26], selector); w[26] = hc_byte_perm_S (w[26], w[25], selector); w[25] = hc_byte_perm_S (w[25], w[24], selector); w[24] = hc_byte_perm_S (w[24], w[23], selector); w[23] = hc_byte_perm_S (w[23], w[22], selector); w[22] = hc_byte_perm_S (w[22], w[21], selector); w[21] = hc_byte_perm_S (w[21], w[20], selector); w[20] = hc_byte_perm_S (w[20], w[19], selector); w[19] = hc_byte_perm_S (w[19], w[18], selector); w[18] = hc_byte_perm_S (w[18], w[17], selector); w[17] = hc_byte_perm_S (w[17], w[16], selector); w[16] = hc_byte_perm_S (w[16], w[15], selector); w[15] = hc_byte_perm_S (w[15], w[14], selector); w[14] = hc_byte_perm_S (w[14], w[13], selector); w[13] = hc_byte_perm_S (w[13], w[12], selector); w[12] = hc_byte_perm_S (w[12], w[11], selector); w[11] = hc_byte_perm_S (w[11], w[10], selector); w[10] = hc_byte_perm_S (w[10], w[ 9], selector); w[ 9] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[ 8] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[ 7] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[ 6] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[ 5] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[ 4] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[ 3] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[ 2] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[ 1] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[ 0] = hc_byte_perm_S (w[ 0], 0, selector); break; case 1: w[63] = hc_byte_perm_S (w[62], w[61], selector); w[62] = hc_byte_perm_S (w[61], w[60], selector); w[61] = hc_byte_perm_S (w[60], w[59], selector); w[60] = hc_byte_perm_S (w[59], w[58], selector); w[59] = hc_byte_perm_S (w[58], w[57], selector); w[58] = hc_byte_perm_S (w[57], w[56], selector); w[57] = hc_byte_perm_S (w[56], w[55], selector); w[56] = hc_byte_perm_S (w[55], w[54], selector); w[55] = hc_byte_perm_S (w[54], w[53], selector); w[54] = hc_byte_perm_S (w[53], w[52], selector); w[53] = hc_byte_perm_S (w[52], w[51], selector); w[52] = hc_byte_perm_S (w[51], w[50], selector); w[51] = hc_byte_perm_S (w[50], w[49], selector); w[50] = hc_byte_perm_S (w[49], w[48], selector); w[49] = hc_byte_perm_S (w[48], w[47], selector); w[48] = hc_byte_perm_S (w[47], w[46], selector); w[47] = hc_byte_perm_S (w[46], w[45], selector); w[46] = hc_byte_perm_S (w[45], w[44], selector); w[45] = hc_byte_perm_S (w[44], w[43], selector); w[44] = hc_byte_perm_S (w[43], w[42], selector); w[43] = hc_byte_perm_S (w[42], w[41], selector); w[42] = hc_byte_perm_S (w[41], w[40], selector); w[41] = hc_byte_perm_S (w[40], w[39], selector); w[40] = hc_byte_perm_S (w[39], w[38], selector); w[39] = hc_byte_perm_S (w[38], w[37], selector); w[38] = hc_byte_perm_S (w[37], w[36], selector); w[37] = hc_byte_perm_S (w[36], w[35], selector); w[36] = hc_byte_perm_S (w[35], w[34], selector); w[35] = hc_byte_perm_S (w[34], w[33], selector); w[34] = hc_byte_perm_S (w[33], w[32], selector); w[33] = hc_byte_perm_S (w[32], w[31], selector); w[32] = hc_byte_perm_S (w[31], w[30], selector); w[31] = hc_byte_perm_S (w[30], w[29], selector); w[30] = hc_byte_perm_S (w[29], w[28], selector); w[29] = hc_byte_perm_S (w[28], w[27], selector); w[28] = hc_byte_perm_S (w[27], w[26], selector); w[27] = hc_byte_perm_S (w[26], w[25], selector); w[26] = hc_byte_perm_S (w[25], w[24], selector); w[25] = hc_byte_perm_S (w[24], w[23], selector); w[24] = hc_byte_perm_S (w[23], w[22], selector); w[23] = hc_byte_perm_S (w[22], w[21], selector); w[22] = hc_byte_perm_S (w[21], w[20], selector); w[21] = hc_byte_perm_S (w[20], w[19], selector); w[20] = hc_byte_perm_S (w[19], w[18], selector); w[19] = hc_byte_perm_S (w[18], w[17], selector); w[18] = hc_byte_perm_S (w[17], w[16], selector); w[17] = hc_byte_perm_S (w[16], w[15], selector); w[16] = hc_byte_perm_S (w[15], w[14], selector); w[15] = hc_byte_perm_S (w[14], w[13], selector); w[14] = hc_byte_perm_S (w[13], w[12], selector); w[13] = hc_byte_perm_S (w[12], w[11], selector); w[12] = hc_byte_perm_S (w[11], w[10], selector); w[11] = hc_byte_perm_S (w[10], w[ 9], selector); w[10] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[ 9] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[ 8] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[ 7] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[ 6] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[ 5] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[ 4] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[ 3] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[ 2] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[ 1] = hc_byte_perm_S (w[ 0], 0, selector); w[ 0] = 0; break; case 2: w[63] = hc_byte_perm_S (w[61], w[60], selector); w[62] = hc_byte_perm_S (w[60], w[59], selector); w[61] = hc_byte_perm_S (w[59], w[58], selector); w[60] = hc_byte_perm_S (w[58], w[57], selector); w[59] = hc_byte_perm_S (w[57], w[56], selector); w[58] = hc_byte_perm_S (w[56], w[55], selector); w[57] = hc_byte_perm_S (w[55], w[54], selector); w[56] = hc_byte_perm_S (w[54], w[53], selector); w[55] = hc_byte_perm_S (w[53], w[52], selector); w[54] = hc_byte_perm_S (w[52], w[51], selector); w[53] = hc_byte_perm_S (w[51], w[50], selector); w[52] = hc_byte_perm_S (w[50], w[49], selector); w[51] = hc_byte_perm_S (w[49], w[48], selector); w[50] = hc_byte_perm_S (w[48], w[47], selector); w[49] = hc_byte_perm_S (w[47], w[46], selector); w[48] = hc_byte_perm_S (w[46], w[45], selector); w[47] = hc_byte_perm_S (w[45], w[44], selector); w[46] = hc_byte_perm_S (w[44], w[43], selector); w[45] = hc_byte_perm_S (w[43], w[42], selector); w[44] = hc_byte_perm_S (w[42], w[41], selector); w[43] = hc_byte_perm_S (w[41], w[40], selector); w[42] = hc_byte_perm_S (w[40], w[39], selector); w[41] = hc_byte_perm_S (w[39], w[38], selector); w[40] = hc_byte_perm_S (w[38], w[37], selector); w[39] = hc_byte_perm_S (w[37], w[36], selector); w[38] = hc_byte_perm_S (w[36], w[35], selector); w[37] = hc_byte_perm_S (w[35], w[34], selector); w[36] = hc_byte_perm_S (w[34], w[33], selector); w[35] = hc_byte_perm_S (w[33], w[32], selector); w[34] = hc_byte_perm_S (w[32], w[31], selector); w[33] = hc_byte_perm_S (w[31], w[30], selector); w[32] = hc_byte_perm_S (w[30], w[29], selector); w[31] = hc_byte_perm_S (w[29], w[28], selector); w[30] = hc_byte_perm_S (w[28], w[27], selector); w[29] = hc_byte_perm_S (w[27], w[26], selector); w[28] = hc_byte_perm_S (w[26], w[25], selector); w[27] = hc_byte_perm_S (w[25], w[24], selector); w[26] = hc_byte_perm_S (w[24], w[23], selector); w[25] = hc_byte_perm_S (w[23], w[22], selector); w[24] = hc_byte_perm_S (w[22], w[21], selector); w[23] = hc_byte_perm_S (w[21], w[20], selector); w[22] = hc_byte_perm_S (w[20], w[19], selector); w[21] = hc_byte_perm_S (w[19], w[18], selector); w[20] = hc_byte_perm_S (w[18], w[17], selector); w[19] = hc_byte_perm_S (w[17], w[16], selector); w[18] = hc_byte_perm_S (w[16], w[15], selector); w[17] = hc_byte_perm_S (w[15], w[14], selector); w[16] = hc_byte_perm_S (w[14], w[13], selector); w[15] = hc_byte_perm_S (w[13], w[12], selector); w[14] = hc_byte_perm_S (w[12], w[11], selector); w[13] = hc_byte_perm_S (w[11], w[10], selector); w[12] = hc_byte_perm_S (w[10], w[ 9], selector); w[11] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[10] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[ 9] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[ 8] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[ 7] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[ 6] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[ 5] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[ 4] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[ 3] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[ 2] = hc_byte_perm_S (w[ 0], 0, selector); w[ 1] = 0; w[ 0] = 0; break; case 3: w[63] = hc_byte_perm_S (w[60], w[59], selector); w[62] = hc_byte_perm_S (w[59], w[58], selector); w[61] = hc_byte_perm_S (w[58], w[57], selector); w[60] = hc_byte_perm_S (w[57], w[56], selector); w[59] = hc_byte_perm_S (w[56], w[55], selector); w[58] = hc_byte_perm_S (w[55], w[54], selector); w[57] = hc_byte_perm_S (w[54], w[53], selector); w[56] = hc_byte_perm_S (w[53], w[52], selector); w[55] = hc_byte_perm_S (w[52], w[51], selector); w[54] = hc_byte_perm_S (w[51], w[50], selector); w[53] = hc_byte_perm_S (w[50], w[49], selector); w[52] = hc_byte_perm_S (w[49], w[48], selector); w[51] = hc_byte_perm_S (w[48], w[47], selector); w[50] = hc_byte_perm_S (w[47], w[46], selector); w[49] = hc_byte_perm_S (w[46], w[45], selector); w[48] = hc_byte_perm_S (w[45], w[44], selector); w[47] = hc_byte_perm_S (w[44], w[43], selector); w[46] = hc_byte_perm_S (w[43], w[42], selector); w[45] = hc_byte_perm_S (w[42], w[41], selector); w[44] = hc_byte_perm_S (w[41], w[40], selector); w[43] = hc_byte_perm_S (w[40], w[39], selector); w[42] = hc_byte_perm_S (w[39], w[38], selector); w[41] = hc_byte_perm_S (w[38], w[37], selector); w[40] = hc_byte_perm_S (w[37], w[36], selector); w[39] = hc_byte_perm_S (w[36], w[35], selector); w[38] = hc_byte_perm_S (w[35], w[34], selector); w[37] = hc_byte_perm_S (w[34], w[33], selector); w[36] = hc_byte_perm_S (w[33], w[32], selector); w[35] = hc_byte_perm_S (w[32], w[31], selector); w[34] = hc_byte_perm_S (w[31], w[30], selector); w[33] = hc_byte_perm_S (w[30], w[29], selector); w[32] = hc_byte_perm_S (w[29], w[28], selector); w[31] = hc_byte_perm_S (w[28], w[27], selector); w[30] = hc_byte_perm_S (w[27], w[26], selector); w[29] = hc_byte_perm_S (w[26], w[25], selector); w[28] = hc_byte_perm_S (w[25], w[24], selector); w[27] = hc_byte_perm_S (w[24], w[23], selector); w[26] = hc_byte_perm_S (w[23], w[22], selector); w[25] = hc_byte_perm_S (w[22], w[21], selector); w[24] = hc_byte_perm_S (w[21], w[20], selector); w[23] = hc_byte_perm_S (w[20], w[19], selector); w[22] = hc_byte_perm_S (w[19], w[18], selector); w[21] = hc_byte_perm_S (w[18], w[17], selector); w[20] = hc_byte_perm_S (w[17], w[16], selector); w[19] = hc_byte_perm_S (w[16], w[15], selector); w[18] = hc_byte_perm_S (w[15], w[14], selector); w[17] = hc_byte_perm_S (w[14], w[13], selector); w[16] = hc_byte_perm_S (w[13], w[12], selector); w[15] = hc_byte_perm_S (w[12], w[11], selector); w[14] = hc_byte_perm_S (w[11], w[10], selector); w[13] = hc_byte_perm_S (w[10], w[ 9], selector); w[12] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[11] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[10] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[ 9] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[ 8] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[ 7] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[ 6] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[ 5] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[ 4] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[ 3] = hc_byte_perm_S (w[ 0], 0, selector); w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 4: w[63] = hc_byte_perm_S (w[59], w[58], selector); w[62] = hc_byte_perm_S (w[58], w[57], selector); w[61] = hc_byte_perm_S (w[57], w[56], selector); w[60] = hc_byte_perm_S (w[56], w[55], selector); w[59] = hc_byte_perm_S (w[55], w[54], selector); w[58] = hc_byte_perm_S (w[54], w[53], selector); w[57] = hc_byte_perm_S (w[53], w[52], selector); w[56] = hc_byte_perm_S (w[52], w[51], selector); w[55] = hc_byte_perm_S (w[51], w[50], selector); w[54] = hc_byte_perm_S (w[50], w[49], selector); w[53] = hc_byte_perm_S (w[49], w[48], selector); w[52] = hc_byte_perm_S (w[48], w[47], selector); w[51] = hc_byte_perm_S (w[47], w[46], selector); w[50] = hc_byte_perm_S (w[46], w[45], selector); w[49] = hc_byte_perm_S (w[45], w[44], selector); w[48] = hc_byte_perm_S (w[44], w[43], selector); w[47] = hc_byte_perm_S (w[43], w[42], selector); w[46] = hc_byte_perm_S (w[42], w[41], selector); w[45] = hc_byte_perm_S (w[41], w[40], selector); w[44] = hc_byte_perm_S (w[40], w[39], selector); w[43] = hc_byte_perm_S (w[39], w[38], selector); w[42] = hc_byte_perm_S (w[38], w[37], selector); w[41] = hc_byte_perm_S (w[37], w[36], selector); w[40] = hc_byte_perm_S (w[36], w[35], selector); w[39] = hc_byte_perm_S (w[35], w[34], selector); w[38] = hc_byte_perm_S (w[34], w[33], selector); w[37] = hc_byte_perm_S (w[33], w[32], selector); w[36] = hc_byte_perm_S (w[32], w[31], selector); w[35] = hc_byte_perm_S (w[31], w[30], selector); w[34] = hc_byte_perm_S (w[30], w[29], selector); w[33] = hc_byte_perm_S (w[29], w[28], selector); w[32] = hc_byte_perm_S (w[28], w[27], selector); w[31] = hc_byte_perm_S (w[27], w[26], selector); w[30] = hc_byte_perm_S (w[26], w[25], selector); w[29] = hc_byte_perm_S (w[25], w[24], selector); w[28] = hc_byte_perm_S (w[24], w[23], selector); w[27] = hc_byte_perm_S (w[23], w[22], selector); w[26] = hc_byte_perm_S (w[22], w[21], selector); w[25] = hc_byte_perm_S (w[21], w[20], selector); w[24] = hc_byte_perm_S (w[20], w[19], selector); w[23] = hc_byte_perm_S (w[19], w[18], selector); w[22] = hc_byte_perm_S (w[18], w[17], selector); w[21] = hc_byte_perm_S (w[17], w[16], selector); w[20] = hc_byte_perm_S (w[16], w[15], selector); w[19] = hc_byte_perm_S (w[15], w[14], selector); w[18] = hc_byte_perm_S (w[14], w[13], selector); w[17] = hc_byte_perm_S (w[13], w[12], selector); w[16] = hc_byte_perm_S (w[12], w[11], selector); w[15] = hc_byte_perm_S (w[11], w[10], selector); w[14] = hc_byte_perm_S (w[10], w[ 9], selector); w[13] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[12] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[11] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[10] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[ 9] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[ 8] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[ 7] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[ 6] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[ 5] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[ 4] = hc_byte_perm_S (w[ 0], 0, selector); w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 5: w[63] = hc_byte_perm_S (w[58], w[57], selector); w[62] = hc_byte_perm_S (w[57], w[56], selector); w[61] = hc_byte_perm_S (w[56], w[55], selector); w[60] = hc_byte_perm_S (w[55], w[54], selector); w[59] = hc_byte_perm_S (w[54], w[53], selector); w[58] = hc_byte_perm_S (w[53], w[52], selector); w[57] = hc_byte_perm_S (w[52], w[51], selector); w[56] = hc_byte_perm_S (w[51], w[50], selector); w[55] = hc_byte_perm_S (w[50], w[49], selector); w[54] = hc_byte_perm_S (w[49], w[48], selector); w[53] = hc_byte_perm_S (w[48], w[47], selector); w[52] = hc_byte_perm_S (w[47], w[46], selector); w[51] = hc_byte_perm_S (w[46], w[45], selector); w[50] = hc_byte_perm_S (w[45], w[44], selector); w[49] = hc_byte_perm_S (w[44], w[43], selector); w[48] = hc_byte_perm_S (w[43], w[42], selector); w[47] = hc_byte_perm_S (w[42], w[41], selector); w[46] = hc_byte_perm_S (w[41], w[40], selector); w[45] = hc_byte_perm_S (w[40], w[39], selector); w[44] = hc_byte_perm_S (w[39], w[38], selector); w[43] = hc_byte_perm_S (w[38], w[37], selector); w[42] = hc_byte_perm_S (w[37], w[36], selector); w[41] = hc_byte_perm_S (w[36], w[35], selector); w[40] = hc_byte_perm_S (w[35], w[34], selector); w[39] = hc_byte_perm_S (w[34], w[33], selector); w[38] = hc_byte_perm_S (w[33], w[32], selector); w[37] = hc_byte_perm_S (w[32], w[31], selector); w[36] = hc_byte_perm_S (w[31], w[30], selector); w[35] = hc_byte_perm_S (w[30], w[29], selector); w[34] = hc_byte_perm_S (w[29], w[28], selector); w[33] = hc_byte_perm_S (w[28], w[27], selector); w[32] = hc_byte_perm_S (w[27], w[26], selector); w[31] = hc_byte_perm_S (w[26], w[25], selector); w[30] = hc_byte_perm_S (w[25], w[24], selector); w[29] = hc_byte_perm_S (w[24], w[23], selector); w[28] = hc_byte_perm_S (w[23], w[22], selector); w[27] = hc_byte_perm_S (w[22], w[21], selector); w[26] = hc_byte_perm_S (w[21], w[20], selector); w[25] = hc_byte_perm_S (w[20], w[19], selector); w[24] = hc_byte_perm_S (w[19], w[18], selector); w[23] = hc_byte_perm_S (w[18], w[17], selector); w[22] = hc_byte_perm_S (w[17], w[16], selector); w[21] = hc_byte_perm_S (w[16], w[15], selector); w[20] = hc_byte_perm_S (w[15], w[14], selector); w[19] = hc_byte_perm_S (w[14], w[13], selector); w[18] = hc_byte_perm_S (w[13], w[12], selector); w[17] = hc_byte_perm_S (w[12], w[11], selector); w[16] = hc_byte_perm_S (w[11], w[10], selector); w[15] = hc_byte_perm_S (w[10], w[ 9], selector); w[14] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[13] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[12] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[11] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[10] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[ 9] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[ 8] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[ 7] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[ 6] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[ 5] = hc_byte_perm_S (w[ 0], 0, selector); w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 6: w[63] = hc_byte_perm_S (w[57], w[56], selector); w[62] = hc_byte_perm_S (w[56], w[55], selector); w[61] = hc_byte_perm_S (w[55], w[54], selector); w[60] = hc_byte_perm_S (w[54], w[53], selector); w[59] = hc_byte_perm_S (w[53], w[52], selector); w[58] = hc_byte_perm_S (w[52], w[51], selector); w[57] = hc_byte_perm_S (w[51], w[50], selector); w[56] = hc_byte_perm_S (w[50], w[49], selector); w[55] = hc_byte_perm_S (w[49], w[48], selector); w[54] = hc_byte_perm_S (w[48], w[47], selector); w[53] = hc_byte_perm_S (w[47], w[46], selector); w[52] = hc_byte_perm_S (w[46], w[45], selector); w[51] = hc_byte_perm_S (w[45], w[44], selector); w[50] = hc_byte_perm_S (w[44], w[43], selector); w[49] = hc_byte_perm_S (w[43], w[42], selector); w[48] = hc_byte_perm_S (w[42], w[41], selector); w[47] = hc_byte_perm_S (w[41], w[40], selector); w[46] = hc_byte_perm_S (w[40], w[39], selector); w[45] = hc_byte_perm_S (w[39], w[38], selector); w[44] = hc_byte_perm_S (w[38], w[37], selector); w[43] = hc_byte_perm_S (w[37], w[36], selector); w[42] = hc_byte_perm_S (w[36], w[35], selector); w[41] = hc_byte_perm_S (w[35], w[34], selector); w[40] = hc_byte_perm_S (w[34], w[33], selector); w[39] = hc_byte_perm_S (w[33], w[32], selector); w[38] = hc_byte_perm_S (w[32], w[31], selector); w[37] = hc_byte_perm_S (w[31], w[30], selector); w[36] = hc_byte_perm_S (w[30], w[29], selector); w[35] = hc_byte_perm_S (w[29], w[28], selector); w[34] = hc_byte_perm_S (w[28], w[27], selector); w[33] = hc_byte_perm_S (w[27], w[26], selector); w[32] = hc_byte_perm_S (w[26], w[25], selector); w[31] = hc_byte_perm_S (w[25], w[24], selector); w[30] = hc_byte_perm_S (w[24], w[23], selector); w[29] = hc_byte_perm_S (w[23], w[22], selector); w[28] = hc_byte_perm_S (w[22], w[21], selector); w[27] = hc_byte_perm_S (w[21], w[20], selector); w[26] = hc_byte_perm_S (w[20], w[19], selector); w[25] = hc_byte_perm_S (w[19], w[18], selector); w[24] = hc_byte_perm_S (w[18], w[17], selector); w[23] = hc_byte_perm_S (w[17], w[16], selector); w[22] = hc_byte_perm_S (w[16], w[15], selector); w[21] = hc_byte_perm_S (w[15], w[14], selector); w[20] = hc_byte_perm_S (w[14], w[13], selector); w[19] = hc_byte_perm_S (w[13], w[12], selector); w[18] = hc_byte_perm_S (w[12], w[11], selector); w[17] = hc_byte_perm_S (w[11], w[10], selector); w[16] = hc_byte_perm_S (w[10], w[ 9], selector); w[15] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[14] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[13] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[12] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[11] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[10] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[ 9] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[ 8] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[ 7] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[ 6] = hc_byte_perm_S (w[ 0], 0, selector); w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 7: w[63] = hc_byte_perm_S (w[56], w[55], selector); w[62] = hc_byte_perm_S (w[55], w[54], selector); w[61] = hc_byte_perm_S (w[54], w[53], selector); w[60] = hc_byte_perm_S (w[53], w[52], selector); w[59] = hc_byte_perm_S (w[52], w[51], selector); w[58] = hc_byte_perm_S (w[51], w[50], selector); w[57] = hc_byte_perm_S (w[50], w[49], selector); w[56] = hc_byte_perm_S (w[49], w[48], selector); w[55] = hc_byte_perm_S (w[48], w[47], selector); w[54] = hc_byte_perm_S (w[47], w[46], selector); w[53] = hc_byte_perm_S (w[46], w[45], selector); w[52] = hc_byte_perm_S (w[45], w[44], selector); w[51] = hc_byte_perm_S (w[44], w[43], selector); w[50] = hc_byte_perm_S (w[43], w[42], selector); w[49] = hc_byte_perm_S (w[42], w[41], selector); w[48] = hc_byte_perm_S (w[41], w[40], selector); w[47] = hc_byte_perm_S (w[40], w[39], selector); w[46] = hc_byte_perm_S (w[39], w[38], selector); w[45] = hc_byte_perm_S (w[38], w[37], selector); w[44] = hc_byte_perm_S (w[37], w[36], selector); w[43] = hc_byte_perm_S (w[36], w[35], selector); w[42] = hc_byte_perm_S (w[35], w[34], selector); w[41] = hc_byte_perm_S (w[34], w[33], selector); w[40] = hc_byte_perm_S (w[33], w[32], selector); w[39] = hc_byte_perm_S (w[32], w[31], selector); w[38] = hc_byte_perm_S (w[31], w[30], selector); w[37] = hc_byte_perm_S (w[30], w[29], selector); w[36] = hc_byte_perm_S (w[29], w[28], selector); w[35] = hc_byte_perm_S (w[28], w[27], selector); w[34] = hc_byte_perm_S (w[27], w[26], selector); w[33] = hc_byte_perm_S (w[26], w[25], selector); w[32] = hc_byte_perm_S (w[25], w[24], selector); w[31] = hc_byte_perm_S (w[24], w[23], selector); w[30] = hc_byte_perm_S (w[23], w[22], selector); w[29] = hc_byte_perm_S (w[22], w[21], selector); w[28] = hc_byte_perm_S (w[21], w[20], selector); w[27] = hc_byte_perm_S (w[20], w[19], selector); w[26] = hc_byte_perm_S (w[19], w[18], selector); w[25] = hc_byte_perm_S (w[18], w[17], selector); w[24] = hc_byte_perm_S (w[17], w[16], selector); w[23] = hc_byte_perm_S (w[16], w[15], selector); w[22] = hc_byte_perm_S (w[15], w[14], selector); w[21] = hc_byte_perm_S (w[14], w[13], selector); w[20] = hc_byte_perm_S (w[13], w[12], selector); w[19] = hc_byte_perm_S (w[12], w[11], selector); w[18] = hc_byte_perm_S (w[11], w[10], selector); w[17] = hc_byte_perm_S (w[10], w[ 9], selector); w[16] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[15] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[14] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[13] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[12] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[11] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[10] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[ 9] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[ 8] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[ 7] = hc_byte_perm_S (w[ 0], 0, selector); w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 8: w[63] = hc_byte_perm_S (w[55], w[54], selector); w[62] = hc_byte_perm_S (w[54], w[53], selector); w[61] = hc_byte_perm_S (w[53], w[52], selector); w[60] = hc_byte_perm_S (w[52], w[51], selector); w[59] = hc_byte_perm_S (w[51], w[50], selector); w[58] = hc_byte_perm_S (w[50], w[49], selector); w[57] = hc_byte_perm_S (w[49], w[48], selector); w[56] = hc_byte_perm_S (w[48], w[47], selector); w[55] = hc_byte_perm_S (w[47], w[46], selector); w[54] = hc_byte_perm_S (w[46], w[45], selector); w[53] = hc_byte_perm_S (w[45], w[44], selector); w[52] = hc_byte_perm_S (w[44], w[43], selector); w[51] = hc_byte_perm_S (w[43], w[42], selector); w[50] = hc_byte_perm_S (w[42], w[41], selector); w[49] = hc_byte_perm_S (w[41], w[40], selector); w[48] = hc_byte_perm_S (w[40], w[39], selector); w[47] = hc_byte_perm_S (w[39], w[38], selector); w[46] = hc_byte_perm_S (w[38], w[37], selector); w[45] = hc_byte_perm_S (w[37], w[36], selector); w[44] = hc_byte_perm_S (w[36], w[35], selector); w[43] = hc_byte_perm_S (w[35], w[34], selector); w[42] = hc_byte_perm_S (w[34], w[33], selector); w[41] = hc_byte_perm_S (w[33], w[32], selector); w[40] = hc_byte_perm_S (w[32], w[31], selector); w[39] = hc_byte_perm_S (w[31], w[30], selector); w[38] = hc_byte_perm_S (w[30], w[29], selector); w[37] = hc_byte_perm_S (w[29], w[28], selector); w[36] = hc_byte_perm_S (w[28], w[27], selector); w[35] = hc_byte_perm_S (w[27], w[26], selector); w[34] = hc_byte_perm_S (w[26], w[25], selector); w[33] = hc_byte_perm_S (w[25], w[24], selector); w[32] = hc_byte_perm_S (w[24], w[23], selector); w[31] = hc_byte_perm_S (w[23], w[22], selector); w[30] = hc_byte_perm_S (w[22], w[21], selector); w[29] = hc_byte_perm_S (w[21], w[20], selector); w[28] = hc_byte_perm_S (w[20], w[19], selector); w[27] = hc_byte_perm_S (w[19], w[18], selector); w[26] = hc_byte_perm_S (w[18], w[17], selector); w[25] = hc_byte_perm_S (w[17], w[16], selector); w[24] = hc_byte_perm_S (w[16], w[15], selector); w[23] = hc_byte_perm_S (w[15], w[14], selector); w[22] = hc_byte_perm_S (w[14], w[13], selector); w[21] = hc_byte_perm_S (w[13], w[12], selector); w[20] = hc_byte_perm_S (w[12], w[11], selector); w[19] = hc_byte_perm_S (w[11], w[10], selector); w[18] = hc_byte_perm_S (w[10], w[ 9], selector); w[17] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[16] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[15] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[14] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[13] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[12] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[11] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[10] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[ 9] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[ 8] = hc_byte_perm_S (w[ 0], 0, selector); w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 9: w[63] = hc_byte_perm_S (w[54], w[53], selector); w[62] = hc_byte_perm_S (w[53], w[52], selector); w[61] = hc_byte_perm_S (w[52], w[51], selector); w[60] = hc_byte_perm_S (w[51], w[50], selector); w[59] = hc_byte_perm_S (w[50], w[49], selector); w[58] = hc_byte_perm_S (w[49], w[48], selector); w[57] = hc_byte_perm_S (w[48], w[47], selector); w[56] = hc_byte_perm_S (w[47], w[46], selector); w[55] = hc_byte_perm_S (w[46], w[45], selector); w[54] = hc_byte_perm_S (w[45], w[44], selector); w[53] = hc_byte_perm_S (w[44], w[43], selector); w[52] = hc_byte_perm_S (w[43], w[42], selector); w[51] = hc_byte_perm_S (w[42], w[41], selector); w[50] = hc_byte_perm_S (w[41], w[40], selector); w[49] = hc_byte_perm_S (w[40], w[39], selector); w[48] = hc_byte_perm_S (w[39], w[38], selector); w[47] = hc_byte_perm_S (w[38], w[37], selector); w[46] = hc_byte_perm_S (w[37], w[36], selector); w[45] = hc_byte_perm_S (w[36], w[35], selector); w[44] = hc_byte_perm_S (w[35], w[34], selector); w[43] = hc_byte_perm_S (w[34], w[33], selector); w[42] = hc_byte_perm_S (w[33], w[32], selector); w[41] = hc_byte_perm_S (w[32], w[31], selector); w[40] = hc_byte_perm_S (w[31], w[30], selector); w[39] = hc_byte_perm_S (w[30], w[29], selector); w[38] = hc_byte_perm_S (w[29], w[28], selector); w[37] = hc_byte_perm_S (w[28], w[27], selector); w[36] = hc_byte_perm_S (w[27], w[26], selector); w[35] = hc_byte_perm_S (w[26], w[25], selector); w[34] = hc_byte_perm_S (w[25], w[24], selector); w[33] = hc_byte_perm_S (w[24], w[23], selector); w[32] = hc_byte_perm_S (w[23], w[22], selector); w[31] = hc_byte_perm_S (w[22], w[21], selector); w[30] = hc_byte_perm_S (w[21], w[20], selector); w[29] = hc_byte_perm_S (w[20], w[19], selector); w[28] = hc_byte_perm_S (w[19], w[18], selector); w[27] = hc_byte_perm_S (w[18], w[17], selector); w[26] = hc_byte_perm_S (w[17], w[16], selector); w[25] = hc_byte_perm_S (w[16], w[15], selector); w[24] = hc_byte_perm_S (w[15], w[14], selector); w[23] = hc_byte_perm_S (w[14], w[13], selector); w[22] = hc_byte_perm_S (w[13], w[12], selector); w[21] = hc_byte_perm_S (w[12], w[11], selector); w[20] = hc_byte_perm_S (w[11], w[10], selector); w[19] = hc_byte_perm_S (w[10], w[ 9], selector); w[18] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[17] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[16] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[15] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[14] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[13] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[12] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[11] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[10] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[ 9] = hc_byte_perm_S (w[ 0], 0, selector); w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 10: w[63] = hc_byte_perm_S (w[53], w[52], selector); w[62] = hc_byte_perm_S (w[52], w[51], selector); w[61] = hc_byte_perm_S (w[51], w[50], selector); w[60] = hc_byte_perm_S (w[50], w[49], selector); w[59] = hc_byte_perm_S (w[49], w[48], selector); w[58] = hc_byte_perm_S (w[48], w[47], selector); w[57] = hc_byte_perm_S (w[47], w[46], selector); w[56] = hc_byte_perm_S (w[46], w[45], selector); w[55] = hc_byte_perm_S (w[45], w[44], selector); w[54] = hc_byte_perm_S (w[44], w[43], selector); w[53] = hc_byte_perm_S (w[43], w[42], selector); w[52] = hc_byte_perm_S (w[42], w[41], selector); w[51] = hc_byte_perm_S (w[41], w[40], selector); w[50] = hc_byte_perm_S (w[40], w[39], selector); w[49] = hc_byte_perm_S (w[39], w[38], selector); w[48] = hc_byte_perm_S (w[38], w[37], selector); w[47] = hc_byte_perm_S (w[37], w[36], selector); w[46] = hc_byte_perm_S (w[36], w[35], selector); w[45] = hc_byte_perm_S (w[35], w[34], selector); w[44] = hc_byte_perm_S (w[34], w[33], selector); w[43] = hc_byte_perm_S (w[33], w[32], selector); w[42] = hc_byte_perm_S (w[32], w[31], selector); w[41] = hc_byte_perm_S (w[31], w[30], selector); w[40] = hc_byte_perm_S (w[30], w[29], selector); w[39] = hc_byte_perm_S (w[29], w[28], selector); w[38] = hc_byte_perm_S (w[28], w[27], selector); w[37] = hc_byte_perm_S (w[27], w[26], selector); w[36] = hc_byte_perm_S (w[26], w[25], selector); w[35] = hc_byte_perm_S (w[25], w[24], selector); w[34] = hc_byte_perm_S (w[24], w[23], selector); w[33] = hc_byte_perm_S (w[23], w[22], selector); w[32] = hc_byte_perm_S (w[22], w[21], selector); w[31] = hc_byte_perm_S (w[21], w[20], selector); w[30] = hc_byte_perm_S (w[20], w[19], selector); w[29] = hc_byte_perm_S (w[19], w[18], selector); w[28] = hc_byte_perm_S (w[18], w[17], selector); w[27] = hc_byte_perm_S (w[17], w[16], selector); w[26] = hc_byte_perm_S (w[16], w[15], selector); w[25] = hc_byte_perm_S (w[15], w[14], selector); w[24] = hc_byte_perm_S (w[14], w[13], selector); w[23] = hc_byte_perm_S (w[13], w[12], selector); w[22] = hc_byte_perm_S (w[12], w[11], selector); w[21] = hc_byte_perm_S (w[11], w[10], selector); w[20] = hc_byte_perm_S (w[10], w[ 9], selector); w[19] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[18] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[17] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[16] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[15] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[14] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[13] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[12] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[11] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[10] = hc_byte_perm_S (w[ 0], 0, selector); w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 11: w[63] = hc_byte_perm_S (w[52], w[51], selector); w[62] = hc_byte_perm_S (w[51], w[50], selector); w[61] = hc_byte_perm_S (w[50], w[49], selector); w[60] = hc_byte_perm_S (w[49], w[48], selector); w[59] = hc_byte_perm_S (w[48], w[47], selector); w[58] = hc_byte_perm_S (w[47], w[46], selector); w[57] = hc_byte_perm_S (w[46], w[45], selector); w[56] = hc_byte_perm_S (w[45], w[44], selector); w[55] = hc_byte_perm_S (w[44], w[43], selector); w[54] = hc_byte_perm_S (w[43], w[42], selector); w[53] = hc_byte_perm_S (w[42], w[41], selector); w[52] = hc_byte_perm_S (w[41], w[40], selector); w[51] = hc_byte_perm_S (w[40], w[39], selector); w[50] = hc_byte_perm_S (w[39], w[38], selector); w[49] = hc_byte_perm_S (w[38], w[37], selector); w[48] = hc_byte_perm_S (w[37], w[36], selector); w[47] = hc_byte_perm_S (w[36], w[35], selector); w[46] = hc_byte_perm_S (w[35], w[34], selector); w[45] = hc_byte_perm_S (w[34], w[33], selector); w[44] = hc_byte_perm_S (w[33], w[32], selector); w[43] = hc_byte_perm_S (w[32], w[31], selector); w[42] = hc_byte_perm_S (w[31], w[30], selector); w[41] = hc_byte_perm_S (w[30], w[29], selector); w[40] = hc_byte_perm_S (w[29], w[28], selector); w[39] = hc_byte_perm_S (w[28], w[27], selector); w[38] = hc_byte_perm_S (w[27], w[26], selector); w[37] = hc_byte_perm_S (w[26], w[25], selector); w[36] = hc_byte_perm_S (w[25], w[24], selector); w[35] = hc_byte_perm_S (w[24], w[23], selector); w[34] = hc_byte_perm_S (w[23], w[22], selector); w[33] = hc_byte_perm_S (w[22], w[21], selector); w[32] = hc_byte_perm_S (w[21], w[20], selector); w[31] = hc_byte_perm_S (w[20], w[19], selector); w[30] = hc_byte_perm_S (w[19], w[18], selector); w[29] = hc_byte_perm_S (w[18], w[17], selector); w[28] = hc_byte_perm_S (w[17], w[16], selector); w[27] = hc_byte_perm_S (w[16], w[15], selector); w[26] = hc_byte_perm_S (w[15], w[14], selector); w[25] = hc_byte_perm_S (w[14], w[13], selector); w[24] = hc_byte_perm_S (w[13], w[12], selector); w[23] = hc_byte_perm_S (w[12], w[11], selector); w[22] = hc_byte_perm_S (w[11], w[10], selector); w[21] = hc_byte_perm_S (w[10], w[ 9], selector); w[20] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[19] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[18] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[17] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[16] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[15] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[14] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[13] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[12] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[11] = hc_byte_perm_S (w[ 0], 0, selector); w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 12: w[63] = hc_byte_perm_S (w[51], w[50], selector); w[62] = hc_byte_perm_S (w[50], w[49], selector); w[61] = hc_byte_perm_S (w[49], w[48], selector); w[60] = hc_byte_perm_S (w[48], w[47], selector); w[59] = hc_byte_perm_S (w[47], w[46], selector); w[58] = hc_byte_perm_S (w[46], w[45], selector); w[57] = hc_byte_perm_S (w[45], w[44], selector); w[56] = hc_byte_perm_S (w[44], w[43], selector); w[55] = hc_byte_perm_S (w[43], w[42], selector); w[54] = hc_byte_perm_S (w[42], w[41], selector); w[53] = hc_byte_perm_S (w[41], w[40], selector); w[52] = hc_byte_perm_S (w[40], w[39], selector); w[51] = hc_byte_perm_S (w[39], w[38], selector); w[50] = hc_byte_perm_S (w[38], w[37], selector); w[49] = hc_byte_perm_S (w[37], w[36], selector); w[48] = hc_byte_perm_S (w[36], w[35], selector); w[47] = hc_byte_perm_S (w[35], w[34], selector); w[46] = hc_byte_perm_S (w[34], w[33], selector); w[45] = hc_byte_perm_S (w[33], w[32], selector); w[44] = hc_byte_perm_S (w[32], w[31], selector); w[43] = hc_byte_perm_S (w[31], w[30], selector); w[42] = hc_byte_perm_S (w[30], w[29], selector); w[41] = hc_byte_perm_S (w[29], w[28], selector); w[40] = hc_byte_perm_S (w[28], w[27], selector); w[39] = hc_byte_perm_S (w[27], w[26], selector); w[38] = hc_byte_perm_S (w[26], w[25], selector); w[37] = hc_byte_perm_S (w[25], w[24], selector); w[36] = hc_byte_perm_S (w[24], w[23], selector); w[35] = hc_byte_perm_S (w[23], w[22], selector); w[34] = hc_byte_perm_S (w[22], w[21], selector); w[33] = hc_byte_perm_S (w[21], w[20], selector); w[32] = hc_byte_perm_S (w[20], w[19], selector); w[31] = hc_byte_perm_S (w[19], w[18], selector); w[30] = hc_byte_perm_S (w[18], w[17], selector); w[29] = hc_byte_perm_S (w[17], w[16], selector); w[28] = hc_byte_perm_S (w[16], w[15], selector); w[27] = hc_byte_perm_S (w[15], w[14], selector); w[26] = hc_byte_perm_S (w[14], w[13], selector); w[25] = hc_byte_perm_S (w[13], w[12], selector); w[24] = hc_byte_perm_S (w[12], w[11], selector); w[23] = hc_byte_perm_S (w[11], w[10], selector); w[22] = hc_byte_perm_S (w[10], w[ 9], selector); w[21] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[20] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[19] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[18] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[17] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[16] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[15] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[14] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[13] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[12] = hc_byte_perm_S (w[ 0], 0, selector); w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 13: w[63] = hc_byte_perm_S (w[50], w[49], selector); w[62] = hc_byte_perm_S (w[49], w[48], selector); w[61] = hc_byte_perm_S (w[48], w[47], selector); w[60] = hc_byte_perm_S (w[47], w[46], selector); w[59] = hc_byte_perm_S (w[46], w[45], selector); w[58] = hc_byte_perm_S (w[45], w[44], selector); w[57] = hc_byte_perm_S (w[44], w[43], selector); w[56] = hc_byte_perm_S (w[43], w[42], selector); w[55] = hc_byte_perm_S (w[42], w[41], selector); w[54] = hc_byte_perm_S (w[41], w[40], selector); w[53] = hc_byte_perm_S (w[40], w[39], selector); w[52] = hc_byte_perm_S (w[39], w[38], selector); w[51] = hc_byte_perm_S (w[38], w[37], selector); w[50] = hc_byte_perm_S (w[37], w[36], selector); w[49] = hc_byte_perm_S (w[36], w[35], selector); w[48] = hc_byte_perm_S (w[35], w[34], selector); w[47] = hc_byte_perm_S (w[34], w[33], selector); w[46] = hc_byte_perm_S (w[33], w[32], selector); w[45] = hc_byte_perm_S (w[32], w[31], selector); w[44] = hc_byte_perm_S (w[31], w[30], selector); w[43] = hc_byte_perm_S (w[30], w[29], selector); w[42] = hc_byte_perm_S (w[29], w[28], selector); w[41] = hc_byte_perm_S (w[28], w[27], selector); w[40] = hc_byte_perm_S (w[27], w[26], selector); w[39] = hc_byte_perm_S (w[26], w[25], selector); w[38] = hc_byte_perm_S (w[25], w[24], selector); w[37] = hc_byte_perm_S (w[24], w[23], selector); w[36] = hc_byte_perm_S (w[23], w[22], selector); w[35] = hc_byte_perm_S (w[22], w[21], selector); w[34] = hc_byte_perm_S (w[21], w[20], selector); w[33] = hc_byte_perm_S (w[20], w[19], selector); w[32] = hc_byte_perm_S (w[19], w[18], selector); w[31] = hc_byte_perm_S (w[18], w[17], selector); w[30] = hc_byte_perm_S (w[17], w[16], selector); w[29] = hc_byte_perm_S (w[16], w[15], selector); w[28] = hc_byte_perm_S (w[15], w[14], selector); w[27] = hc_byte_perm_S (w[14], w[13], selector); w[26] = hc_byte_perm_S (w[13], w[12], selector); w[25] = hc_byte_perm_S (w[12], w[11], selector); w[24] = hc_byte_perm_S (w[11], w[10], selector); w[23] = hc_byte_perm_S (w[10], w[ 9], selector); w[22] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[21] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[20] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[19] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[18] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[17] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[16] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[15] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[14] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[13] = hc_byte_perm_S (w[ 0], 0, selector); w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 14: w[63] = hc_byte_perm_S (w[49], w[48], selector); w[62] = hc_byte_perm_S (w[48], w[47], selector); w[61] = hc_byte_perm_S (w[47], w[46], selector); w[60] = hc_byte_perm_S (w[46], w[45], selector); w[59] = hc_byte_perm_S (w[45], w[44], selector); w[58] = hc_byte_perm_S (w[44], w[43], selector); w[57] = hc_byte_perm_S (w[43], w[42], selector); w[56] = hc_byte_perm_S (w[42], w[41], selector); w[55] = hc_byte_perm_S (w[41], w[40], selector); w[54] = hc_byte_perm_S (w[40], w[39], selector); w[53] = hc_byte_perm_S (w[39], w[38], selector); w[52] = hc_byte_perm_S (w[38], w[37], selector); w[51] = hc_byte_perm_S (w[37], w[36], selector); w[50] = hc_byte_perm_S (w[36], w[35], selector); w[49] = hc_byte_perm_S (w[35], w[34], selector); w[48] = hc_byte_perm_S (w[34], w[33], selector); w[47] = hc_byte_perm_S (w[33], w[32], selector); w[46] = hc_byte_perm_S (w[32], w[31], selector); w[45] = hc_byte_perm_S (w[31], w[30], selector); w[44] = hc_byte_perm_S (w[30], w[29], selector); w[43] = hc_byte_perm_S (w[29], w[28], selector); w[42] = hc_byte_perm_S (w[28], w[27], selector); w[41] = hc_byte_perm_S (w[27], w[26], selector); w[40] = hc_byte_perm_S (w[26], w[25], selector); w[39] = hc_byte_perm_S (w[25], w[24], selector); w[38] = hc_byte_perm_S (w[24], w[23], selector); w[37] = hc_byte_perm_S (w[23], w[22], selector); w[36] = hc_byte_perm_S (w[22], w[21], selector); w[35] = hc_byte_perm_S (w[21], w[20], selector); w[34] = hc_byte_perm_S (w[20], w[19], selector); w[33] = hc_byte_perm_S (w[19], w[18], selector); w[32] = hc_byte_perm_S (w[18], w[17], selector); w[31] = hc_byte_perm_S (w[17], w[16], selector); w[30] = hc_byte_perm_S (w[16], w[15], selector); w[29] = hc_byte_perm_S (w[15], w[14], selector); w[28] = hc_byte_perm_S (w[14], w[13], selector); w[27] = hc_byte_perm_S (w[13], w[12], selector); w[26] = hc_byte_perm_S (w[12], w[11], selector); w[25] = hc_byte_perm_S (w[11], w[10], selector); w[24] = hc_byte_perm_S (w[10], w[ 9], selector); w[23] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[22] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[21] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[20] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[19] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[18] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[17] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[16] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[15] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[14] = hc_byte_perm_S (w[ 0], 0, selector); w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 15: w[63] = hc_byte_perm_S (w[48], w[47], selector); w[62] = hc_byte_perm_S (w[47], w[46], selector); w[61] = hc_byte_perm_S (w[46], w[45], selector); w[60] = hc_byte_perm_S (w[45], w[44], selector); w[59] = hc_byte_perm_S (w[44], w[43], selector); w[58] = hc_byte_perm_S (w[43], w[42], selector); w[57] = hc_byte_perm_S (w[42], w[41], selector); w[56] = hc_byte_perm_S (w[41], w[40], selector); w[55] = hc_byte_perm_S (w[40], w[39], selector); w[54] = hc_byte_perm_S (w[39], w[38], selector); w[53] = hc_byte_perm_S (w[38], w[37], selector); w[52] = hc_byte_perm_S (w[37], w[36], selector); w[51] = hc_byte_perm_S (w[36], w[35], selector); w[50] = hc_byte_perm_S (w[35], w[34], selector); w[49] = hc_byte_perm_S (w[34], w[33], selector); w[48] = hc_byte_perm_S (w[33], w[32], selector); w[47] = hc_byte_perm_S (w[32], w[31], selector); w[46] = hc_byte_perm_S (w[31], w[30], selector); w[45] = hc_byte_perm_S (w[30], w[29], selector); w[44] = hc_byte_perm_S (w[29], w[28], selector); w[43] = hc_byte_perm_S (w[28], w[27], selector); w[42] = hc_byte_perm_S (w[27], w[26], selector); w[41] = hc_byte_perm_S (w[26], w[25], selector); w[40] = hc_byte_perm_S (w[25], w[24], selector); w[39] = hc_byte_perm_S (w[24], w[23], selector); w[38] = hc_byte_perm_S (w[23], w[22], selector); w[37] = hc_byte_perm_S (w[22], w[21], selector); w[36] = hc_byte_perm_S (w[21], w[20], selector); w[35] = hc_byte_perm_S (w[20], w[19], selector); w[34] = hc_byte_perm_S (w[19], w[18], selector); w[33] = hc_byte_perm_S (w[18], w[17], selector); w[32] = hc_byte_perm_S (w[17], w[16], selector); w[31] = hc_byte_perm_S (w[16], w[15], selector); w[30] = hc_byte_perm_S (w[15], w[14], selector); w[29] = hc_byte_perm_S (w[14], w[13], selector); w[28] = hc_byte_perm_S (w[13], w[12], selector); w[27] = hc_byte_perm_S (w[12], w[11], selector); w[26] = hc_byte_perm_S (w[11], w[10], selector); w[25] = hc_byte_perm_S (w[10], w[ 9], selector); w[24] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[23] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[22] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[21] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[20] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[19] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[18] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[17] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[16] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[15] = hc_byte_perm_S (w[ 0], 0, selector); w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 16: w[63] = hc_byte_perm_S (w[47], w[46], selector); w[62] = hc_byte_perm_S (w[46], w[45], selector); w[61] = hc_byte_perm_S (w[45], w[44], selector); w[60] = hc_byte_perm_S (w[44], w[43], selector); w[59] = hc_byte_perm_S (w[43], w[42], selector); w[58] = hc_byte_perm_S (w[42], w[41], selector); w[57] = hc_byte_perm_S (w[41], w[40], selector); w[56] = hc_byte_perm_S (w[40], w[39], selector); w[55] = hc_byte_perm_S (w[39], w[38], selector); w[54] = hc_byte_perm_S (w[38], w[37], selector); w[53] = hc_byte_perm_S (w[37], w[36], selector); w[52] = hc_byte_perm_S (w[36], w[35], selector); w[51] = hc_byte_perm_S (w[35], w[34], selector); w[50] = hc_byte_perm_S (w[34], w[33], selector); w[49] = hc_byte_perm_S (w[33], w[32], selector); w[48] = hc_byte_perm_S (w[32], w[31], selector); w[47] = hc_byte_perm_S (w[31], w[30], selector); w[46] = hc_byte_perm_S (w[30], w[29], selector); w[45] = hc_byte_perm_S (w[29], w[28], selector); w[44] = hc_byte_perm_S (w[28], w[27], selector); w[43] = hc_byte_perm_S (w[27], w[26], selector); w[42] = hc_byte_perm_S (w[26], w[25], selector); w[41] = hc_byte_perm_S (w[25], w[24], selector); w[40] = hc_byte_perm_S (w[24], w[23], selector); w[39] = hc_byte_perm_S (w[23], w[22], selector); w[38] = hc_byte_perm_S (w[22], w[21], selector); w[37] = hc_byte_perm_S (w[21], w[20], selector); w[36] = hc_byte_perm_S (w[20], w[19], selector); w[35] = hc_byte_perm_S (w[19], w[18], selector); w[34] = hc_byte_perm_S (w[18], w[17], selector); w[33] = hc_byte_perm_S (w[17], w[16], selector); w[32] = hc_byte_perm_S (w[16], w[15], selector); w[31] = hc_byte_perm_S (w[15], w[14], selector); w[30] = hc_byte_perm_S (w[14], w[13], selector); w[29] = hc_byte_perm_S (w[13], w[12], selector); w[28] = hc_byte_perm_S (w[12], w[11], selector); w[27] = hc_byte_perm_S (w[11], w[10], selector); w[26] = hc_byte_perm_S (w[10], w[ 9], selector); w[25] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[24] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[23] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[22] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[21] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[20] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[19] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[18] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[17] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[16] = hc_byte_perm_S (w[ 0], 0, selector); w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 17: w[63] = hc_byte_perm_S (w[46], w[45], selector); w[62] = hc_byte_perm_S (w[45], w[44], selector); w[61] = hc_byte_perm_S (w[44], w[43], selector); w[60] = hc_byte_perm_S (w[43], w[42], selector); w[59] = hc_byte_perm_S (w[42], w[41], selector); w[58] = hc_byte_perm_S (w[41], w[40], selector); w[57] = hc_byte_perm_S (w[40], w[39], selector); w[56] = hc_byte_perm_S (w[39], w[38], selector); w[55] = hc_byte_perm_S (w[38], w[37], selector); w[54] = hc_byte_perm_S (w[37], w[36], selector); w[53] = hc_byte_perm_S (w[36], w[35], selector); w[52] = hc_byte_perm_S (w[35], w[34], selector); w[51] = hc_byte_perm_S (w[34], w[33], selector); w[50] = hc_byte_perm_S (w[33], w[32], selector); w[49] = hc_byte_perm_S (w[32], w[31], selector); w[48] = hc_byte_perm_S (w[31], w[30], selector); w[47] = hc_byte_perm_S (w[30], w[29], selector); w[46] = hc_byte_perm_S (w[29], w[28], selector); w[45] = hc_byte_perm_S (w[28], w[27], selector); w[44] = hc_byte_perm_S (w[27], w[26], selector); w[43] = hc_byte_perm_S (w[26], w[25], selector); w[42] = hc_byte_perm_S (w[25], w[24], selector); w[41] = hc_byte_perm_S (w[24], w[23], selector); w[40] = hc_byte_perm_S (w[23], w[22], selector); w[39] = hc_byte_perm_S (w[22], w[21], selector); w[38] = hc_byte_perm_S (w[21], w[20], selector); w[37] = hc_byte_perm_S (w[20], w[19], selector); w[36] = hc_byte_perm_S (w[19], w[18], selector); w[35] = hc_byte_perm_S (w[18], w[17], selector); w[34] = hc_byte_perm_S (w[17], w[16], selector); w[33] = hc_byte_perm_S (w[16], w[15], selector); w[32] = hc_byte_perm_S (w[15], w[14], selector); w[31] = hc_byte_perm_S (w[14], w[13], selector); w[30] = hc_byte_perm_S (w[13], w[12], selector); w[29] = hc_byte_perm_S (w[12], w[11], selector); w[28] = hc_byte_perm_S (w[11], w[10], selector); w[27] = hc_byte_perm_S (w[10], w[ 9], selector); w[26] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[25] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[24] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[23] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[22] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[21] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[20] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[19] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[18] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[17] = hc_byte_perm_S (w[ 0], 0, selector); w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 18: w[63] = hc_byte_perm_S (w[45], w[44], selector); w[62] = hc_byte_perm_S (w[44], w[43], selector); w[61] = hc_byte_perm_S (w[43], w[42], selector); w[60] = hc_byte_perm_S (w[42], w[41], selector); w[59] = hc_byte_perm_S (w[41], w[40], selector); w[58] = hc_byte_perm_S (w[40], w[39], selector); w[57] = hc_byte_perm_S (w[39], w[38], selector); w[56] = hc_byte_perm_S (w[38], w[37], selector); w[55] = hc_byte_perm_S (w[37], w[36], selector); w[54] = hc_byte_perm_S (w[36], w[35], selector); w[53] = hc_byte_perm_S (w[35], w[34], selector); w[52] = hc_byte_perm_S (w[34], w[33], selector); w[51] = hc_byte_perm_S (w[33], w[32], selector); w[50] = hc_byte_perm_S (w[32], w[31], selector); w[49] = hc_byte_perm_S (w[31], w[30], selector); w[48] = hc_byte_perm_S (w[30], w[29], selector); w[47] = hc_byte_perm_S (w[29], w[28], selector); w[46] = hc_byte_perm_S (w[28], w[27], selector); w[45] = hc_byte_perm_S (w[27], w[26], selector); w[44] = hc_byte_perm_S (w[26], w[25], selector); w[43] = hc_byte_perm_S (w[25], w[24], selector); w[42] = hc_byte_perm_S (w[24], w[23], selector); w[41] = hc_byte_perm_S (w[23], w[22], selector); w[40] = hc_byte_perm_S (w[22], w[21], selector); w[39] = hc_byte_perm_S (w[21], w[20], selector); w[38] = hc_byte_perm_S (w[20], w[19], selector); w[37] = hc_byte_perm_S (w[19], w[18], selector); w[36] = hc_byte_perm_S (w[18], w[17], selector); w[35] = hc_byte_perm_S (w[17], w[16], selector); w[34] = hc_byte_perm_S (w[16], w[15], selector); w[33] = hc_byte_perm_S (w[15], w[14], selector); w[32] = hc_byte_perm_S (w[14], w[13], selector); w[31] = hc_byte_perm_S (w[13], w[12], selector); w[30] = hc_byte_perm_S (w[12], w[11], selector); w[29] = hc_byte_perm_S (w[11], w[10], selector); w[28] = hc_byte_perm_S (w[10], w[ 9], selector); w[27] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[26] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[25] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[24] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[23] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[22] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[21] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[20] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[19] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[18] = hc_byte_perm_S (w[ 0], 0, selector); w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 19: w[63] = hc_byte_perm_S (w[44], w[43], selector); w[62] = hc_byte_perm_S (w[43], w[42], selector); w[61] = hc_byte_perm_S (w[42], w[41], selector); w[60] = hc_byte_perm_S (w[41], w[40], selector); w[59] = hc_byte_perm_S (w[40], w[39], selector); w[58] = hc_byte_perm_S (w[39], w[38], selector); w[57] = hc_byte_perm_S (w[38], w[37], selector); w[56] = hc_byte_perm_S (w[37], w[36], selector); w[55] = hc_byte_perm_S (w[36], w[35], selector); w[54] = hc_byte_perm_S (w[35], w[34], selector); w[53] = hc_byte_perm_S (w[34], w[33], selector); w[52] = hc_byte_perm_S (w[33], w[32], selector); w[51] = hc_byte_perm_S (w[32], w[31], selector); w[50] = hc_byte_perm_S (w[31], w[30], selector); w[49] = hc_byte_perm_S (w[30], w[29], selector); w[48] = hc_byte_perm_S (w[29], w[28], selector); w[47] = hc_byte_perm_S (w[28], w[27], selector); w[46] = hc_byte_perm_S (w[27], w[26], selector); w[45] = hc_byte_perm_S (w[26], w[25], selector); w[44] = hc_byte_perm_S (w[25], w[24], selector); w[43] = hc_byte_perm_S (w[24], w[23], selector); w[42] = hc_byte_perm_S (w[23], w[22], selector); w[41] = hc_byte_perm_S (w[22], w[21], selector); w[40] = hc_byte_perm_S (w[21], w[20], selector); w[39] = hc_byte_perm_S (w[20], w[19], selector); w[38] = hc_byte_perm_S (w[19], w[18], selector); w[37] = hc_byte_perm_S (w[18], w[17], selector); w[36] = hc_byte_perm_S (w[17], w[16], selector); w[35] = hc_byte_perm_S (w[16], w[15], selector); w[34] = hc_byte_perm_S (w[15], w[14], selector); w[33] = hc_byte_perm_S (w[14], w[13], selector); w[32] = hc_byte_perm_S (w[13], w[12], selector); w[31] = hc_byte_perm_S (w[12], w[11], selector); w[30] = hc_byte_perm_S (w[11], w[10], selector); w[29] = hc_byte_perm_S (w[10], w[ 9], selector); w[28] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[27] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[26] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[25] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[24] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[23] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[22] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[21] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[20] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[19] = hc_byte_perm_S (w[ 0], 0, selector); w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 20: w[63] = hc_byte_perm_S (w[43], w[42], selector); w[62] = hc_byte_perm_S (w[42], w[41], selector); w[61] = hc_byte_perm_S (w[41], w[40], selector); w[60] = hc_byte_perm_S (w[40], w[39], selector); w[59] = hc_byte_perm_S (w[39], w[38], selector); w[58] = hc_byte_perm_S (w[38], w[37], selector); w[57] = hc_byte_perm_S (w[37], w[36], selector); w[56] = hc_byte_perm_S (w[36], w[35], selector); w[55] = hc_byte_perm_S (w[35], w[34], selector); w[54] = hc_byte_perm_S (w[34], w[33], selector); w[53] = hc_byte_perm_S (w[33], w[32], selector); w[52] = hc_byte_perm_S (w[32], w[31], selector); w[51] = hc_byte_perm_S (w[31], w[30], selector); w[50] = hc_byte_perm_S (w[30], w[29], selector); w[49] = hc_byte_perm_S (w[29], w[28], selector); w[48] = hc_byte_perm_S (w[28], w[27], selector); w[47] = hc_byte_perm_S (w[27], w[26], selector); w[46] = hc_byte_perm_S (w[26], w[25], selector); w[45] = hc_byte_perm_S (w[25], w[24], selector); w[44] = hc_byte_perm_S (w[24], w[23], selector); w[43] = hc_byte_perm_S (w[23], w[22], selector); w[42] = hc_byte_perm_S (w[22], w[21], selector); w[41] = hc_byte_perm_S (w[21], w[20], selector); w[40] = hc_byte_perm_S (w[20], w[19], selector); w[39] = hc_byte_perm_S (w[19], w[18], selector); w[38] = hc_byte_perm_S (w[18], w[17], selector); w[37] = hc_byte_perm_S (w[17], w[16], selector); w[36] = hc_byte_perm_S (w[16], w[15], selector); w[35] = hc_byte_perm_S (w[15], w[14], selector); w[34] = hc_byte_perm_S (w[14], w[13], selector); w[33] = hc_byte_perm_S (w[13], w[12], selector); w[32] = hc_byte_perm_S (w[12], w[11], selector); w[31] = hc_byte_perm_S (w[11], w[10], selector); w[30] = hc_byte_perm_S (w[10], w[ 9], selector); w[29] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[28] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[27] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[26] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[25] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[24] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[23] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[22] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[21] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[20] = hc_byte_perm_S (w[ 0], 0, selector); w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 21: w[63] = hc_byte_perm_S (w[42], w[41], selector); w[62] = hc_byte_perm_S (w[41], w[40], selector); w[61] = hc_byte_perm_S (w[40], w[39], selector); w[60] = hc_byte_perm_S (w[39], w[38], selector); w[59] = hc_byte_perm_S (w[38], w[37], selector); w[58] = hc_byte_perm_S (w[37], w[36], selector); w[57] = hc_byte_perm_S (w[36], w[35], selector); w[56] = hc_byte_perm_S (w[35], w[34], selector); w[55] = hc_byte_perm_S (w[34], w[33], selector); w[54] = hc_byte_perm_S (w[33], w[32], selector); w[53] = hc_byte_perm_S (w[32], w[31], selector); w[52] = hc_byte_perm_S (w[31], w[30], selector); w[51] = hc_byte_perm_S (w[30], w[29], selector); w[50] = hc_byte_perm_S (w[29], w[28], selector); w[49] = hc_byte_perm_S (w[28], w[27], selector); w[48] = hc_byte_perm_S (w[27], w[26], selector); w[47] = hc_byte_perm_S (w[26], w[25], selector); w[46] = hc_byte_perm_S (w[25], w[24], selector); w[45] = hc_byte_perm_S (w[24], w[23], selector); w[44] = hc_byte_perm_S (w[23], w[22], selector); w[43] = hc_byte_perm_S (w[22], w[21], selector); w[42] = hc_byte_perm_S (w[21], w[20], selector); w[41] = hc_byte_perm_S (w[20], w[19], selector); w[40] = hc_byte_perm_S (w[19], w[18], selector); w[39] = hc_byte_perm_S (w[18], w[17], selector); w[38] = hc_byte_perm_S (w[17], w[16], selector); w[37] = hc_byte_perm_S (w[16], w[15], selector); w[36] = hc_byte_perm_S (w[15], w[14], selector); w[35] = hc_byte_perm_S (w[14], w[13], selector); w[34] = hc_byte_perm_S (w[13], w[12], selector); w[33] = hc_byte_perm_S (w[12], w[11], selector); w[32] = hc_byte_perm_S (w[11], w[10], selector); w[31] = hc_byte_perm_S (w[10], w[ 9], selector); w[30] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[29] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[28] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[27] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[26] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[25] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[24] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[23] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[22] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[21] = hc_byte_perm_S (w[ 0], 0, selector); w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 22: w[63] = hc_byte_perm_S (w[41], w[40], selector); w[62] = hc_byte_perm_S (w[40], w[39], selector); w[61] = hc_byte_perm_S (w[39], w[38], selector); w[60] = hc_byte_perm_S (w[38], w[37], selector); w[59] = hc_byte_perm_S (w[37], w[36], selector); w[58] = hc_byte_perm_S (w[36], w[35], selector); w[57] = hc_byte_perm_S (w[35], w[34], selector); w[56] = hc_byte_perm_S (w[34], w[33], selector); w[55] = hc_byte_perm_S (w[33], w[32], selector); w[54] = hc_byte_perm_S (w[32], w[31], selector); w[53] = hc_byte_perm_S (w[31], w[30], selector); w[52] = hc_byte_perm_S (w[30], w[29], selector); w[51] = hc_byte_perm_S (w[29], w[28], selector); w[50] = hc_byte_perm_S (w[28], w[27], selector); w[49] = hc_byte_perm_S (w[27], w[26], selector); w[48] = hc_byte_perm_S (w[26], w[25], selector); w[47] = hc_byte_perm_S (w[25], w[24], selector); w[46] = hc_byte_perm_S (w[24], w[23], selector); w[45] = hc_byte_perm_S (w[23], w[22], selector); w[44] = hc_byte_perm_S (w[22], w[21], selector); w[43] = hc_byte_perm_S (w[21], w[20], selector); w[42] = hc_byte_perm_S (w[20], w[19], selector); w[41] = hc_byte_perm_S (w[19], w[18], selector); w[40] = hc_byte_perm_S (w[18], w[17], selector); w[39] = hc_byte_perm_S (w[17], w[16], selector); w[38] = hc_byte_perm_S (w[16], w[15], selector); w[37] = hc_byte_perm_S (w[15], w[14], selector); w[36] = hc_byte_perm_S (w[14], w[13], selector); w[35] = hc_byte_perm_S (w[13], w[12], selector); w[34] = hc_byte_perm_S (w[12], w[11], selector); w[33] = hc_byte_perm_S (w[11], w[10], selector); w[32] = hc_byte_perm_S (w[10], w[ 9], selector); w[31] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[30] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[29] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[28] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[27] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[26] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[25] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[24] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[23] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[22] = hc_byte_perm_S (w[ 0], 0, selector); w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 23: w[63] = hc_byte_perm_S (w[40], w[39], selector); w[62] = hc_byte_perm_S (w[39], w[38], selector); w[61] = hc_byte_perm_S (w[38], w[37], selector); w[60] = hc_byte_perm_S (w[37], w[36], selector); w[59] = hc_byte_perm_S (w[36], w[35], selector); w[58] = hc_byte_perm_S (w[35], w[34], selector); w[57] = hc_byte_perm_S (w[34], w[33], selector); w[56] = hc_byte_perm_S (w[33], w[32], selector); w[55] = hc_byte_perm_S (w[32], w[31], selector); w[54] = hc_byte_perm_S (w[31], w[30], selector); w[53] = hc_byte_perm_S (w[30], w[29], selector); w[52] = hc_byte_perm_S (w[29], w[28], selector); w[51] = hc_byte_perm_S (w[28], w[27], selector); w[50] = hc_byte_perm_S (w[27], w[26], selector); w[49] = hc_byte_perm_S (w[26], w[25], selector); w[48] = hc_byte_perm_S (w[25], w[24], selector); w[47] = hc_byte_perm_S (w[24], w[23], selector); w[46] = hc_byte_perm_S (w[23], w[22], selector); w[45] = hc_byte_perm_S (w[22], w[21], selector); w[44] = hc_byte_perm_S (w[21], w[20], selector); w[43] = hc_byte_perm_S (w[20], w[19], selector); w[42] = hc_byte_perm_S (w[19], w[18], selector); w[41] = hc_byte_perm_S (w[18], w[17], selector); w[40] = hc_byte_perm_S (w[17], w[16], selector); w[39] = hc_byte_perm_S (w[16], w[15], selector); w[38] = hc_byte_perm_S (w[15], w[14], selector); w[37] = hc_byte_perm_S (w[14], w[13], selector); w[36] = hc_byte_perm_S (w[13], w[12], selector); w[35] = hc_byte_perm_S (w[12], w[11], selector); w[34] = hc_byte_perm_S (w[11], w[10], selector); w[33] = hc_byte_perm_S (w[10], w[ 9], selector); w[32] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[31] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[30] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[29] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[28] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[27] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[26] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[25] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[24] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[23] = hc_byte_perm_S (w[ 0], 0, selector); w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 24: w[63] = hc_byte_perm_S (w[39], w[38], selector); w[62] = hc_byte_perm_S (w[38], w[37], selector); w[61] = hc_byte_perm_S (w[37], w[36], selector); w[60] = hc_byte_perm_S (w[36], w[35], selector); w[59] = hc_byte_perm_S (w[35], w[34], selector); w[58] = hc_byte_perm_S (w[34], w[33], selector); w[57] = hc_byte_perm_S (w[33], w[32], selector); w[56] = hc_byte_perm_S (w[32], w[31], selector); w[55] = hc_byte_perm_S (w[31], w[30], selector); w[54] = hc_byte_perm_S (w[30], w[29], selector); w[53] = hc_byte_perm_S (w[29], w[28], selector); w[52] = hc_byte_perm_S (w[28], w[27], selector); w[51] = hc_byte_perm_S (w[27], w[26], selector); w[50] = hc_byte_perm_S (w[26], w[25], selector); w[49] = hc_byte_perm_S (w[25], w[24], selector); w[48] = hc_byte_perm_S (w[24], w[23], selector); w[47] = hc_byte_perm_S (w[23], w[22], selector); w[46] = hc_byte_perm_S (w[22], w[21], selector); w[45] = hc_byte_perm_S (w[21], w[20], selector); w[44] = hc_byte_perm_S (w[20], w[19], selector); w[43] = hc_byte_perm_S (w[19], w[18], selector); w[42] = hc_byte_perm_S (w[18], w[17], selector); w[41] = hc_byte_perm_S (w[17], w[16], selector); w[40] = hc_byte_perm_S (w[16], w[15], selector); w[39] = hc_byte_perm_S (w[15], w[14], selector); w[38] = hc_byte_perm_S (w[14], w[13], selector); w[37] = hc_byte_perm_S (w[13], w[12], selector); w[36] = hc_byte_perm_S (w[12], w[11], selector); w[35] = hc_byte_perm_S (w[11], w[10], selector); w[34] = hc_byte_perm_S (w[10], w[ 9], selector); w[33] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[32] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[31] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[30] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[29] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[28] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[27] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[26] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[25] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[24] = hc_byte_perm_S (w[ 0], 0, selector); w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 25: w[63] = hc_byte_perm_S (w[38], w[37], selector); w[62] = hc_byte_perm_S (w[37], w[36], selector); w[61] = hc_byte_perm_S (w[36], w[35], selector); w[60] = hc_byte_perm_S (w[35], w[34], selector); w[59] = hc_byte_perm_S (w[34], w[33], selector); w[58] = hc_byte_perm_S (w[33], w[32], selector); w[57] = hc_byte_perm_S (w[32], w[31], selector); w[56] = hc_byte_perm_S (w[31], w[30], selector); w[55] = hc_byte_perm_S (w[30], w[29], selector); w[54] = hc_byte_perm_S (w[29], w[28], selector); w[53] = hc_byte_perm_S (w[28], w[27], selector); w[52] = hc_byte_perm_S (w[27], w[26], selector); w[51] = hc_byte_perm_S (w[26], w[25], selector); w[50] = hc_byte_perm_S (w[25], w[24], selector); w[49] = hc_byte_perm_S (w[24], w[23], selector); w[48] = hc_byte_perm_S (w[23], w[22], selector); w[47] = hc_byte_perm_S (w[22], w[21], selector); w[46] = hc_byte_perm_S (w[21], w[20], selector); w[45] = hc_byte_perm_S (w[20], w[19], selector); w[44] = hc_byte_perm_S (w[19], w[18], selector); w[43] = hc_byte_perm_S (w[18], w[17], selector); w[42] = hc_byte_perm_S (w[17], w[16], selector); w[41] = hc_byte_perm_S (w[16], w[15], selector); w[40] = hc_byte_perm_S (w[15], w[14], selector); w[39] = hc_byte_perm_S (w[14], w[13], selector); w[38] = hc_byte_perm_S (w[13], w[12], selector); w[37] = hc_byte_perm_S (w[12], w[11], selector); w[36] = hc_byte_perm_S (w[11], w[10], selector); w[35] = hc_byte_perm_S (w[10], w[ 9], selector); w[34] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[33] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[32] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[31] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[30] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[29] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[28] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[27] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[26] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[25] = hc_byte_perm_S (w[ 0], 0, selector); w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 26: w[63] = hc_byte_perm_S (w[37], w[36], selector); w[62] = hc_byte_perm_S (w[36], w[35], selector); w[61] = hc_byte_perm_S (w[35], w[34], selector); w[60] = hc_byte_perm_S (w[34], w[33], selector); w[59] = hc_byte_perm_S (w[33], w[32], selector); w[58] = hc_byte_perm_S (w[32], w[31], selector); w[57] = hc_byte_perm_S (w[31], w[30], selector); w[56] = hc_byte_perm_S (w[30], w[29], selector); w[55] = hc_byte_perm_S (w[29], w[28], selector); w[54] = hc_byte_perm_S (w[28], w[27], selector); w[53] = hc_byte_perm_S (w[27], w[26], selector); w[52] = hc_byte_perm_S (w[26], w[25], selector); w[51] = hc_byte_perm_S (w[25], w[24], selector); w[50] = hc_byte_perm_S (w[24], w[23], selector); w[49] = hc_byte_perm_S (w[23], w[22], selector); w[48] = hc_byte_perm_S (w[22], w[21], selector); w[47] = hc_byte_perm_S (w[21], w[20], selector); w[46] = hc_byte_perm_S (w[20], w[19], selector); w[45] = hc_byte_perm_S (w[19], w[18], selector); w[44] = hc_byte_perm_S (w[18], w[17], selector); w[43] = hc_byte_perm_S (w[17], w[16], selector); w[42] = hc_byte_perm_S (w[16], w[15], selector); w[41] = hc_byte_perm_S (w[15], w[14], selector); w[40] = hc_byte_perm_S (w[14], w[13], selector); w[39] = hc_byte_perm_S (w[13], w[12], selector); w[38] = hc_byte_perm_S (w[12], w[11], selector); w[37] = hc_byte_perm_S (w[11], w[10], selector); w[36] = hc_byte_perm_S (w[10], w[ 9], selector); w[35] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[34] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[33] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[32] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[31] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[30] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[29] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[28] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[27] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[26] = hc_byte_perm_S (w[ 0], 0, selector); w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 27: w[63] = hc_byte_perm_S (w[36], w[35], selector); w[62] = hc_byte_perm_S (w[35], w[34], selector); w[61] = hc_byte_perm_S (w[34], w[33], selector); w[60] = hc_byte_perm_S (w[33], w[32], selector); w[59] = hc_byte_perm_S (w[32], w[31], selector); w[58] = hc_byte_perm_S (w[31], w[30], selector); w[57] = hc_byte_perm_S (w[30], w[29], selector); w[56] = hc_byte_perm_S (w[29], w[28], selector); w[55] = hc_byte_perm_S (w[28], w[27], selector); w[54] = hc_byte_perm_S (w[27], w[26], selector); w[53] = hc_byte_perm_S (w[26], w[25], selector); w[52] = hc_byte_perm_S (w[25], w[24], selector); w[51] = hc_byte_perm_S (w[24], w[23], selector); w[50] = hc_byte_perm_S (w[23], w[22], selector); w[49] = hc_byte_perm_S (w[22], w[21], selector); w[48] = hc_byte_perm_S (w[21], w[20], selector); w[47] = hc_byte_perm_S (w[20], w[19], selector); w[46] = hc_byte_perm_S (w[19], w[18], selector); w[45] = hc_byte_perm_S (w[18], w[17], selector); w[44] = hc_byte_perm_S (w[17], w[16], selector); w[43] = hc_byte_perm_S (w[16], w[15], selector); w[42] = hc_byte_perm_S (w[15], w[14], selector); w[41] = hc_byte_perm_S (w[14], w[13], selector); w[40] = hc_byte_perm_S (w[13], w[12], selector); w[39] = hc_byte_perm_S (w[12], w[11], selector); w[38] = hc_byte_perm_S (w[11], w[10], selector); w[37] = hc_byte_perm_S (w[10], w[ 9], selector); w[36] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[35] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[34] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[33] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[32] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[31] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[30] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[29] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[28] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[27] = hc_byte_perm_S (w[ 0], 0, selector); w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 28: w[63] = hc_byte_perm_S (w[35], w[34], selector); w[62] = hc_byte_perm_S (w[34], w[33], selector); w[61] = hc_byte_perm_S (w[33], w[32], selector); w[60] = hc_byte_perm_S (w[32], w[31], selector); w[59] = hc_byte_perm_S (w[31], w[30], selector); w[58] = hc_byte_perm_S (w[30], w[29], selector); w[57] = hc_byte_perm_S (w[29], w[28], selector); w[56] = hc_byte_perm_S (w[28], w[27], selector); w[55] = hc_byte_perm_S (w[27], w[26], selector); w[54] = hc_byte_perm_S (w[26], w[25], selector); w[53] = hc_byte_perm_S (w[25], w[24], selector); w[52] = hc_byte_perm_S (w[24], w[23], selector); w[51] = hc_byte_perm_S (w[23], w[22], selector); w[50] = hc_byte_perm_S (w[22], w[21], selector); w[49] = hc_byte_perm_S (w[21], w[20], selector); w[48] = hc_byte_perm_S (w[20], w[19], selector); w[47] = hc_byte_perm_S (w[19], w[18], selector); w[46] = hc_byte_perm_S (w[18], w[17], selector); w[45] = hc_byte_perm_S (w[17], w[16], selector); w[44] = hc_byte_perm_S (w[16], w[15], selector); w[43] = hc_byte_perm_S (w[15], w[14], selector); w[42] = hc_byte_perm_S (w[14], w[13], selector); w[41] = hc_byte_perm_S (w[13], w[12], selector); w[40] = hc_byte_perm_S (w[12], w[11], selector); w[39] = hc_byte_perm_S (w[11], w[10], selector); w[38] = hc_byte_perm_S (w[10], w[ 9], selector); w[37] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[36] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[35] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[34] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[33] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[32] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[31] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[30] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[29] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[28] = hc_byte_perm_S (w[ 0], 0, selector); w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 29: w[63] = hc_byte_perm_S (w[34], w[33], selector); w[62] = hc_byte_perm_S (w[33], w[32], selector); w[61] = hc_byte_perm_S (w[32], w[31], selector); w[60] = hc_byte_perm_S (w[31], w[30], selector); w[59] = hc_byte_perm_S (w[30], w[29], selector); w[58] = hc_byte_perm_S (w[29], w[28], selector); w[57] = hc_byte_perm_S (w[28], w[27], selector); w[56] = hc_byte_perm_S (w[27], w[26], selector); w[55] = hc_byte_perm_S (w[26], w[25], selector); w[54] = hc_byte_perm_S (w[25], w[24], selector); w[53] = hc_byte_perm_S (w[24], w[23], selector); w[52] = hc_byte_perm_S (w[23], w[22], selector); w[51] = hc_byte_perm_S (w[22], w[21], selector); w[50] = hc_byte_perm_S (w[21], w[20], selector); w[49] = hc_byte_perm_S (w[20], w[19], selector); w[48] = hc_byte_perm_S (w[19], w[18], selector); w[47] = hc_byte_perm_S (w[18], w[17], selector); w[46] = hc_byte_perm_S (w[17], w[16], selector); w[45] = hc_byte_perm_S (w[16], w[15], selector); w[44] = hc_byte_perm_S (w[15], w[14], selector); w[43] = hc_byte_perm_S (w[14], w[13], selector); w[42] = hc_byte_perm_S (w[13], w[12], selector); w[41] = hc_byte_perm_S (w[12], w[11], selector); w[40] = hc_byte_perm_S (w[11], w[10], selector); w[39] = hc_byte_perm_S (w[10], w[ 9], selector); w[38] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[37] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[36] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[35] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[34] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[33] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[32] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[31] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[30] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[29] = hc_byte_perm_S (w[ 0], 0, selector); w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 30: w[63] = hc_byte_perm_S (w[33], w[32], selector); w[62] = hc_byte_perm_S (w[32], w[31], selector); w[61] = hc_byte_perm_S (w[31], w[30], selector); w[60] = hc_byte_perm_S (w[30], w[29], selector); w[59] = hc_byte_perm_S (w[29], w[28], selector); w[58] = hc_byte_perm_S (w[28], w[27], selector); w[57] = hc_byte_perm_S (w[27], w[26], selector); w[56] = hc_byte_perm_S (w[26], w[25], selector); w[55] = hc_byte_perm_S (w[25], w[24], selector); w[54] = hc_byte_perm_S (w[24], w[23], selector); w[53] = hc_byte_perm_S (w[23], w[22], selector); w[52] = hc_byte_perm_S (w[22], w[21], selector); w[51] = hc_byte_perm_S (w[21], w[20], selector); w[50] = hc_byte_perm_S (w[20], w[19], selector); w[49] = hc_byte_perm_S (w[19], w[18], selector); w[48] = hc_byte_perm_S (w[18], w[17], selector); w[47] = hc_byte_perm_S (w[17], w[16], selector); w[46] = hc_byte_perm_S (w[16], w[15], selector); w[45] = hc_byte_perm_S (w[15], w[14], selector); w[44] = hc_byte_perm_S (w[14], w[13], selector); w[43] = hc_byte_perm_S (w[13], w[12], selector); w[42] = hc_byte_perm_S (w[12], w[11], selector); w[41] = hc_byte_perm_S (w[11], w[10], selector); w[40] = hc_byte_perm_S (w[10], w[ 9], selector); w[39] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[38] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[37] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[36] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[35] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[34] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[33] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[32] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[31] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[30] = hc_byte_perm_S (w[ 0], 0, selector); w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 31: w[63] = hc_byte_perm_S (w[32], w[31], selector); w[62] = hc_byte_perm_S (w[31], w[30], selector); w[61] = hc_byte_perm_S (w[30], w[29], selector); w[60] = hc_byte_perm_S (w[29], w[28], selector); w[59] = hc_byte_perm_S (w[28], w[27], selector); w[58] = hc_byte_perm_S (w[27], w[26], selector); w[57] = hc_byte_perm_S (w[26], w[25], selector); w[56] = hc_byte_perm_S (w[25], w[24], selector); w[55] = hc_byte_perm_S (w[24], w[23], selector); w[54] = hc_byte_perm_S (w[23], w[22], selector); w[53] = hc_byte_perm_S (w[22], w[21], selector); w[52] = hc_byte_perm_S (w[21], w[20], selector); w[51] = hc_byte_perm_S (w[20], w[19], selector); w[50] = hc_byte_perm_S (w[19], w[18], selector); w[49] = hc_byte_perm_S (w[18], w[17], selector); w[48] = hc_byte_perm_S (w[17], w[16], selector); w[47] = hc_byte_perm_S (w[16], w[15], selector); w[46] = hc_byte_perm_S (w[15], w[14], selector); w[45] = hc_byte_perm_S (w[14], w[13], selector); w[44] = hc_byte_perm_S (w[13], w[12], selector); w[43] = hc_byte_perm_S (w[12], w[11], selector); w[42] = hc_byte_perm_S (w[11], w[10], selector); w[41] = hc_byte_perm_S (w[10], w[ 9], selector); w[40] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[39] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[38] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[37] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[36] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[35] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[34] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[33] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[32] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[31] = hc_byte_perm_S (w[ 0], 0, selector); w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 32: w[63] = hc_byte_perm_S (w[31], w[30], selector); w[62] = hc_byte_perm_S (w[30], w[29], selector); w[61] = hc_byte_perm_S (w[29], w[28], selector); w[60] = hc_byte_perm_S (w[28], w[27], selector); w[59] = hc_byte_perm_S (w[27], w[26], selector); w[58] = hc_byte_perm_S (w[26], w[25], selector); w[57] = hc_byte_perm_S (w[25], w[24], selector); w[56] = hc_byte_perm_S (w[24], w[23], selector); w[55] = hc_byte_perm_S (w[23], w[22], selector); w[54] = hc_byte_perm_S (w[22], w[21], selector); w[53] = hc_byte_perm_S (w[21], w[20], selector); w[52] = hc_byte_perm_S (w[20], w[19], selector); w[51] = hc_byte_perm_S (w[19], w[18], selector); w[50] = hc_byte_perm_S (w[18], w[17], selector); w[49] = hc_byte_perm_S (w[17], w[16], selector); w[48] = hc_byte_perm_S (w[16], w[15], selector); w[47] = hc_byte_perm_S (w[15], w[14], selector); w[46] = hc_byte_perm_S (w[14], w[13], selector); w[45] = hc_byte_perm_S (w[13], w[12], selector); w[44] = hc_byte_perm_S (w[12], w[11], selector); w[43] = hc_byte_perm_S (w[11], w[10], selector); w[42] = hc_byte_perm_S (w[10], w[ 9], selector); w[41] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[40] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[39] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[38] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[37] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[36] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[35] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[34] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[33] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[32] = hc_byte_perm_S (w[ 0], 0, selector); w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 33: w[63] = hc_byte_perm_S (w[30], w[29], selector); w[62] = hc_byte_perm_S (w[29], w[28], selector); w[61] = hc_byte_perm_S (w[28], w[27], selector); w[60] = hc_byte_perm_S (w[27], w[26], selector); w[59] = hc_byte_perm_S (w[26], w[25], selector); w[58] = hc_byte_perm_S (w[25], w[24], selector); w[57] = hc_byte_perm_S (w[24], w[23], selector); w[56] = hc_byte_perm_S (w[23], w[22], selector); w[55] = hc_byte_perm_S (w[22], w[21], selector); w[54] = hc_byte_perm_S (w[21], w[20], selector); w[53] = hc_byte_perm_S (w[20], w[19], selector); w[52] = hc_byte_perm_S (w[19], w[18], selector); w[51] = hc_byte_perm_S (w[18], w[17], selector); w[50] = hc_byte_perm_S (w[17], w[16], selector); w[49] = hc_byte_perm_S (w[16], w[15], selector); w[48] = hc_byte_perm_S (w[15], w[14], selector); w[47] = hc_byte_perm_S (w[14], w[13], selector); w[46] = hc_byte_perm_S (w[13], w[12], selector); w[45] = hc_byte_perm_S (w[12], w[11], selector); w[44] = hc_byte_perm_S (w[11], w[10], selector); w[43] = hc_byte_perm_S (w[10], w[ 9], selector); w[42] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[41] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[40] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[39] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[38] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[37] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[36] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[35] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[34] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[33] = hc_byte_perm_S (w[ 0], 0, selector); w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 34: w[63] = hc_byte_perm_S (w[29], w[28], selector); w[62] = hc_byte_perm_S (w[28], w[27], selector); w[61] = hc_byte_perm_S (w[27], w[26], selector); w[60] = hc_byte_perm_S (w[26], w[25], selector); w[59] = hc_byte_perm_S (w[25], w[24], selector); w[58] = hc_byte_perm_S (w[24], w[23], selector); w[57] = hc_byte_perm_S (w[23], w[22], selector); w[56] = hc_byte_perm_S (w[22], w[21], selector); w[55] = hc_byte_perm_S (w[21], w[20], selector); w[54] = hc_byte_perm_S (w[20], w[19], selector); w[53] = hc_byte_perm_S (w[19], w[18], selector); w[52] = hc_byte_perm_S (w[18], w[17], selector); w[51] = hc_byte_perm_S (w[17], w[16], selector); w[50] = hc_byte_perm_S (w[16], w[15], selector); w[49] = hc_byte_perm_S (w[15], w[14], selector); w[48] = hc_byte_perm_S (w[14], w[13], selector); w[47] = hc_byte_perm_S (w[13], w[12], selector); w[46] = hc_byte_perm_S (w[12], w[11], selector); w[45] = hc_byte_perm_S (w[11], w[10], selector); w[44] = hc_byte_perm_S (w[10], w[ 9], selector); w[43] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[42] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[41] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[40] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[39] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[38] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[37] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[36] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[35] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[34] = hc_byte_perm_S (w[ 0], 0, selector); w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 35: w[63] = hc_byte_perm_S (w[28], w[27], selector); w[62] = hc_byte_perm_S (w[27], w[26], selector); w[61] = hc_byte_perm_S (w[26], w[25], selector); w[60] = hc_byte_perm_S (w[25], w[24], selector); w[59] = hc_byte_perm_S (w[24], w[23], selector); w[58] = hc_byte_perm_S (w[23], w[22], selector); w[57] = hc_byte_perm_S (w[22], w[21], selector); w[56] = hc_byte_perm_S (w[21], w[20], selector); w[55] = hc_byte_perm_S (w[20], w[19], selector); w[54] = hc_byte_perm_S (w[19], w[18], selector); w[53] = hc_byte_perm_S (w[18], w[17], selector); w[52] = hc_byte_perm_S (w[17], w[16], selector); w[51] = hc_byte_perm_S (w[16], w[15], selector); w[50] = hc_byte_perm_S (w[15], w[14], selector); w[49] = hc_byte_perm_S (w[14], w[13], selector); w[48] = hc_byte_perm_S (w[13], w[12], selector); w[47] = hc_byte_perm_S (w[12], w[11], selector); w[46] = hc_byte_perm_S (w[11], w[10], selector); w[45] = hc_byte_perm_S (w[10], w[ 9], selector); w[44] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[43] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[42] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[41] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[40] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[39] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[38] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[37] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[36] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[35] = hc_byte_perm_S (w[ 0], 0, selector); w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 36: w[63] = hc_byte_perm_S (w[27], w[26], selector); w[62] = hc_byte_perm_S (w[26], w[25], selector); w[61] = hc_byte_perm_S (w[25], w[24], selector); w[60] = hc_byte_perm_S (w[24], w[23], selector); w[59] = hc_byte_perm_S (w[23], w[22], selector); w[58] = hc_byte_perm_S (w[22], w[21], selector); w[57] = hc_byte_perm_S (w[21], w[20], selector); w[56] = hc_byte_perm_S (w[20], w[19], selector); w[55] = hc_byte_perm_S (w[19], w[18], selector); w[54] = hc_byte_perm_S (w[18], w[17], selector); w[53] = hc_byte_perm_S (w[17], w[16], selector); w[52] = hc_byte_perm_S (w[16], w[15], selector); w[51] = hc_byte_perm_S (w[15], w[14], selector); w[50] = hc_byte_perm_S (w[14], w[13], selector); w[49] = hc_byte_perm_S (w[13], w[12], selector); w[48] = hc_byte_perm_S (w[12], w[11], selector); w[47] = hc_byte_perm_S (w[11], w[10], selector); w[46] = hc_byte_perm_S (w[10], w[ 9], selector); w[45] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[44] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[43] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[42] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[41] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[40] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[39] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[38] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[37] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[36] = hc_byte_perm_S (w[ 0], 0, selector); w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 37: w[63] = hc_byte_perm_S (w[26], w[25], selector); w[62] = hc_byte_perm_S (w[25], w[24], selector); w[61] = hc_byte_perm_S (w[24], w[23], selector); w[60] = hc_byte_perm_S (w[23], w[22], selector); w[59] = hc_byte_perm_S (w[22], w[21], selector); w[58] = hc_byte_perm_S (w[21], w[20], selector); w[57] = hc_byte_perm_S (w[20], w[19], selector); w[56] = hc_byte_perm_S (w[19], w[18], selector); w[55] = hc_byte_perm_S (w[18], w[17], selector); w[54] = hc_byte_perm_S (w[17], w[16], selector); w[53] = hc_byte_perm_S (w[16], w[15], selector); w[52] = hc_byte_perm_S (w[15], w[14], selector); w[51] = hc_byte_perm_S (w[14], w[13], selector); w[50] = hc_byte_perm_S (w[13], w[12], selector); w[49] = hc_byte_perm_S (w[12], w[11], selector); w[48] = hc_byte_perm_S (w[11], w[10], selector); w[47] = hc_byte_perm_S (w[10], w[ 9], selector); w[46] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[45] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[44] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[43] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[42] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[41] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[40] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[39] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[38] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[37] = hc_byte_perm_S (w[ 0], 0, selector); w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 38: w[63] = hc_byte_perm_S (w[25], w[24], selector); w[62] = hc_byte_perm_S (w[24], w[23], selector); w[61] = hc_byte_perm_S (w[23], w[22], selector); w[60] = hc_byte_perm_S (w[22], w[21], selector); w[59] = hc_byte_perm_S (w[21], w[20], selector); w[58] = hc_byte_perm_S (w[20], w[19], selector); w[57] = hc_byte_perm_S (w[19], w[18], selector); w[56] = hc_byte_perm_S (w[18], w[17], selector); w[55] = hc_byte_perm_S (w[17], w[16], selector); w[54] = hc_byte_perm_S (w[16], w[15], selector); w[53] = hc_byte_perm_S (w[15], w[14], selector); w[52] = hc_byte_perm_S (w[14], w[13], selector); w[51] = hc_byte_perm_S (w[13], w[12], selector); w[50] = hc_byte_perm_S (w[12], w[11], selector); w[49] = hc_byte_perm_S (w[11], w[10], selector); w[48] = hc_byte_perm_S (w[10], w[ 9], selector); w[47] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[46] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[45] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[44] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[43] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[42] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[41] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[40] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[39] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[38] = hc_byte_perm_S (w[ 0], 0, selector); w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 39: w[63] = hc_byte_perm_S (w[24], w[23], selector); w[62] = hc_byte_perm_S (w[23], w[22], selector); w[61] = hc_byte_perm_S (w[22], w[21], selector); w[60] = hc_byte_perm_S (w[21], w[20], selector); w[59] = hc_byte_perm_S (w[20], w[19], selector); w[58] = hc_byte_perm_S (w[19], w[18], selector); w[57] = hc_byte_perm_S (w[18], w[17], selector); w[56] = hc_byte_perm_S (w[17], w[16], selector); w[55] = hc_byte_perm_S (w[16], w[15], selector); w[54] = hc_byte_perm_S (w[15], w[14], selector); w[53] = hc_byte_perm_S (w[14], w[13], selector); w[52] = hc_byte_perm_S (w[13], w[12], selector); w[51] = hc_byte_perm_S (w[12], w[11], selector); w[50] = hc_byte_perm_S (w[11], w[10], selector); w[49] = hc_byte_perm_S (w[10], w[ 9], selector); w[48] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[47] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[46] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[45] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[44] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[43] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[42] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[41] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[40] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[39] = hc_byte_perm_S (w[ 0], 0, selector); w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 40: w[63] = hc_byte_perm_S (w[23], w[22], selector); w[62] = hc_byte_perm_S (w[22], w[21], selector); w[61] = hc_byte_perm_S (w[21], w[20], selector); w[60] = hc_byte_perm_S (w[20], w[19], selector); w[59] = hc_byte_perm_S (w[19], w[18], selector); w[58] = hc_byte_perm_S (w[18], w[17], selector); w[57] = hc_byte_perm_S (w[17], w[16], selector); w[56] = hc_byte_perm_S (w[16], w[15], selector); w[55] = hc_byte_perm_S (w[15], w[14], selector); w[54] = hc_byte_perm_S (w[14], w[13], selector); w[53] = hc_byte_perm_S (w[13], w[12], selector); w[52] = hc_byte_perm_S (w[12], w[11], selector); w[51] = hc_byte_perm_S (w[11], w[10], selector); w[50] = hc_byte_perm_S (w[10], w[ 9], selector); w[49] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[48] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[47] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[46] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[45] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[44] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[43] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[42] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[41] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[40] = hc_byte_perm_S (w[ 0], 0, selector); w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 41: w[63] = hc_byte_perm_S (w[22], w[21], selector); w[62] = hc_byte_perm_S (w[21], w[20], selector); w[61] = hc_byte_perm_S (w[20], w[19], selector); w[60] = hc_byte_perm_S (w[19], w[18], selector); w[59] = hc_byte_perm_S (w[18], w[17], selector); w[58] = hc_byte_perm_S (w[17], w[16], selector); w[57] = hc_byte_perm_S (w[16], w[15], selector); w[56] = hc_byte_perm_S (w[15], w[14], selector); w[55] = hc_byte_perm_S (w[14], w[13], selector); w[54] = hc_byte_perm_S (w[13], w[12], selector); w[53] = hc_byte_perm_S (w[12], w[11], selector); w[52] = hc_byte_perm_S (w[11], w[10], selector); w[51] = hc_byte_perm_S (w[10], w[ 9], selector); w[50] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[49] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[48] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[47] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[46] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[45] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[44] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[43] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[42] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[41] = hc_byte_perm_S (w[ 0], 0, selector); w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 42: w[63] = hc_byte_perm_S (w[21], w[20], selector); w[62] = hc_byte_perm_S (w[20], w[19], selector); w[61] = hc_byte_perm_S (w[19], w[18], selector); w[60] = hc_byte_perm_S (w[18], w[17], selector); w[59] = hc_byte_perm_S (w[17], w[16], selector); w[58] = hc_byte_perm_S (w[16], w[15], selector); w[57] = hc_byte_perm_S (w[15], w[14], selector); w[56] = hc_byte_perm_S (w[14], w[13], selector); w[55] = hc_byte_perm_S (w[13], w[12], selector); w[54] = hc_byte_perm_S (w[12], w[11], selector); w[53] = hc_byte_perm_S (w[11], w[10], selector); w[52] = hc_byte_perm_S (w[10], w[ 9], selector); w[51] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[50] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[49] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[48] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[47] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[46] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[45] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[44] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[43] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[42] = hc_byte_perm_S (w[ 0], 0, selector); w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 43: w[63] = hc_byte_perm_S (w[20], w[19], selector); w[62] = hc_byte_perm_S (w[19], w[18], selector); w[61] = hc_byte_perm_S (w[18], w[17], selector); w[60] = hc_byte_perm_S (w[17], w[16], selector); w[59] = hc_byte_perm_S (w[16], w[15], selector); w[58] = hc_byte_perm_S (w[15], w[14], selector); w[57] = hc_byte_perm_S (w[14], w[13], selector); w[56] = hc_byte_perm_S (w[13], w[12], selector); w[55] = hc_byte_perm_S (w[12], w[11], selector); w[54] = hc_byte_perm_S (w[11], w[10], selector); w[53] = hc_byte_perm_S (w[10], w[ 9], selector); w[52] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[51] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[50] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[49] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[48] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[47] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[46] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[45] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[44] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[43] = hc_byte_perm_S (w[ 0], 0, selector); w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 44: w[63] = hc_byte_perm_S (w[19], w[18], selector); w[62] = hc_byte_perm_S (w[18], w[17], selector); w[61] = hc_byte_perm_S (w[17], w[16], selector); w[60] = hc_byte_perm_S (w[16], w[15], selector); w[59] = hc_byte_perm_S (w[15], w[14], selector); w[58] = hc_byte_perm_S (w[14], w[13], selector); w[57] = hc_byte_perm_S (w[13], w[12], selector); w[56] = hc_byte_perm_S (w[12], w[11], selector); w[55] = hc_byte_perm_S (w[11], w[10], selector); w[54] = hc_byte_perm_S (w[10], w[ 9], selector); w[53] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[52] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[51] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[50] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[49] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[48] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[47] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[46] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[45] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[44] = hc_byte_perm_S (w[ 0], 0, selector); w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 45: w[63] = hc_byte_perm_S (w[18], w[17], selector); w[62] = hc_byte_perm_S (w[17], w[16], selector); w[61] = hc_byte_perm_S (w[16], w[15], selector); w[60] = hc_byte_perm_S (w[15], w[14], selector); w[59] = hc_byte_perm_S (w[14], w[13], selector); w[58] = hc_byte_perm_S (w[13], w[12], selector); w[57] = hc_byte_perm_S (w[12], w[11], selector); w[56] = hc_byte_perm_S (w[11], w[10], selector); w[55] = hc_byte_perm_S (w[10], w[ 9], selector); w[54] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[53] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[52] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[51] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[50] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[49] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[48] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[47] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[46] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[45] = hc_byte_perm_S (w[ 0], 0, selector); w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 46: w[63] = hc_byte_perm_S (w[17], w[16], selector); w[62] = hc_byte_perm_S (w[16], w[15], selector); w[61] = hc_byte_perm_S (w[15], w[14], selector); w[60] = hc_byte_perm_S (w[14], w[13], selector); w[59] = hc_byte_perm_S (w[13], w[12], selector); w[58] = hc_byte_perm_S (w[12], w[11], selector); w[57] = hc_byte_perm_S (w[11], w[10], selector); w[56] = hc_byte_perm_S (w[10], w[ 9], selector); w[55] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[54] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[53] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[52] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[51] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[50] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[49] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[48] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[47] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[46] = hc_byte_perm_S (w[ 0], 0, selector); w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 47: w[63] = hc_byte_perm_S (w[16], w[15], selector); w[62] = hc_byte_perm_S (w[15], w[14], selector); w[61] = hc_byte_perm_S (w[14], w[13], selector); w[60] = hc_byte_perm_S (w[13], w[12], selector); w[59] = hc_byte_perm_S (w[12], w[11], selector); w[58] = hc_byte_perm_S (w[11], w[10], selector); w[57] = hc_byte_perm_S (w[10], w[ 9], selector); w[56] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[55] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[54] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[53] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[52] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[51] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[50] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[49] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[48] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[47] = hc_byte_perm_S (w[ 0], 0, selector); w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 48: w[63] = hc_byte_perm_S (w[15], w[14], selector); w[62] = hc_byte_perm_S (w[14], w[13], selector); w[61] = hc_byte_perm_S (w[13], w[12], selector); w[60] = hc_byte_perm_S (w[12], w[11], selector); w[59] = hc_byte_perm_S (w[11], w[10], selector); w[58] = hc_byte_perm_S (w[10], w[ 9], selector); w[57] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[56] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[55] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[54] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[53] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[52] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[51] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[50] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[49] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[48] = hc_byte_perm_S (w[ 0], 0, selector); w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 49: w[63] = hc_byte_perm_S (w[14], w[13], selector); w[62] = hc_byte_perm_S (w[13], w[12], selector); w[61] = hc_byte_perm_S (w[12], w[11], selector); w[60] = hc_byte_perm_S (w[11], w[10], selector); w[59] = hc_byte_perm_S (w[10], w[ 9], selector); w[58] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[57] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[56] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[55] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[54] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[53] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[52] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[51] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[50] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[49] = hc_byte_perm_S (w[ 0], 0, selector); w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 50: w[63] = hc_byte_perm_S (w[13], w[12], selector); w[62] = hc_byte_perm_S (w[12], w[11], selector); w[61] = hc_byte_perm_S (w[11], w[10], selector); w[60] = hc_byte_perm_S (w[10], w[ 9], selector); w[59] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[58] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[57] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[56] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[55] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[54] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[53] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[52] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[51] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[50] = hc_byte_perm_S (w[ 0], 0, selector); w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 51: w[63] = hc_byte_perm_S (w[12], w[11], selector); w[62] = hc_byte_perm_S (w[11], w[10], selector); w[61] = hc_byte_perm_S (w[10], w[ 9], selector); w[60] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[59] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[58] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[57] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[56] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[55] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[54] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[53] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[52] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[51] = hc_byte_perm_S (w[ 0], 0, selector); w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 52: w[63] = hc_byte_perm_S (w[11], w[10], selector); w[62] = hc_byte_perm_S (w[10], w[ 9], selector); w[61] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[60] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[59] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[58] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[57] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[56] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[55] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[54] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[53] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[52] = hc_byte_perm_S (w[ 0], 0, selector); w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 53: w[63] = hc_byte_perm_S (w[10], w[ 9], selector); w[62] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[61] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[60] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[59] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[58] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[57] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[56] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[55] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[54] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[53] = hc_byte_perm_S (w[ 0], 0, selector); w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 54: w[63] = hc_byte_perm_S (w[ 9], w[ 8], selector); w[62] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[61] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[60] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[59] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[58] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[57] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[56] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[55] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[54] = hc_byte_perm_S (w[ 0], 0, selector); w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 55: w[63] = hc_byte_perm_S (w[ 8], w[ 7], selector); w[62] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[61] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[60] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[59] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[58] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[57] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[56] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[55] = hc_byte_perm_S (w[ 0], 0, selector); w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 56: w[63] = hc_byte_perm_S (w[ 7], w[ 6], selector); w[62] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[61] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[60] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[59] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[58] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[57] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[56] = hc_byte_perm_S (w[ 0], 0, selector); w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 57: w[63] = hc_byte_perm_S (w[ 6], w[ 5], selector); w[62] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[61] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[60] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[59] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[58] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[57] = hc_byte_perm_S (w[ 0], 0, selector); w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 58: w[63] = hc_byte_perm_S (w[ 5], w[ 4], selector); w[62] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[61] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[60] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[59] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[58] = hc_byte_perm_S (w[ 0], 0, selector); w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 59: w[63] = hc_byte_perm_S (w[ 4], w[ 3], selector); w[62] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[61] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[60] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[59] = hc_byte_perm_S (w[ 0], 0, selector); w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 60: w[63] = hc_byte_perm_S (w[ 3], w[ 2], selector); w[62] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[61] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[60] = hc_byte_perm_S (w[ 0], 0, selector); w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 61: w[63] = hc_byte_perm_S (w[ 2], w[ 1], selector); w[62] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[61] = hc_byte_perm_S (w[ 0], 0, selector); w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 62: w[63] = hc_byte_perm_S (w[ 1], w[ 0], selector); w[62] = hc_byte_perm_S (w[ 0], 0, selector); w[61] = 0; w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; case 63: w[63] = hc_byte_perm_S (w[ 0], 0, selector); w[62] = 0; w[61] = 0; w[60] = 0; w[59] = 0; w[58] = 0; w[57] = 0; w[56] = 0; w[55] = 0; w[54] = 0; w[53] = 0; w[52] = 0; w[51] = 0; w[50] = 0; w[49] = 0; w[48] = 0; w[47] = 0; w[46] = 0; w[45] = 0; w[44] = 0; w[43] = 0; w[42] = 0; w[41] = 0; w[40] = 0; w[39] = 0; w[38] = 0; w[37] = 0; w[36] = 0; w[35] = 0; w[34] = 0; w[33] = 0; w[32] = 0; w[31] = 0; w[30] = 0; w[29] = 0; w[28] = 0; w[27] = 0; w[26] = 0; w[25] = 0; w[24] = 0; w[23] = 0; w[22] = 0; w[21] = 0; w[20] = 0; w[19] = 0; w[18] = 0; w[17] = 0; w[16] = 0; w[15] = 0; w[14] = 0; w[13] = 0; w[12] = 0; w[11] = 0; w[10] = 0; w[ 9] = 0; w[ 8] = 0; w[ 7] = 0; w[ 6] = 0; w[ 5] = 0; w[ 4] = 0; w[ 3] = 0; w[ 2] = 0; w[ 1] = 0; w[ 0] = 0; break; } #endif } /** * vector functions on scalar types (for inner loop usage) */ #define PACKVS2(sn,vn,e) \ sn[0] = vn[0].s##e; \ sn[1] = vn[1].s##e; #define PACKSV2(sn,vn,e) \ vn[0].s##e = sn[0]; \ vn[1].s##e = sn[1]; #define PACKVS24(s0,s1,v0,v1,e) \ PACKVS4 (s0, v0, e); \ PACKVS4 (s1, v1, e); #define PACKSV24(s0,s1,v0,v1,e) \ PACKSV4 (s0, v0, e); \ PACKSV4 (s1, v1, e); #define PACKVS4(sn,vn,e) \ sn[0] = vn[0].s##e; \ sn[1] = vn[1].s##e; \ sn[2] = vn[2].s##e; \ sn[3] = vn[3].s##e; #define PACKSV4(sn,vn,e) \ vn[0].s##e = sn[0]; \ vn[1].s##e = sn[1]; \ vn[2].s##e = sn[2]; \ vn[3].s##e = sn[3]; #define PACKVS44(s0,s1,s2,s3,v0,v1,v2,v3,e) \ PACKVS4 (s0, v0, e); \ PACKVS4 (s1, v1, e); \ PACKVS4 (s2, v2, e); \ PACKVS4 (s3, v3, e); #define PACKSV44(s0,s1,s2,s3,v0,v1,v2,v3,e) \ PACKSV4 (s0, v0, e); \ PACKSV4 (s1, v1, e); \ PACKSV4 (s2, v2, e); \ PACKSV4 (s3, v3, e); #define PACKVS84(s0,s1,s2,s3,s4,s5,s6,s7,v0,v1,v2,v3,v4,v5,v6,v7,e) \ PACKVS4 (s0, v0, e); \ PACKVS4 (s1, v1, e); \ PACKVS4 (s2, v2, e); \ PACKVS4 (s3, v3, e); \ PACKVS4 (s4, v4, e); \ PACKVS4 (s5, v5, e); \ PACKVS4 (s6, v6, e); \ PACKVS4 (s7, v7, e); #define PACKSV84(s0,s1,s2,s3,s4,s5,s6,s7,v0,v1,v2,v3,v4,v5,v6,v7,e) \ PACKSV4 (s0, v0, e); \ PACKSV4 (s1, v1, e); \ PACKSV4 (s2, v2, e); \ PACKSV4 (s3, v3, e); \ PACKSV4 (s4, v4, e); \ PACKSV4 (s5, v5, e); \ PACKSV4 (s6, v6, e); \ PACKSV4 (s7, v7, e); DECLSPEC void switch_buffer_by_offset_le_VV (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const u32x offset) { #if VECT_SIZE == 1 switch_buffer_by_offset_le_S (w0, w1, w2, w3, offset); #else u32 t0[4]; u32 t1[4]; u32 t2[4]; u32 t3[4]; #endif #if VECT_SIZE == 2 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); #elif VECT_SIZE == 4 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s2); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s3); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); #elif VECT_SIZE == 8 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s2); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s3); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s4); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s5); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s6); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s7); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); #elif VECT_SIZE == 16 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s2); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s3); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s4); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s5); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s6); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s7); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 8); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s8); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 8); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 9); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.s9); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 9); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, a); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.sa); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, a); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, b); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.sb); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, b); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, c); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.sc); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, c); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, d); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.sd); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, d); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, e); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.se); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, e); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, f); switch_buffer_by_offset_le_S (t0, t1, t2, t3, offset.sf); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, f); #endif } DECLSPEC void switch_buffer_by_offset_8x4_le_VV (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *w4, PRIVATE_AS u32x *w5, PRIVATE_AS u32x *w6, PRIVATE_AS u32x *w7, const u32x offset) { #if VECT_SIZE == 1 switch_buffer_by_offset_8x4_le_S (w0, w1, w2, w3, w4, w5, w6, w7, offset); #else u32 t0[4]; u32 t1[4]; u32 t2[4]; u32 t3[4]; u32 t4[4]; u32 t5[4]; u32 t6[4]; u32 t7[4]; #endif #if VECT_SIZE == 2 // 1 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 0); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s0); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 0); // 2 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 1); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s1); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 1); #elif VECT_SIZE == 4 // 1 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 0); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s0); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 0); // 2 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 1); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s1); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 1); // 3 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 2); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s2); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 2); // 4 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 3); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s3); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 3); #elif VECT_SIZE == 8 // 1 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 0); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s0); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 0); // 2 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 1); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s1); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 1); // 3 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 2); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s2); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 2); // 4 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 3); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s3); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 3); // 5 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 4); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s4); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 4); // 6 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 5); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s5); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 5); // 7 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 6); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s6); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 6); // 8 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 7); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s7); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 7); #elif VECT_SIZE == 16 // 1 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 0); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s0); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 0); // 2 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 1); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s1); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 1); // 3 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 2); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s2); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 2); // 4 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 3); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s3); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 3); // 5 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 4); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s4); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 4); // 6 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 5); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s5); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 5); // 7 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 6); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s6); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 6); // 8 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 7); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s7); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 7); // 9 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 8); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s8); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 8); // 10 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 9); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.s9); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, 9); // 11 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, a); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.sa); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, a); // 12 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, b); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.sb); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, b); // 13 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, c); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.sc); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, c); // 14 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, d); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.sd); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, d); // 15 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, e); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.se); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, e); // 16 PACKVS84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, f); switch_buffer_by_offset_8x4_le_S (t0, t1, t2, t3, t4, t5, t6, t7, offset.sf); PACKSV84 (t0, t1, t2, t3, t4, t5, t6, t7, w0, w1, w2, w3, w4, w5, w6, w7, f); #endif } DECLSPEC void append_0x01_2x4_VV (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, const u32x offset) { #if VECT_SIZE == 1 append_0x01_2x4_S (w0, w1, offset); #else u32 t0[4]; u32 t1[4]; #endif #if VECT_SIZE == 2 PACKVS24 (t0, t1, w0, w1, 0); append_0x01_2x4_S (t0, t1, offset.s0); PACKSV24 (t0, t1, w0, w1, 0); PACKVS24 (t0, t1, w0, w1, 1); append_0x01_2x4_S (t0, t1, offset.s1); PACKSV24 (t0, t1, w0, w1, 1); #elif VECT_SIZE == 4 PACKVS24 (t0, t1, w0, w1, 0); append_0x01_2x4_S (t0, t1, offset.s0); PACKSV24 (t0, t1, w0, w1, 0); PACKVS24 (t0, t1, w0, w1, 1); append_0x01_2x4_S (t0, t1, offset.s1); PACKSV24 (t0, t1, w0, w1, 1); PACKVS24 (t0, t1, w0, w1, 2); append_0x01_2x4_S (t0, t1, offset.s2); PACKSV24 (t0, t1, w0, w1, 2); PACKVS24 (t0, t1, w0, w1, 3); append_0x01_2x4_S (t0, t1, offset.s3); PACKSV24 (t0, t1, w0, w1, 3); #elif VECT_SIZE == 8 PACKVS24 (t0, t1, w0, w1, 0); append_0x01_2x4_S (t0, t1, offset.s0); PACKSV24 (t0, t1, w0, w1, 0); PACKVS24 (t0, t1, w0, w1, 1); append_0x01_2x4_S (t0, t1, offset.s1); PACKSV24 (t0, t1, w0, w1, 1); PACKVS24 (t0, t1, w0, w1, 2); append_0x01_2x4_S (t0, t1, offset.s2); PACKSV24 (t0, t1, w0, w1, 2); PACKVS24 (t0, t1, w0, w1, 3); append_0x01_2x4_S (t0, t1, offset.s3); PACKSV24 (t0, t1, w0, w1, 3); PACKVS24 (t0, t1, w0, w1, 4); append_0x01_2x4_S (t0, t1, offset.s4); PACKSV24 (t0, t1, w0, w1, 4); PACKVS24 (t0, t1, w0, w1, 5); append_0x01_2x4_S (t0, t1, offset.s5); PACKSV24 (t0, t1, w0, w1, 5); PACKVS24 (t0, t1, w0, w1, 6); append_0x01_2x4_S (t0, t1, offset.s6); PACKSV24 (t0, t1, w0, w1, 6); PACKVS24 (t0, t1, w0, w1, 7); append_0x01_2x4_S (t0, t1, offset.s7); PACKSV24 (t0, t1, w0, w1, 7); #elif VECT_SIZE == 16 PACKVS24 (t0, t1, w0, w1, 0); append_0x01_2x4_S (t0, t1, offset.s0); PACKSV24 (t0, t1, w0, w1, 0); PACKVS24 (t0, t1, w0, w1, 1); append_0x01_2x4_S (t0, t1, offset.s1); PACKSV24 (t0, t1, w0, w1, 1); PACKVS24 (t0, t1, w0, w1, 2); append_0x01_2x4_S (t0, t1, offset.s2); PACKSV24 (t0, t1, w0, w1, 2); PACKVS24 (t0, t1, w0, w1, 3); append_0x01_2x4_S (t0, t1, offset.s3); PACKSV24 (t0, t1, w0, w1, 3); PACKVS24 (t0, t1, w0, w1, 4); append_0x01_2x4_S (t0, t1, offset.s4); PACKSV24 (t0, t1, w0, w1, 4); PACKVS24 (t0, t1, w0, w1, 5); append_0x01_2x4_S (t0, t1, offset.s5); PACKSV24 (t0, t1, w0, w1, 5); PACKVS24 (t0, t1, w0, w1, 6); append_0x01_2x4_S (t0, t1, offset.s6); PACKSV24 (t0, t1, w0, w1, 6); PACKVS24 (t0, t1, w0, w1, 7); append_0x01_2x4_S (t0, t1, offset.s7); PACKSV24 (t0, t1, w0, w1, 7); PACKVS24 (t0, t1, w0, w1, 8); append_0x01_2x4_S (t0, t1, offset.s8); PACKSV24 (t0, t1, w0, w1, 8); PACKVS24 (t0, t1, w0, w1, 9); append_0x01_2x4_S (t0, t1, offset.s9); PACKSV24 (t0, t1, w0, w1, 9); PACKVS24 (t0, t1, w0, w1, a); append_0x01_2x4_S (t0, t1, offset.sa); PACKSV24 (t0, t1, w0, w1, a); PACKVS24 (t0, t1, w0, w1, b); append_0x01_2x4_S (t0, t1, offset.sb); PACKSV24 (t0, t1, w0, w1, b); PACKVS24 (t0, t1, w0, w1, c); append_0x01_2x4_S (t0, t1, offset.sc); PACKSV24 (t0, t1, w0, w1, c); PACKVS24 (t0, t1, w0, w1, d); append_0x01_2x4_S (t0, t1, offset.sd); PACKSV24 (t0, t1, w0, w1, d); PACKVS24 (t0, t1, w0, w1, e); append_0x01_2x4_S (t0, t1, offset.se); PACKSV24 (t0, t1, w0, w1, e); PACKVS24 (t0, t1, w0, w1, f); append_0x01_2x4_S (t0, t1, offset.sf); PACKSV24 (t0, t1, w0, w1, f); #endif } DECLSPEC void append_0x01_4x4_VV (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const u32x offset) { #if VECT_SIZE == 1 append_0x01_4x4_S (w0, w1, w2, w3, offset); #else u32 t0[4]; u32 t1[4]; u32 t2[4]; u32 t3[4]; #endif #if VECT_SIZE == 2 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); append_0x01_4x4_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); append_0x01_4x4_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); #elif VECT_SIZE == 4 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); append_0x01_4x4_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); append_0x01_4x4_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); append_0x01_4x4_S (t0, t1, t2, t3, offset.s2); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); append_0x01_4x4_S (t0, t1, t2, t3, offset.s3); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); #elif VECT_SIZE == 8 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); append_0x01_4x4_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); append_0x01_4x4_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); append_0x01_4x4_S (t0, t1, t2, t3, offset.s2); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); append_0x01_4x4_S (t0, t1, t2, t3, offset.s3); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); append_0x01_4x4_S (t0, t1, t2, t3, offset.s4); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); append_0x01_4x4_S (t0, t1, t2, t3, offset.s5); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); append_0x01_4x4_S (t0, t1, t2, t3, offset.s6); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); append_0x01_4x4_S (t0, t1, t2, t3, offset.s7); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); #elif VECT_SIZE == 16 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); append_0x01_4x4_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); append_0x01_4x4_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); append_0x01_4x4_S (t0, t1, t2, t3, offset.s2); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); append_0x01_4x4_S (t0, t1, t2, t3, offset.s3); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); append_0x01_4x4_S (t0, t1, t2, t3, offset.s4); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); append_0x01_4x4_S (t0, t1, t2, t3, offset.s5); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); append_0x01_4x4_S (t0, t1, t2, t3, offset.s6); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); append_0x01_4x4_S (t0, t1, t2, t3, offset.s7); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 8); append_0x01_4x4_S (t0, t1, t2, t3, offset.s8); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 8); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 9); append_0x01_4x4_S (t0, t1, t2, t3, offset.s9); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 9); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, a); append_0x01_4x4_S (t0, t1, t2, t3, offset.sa); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, a); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, b); append_0x01_4x4_S (t0, t1, t2, t3, offset.sb); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, b); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, c); append_0x01_4x4_S (t0, t1, t2, t3, offset.sc); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, c); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, d); append_0x01_4x4_S (t0, t1, t2, t3, offset.sd); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, d); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, e); append_0x01_4x4_S (t0, t1, t2, t3, offset.se); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, e); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, f); append_0x01_4x4_S (t0, t1, t2, t3, offset.sf); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, f); #endif } DECLSPEC void append_0x06_2x4_VV (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, const u32x offset) { #if VECT_SIZE == 1 append_0x06_2x4_S (w0, w1, offset); #else u32 t0[4]; u32 t1[4]; #endif #if VECT_SIZE == 2 PACKVS24 (t0, t1, w0, w1, 0); append_0x06_2x4_S (t0, t1, offset.s0); PACKSV24 (t0, t1, w0, w1, 0); PACKVS24 (t0, t1, w0, w1, 1); append_0x06_2x4_S (t0, t1, offset.s1); PACKSV24 (t0, t1, w0, w1, 1); #elif VECT_SIZE == 4 PACKVS24 (t0, t1, w0, w1, 0); append_0x06_2x4_S (t0, t1, offset.s0); PACKSV24 (t0, t1, w0, w1, 0); PACKVS24 (t0, t1, w0, w1, 1); append_0x06_2x4_S (t0, t1, offset.s1); PACKSV24 (t0, t1, w0, w1, 1); PACKVS24 (t0, t1, w0, w1, 2); append_0x06_2x4_S (t0, t1, offset.s2); PACKSV24 (t0, t1, w0, w1, 2); PACKVS24 (t0, t1, w0, w1, 3); append_0x06_2x4_S (t0, t1, offset.s3); PACKSV24 (t0, t1, w0, w1, 3); #elif VECT_SIZE == 8 PACKVS24 (t0, t1, w0, w1, 0); append_0x06_2x4_S (t0, t1, offset.s0); PACKSV24 (t0, t1, w0, w1, 0); PACKVS24 (t0, t1, w0, w1, 1); append_0x06_2x4_S (t0, t1, offset.s1); PACKSV24 (t0, t1, w0, w1, 1); PACKVS24 (t0, t1, w0, w1, 2); append_0x06_2x4_S (t0, t1, offset.s2); PACKSV24 (t0, t1, w0, w1, 2); PACKVS24 (t0, t1, w0, w1, 3); append_0x06_2x4_S (t0, t1, offset.s3); PACKSV24 (t0, t1, w0, w1, 3); PACKVS24 (t0, t1, w0, w1, 4); append_0x06_2x4_S (t0, t1, offset.s4); PACKSV24 (t0, t1, w0, w1, 4); PACKVS24 (t0, t1, w0, w1, 5); append_0x06_2x4_S (t0, t1, offset.s5); PACKSV24 (t0, t1, w0, w1, 5); PACKVS24 (t0, t1, w0, w1, 6); append_0x06_2x4_S (t0, t1, offset.s6); PACKSV24 (t0, t1, w0, w1, 6); PACKVS24 (t0, t1, w0, w1, 7); append_0x06_2x4_S (t0, t1, offset.s7); PACKSV24 (t0, t1, w0, w1, 7); #elif VECT_SIZE == 16 PACKVS24 (t0, t1, w0, w1, 0); append_0x06_2x4_S (t0, t1, offset.s0); PACKSV24 (t0, t1, w0, w1, 0); PACKVS24 (t0, t1, w0, w1, 1); append_0x06_2x4_S (t0, t1, offset.s1); PACKSV24 (t0, t1, w0, w1, 1); PACKVS24 (t0, t1, w0, w1, 2); append_0x06_2x4_S (t0, t1, offset.s2); PACKSV24 (t0, t1, w0, w1, 2); PACKVS24 (t0, t1, w0, w1, 3); append_0x06_2x4_S (t0, t1, offset.s3); PACKSV24 (t0, t1, w0, w1, 3); PACKVS24 (t0, t1, w0, w1, 4); append_0x06_2x4_S (t0, t1, offset.s4); PACKSV24 (t0, t1, w0, w1, 4); PACKVS24 (t0, t1, w0, w1, 5); append_0x06_2x4_S (t0, t1, offset.s5); PACKSV24 (t0, t1, w0, w1, 5); PACKVS24 (t0, t1, w0, w1, 6); append_0x06_2x4_S (t0, t1, offset.s6); PACKSV24 (t0, t1, w0, w1, 6); PACKVS24 (t0, t1, w0, w1, 7); append_0x06_2x4_S (t0, t1, offset.s7); PACKSV24 (t0, t1, w0, w1, 7); PACKVS24 (t0, t1, w0, w1, 8); append_0x06_2x4_S (t0, t1, offset.s8); PACKSV24 (t0, t1, w0, w1, 8); PACKVS24 (t0, t1, w0, w1, 9); append_0x06_2x4_S (t0, t1, offset.s9); PACKSV24 (t0, t1, w0, w1, 9); PACKVS24 (t0, t1, w0, w1, a); append_0x06_2x4_S (t0, t1, offset.sa); PACKSV24 (t0, t1, w0, w1, a); PACKVS24 (t0, t1, w0, w1, b); append_0x06_2x4_S (t0, t1, offset.sb); PACKSV24 (t0, t1, w0, w1, b); PACKVS24 (t0, t1, w0, w1, c); append_0x06_2x4_S (t0, t1, offset.sc); PACKSV24 (t0, t1, w0, w1, c); PACKVS24 (t0, t1, w0, w1, d); append_0x06_2x4_S (t0, t1, offset.sd); PACKSV24 (t0, t1, w0, w1, d); PACKVS24 (t0, t1, w0, w1, e); append_0x06_2x4_S (t0, t1, offset.se); PACKSV24 (t0, t1, w0, w1, e); PACKVS24 (t0, t1, w0, w1, f); append_0x06_2x4_S (t0, t1, offset.sf); PACKSV24 (t0, t1, w0, w1, f); #endif } DECLSPEC void append_0x80_2x4_VV (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, const u32x offset) { #if VECT_SIZE == 1 append_0x80_2x4_S (w0, w1, offset); #else u32 t0[4]; u32 t1[4]; #endif #if VECT_SIZE == 2 PACKVS24 (t0, t1, w0, w1, 0); append_0x80_2x4_S (t0, t1, offset.s0); PACKSV24 (t0, t1, w0, w1, 0); PACKVS24 (t0, t1, w0, w1, 1); append_0x80_2x4_S (t0, t1, offset.s1); PACKSV24 (t0, t1, w0, w1, 1); #elif VECT_SIZE == 4 PACKVS24 (t0, t1, w0, w1, 0); append_0x80_2x4_S (t0, t1, offset.s0); PACKSV24 (t0, t1, w0, w1, 0); PACKVS24 (t0, t1, w0, w1, 1); append_0x80_2x4_S (t0, t1, offset.s1); PACKSV24 (t0, t1, w0, w1, 1); PACKVS24 (t0, t1, w0, w1, 2); append_0x80_2x4_S (t0, t1, offset.s2); PACKSV24 (t0, t1, w0, w1, 2); PACKVS24 (t0, t1, w0, w1, 3); append_0x80_2x4_S (t0, t1, offset.s3); PACKSV24 (t0, t1, w0, w1, 3); #elif VECT_SIZE == 8 PACKVS24 (t0, t1, w0, w1, 0); append_0x80_2x4_S (t0, t1, offset.s0); PACKSV24 (t0, t1, w0, w1, 0); PACKVS24 (t0, t1, w0, w1, 1); append_0x80_2x4_S (t0, t1, offset.s1); PACKSV24 (t0, t1, w0, w1, 1); PACKVS24 (t0, t1, w0, w1, 2); append_0x80_2x4_S (t0, t1, offset.s2); PACKSV24 (t0, t1, w0, w1, 2); PACKVS24 (t0, t1, w0, w1, 3); append_0x80_2x4_S (t0, t1, offset.s3); PACKSV24 (t0, t1, w0, w1, 3); PACKVS24 (t0, t1, w0, w1, 4); append_0x80_2x4_S (t0, t1, offset.s4); PACKSV24 (t0, t1, w0, w1, 4); PACKVS24 (t0, t1, w0, w1, 5); append_0x80_2x4_S (t0, t1, offset.s5); PACKSV24 (t0, t1, w0, w1, 5); PACKVS24 (t0, t1, w0, w1, 6); append_0x80_2x4_S (t0, t1, offset.s6); PACKSV24 (t0, t1, w0, w1, 6); PACKVS24 (t0, t1, w0, w1, 7); append_0x80_2x4_S (t0, t1, offset.s7); PACKSV24 (t0, t1, w0, w1, 7); #elif VECT_SIZE == 16 PACKVS24 (t0, t1, w0, w1, 0); append_0x80_2x4_S (t0, t1, offset.s0); PACKSV24 (t0, t1, w0, w1, 0); PACKVS24 (t0, t1, w0, w1, 1); append_0x80_2x4_S (t0, t1, offset.s1); PACKSV24 (t0, t1, w0, w1, 1); PACKVS24 (t0, t1, w0, w1, 2); append_0x80_2x4_S (t0, t1, offset.s2); PACKSV24 (t0, t1, w0, w1, 2); PACKVS24 (t0, t1, w0, w1, 3); append_0x80_2x4_S (t0, t1, offset.s3); PACKSV24 (t0, t1, w0, w1, 3); PACKVS24 (t0, t1, w0, w1, 4); append_0x80_2x4_S (t0, t1, offset.s4); PACKSV24 (t0, t1, w0, w1, 4); PACKVS24 (t0, t1, w0, w1, 5); append_0x80_2x4_S (t0, t1, offset.s5); PACKSV24 (t0, t1, w0, w1, 5); PACKVS24 (t0, t1, w0, w1, 6); append_0x80_2x4_S (t0, t1, offset.s6); PACKSV24 (t0, t1, w0, w1, 6); PACKVS24 (t0, t1, w0, w1, 7); append_0x80_2x4_S (t0, t1, offset.s7); PACKSV24 (t0, t1, w0, w1, 7); PACKVS24 (t0, t1, w0, w1, 8); append_0x80_2x4_S (t0, t1, offset.s8); PACKSV24 (t0, t1, w0, w1, 8); PACKVS24 (t0, t1, w0, w1, 9); append_0x80_2x4_S (t0, t1, offset.s9); PACKSV24 (t0, t1, w0, w1, 9); PACKVS24 (t0, t1, w0, w1, a); append_0x80_2x4_S (t0, t1, offset.sa); PACKSV24 (t0, t1, w0, w1, a); PACKVS24 (t0, t1, w0, w1, b); append_0x80_2x4_S (t0, t1, offset.sb); PACKSV24 (t0, t1, w0, w1, b); PACKVS24 (t0, t1, w0, w1, c); append_0x80_2x4_S (t0, t1, offset.sc); PACKSV24 (t0, t1, w0, w1, c); PACKVS24 (t0, t1, w0, w1, d); append_0x80_2x4_S (t0, t1, offset.sd); PACKSV24 (t0, t1, w0, w1, d); PACKVS24 (t0, t1, w0, w1, e); append_0x80_2x4_S (t0, t1, offset.se); PACKSV24 (t0, t1, w0, w1, e); PACKVS24 (t0, t1, w0, w1, f); append_0x80_2x4_S (t0, t1, offset.sf); PACKSV24 (t0, t1, w0, w1, f); #endif } DECLSPEC void append_0x80_4x4_VV (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const u32x offset) { #if VECT_SIZE == 1 append_0x80_4x4_S (w0, w1, w2, w3, offset); #else u32 t0[4]; u32 t1[4]; u32 t2[4]; u32 t3[4]; #endif #if VECT_SIZE == 2 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); append_0x80_4x4_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); append_0x80_4x4_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); #elif VECT_SIZE == 4 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); append_0x80_4x4_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); append_0x80_4x4_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); append_0x80_4x4_S (t0, t1, t2, t3, offset.s2); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); append_0x80_4x4_S (t0, t1, t2, t3, offset.s3); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); #elif VECT_SIZE == 8 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); append_0x80_4x4_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); append_0x80_4x4_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); append_0x80_4x4_S (t0, t1, t2, t3, offset.s2); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); append_0x80_4x4_S (t0, t1, t2, t3, offset.s3); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); append_0x80_4x4_S (t0, t1, t2, t3, offset.s4); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); append_0x80_4x4_S (t0, t1, t2, t3, offset.s5); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); append_0x80_4x4_S (t0, t1, t2, t3, offset.s6); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); append_0x80_4x4_S (t0, t1, t2, t3, offset.s7); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); #elif VECT_SIZE == 16 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); append_0x80_4x4_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); append_0x80_4x4_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); append_0x80_4x4_S (t0, t1, t2, t3, offset.s2); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); append_0x80_4x4_S (t0, t1, t2, t3, offset.s3); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); append_0x80_4x4_S (t0, t1, t2, t3, offset.s4); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); append_0x80_4x4_S (t0, t1, t2, t3, offset.s5); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); append_0x80_4x4_S (t0, t1, t2, t3, offset.s6); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); append_0x80_4x4_S (t0, t1, t2, t3, offset.s7); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 8); append_0x80_4x4_S (t0, t1, t2, t3, offset.s8); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 8); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 9); append_0x80_4x4_S (t0, t1, t2, t3, offset.s9); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 9); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, a); append_0x80_4x4_S (t0, t1, t2, t3, offset.sa); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, a); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, b); append_0x80_4x4_S (t0, t1, t2, t3, offset.sb); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, b); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, c); append_0x80_4x4_S (t0, t1, t2, t3, offset.sc); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, c); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, d); append_0x80_4x4_S (t0, t1, t2, t3, offset.sd); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, d); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, e); append_0x80_4x4_S (t0, t1, t2, t3, offset.se); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, e); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, f); append_0x80_4x4_S (t0, t1, t2, t3, offset.sf); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, f); #endif } DECLSPEC void append_0x2d_4x4_VV (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const u32x offset) { #if VECT_SIZE == 1 append_0x2d_4x4_S (w0, w1, w2, w3, offset); #else u32 t0[4]; u32 t1[4]; u32 t2[4]; u32 t3[4]; #endif #if VECT_SIZE == 2 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); #elif VECT_SIZE == 4 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s2); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s3); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); #elif VECT_SIZE == 8 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s2); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s3); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s4); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s5); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s6); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s7); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); #elif VECT_SIZE == 16 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s2); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s3); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s4); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s5); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s6); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s7); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 8); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s8); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 8); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 9); append_0x2d_4x4_S (t0, t1, t2, t3, offset.s9); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 9); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, a); append_0x2d_4x4_S (t0, t1, t2, t3, offset.sa); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, a); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, b); append_0x2d_4x4_S (t0, t1, t2, t3, offset.sb); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, b); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, c); append_0x2d_4x4_S (t0, t1, t2, t3, offset.sc); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, c); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, d); append_0x2d_4x4_S (t0, t1, t2, t3, offset.sd); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, d); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, e); append_0x2d_4x4_S (t0, t1, t2, t3, offset.se); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, e); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, f); append_0x2d_4x4_S (t0, t1, t2, t3, offset.sf); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, f); #endif } DECLSPEC void append_0x3a_4x4_VV (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const u32x offset) { #if VECT_SIZE == 1 append_0x3a_4x4_S (w0, w1, w2, w3, offset); #else u32 t0[4]; u32 t1[4]; u32 t2[4]; u32 t3[4]; #endif #if VECT_SIZE == 2 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); #elif VECT_SIZE == 4 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s2); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s3); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); #elif VECT_SIZE == 8 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s2); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s3); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s4); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s5); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s6); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s7); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); #elif VECT_SIZE == 16 PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s0); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 0); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s1); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 1); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s2); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 2); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s3); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 3); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s4); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 4); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s5); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 5); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s6); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 6); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s7); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 7); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 8); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s8); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 8); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, 9); append_0x3a_4x4_S (t0, t1, t2, t3, offset.s9); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, 9); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, a); append_0x3a_4x4_S (t0, t1, t2, t3, offset.sa); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, a); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, b); append_0x3a_4x4_S (t0, t1, t2, t3, offset.sb); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, b); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, c); append_0x3a_4x4_S (t0, t1, t2, t3, offset.sc); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, c); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, d); append_0x3a_4x4_S (t0, t1, t2, t3, offset.sd); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, d); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, e); append_0x3a_4x4_S (t0, t1, t2, t3, offset.se); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, e); PACKVS44 (t0, t1, t2, t3, w0, w1, w2, w3, f); append_0x3a_4x4_S (t0, t1, t2, t3, offset.sf); PACKSV44 (t0, t1, t2, t3, w0, w1, w2, w3, f); #endif } ================================================ FILE: src/main/resources/copyfromhashcat/inc_common.h ================================================ /** * Author......: See docs/credits.txt * License.....: MIT */ #ifndef INC_COMMON_H #define INC_COMMON_H /* * Prototype kernel function that fits all kernel macros * * There are four variables where major differences occur: * * - P2: Address space of kernel_rules_t struct. * If the kernel uses rules_buf, it will be stored in CONSTANT_AS. * If it does not, cheaper GLOBAL_AS space is used. * * - P4: Innerloop word buffer: * Most kernels use a bf_t structure in GLOBAL_AS address space (_BASIC). * Some use u32x pointer to a vector in CONSTANT_AS address space (_VECTOR). * A few use a specific bs_word_t struct (_BITSLICE). * * - P5: Type of the tmps structure with additional data, or void. * Used with slow hash types (ATTACK_EXEC_OUTSIDE_KERNEL) only. * * - P19: Type of the esalt_bufs structure with additional data, or void. */ #if defined IS_CUDA || defined IS_HIP #define KERN_ATTR(p2,p4,p5,p6,p19) \ MAYBE_UNUSED GLOBAL_AS pw_t *pws, \ MAYBE_UNUSED p2 const kernel_rule_t *g_rules_buf, \ MAYBE_UNUSED GLOBAL_AS const pw_t *combs_buf, \ MAYBE_UNUSED p4, \ MAYBE_UNUSED GLOBAL_AS p5 *tmps, \ MAYBE_UNUSED GLOBAL_AS p6 *hooks, \ MAYBE_UNUSED GLOBAL_AS const u32 *bitmaps_buf_s1_a, \ MAYBE_UNUSED GLOBAL_AS const u32 *bitmaps_buf_s1_b, \ MAYBE_UNUSED GLOBAL_AS const u32 *bitmaps_buf_s1_c, \ MAYBE_UNUSED GLOBAL_AS const u32 *bitmaps_buf_s1_d, \ MAYBE_UNUSED GLOBAL_AS const u32 *bitmaps_buf_s2_a, \ MAYBE_UNUSED GLOBAL_AS const u32 *bitmaps_buf_s2_b, \ MAYBE_UNUSED GLOBAL_AS const u32 *bitmaps_buf_s2_c, \ MAYBE_UNUSED GLOBAL_AS const u32 *bitmaps_buf_s2_d, \ MAYBE_UNUSED GLOBAL_AS plain_t *plains_buf, \ MAYBE_UNUSED GLOBAL_AS const digest_t *digests_buf, \ MAYBE_UNUSED GLOBAL_AS u32 *hashes_shown, \ MAYBE_UNUSED GLOBAL_AS const salt_t *salt_bufs, \ MAYBE_UNUSED GLOBAL_AS const p19 *esalt_bufs, \ MAYBE_UNUSED GLOBAL_AS u32 *d_return_buf, \ MAYBE_UNUSED GLOBAL_AS void *d_extra0_buf, \ MAYBE_UNUSED GLOBAL_AS void *d_extra1_buf, \ MAYBE_UNUSED GLOBAL_AS void *d_extra2_buf, \ MAYBE_UNUSED GLOBAL_AS void *d_extra3_buf, \ MAYBE_UNUSED GLOBAL_AS const kernel_param_t *kernel_param #else #define KERN_ATTR(p2,p4,p5,p6,p19) \ MAYBE_UNUSED GLOBAL_AS pw_t *pws, \ MAYBE_UNUSED p2 const kernel_rule_t *rules_buf, \ MAYBE_UNUSED GLOBAL_AS const pw_t *combs_buf, \ MAYBE_UNUSED p4, \ MAYBE_UNUSED GLOBAL_AS p5 *tmps, \ MAYBE_UNUSED GLOBAL_AS p6 *hooks, \ MAYBE_UNUSED GLOBAL_AS const u32 *bitmaps_buf_s1_a, \ MAYBE_UNUSED GLOBAL_AS const u32 *bitmaps_buf_s1_b, \ MAYBE_UNUSED GLOBAL_AS const u32 *bitmaps_buf_s1_c, \ MAYBE_UNUSED GLOBAL_AS const u32 *bitmaps_buf_s1_d, \ MAYBE_UNUSED GLOBAL_AS const u32 *bitmaps_buf_s2_a, \ MAYBE_UNUSED GLOBAL_AS const u32 *bitmaps_buf_s2_b, \ MAYBE_UNUSED GLOBAL_AS const u32 *bitmaps_buf_s2_c, \ MAYBE_UNUSED GLOBAL_AS const u32 *bitmaps_buf_s2_d, \ MAYBE_UNUSED GLOBAL_AS plain_t *plains_buf, \ MAYBE_UNUSED GLOBAL_AS const digest_t *digests_buf, \ MAYBE_UNUSED GLOBAL_AS u32 *hashes_shown, \ MAYBE_UNUSED GLOBAL_AS const salt_t *salt_bufs, \ MAYBE_UNUSED GLOBAL_AS const p19 *esalt_bufs, \ MAYBE_UNUSED GLOBAL_AS u32 *d_return_buf, \ MAYBE_UNUSED GLOBAL_AS void *d_extra0_buf, \ MAYBE_UNUSED GLOBAL_AS void *d_extra1_buf, \ MAYBE_UNUSED GLOBAL_AS void *d_extra2_buf, \ MAYBE_UNUSED GLOBAL_AS void *d_extra3_buf, \ MAYBE_UNUSED GLOBAL_AS const kernel_param_t *kernel_param #endif /* * Shortcut macros for usage in the actual kernels * * Not all possible combinations are needed. E.g. all kernels that use rules * do not use the tmps pointer, all kernels that use a vector pointer in P4 * do not use rules or tmps, etc. */ #if defined IS_CUDA || defined IS_HIP #define _KERN_ATTR_BASIC() KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t *g_bfs_buf, void, void, void) #define _KERN_ATTR_BITSLICE() KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bs_word_t *g_words_buf_s, void, void, void) #define _KERN_ATTR_ESALT(e) KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t *g_bfs_buf, void, void, e) #define _KERN_ATTR_RULES() KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t *g_bfs_buf, void, void, void) #define _KERN_ATTR_RULES_ESALT(e) KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t *g_bfs_buf, void, void, e) #define _KERN_ATTR_TMPS(t) KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t *g_bfs_buf, t, void, void) #define _KERN_ATTR_TMPS_ESALT(t,e) KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t *g_bfs_buf, t, void, e) #define _KERN_ATTR_TMPS_HOOKS(t,h) KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t *g_bfs_buf, t, h, void) #define _KERN_ATTR_TMPS_HOOKS_ESALT(t,h,e) KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t *g_bfs_buf, t, h, e) #define _KERN_ATTR_VECTOR() KERN_ATTR (GLOBAL_AS, GLOBAL_AS const u32x *g_words_buf_r, void, void, void) #define _KERN_ATTR_VECTOR_ESALT(e) KERN_ATTR (GLOBAL_AS, GLOBAL_AS const u32x *g_words_buf_r, void, void, e) #else #define _KERN_ATTR_BASIC() KERN_ATTR (GLOBAL_AS, CONSTANT_AS const bf_t *bfs_buf, void, void, void) #define _KERN_ATTR_BITSLICE() KERN_ATTR (GLOBAL_AS, CONSTANT_AS const bs_word_t *words_buf_s, void, void, void) #define _KERN_ATTR_ESALT(e) KERN_ATTR (GLOBAL_AS, CONSTANT_AS const bf_t *bfs_buf, void, void, e) #define _KERN_ATTR_RULES() KERN_ATTR (CONSTANT_AS, GLOBAL_AS const bf_t *bfs_buf, void, void, void) #define _KERN_ATTR_RULES_ESALT(e) KERN_ATTR (CONSTANT_AS, GLOBAL_AS const bf_t *bfs_buf, void, void, e) #define _KERN_ATTR_TMPS(t) KERN_ATTR (GLOBAL_AS, CONSTANT_AS const bf_t *bfs_buf, t, void, void) #define _KERN_ATTR_TMPS_ESALT(t,e) KERN_ATTR (GLOBAL_AS, CONSTANT_AS const bf_t *bfs_buf, t, void, e) #define _KERN_ATTR_TMPS_HOOKS(t,h) KERN_ATTR (GLOBAL_AS, CONSTANT_AS const bf_t *bfs_buf, t, h, void) #define _KERN_ATTR_TMPS_HOOKS_ESALT(t,h,e) KERN_ATTR (GLOBAL_AS, CONSTANT_AS const bf_t *bfs_buf, t, h, e) #define _KERN_ATTR_VECTOR() KERN_ATTR (GLOBAL_AS, CONSTANT_AS const u32x *words_buf_r, void, void, void) #define _KERN_ATTR_VECTOR_ESALT(e) KERN_ATTR (GLOBAL_AS, CONSTANT_AS const u32x *words_buf_r, void, void, e) #endif /* * with Metal we have additional parameters for the 'modifiers' (gid, lid, lsize, etc...) * they should not be declared in the host code * the compiler make the magic for us :) */ #if defined IS_METAL #define KERN_ATTR_MAIN_PARAMS \ uint hc_gid [[ thread_position_in_grid ]], \ uint hc_lid [[ thread_position_in_threadgroup ]], \ uint hc_lsz [[ threads_per_threadgroup ]] #endif // IS_METAL /* * TM kernel function parameters */ #define _KERN_ATTR_TM \ GLOBAL_AS u32 *mod, \ GLOBAL_AS bs_word_t *words_buf_b /* * Below are the macros to be used in the declarations of the KERNEL_FQ functions (pure and optimized kernels) * With Metal we need to add KERN_ATTR_MAIN_PARAMS * With CUDA, HIP and OpenCL there are no additional parameters other than those declared in the host code */ #if defined IS_METAL #define KERN_ATTR_BASIC() _KERN_ATTR_BASIC(), KERN_ATTR_MAIN_PARAMS #define KERN_ATTR_BITSLICE() _KERN_ATTR_BITSLICE(), KERN_ATTR_MAIN_PARAMS #define KERN_ATTR_ESALT(e) _KERN_ATTR_ESALT(e), KERN_ATTR_MAIN_PARAMS #define KERN_ATTR_RULES() _KERN_ATTR_RULES(), KERN_ATTR_MAIN_PARAMS #define KERN_ATTR_RULES_ESALT(e) _KERN_ATTR_RULES_ESALT(e), KERN_ATTR_MAIN_PARAMS #define KERN_ATTR_TMPS(t) _KERN_ATTR_TMPS(t), KERN_ATTR_MAIN_PARAMS #define KERN_ATTR_TMPS_ESALT(t,e) _KERN_ATTR_TMPS_ESALT(t,e), KERN_ATTR_MAIN_PARAMS #define KERN_ATTR_TMPS_HOOKS(t,h) _KERN_ATTR_TMPS_HOOKS(t,h), KERN_ATTR_MAIN_PARAMS #define KERN_ATTR_TMPS_HOOKS_ESALT(t,h,e) _KERN_ATTR_TMPS_HOOKS_ESALT(t,h,e), KERN_ATTR_MAIN_PARAMS #define KERN_ATTR_VECTOR() _KERN_ATTR_VECTOR(), KERN_ATTR_MAIN_PARAMS #define KERN_ATTR_VECTOR_ESALT(e) _KERN_ATTR_VECTOR_ESALT(e), KERN_ATTR_MAIN_PARAMS #define KERN_ATTR_TM _KERN_ATTR_TM, KERN_ATTR_MAIN_PARAMS #else // CUDA, HIP and OpenCL #define KERN_ATTR_BASIC() _KERN_ATTR_BASIC() #define KERN_ATTR_BITSLICE() _KERN_ATTR_BITSLICE() #define KERN_ATTR_ESALT(e) _KERN_ATTR_ESALT(e) #define KERN_ATTR_RULES() _KERN_ATTR_RULES() #define KERN_ATTR_RULES_ESALT(e) _KERN_ATTR_RULES_ESALT(e) #define KERN_ATTR_TMPS(t) _KERN_ATTR_TMPS(t) #define KERN_ATTR_TMPS_ESALT(t,e) _KERN_ATTR_TMPS_ESALT(t,e) #define KERN_ATTR_TMPS_HOOKS(t,h) _KERN_ATTR_TMPS_HOOKS(t,h) #define KERN_ATTR_TMPS_HOOKS_ESALT(t,h,e) _KERN_ATTR_TMPS_HOOKS_ESALT(t,h,e) #define KERN_ATTR_VECTOR() _KERN_ATTR_VECTOR() #define KERN_ATTR_VECTOR_ESALT(e) _KERN_ATTR_VECTOR_ESALT(e) #define KERN_ATTR_TM _KERN_ATTR_TM #endif // IS_METAL /* * Below are the macros to be used in the declarations of the DECLSPEC functions * that reuse the same parameters of KERNEL_FQ functions (-a3 optimized kernels) * They are shared with CUDA, HIP, Metal and OpenCL runtime * With these we can reuse 'modifier' (gid, lid, lsz, etc...) if we got it inside KERNEL functions */ #define KERN_ATTR_FUNC_PARAMS \ const u64 gid, \ MAYBE_UNUSED const u64 lid, \ MAYBE_UNUSED const u64 lsz #define KERN_ATTR_FUNC_BASIC() _KERN_ATTR_BASIC(), KERN_ATTR_FUNC_PARAMS #define KERN_ATTR_FUNC_BITSLICE() _KERN_ATTR_BITSLICE(), KERN_ATTR_FUNC_PARAMS #define KERN_ATTR_FUNC_ESALT(e) _KERN_ATTR_ESALT(e), KERN_ATTR_FUNC_PARAMS #define KERN_ATTR_FUNC_RULES() _KERN_ATTR_RULES(), KERN_ATTR_FUNC_PARAMS #define KERN_ATTR_FUNC_RULES_ESALT(e) _KERN_ATTR_RULES_ESALT(e), KERN_ATTR_FUNC_PARAMS #define KERN_ATTR_FUNC_TMPS(t) _KERN_ATTR_TMPS(t), KERN_ATTR_FUNC_PARAMS #define KERN_ATTR_FUNC_TMPS_ESALT(t,e) _KERN_ATTR_TMPS_ESALT(t,e), KERN_ATTR_FUNC_PARAMS #define KERN_ATTR_FUNC_TMPS_HOOKS(t,h) _KERN_ATTR_TMPS_HOOKS(t,h), KERN_ATTR_FUNC_PARAMS #define KERN_ATTR_FUNC_TMPS_HOOKS_ESALT(t,h,e) _KERN_ATTR_TMPS_HOOKS_ESALT(t,h,e), KERN_ATTR_FUNC_PARAMS #define KERN_ATTR_FUNC_VECTOR() _KERN_ATTR_VECTOR(), KERN_ATTR_FUNC_PARAMS #define KERN_ATTR_FUNC_VECTOR_ESALT(e) _KERN_ATTR_VECTOR_ESALT(e), KERN_ATTR_FUNC_PARAMS // union based packing DECLSPEC u8 v8a_from_v32_S (const u32 v32); DECLSPEC u8 v8b_from_v32_S (const u32 v32); DECLSPEC u8 v8c_from_v32_S (const u32 v32); DECLSPEC u8 v8d_from_v32_S (const u32 v32); DECLSPEC u8 v8a_from_v64_S (const u64 v64); DECLSPEC u8 v8b_from_v64_S (const u64 v64); DECLSPEC u8 v8c_from_v64_S (const u64 v64); DECLSPEC u8 v8d_from_v64_S (const u64 v64); DECLSPEC u8 v8e_from_v64_S (const u64 v64); DECLSPEC u8 v8f_from_v64_S (const u64 v64); DECLSPEC u8 v8g_from_v64_S (const u64 v64); DECLSPEC u8 v8h_from_v64_S (const u64 v64); DECLSPEC u8x v8a_from_v64 (const u64x v64); DECLSPEC u8x v8b_from_v64 (const u64x v64); DECLSPEC u8x v8c_from_v64 (const u64x v64); DECLSPEC u8x v8d_from_v64 (const u64x v64); DECLSPEC u8x v8e_from_v64 (const u64x v64); DECLSPEC u8x v8f_from_v64 (const u64x v64); DECLSPEC u8x v8g_from_v64 (const u64x v64); DECLSPEC u8x v8h_from_v64 (const u64x v64); DECLSPEC u16 v16a_from_v32_S (const u32 v32); DECLSPEC u16 v16b_from_v32_S (const u32 v32); DECLSPEC u32 v32a_from_v64_S (const u64 v64); DECLSPEC u32 v32b_from_v64_S (const u64 v64); DECLSPEC u32 v32_from_v16ab_S (const u16 v16a, const u16 v16b); DECLSPEC u64 v64_from_v32ab_S (const u32 v32a, const u32 v32b); // inline asm packing DECLSPEC u32x unpack_v8a_from_v32 (const u32x v32); DECLSPEC u32x unpack_v8b_from_v32 (const u32x v32); DECLSPEC u32x unpack_v8c_from_v32 (const u32x v32); DECLSPEC u32x unpack_v8d_from_v32 (const u32x v32); DECLSPEC u32 unpack_v8a_from_v32_S (const u32 v32); DECLSPEC u32 unpack_v8b_from_v32_S (const u32 v32); DECLSPEC u32 unpack_v8c_from_v32_S (const u32 v32); DECLSPEC u32 unpack_v8d_from_v32_S (const u32 v32); // opencl intern based packing DECLSPEC u32x l32_from_64 (u64x a); DECLSPEC u32x h32_from_64 (u64x a); DECLSPEC u32 l32_from_64_S (u64 a); DECLSPEC u32 h32_from_64_S (u64 a); DECLSPEC u64x hl32_to_64 (const u32x a, const u32x b); DECLSPEC u64 hl32_to_64_S (const u32 a, const u32 b); // bit operations DECLSPEC u32x hc_rotl32 (const u32x a, const int n); DECLSPEC u32x hc_rotr32 (const u32x a, const int n); DECLSPEC u32 hc_rotl32_S (const u32 a, const int n); DECLSPEC u32 hc_rotr32_S (const u32 a, const int n); DECLSPEC u64x hc_rotl64 (const u64x a, const int n); DECLSPEC u64x hc_rotr64 (const u64x a, const int n); DECLSPEC u64 hc_rotl64_S (const u64 a, const int n); DECLSPEC u64 hc_rotr64_S (const u64 a, const int n); DECLSPEC u32x hc_swap32 (const u32x v); DECLSPEC u32 hc_swap32_S (const u32 v); DECLSPEC u64x hc_swap64 (const u64x v); DECLSPEC u64 hc_swap64_S (const u64 v); // byte operations DECLSPEC u32x hc_bytealign (const u32x a, const u32x b, const int c); DECLSPEC u32 hc_bytealign_S (const u32 a, const u32 b, const int c); DECLSPEC u32x hc_bytealign_be (const u32x a, const u32x b, const int c); DECLSPEC u32 hc_bytealign_be_S (const u32 a, const u32 b, const int c); DECLSPEC u32x hc_byte_perm (const u32x a, const u32x b, const int c); DECLSPEC u32 hc_byte_perm_S (const u32 a, const u32 b, const int c); DECLSPEC u32x hc_add3 (const u32x a, const u32x b, const u32x c); DECLSPEC u32 hc_add3_S (const u32 a, const u32 b, const u32 c); DECLSPEC u32x hc_bfe (const u32x a, const u32x b, const u32x c); DECLSPEC u32 hc_bfe_S (const u32 a, const u32 b, const u32 c); DECLSPEC u32x hc_lop_0x96 (const u32x a, const u32x b, const u32x c); DECLSPEC u32 hc_lop_0x96_S (const u32 a, const u32 b, const u32 c); // legacy common code DECLSPEC int ffz (const u32 v); #ifdef KERNEL_STATIC DECLSPEC int hash_comp (PRIVATE_AS const u32 *d1, GLOBAL_AS const u32 *d2); DECLSPEC int find_hash (PRIVATE_AS const u32 *digest, const u32 digests_cnt, GLOBAL_AS const digest_t *digests_buf); #endif DECLSPEC int hc_enc_scan (PRIVATE_AS const u32 *buf, const int len); DECLSPEC int hc_enc_scan_global (GLOBAL_AS const u32 *buf, const int len); DECLSPEC void hc_enc_init (PRIVATE_AS hc_enc_t *hc_enc); DECLSPEC int hc_enc_has_next (PRIVATE_AS hc_enc_t *hc_enc, const int sz); DECLSPEC int hc_enc_next (PRIVATE_AS hc_enc_t *hc_enc, PRIVATE_AS const u32 *src_buf, const int src_len, const int src_sz, PRIVATE_AS u32 *dst_buf, const int dst_sz); DECLSPEC int hc_enc_next_global (PRIVATE_AS hc_enc_t *hc_enc, GLOBAL_AS const u32 *src_buf, const int src_len, const int src_sz, PRIVATE_AS u32 *dst_buf, const int dst_sz); DECLSPEC int pkcs_padding_bs8 (PRIVATE_AS const u32 *data_buf, const int data_len); DECLSPEC int pkcs_padding_bs16 (PRIVATE_AS const u32 *data_buf, const int data_len); DECLSPEC int asn1_detect (PRIVATE_AS const u32 *buf, const int len); DECLSPEC u32 check_bitmap (GLOBAL_AS const u32 *bitmap, const u32 bitmap_mask, const u32 bitmap_shift, const u32 digest); DECLSPEC u32 check (PRIVATE_AS const u32 *digest, GLOBAL_AS const u32 *bitmap_s1_a, GLOBAL_AS const u32 *bitmap_s1_b, GLOBAL_AS const u32 *bitmap_s1_c, GLOBAL_AS const u32 *bitmap_s1_d, GLOBAL_AS const u32 *bitmap_s2_a, GLOBAL_AS const u32 *bitmap_s2_b, GLOBAL_AS const u32 *bitmap_s2_c, GLOBAL_AS const u32 *bitmap_s2_d, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2); DECLSPEC void mark_hash (GLOBAL_AS plain_t *plains_buf, GLOBAL_AS u32 *d_result, const u32 salt_pos, const u32 digests_cnt, const u32 digest_pos, const u32 hash_pos, const u64 gid, const u32 il_pos, const u32 extra1, const u32 extra2); DECLSPEC int hc_count_char (PRIVATE_AS const u32 *buf, const int elems, const u32 c); DECLSPEC float hc_get_entropy (PRIVATE_AS const u32 *buf, const int elems); DECLSPEC int is_valid_hex_8 (const u8 v); DECLSPEC int is_valid_hex_32 (const u32 v); DECLSPEC int is_valid_base58_8 (const u8 v); DECLSPEC int is_valid_base58_32 (const u32 v); DECLSPEC int is_valid_printable_8 (const u8 v); DECLSPEC int is_valid_printable_32 (const u32 v); DECLSPEC int hc_find_keyboard_layout_map (const u32 search, const int search_len, LOCAL_AS keyboard_layout_mapping_t *s_keyboard_layout_mapping_buf, const int keyboard_layout_mapping_cnt); DECLSPEC int hc_execute_keyboard_layout_mapping (PRIVATE_AS u32 *w, const int pw_len, LOCAL_AS keyboard_layout_mapping_t *s_keyboard_layout_mapping_buf, const int keyboard_layout_mapping_cnt); DECLSPEC int count_bits_32 (const u32 v0, const u32 v1); DECLSPEC void make_utf16be (PRIVATE_AS const u32x *in, PRIVATE_AS u32x *out1, PRIVATE_AS u32x *out2); DECLSPEC void make_utf16beN (PRIVATE_AS const u32x *in, PRIVATE_AS u32x *out1, PRIVATE_AS u32x *out2); DECLSPEC void make_utf16beN_S (PRIVATE_AS const u32 *in, PRIVATE_AS u32 *out1, PRIVATE_AS u32 *out2); DECLSPEC void make_utf16le (PRIVATE_AS const u32x *in, PRIVATE_AS u32x *out1, PRIVATE_AS u32x *out2); DECLSPEC void make_utf16leN (PRIVATE_AS const u32x *in, PRIVATE_AS u32x *out1, PRIVATE_AS u32x *out2); DECLSPEC void undo_utf16be (PRIVATE_AS const u32x *in1, PRIVATE_AS const u32x *in2, PRIVATE_AS u32x *out); DECLSPEC void undo_utf16le (PRIVATE_AS const u32x *in1, PRIVATE_AS const u32x *in2, PRIVATE_AS u32x *out); DECLSPEC void set_mark_1x4 (PRIVATE_AS u32 *v, const u32 offset); DECLSPEC void append_helper_1x4 (PRIVATE_AS u32x *r, const u32 v, PRIVATE_AS const u32 *m); DECLSPEC void append_0x80_1x4 (PRIVATE_AS u32x *w0, const u32 offset); DECLSPEC void append_0x80_2x4 (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, const u32 offset); DECLSPEC void append_0x80_3x4 (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, const u32 offset); DECLSPEC void append_0x80_4x4 (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const u32 offset); DECLSPEC void append_0x80_8x4 (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *w4, PRIVATE_AS u32x *w5, PRIVATE_AS u32x *w6, PRIVATE_AS u32x *w7, const u32 offset); DECLSPEC void append_0x80_1x16 (PRIVATE_AS u32x *w, const u32 offset); DECLSPEC void switch_buffer_by_offset_le (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const u32 offset); DECLSPEC void switch_buffer_by_offset_carry_le (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *c0, PRIVATE_AS u32x *c1, PRIVATE_AS u32x *c2, PRIVATE_AS u32x *c3, const u32 offset); DECLSPEC void switch_buffer_by_offset_be (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const u32 offset); DECLSPEC void switch_buffer_by_offset_carry_be (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *c0, PRIVATE_AS u32x *c1, PRIVATE_AS u32x *c2, PRIVATE_AS u32x *c3, const u32 offset); DECLSPEC void switch_buffer_by_offset_8x4_le (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *w4, PRIVATE_AS u32x *w5, PRIVATE_AS u32x *w6, PRIVATE_AS u32x *w7, const u32 offset); DECLSPEC void switch_buffer_by_offset_8x4_carry_le (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *w4, PRIVATE_AS u32x *w5, PRIVATE_AS u32x *w6, PRIVATE_AS u32x *w7, PRIVATE_AS u32x *c0, PRIVATE_AS u32x *c1, PRIVATE_AS u32x *c2, PRIVATE_AS u32x *c3, PRIVATE_AS u32x *c4, PRIVATE_AS u32x *c5, PRIVATE_AS u32x *c6, PRIVATE_AS u32x *c7, const u32 offset); DECLSPEC void switch_buffer_by_offset_8x4_be (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *w4, PRIVATE_AS u32x *w5, PRIVATE_AS u32x *w6, PRIVATE_AS u32x *w7, const u32 offset); DECLSPEC void switch_buffer_by_offset_8x4_carry_be (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *w4, PRIVATE_AS u32x *w5, PRIVATE_AS u32x *w6, PRIVATE_AS u32x *w7, PRIVATE_AS u32x *c0, PRIVATE_AS u32x *c1, PRIVATE_AS u32x *c2, PRIVATE_AS u32x *c3, PRIVATE_AS u32x *c4, PRIVATE_AS u32x *c5, PRIVATE_AS u32x *c6, PRIVATE_AS u32x *c7, const u32 offset); DECLSPEC void switch_buffer_by_offset_1x64_le (PRIVATE_AS u32x *w, const u32 offset); DECLSPEC void switch_buffer_by_offset_1x64_be (PRIVATE_AS u32x *w, const u32 offset); DECLSPEC void truncate_block_4x4_le_S (PRIVATE_AS u32 *w0, const u32 len); DECLSPEC void truncate_block_4x4_be_S (PRIVATE_AS u32 *w0, const u32 len); DECLSPEC void truncate_block_16x4_le_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 len); DECLSPEC void truncate_block_16x4_be_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 len); DECLSPEC void set_mark_1x4_S (PRIVATE_AS u32 *v, const u32 offset); DECLSPEC void append_helper_1x4_S (PRIVATE_AS u32 *r, const u32 v, PRIVATE_AS const u32 *m); DECLSPEC void append_0x01_2x4_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, const u32 offset); DECLSPEC void append_0x06_2x4_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, const u32 offset); DECLSPEC void append_0x01_4x4_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 offset); DECLSPEC void append_0x2d_4x4_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 offset); DECLSPEC void append_0x80_1x4_S (PRIVATE_AS u32 *w0, const u32 offset); DECLSPEC void append_0x80_2x4_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, const u32 offset); DECLSPEC void append_0x80_3x4_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, const u32 offset); DECLSPEC void append_0x80_4x4_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 offset); DECLSPEC void append_0x80_8x4_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, PRIVATE_AS u32 *w4, PRIVATE_AS u32 *w5, PRIVATE_AS u32 *w6, PRIVATE_AS u32 *w7, const u32 offset); DECLSPEC void make_utf16be_S (PRIVATE_AS const u32 *in, PRIVATE_AS u32 *out1, PRIVATE_AS u32 *out2); DECLSPEC void make_utf16le_S (PRIVATE_AS const u32 *in, PRIVATE_AS u32 *out1, PRIVATE_AS u32 *out2); DECLSPEC void undo_utf16be_S (PRIVATE_AS const u32 *in1, PRIVATE_AS const u32 *in2, PRIVATE_AS u32 *out); DECLSPEC void undo_utf16le_S (PRIVATE_AS const u32 *in1, PRIVATE_AS const u32 *in2, PRIVATE_AS u32 *out); DECLSPEC void switch_buffer_by_offset_le_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 offset); DECLSPEC void switch_buffer_by_offset_carry_le_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, PRIVATE_AS u32 *c0, PRIVATE_AS u32 *c1, PRIVATE_AS u32 *c2, PRIVATE_AS u32 *c3, const u32 offset); DECLSPEC void switch_buffer_by_offset_be_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 offset); DECLSPEC void switch_buffer_by_offset_carry_be_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, PRIVATE_AS u32 *c0, PRIVATE_AS u32 *c1, PRIVATE_AS u32 *c2, PRIVATE_AS u32 *c3, const u32 offset); DECLSPEC void switch_buffer_by_offset_8x4_le_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, PRIVATE_AS u32 *w4, PRIVATE_AS u32 *w5, PRIVATE_AS u32 *w6, PRIVATE_AS u32 *w7, const u32 offset); DECLSPEC void switch_buffer_by_offset_8x4_carry_le_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, PRIVATE_AS u32 *w4, PRIVATE_AS u32 *w5, PRIVATE_AS u32 *w6, PRIVATE_AS u32 *w7, PRIVATE_AS u32 *c0, PRIVATE_AS u32 *c1, PRIVATE_AS u32 *c2, PRIVATE_AS u32 *c3, PRIVATE_AS u32 *c4, PRIVATE_AS u32 *c5, PRIVATE_AS u32 *c6, PRIVATE_AS u32 *c7, const u32 offset); DECLSPEC void switch_buffer_by_offset_8x4_be_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, PRIVATE_AS u32 *w4, PRIVATE_AS u32 *w5, PRIVATE_AS u32 *w6, PRIVATE_AS u32 *w7, const u32 offset); DECLSPEC void switch_buffer_by_offset_8x4_carry_be_S (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, PRIVATE_AS u32 *w4, PRIVATE_AS u32 *w5, PRIVATE_AS u32 *w6, PRIVATE_AS u32 *w7, PRIVATE_AS u32 *c0, PRIVATE_AS u32 *c1, PRIVATE_AS u32 *c2, PRIVATE_AS u32 *c3, PRIVATE_AS u32 *c4, PRIVATE_AS u32 *c5, PRIVATE_AS u32 *c6, PRIVATE_AS u32 *c7, const u32 offset); DECLSPEC void switch_buffer_by_offset_1x64_le_S (PRIVATE_AS u32 *w, const u32 offset); DECLSPEC void switch_buffer_by_offset_1x64_be_S (PRIVATE_AS u32 *w, const u32 offset); DECLSPEC void switch_buffer_by_offset_le_VV (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const u32x offset); DECLSPEC void switch_buffer_by_offset_8x4_le_VV (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, PRIVATE_AS u32x *w4, PRIVATE_AS u32x *w5, PRIVATE_AS u32x *w6, PRIVATE_AS u32x *w7, const u32x offset); DECLSPEC void append_0x01_2x4_VV (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, const u32x offset); DECLSPEC void append_0x01_4x4_VV (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const u32x offset); DECLSPEC void append_0x06_2x4_VV (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, const u32x offset); DECLSPEC void append_0x80_2x4_VV (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, const u32x offset); DECLSPEC void append_0x80_4x4_VV (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const u32x offset); DECLSPEC void append_0x2d_4x4_VV (PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const u32x offset); #endif // INC_COMMON_H ================================================ FILE: src/main/resources/copyfromhashcat/inc_ecc_secp256k1.cl ================================================ /** * Author......: See docs/credits.txt * License.....: MIT * * Furthermore, since elliptic curve operations are highly researched and optimized, * we've consulted a lot of online resources to implement this, including several papers and * example code. * * Credits where credits are due: there are a lot of nice projects that explain and/or optimize * elliptic curve operations (especially elliptic curve multiplications by a scalar). * * We want to shout out following projects, which were quite helpful when implementing this: * - secp256k1 by Pieter Wuille (https://github.com/bitcoin-core/secp256k1/, MIT) * - secp256k1-cl by hhanh00 (https://github.com/hhanh00/secp256k1-cl/, MIT) * - ec_pure_c by masterzorag (https://github.com/masterzorag/ec_pure_c/) * - ecc-gmp by leivaburto (https://github.com/leivaburto/ecc-gmp) * - micro-ecc by Ken MacKay (https://github.com/kmackay/micro-ecc/, BSD) * - curve_example by willem (https://gist.github.com/nlitsme/c9031c7b9bf6bb009e5a) * - py_ecc by Vitalik Buterin (https://github.com/ethereum/py_ecc/, MIT) * * * Some BigNum operations are implemented similar to micro-ecc which is licensed under these terms: * Copyright 2014 Ken MacKay, 2-Clause BSD License * * Redistribution and use in source and binary forms, with or without modification, are permitted * provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * ATTENTION: this code is NOT meant to be used in security critical environments that are at risk * of side-channel or timing attacks etc, it's only purpose is to make it work fast for GPGPU * (OpenCL/CUDA). Some attack vectors like side-channel and timing-attacks might be possible, * because of some optimizations used within this code (non-constant time etc). */ /* * Implementation considerations: * point double and point add are implemented similar to algorithms mentioned in this 2011 paper: * http://eprint.iacr.org/2011/338.pdf * (Fast and Regular Algorithms for Scalar Multiplication over Elliptic Curves by Matthieu Rivain) * * In theory we could use the Jacobian Co-Z enhancement to get rid of the larger buffer caused by * the z coordinates (and in this way reduce register pressure etc). * For the Co-Z improvement there are a lot of fast algorithms, but we might still be faster * with this implementation (b/c we allow non-constant time) without the Brier/Joye Montgomery-like * ladder. Of course, this claim would need to be verified and tested to see which one is faster * for our specific scenario at the end. * * We accomplish a "little" speedup by using scalars converted to w-NAF (non-adjacent form): * The general idea of w-NAF is to pre-compute some zi coefficients like below to reduce the * costly point additions by using a non-binary ("signed") number system (values other than just * 0 and 1, but ranging from -2^(w-1)-1 to 2^(w-1)-1). This works best with the left-to-right * binary algorithm such that we just add zi * P when adding point P (we pre-compute all the * possible zi * P values because the x/y coordinates are known before the kernel starts): * * // Example with window size w = 2 (i.e. mod 4 => & 3): * // 173 => 1 0 -1 0 -1 0 -1 0 1 = 2^8 - 2^6 - 2^4 - 2^2 + 1 * int e = 0b10101101; // 173 * int z[8 + 1] = { 0 }; // our zi/di, we need one extra slot to make the subtraction work * * int i = 0; * * while (e) * { * if (e & 1) * { * // for window size w = 3 it would be: * // => 2^(w-0) = 2^3 = 8 * // => 2^(w-1) = 2^2 = 4 * * int bit; // = 2 - (e & 3) for w = 2 * * if ((e & 3) >= 2) // e % 4 == e & 3, use (e & 7) >= 4 for w = 3 * bit = (e & 3) - 4; // (e & 7) - 8 for w = 3 * else * bit = e & 3; // e & 7 for w = 3 * * z[i] = bit; * e -= bit; * } * * e >>= 1; // e / 2 * i++; * } */ #include "inc_ecc_secp256k1.h" DECLSPEC u32 sub (PRIVATE_AS u32 *r, PRIVATE_AS const u32 *a, PRIVATE_AS const u32 *b) { u32 c = 0; // carry/borrow #if defined IS_NV && HAS_SUB == 1 && HAS_SUBC == 1 asm volatile ( "sub.cc.u32 %0, %9, %17;" "subc.cc.u32 %1, %10, %18;" "subc.cc.u32 %2, %11, %19;" "subc.cc.u32 %3, %12, %20;" "subc.cc.u32 %4, %13, %21;" "subc.cc.u32 %5, %14, %22;" "subc.cc.u32 %6, %15, %23;" "subc.cc.u32 %7, %16, %24;" "subc.u32 %8, 0, 0;" : "=r"(r[0]), "=r"(r[1]), "=r"(r[2]), "=r"(r[3]), "=r"(r[4]), "=r"(r[5]), "=r"(r[6]), "=r"(r[7]), "=r"(c) : "r"(a[0]), "r"(a[1]), "r"(a[2]), "r"(a[3]), "r"(a[4]), "r"(a[5]), "r"(a[6]), "r"(a[7]), "r"(b[0]), "r"(b[1]), "r"(b[2]), "r"(b[3]), "r"(b[4]), "r"(b[5]), "r"(b[6]), "r"(b[7]) ); // HIP doesnt support these so we stick to OpenCL (aka IS_AMD) - is also faster without asm //#elif (defined IS_AMD || defined IS_HIP) && HAS_VSUB == 1 && HAS_VSUBB == 1 #elif 0 __asm__ __volatile__ ( "V_SUB_U32 %0, %9, %17;" "V_SUBB_U32 %1, %10, %18;" "V_SUBB_U32 %2, %11, %19;" "V_SUBB_U32 %3, %12, %20;" "V_SUBB_U32 %4, %13, %21;" "V_SUBB_U32 %5, %14, %22;" "V_SUBB_U32 %6, %15, %23;" "V_SUBB_U32 %7, %16, %24;" "V_SUBB_U32 %8, 0, 0;" : "=v"(r[0]), "=v"(r[1]), "=v"(r[2]), "=v"(r[3]), "=v"(r[4]), "=v"(r[5]), "=v"(r[6]), "=v"(r[7]), "=v"(c) : "v"(a[0]), "v"(a[1]), "v"(a[2]), "v"(a[3]), "v"(a[4]), "v"(a[5]), "v"(a[6]), "v"(a[7]), "v"(b[0]), "v"(b[1]), "v"(b[2]), "v"(b[3]), "v"(b[4]), "v"(b[5]), "v"(b[6]), "v"(b[7]) ); #else for (u32 i = 0; i < 8; i++) { const u32 diff = a[i] - b[i] - c; if (diff != a[i]) c = (diff > a[i]); r[i] = diff; } #endif return c; } DECLSPEC u32 add (PRIVATE_AS u32 *r, PRIVATE_AS const u32 *a, PRIVATE_AS const u32 *b) { u32 c = 0; // carry/borrow #if defined IS_NV && HAS_ADD == 1 && HAS_ADDC == 1 asm volatile ( "add.cc.u32 %0, %9, %17;" "addc.cc.u32 %1, %10, %18;" "addc.cc.u32 %2, %11, %19;" "addc.cc.u32 %3, %12, %20;" "addc.cc.u32 %4, %13, %21;" "addc.cc.u32 %5, %14, %22;" "addc.cc.u32 %6, %15, %23;" "addc.cc.u32 %7, %16, %24;" "addc.u32 %8, 0, 0;" : "=r"(r[0]), "=r"(r[1]), "=r"(r[2]), "=r"(r[3]), "=r"(r[4]), "=r"(r[5]), "=r"(r[6]), "=r"(r[7]), "=r"(c) : "r"(a[0]), "r"(a[1]), "r"(a[2]), "r"(a[3]), "r"(a[4]), "r"(a[5]), "r"(a[6]), "r"(a[7]), "r"(b[0]), "r"(b[1]), "r"(b[2]), "r"(b[3]), "r"(b[4]), "r"(b[5]), "r"(b[6]), "r"(b[7]) ); // HIP doesnt support these so we stick to OpenCL (aka IS_AMD) - is also faster without asm //#elif (defined IS_AMD || defined IS_HIP) && HAS_VSUB == 1 && HAS_VSUBB == 1 #elif 0 __asm__ __volatile__ ( "V_ADD_U32 %0, %9, %17;" "V_ADDC_U32 %1, %10, %18;" "V_ADDC_U32 %2, %11, %19;" "V_ADDC_U32 %3, %12, %20;" "V_ADDC_U32 %4, %13, %21;" "V_ADDC_U32 %5, %14, %22;" "V_ADDC_U32 %6, %15, %23;" "V_ADDC_U32 %7, %16, %24;" "V_ADDC_U32 %8, 0, 0;" : "=v"(r[0]), "=v"(r[1]), "=v"(r[2]), "=v"(r[3]), "=v"(r[4]), "=v"(r[5]), "=v"(r[6]), "=v"(r[7]), "=v"(c) : "v"(a[0]), "v"(a[1]), "v"(a[2]), "v"(a[3]), "v"(a[4]), "v"(a[5]), "v"(a[6]), "v"(a[7]), "v"(b[0]), "v"(b[1]), "v"(b[2]), "v"(b[3]), "v"(b[4]), "v"(b[5]), "v"(b[6]), "v"(b[7]) ); #else for (u32 i = 0; i < 8; i++) { const u32 t = a[i] + b[i] + c; if (t != a[i]) c = (t < a[i]); r[i] = t; } #endif return c; } DECLSPEC void sub_mod (PRIVATE_AS u32 *r, PRIVATE_AS const u32 *a, PRIVATE_AS const u32 *b) { const u32 c = sub (r, a, b); // carry if (c) { u32 t[8]; t[0] = SECP256K1_P0; t[1] = SECP256K1_P1; t[2] = SECP256K1_P2; t[3] = SECP256K1_P3; t[4] = SECP256K1_P4; t[5] = SECP256K1_P5; t[6] = SECP256K1_P6; t[7] = SECP256K1_P7; add (r, r, t); } } DECLSPEC void add_mod (PRIVATE_AS u32 *r, PRIVATE_AS const u32 *a, PRIVATE_AS const u32 *b) { const u32 c = add (r, a, b); // carry /* * Modulo operation: */ // note: we could have an early exit in case of c == 1 => sub () u32 t[8]; t[0] = SECP256K1_P0; t[1] = SECP256K1_P1; t[2] = SECP256K1_P2; t[3] = SECP256K1_P3; t[4] = SECP256K1_P4; t[5] = SECP256K1_P5; t[6] = SECP256K1_P6; t[7] = SECP256K1_P7; // check if modulo operation is needed u32 mod = 1; if (c == 0) { for (int i = 7; i >= 0; i--) { if (r[i] < t[i]) { mod = 0; break; // or return ! (check if faster) } if (r[i] > t[i]) break; } } if (mod == 1) { sub (r, r, t); } } DECLSPEC void mod_512 (PRIVATE_AS u32 *n) { // we need to perform a modulo operation with 512-bit % 256-bit (bignum modulo): // the modulus is the secp256k1 group order // ATTENTION: for this function the byte-order is reversed (most significant bytes // at the left) /* the general modulo by shift and substract code (a = a % b): x = b; t = a >> 1; while (x <= t) x <<= 1; while (a >= b) { if (a >= x) a -= x; x >>= 1; } return a; // remainder */ u32 a[16]; a[ 0] = n[ 0]; a[ 1] = n[ 1]; a[ 2] = n[ 2]; a[ 3] = n[ 3]; a[ 4] = n[ 4]; a[ 5] = n[ 5]; a[ 6] = n[ 6]; a[ 7] = n[ 7]; a[ 8] = n[ 8]; a[ 9] = n[ 9]; a[10] = n[10]; a[11] = n[11]; a[12] = n[12]; a[13] = n[13]; a[14] = n[14]; a[15] = n[15]; u32 b[16]; b[ 0] = 0x00000000; b[ 1] = 0x00000000; b[ 2] = 0x00000000; b[ 3] = 0x00000000; b[ 4] = 0x00000000; b[ 5] = 0x00000000; b[ 6] = 0x00000000; b[ 7] = 0x00000000; b[ 8] = SECP256K1_N7; b[ 9] = SECP256K1_N6; b[10] = SECP256K1_N5; b[11] = SECP256K1_N4; b[12] = SECP256K1_N3; b[13] = SECP256K1_N2; b[14] = SECP256K1_N1; b[15] = SECP256K1_N0; /* * Start: */ // x = b (but with a fast "shift" trick to avoid the while loop) u32 x[16]; x[ 0] = b[ 8]; // this is a trick: we just put the group order's most significant bit all the x[ 1] = b[ 9]; // way to the top to avoid doing the initial: while (x <= t) x <<= 1 x[ 2] = b[10]; x[ 3] = b[11]; x[ 4] = b[12]; x[ 5] = b[13]; x[ 6] = b[14]; x[ 7] = b[15]; x[ 8] = 0x00000000; x[ 9] = 0x00000000; x[10] = 0x00000000; x[11] = 0x00000000; x[12] = 0x00000000; x[13] = 0x00000000; x[14] = 0x00000000; x[15] = 0x00000000; // a >= b while (a[0] >= b[0]) { u32 l00 = a[ 0] < b[ 0]; u32 l01 = a[ 1] < b[ 1]; u32 l02 = a[ 2] < b[ 2]; u32 l03 = a[ 3] < b[ 3]; u32 l04 = a[ 4] < b[ 4]; u32 l05 = a[ 5] < b[ 5]; u32 l06 = a[ 6] < b[ 6]; u32 l07 = a[ 7] < b[ 7]; u32 l08 = a[ 8] < b[ 8]; u32 l09 = a[ 9] < b[ 9]; u32 l10 = a[10] < b[10]; u32 l11 = a[11] < b[11]; u32 l12 = a[12] < b[12]; u32 l13 = a[13] < b[13]; u32 l14 = a[14] < b[14]; u32 l15 = a[15] < b[15]; u32 e00 = a[ 0] == b[ 0]; u32 e01 = a[ 1] == b[ 1]; u32 e02 = a[ 2] == b[ 2]; u32 e03 = a[ 3] == b[ 3]; u32 e04 = a[ 4] == b[ 4]; u32 e05 = a[ 5] == b[ 5]; u32 e06 = a[ 6] == b[ 6]; u32 e07 = a[ 7] == b[ 7]; u32 e08 = a[ 8] == b[ 8]; u32 e09 = a[ 9] == b[ 9]; u32 e10 = a[10] == b[10]; u32 e11 = a[11] == b[11]; u32 e12 = a[12] == b[12]; u32 e13 = a[13] == b[13]; u32 e14 = a[14] == b[14]; if (l00) break; if (l01 && e00) break; if (l02 && e00 && e01) break; if (l03 && e00 && e01 && e02) break; if (l04 && e00 && e01 && e02 && e03) break; if (l05 && e00 && e01 && e02 && e03 && e04) break; if (l06 && e00 && e01 && e02 && e03 && e04 && e05) break; if (l07 && e00 && e01 && e02 && e03 && e04 && e05 && e06) break; if (l08 && e00 && e01 && e02 && e03 && e04 && e05 && e06 && e07) break; if (l09 && e00 && e01 && e02 && e03 && e04 && e05 && e06 && e07 && e08) break; if (l10 && e00 && e01 && e02 && e03 && e04 && e05 && e06 && e07 && e08 && e09) break; if (l11 && e00 && e01 && e02 && e03 && e04 && e05 && e06 && e07 && e08 && e09 && e10) break; if (l12 && e00 && e01 && e02 && e03 && e04 && e05 && e06 && e07 && e08 && e09 && e10 && e11) break; if (l13 && e00 && e01 && e02 && e03 && e04 && e05 && e06 && e07 && e08 && e09 && e10 && e11 && e12) break; if (l14 && e00 && e01 && e02 && e03 && e04 && e05 && e06 && e07 && e08 && e09 && e10 && e11 && e12 && e13) break; if (l15 && e00 && e01 && e02 && e03 && e04 && e05 && e06 && e07 && e08 && e09 && e10 && e11 && e12 && e13 && e14) break; // r = x (copy it to have the original values for the subtraction) u32 r[16]; r[ 0] = x[ 0]; r[ 1] = x[ 1]; r[ 2] = x[ 2]; r[ 3] = x[ 3]; r[ 4] = x[ 4]; r[ 5] = x[ 5]; r[ 6] = x[ 6]; r[ 7] = x[ 7]; r[ 8] = x[ 8]; r[ 9] = x[ 9]; r[10] = x[10]; r[11] = x[11]; r[12] = x[12]; r[13] = x[13]; r[14] = x[14]; r[15] = x[15]; // x <<= 1 x[15] = x[15] >> 1 | x[14] << 31; x[14] = x[14] >> 1 | x[13] << 31; x[13] = x[13] >> 1 | x[12] << 31; x[12] = x[12] >> 1 | x[11] << 31; x[11] = x[11] >> 1 | x[10] << 31; x[10] = x[10] >> 1 | x[ 9] << 31; x[ 9] = x[ 9] >> 1 | x[ 8] << 31; x[ 8] = x[ 8] >> 1 | x[ 7] << 31; x[ 7] = x[ 7] >> 1 | x[ 6] << 31; x[ 6] = x[ 6] >> 1 | x[ 5] << 31; x[ 5] = x[ 5] >> 1 | x[ 4] << 31; x[ 4] = x[ 4] >> 1 | x[ 3] << 31; x[ 3] = x[ 3] >> 1 | x[ 2] << 31; x[ 2] = x[ 2] >> 1 | x[ 1] << 31; x[ 1] = x[ 1] >> 1 | x[ 0] << 31; x[ 0] = x[ 0] >> 1; // if (a >= r) a -= r; l00 = a[ 0] < r[ 0]; l01 = a[ 1] < r[ 1]; l02 = a[ 2] < r[ 2]; l03 = a[ 3] < r[ 3]; l04 = a[ 4] < r[ 4]; l05 = a[ 5] < r[ 5]; l06 = a[ 6] < r[ 6]; l07 = a[ 7] < r[ 7]; l08 = a[ 8] < r[ 8]; l09 = a[ 9] < r[ 9]; l10 = a[10] < r[10]; l11 = a[11] < r[11]; l12 = a[12] < r[12]; l13 = a[13] < r[13]; l14 = a[14] < r[14]; l15 = a[15] < r[15]; e00 = a[ 0] == r[ 0]; e01 = a[ 1] == r[ 1]; e02 = a[ 2] == r[ 2]; e03 = a[ 3] == r[ 3]; e04 = a[ 4] == r[ 4]; e05 = a[ 5] == r[ 5]; e06 = a[ 6] == r[ 6]; e07 = a[ 7] == r[ 7]; e08 = a[ 8] == r[ 8]; e09 = a[ 9] == r[ 9]; e10 = a[10] == r[10]; e11 = a[11] == r[11]; e12 = a[12] == r[12]; e13 = a[13] == r[13]; e14 = a[14] == r[14]; if (l00) continue; if (l01 && e00) continue; if (l02 && e00 && e01) continue; if (l03 && e00 && e01 && e02) continue; if (l04 && e00 && e01 && e02 && e03) continue; if (l05 && e00 && e01 && e02 && e03 && e04) continue; if (l06 && e00 && e01 && e02 && e03 && e04 && e05) continue; if (l07 && e00 && e01 && e02 && e03 && e04 && e05 && e06) continue; if (l08 && e00 && e01 && e02 && e03 && e04 && e05 && e06 && e07) continue; if (l09 && e00 && e01 && e02 && e03 && e04 && e05 && e06 && e07 && e08) continue; if (l10 && e00 && e01 && e02 && e03 && e04 && e05 && e06 && e07 && e08 && e09) continue; if (l11 && e00 && e01 && e02 && e03 && e04 && e05 && e06 && e07 && e08 && e09 && e10) continue; if (l12 && e00 && e01 && e02 && e03 && e04 && e05 && e06 && e07 && e08 && e09 && e10 && e11) continue; if (l13 && e00 && e01 && e02 && e03 && e04 && e05 && e06 && e07 && e08 && e09 && e10 && e11 && e12) continue; if (l14 && e00 && e01 && e02 && e03 && e04 && e05 && e06 && e07 && e08 && e09 && e10 && e11 && e12 && e13) continue; if (l15 && e00 && e01 && e02 && e03 && e04 && e05 && e06 && e07 && e08 && e09 && e10 && e11 && e12 && e13 && e14) continue; // substract (a -= r): if ((r[ 0] | r[ 1] | r[ 2] | r[ 3] | r[ 4] | r[ 5] | r[ 6] | r[ 7] | r[ 8] | r[ 9] | r[10] | r[11] | r[12] | r[13] | r[14] | r[15]) == 0) break; r[ 0] = a[ 0] - r[ 0]; r[ 1] = a[ 1] - r[ 1]; r[ 2] = a[ 2] - r[ 2]; r[ 3] = a[ 3] - r[ 3]; r[ 4] = a[ 4] - r[ 4]; r[ 5] = a[ 5] - r[ 5]; r[ 6] = a[ 6] - r[ 6]; r[ 7] = a[ 7] - r[ 7]; r[ 8] = a[ 8] - r[ 8]; r[ 9] = a[ 9] - r[ 9]; r[10] = a[10] - r[10]; r[11] = a[11] - r[11]; r[12] = a[12] - r[12]; r[13] = a[13] - r[13]; r[14] = a[14] - r[14]; r[15] = a[15] - r[15]; // take care of the "borrow" (we can't do it the other way around 15...1 because r[x] is changed!) if (r[ 1] > a[ 1]) r[ 0]--; if (r[ 2] > a[ 2]) r[ 1]--; if (r[ 3] > a[ 3]) r[ 2]--; if (r[ 4] > a[ 4]) r[ 3]--; if (r[ 5] > a[ 5]) r[ 4]--; if (r[ 6] > a[ 6]) r[ 5]--; if (r[ 7] > a[ 7]) r[ 6]--; if (r[ 8] > a[ 8]) r[ 7]--; if (r[ 9] > a[ 9]) r[ 8]--; if (r[10] > a[10]) r[ 9]--; if (r[11] > a[11]) r[10]--; if (r[12] > a[12]) r[11]--; if (r[13] > a[13]) r[12]--; if (r[14] > a[14]) r[13]--; if (r[15] > a[15]) r[14]--; a[ 0] = r[ 0]; a[ 1] = r[ 1]; a[ 2] = r[ 2]; a[ 3] = r[ 3]; a[ 4] = r[ 4]; a[ 5] = r[ 5]; a[ 6] = r[ 6]; a[ 7] = r[ 7]; a[ 8] = r[ 8]; a[ 9] = r[ 9]; a[10] = r[10]; a[11] = r[11]; a[12] = r[12]; a[13] = r[13]; a[14] = r[14]; a[15] = r[15]; } n[ 0] = a[ 0]; n[ 1] = a[ 1]; n[ 2] = a[ 2]; n[ 3] = a[ 3]; n[ 4] = a[ 4]; n[ 5] = a[ 5]; n[ 6] = a[ 6]; n[ 7] = a[ 7]; n[ 8] = a[ 8]; n[ 9] = a[ 9]; n[10] = a[10]; n[11] = a[11]; n[12] = a[12]; n[13] = a[13]; n[14] = a[14]; n[15] = a[15]; } DECLSPEC void mul_mod (PRIVATE_AS u32 *r, PRIVATE_AS const u32 *a, PRIVATE_AS const u32 *b) // TODO get rid of u64 ? { u32 t[16] = { 0 }; // we need up to double the space (2 * 8) /* * First start with the basic a * b multiplication: */ u32 t0 = 0; u32 t1 = 0; u32 c = 0; for (u32 i = 0; i < 8; i++) { for (u32 j = 0; j <= i; j++) { u64 p = ((u64) a[j]) * b[i - j]; u64 d = ((u64) t1) << 32 | t0; d += p; t0 = (u32) d; t1 = d >> 32; c += d < p; // carry } t[i] = t0; t0 = t1; t1 = c; c = 0; } for (u32 i = 8; i < 15; i++) { for (u32 j = i - 7; j < 8; j++) { u64 p = ((u64) a[j]) * b[i - j]; u64 d = ((u64) t1) << 32 | t0; d += p; t0 = (u32) d; t1 = d >> 32; c += d < p; } t[i] = t0; t0 = t1; t1 = c; c = 0; } t[15] = t0; /* * Now do the modulo operation: * (r = t % p) * * http://www.isys.uni-klu.ac.at/PDF/2001-0126-MT.pdf (p.354 or p.9 in that document) */ u32 tmp[16] = { 0 }; // c = 0; // Note: SECP256K1_P = 2^256 - 2^32 - 977 (0x03d1 = 977) // multiply t[8]...t[15] by omega: for (u32 i = 0, j = 8; i < 8; i++, j++) { u64 p = ((u64) 0x03d1) * t[j] + c; tmp[i] = (u32) p; c = p >> 32; } tmp[8] = c; c = add (tmp + 1, tmp + 1, t + 8); // modifies tmp[1]...tmp[8] tmp[9] = c; // r = t + tmp c = add (r, t, tmp); // multiply t[0]...t[7] by omega: u32 c2 = 0; // memset (t, 0, sizeof (t)); for (u32 i = 0, j = 8; i < 8; i++, j++) { u64 p = ((u64) 0x3d1) * tmp[j] + c2; t[i] = (u32) p; c2 = p >> 32; } t[8] = c2; c2 = add (t + 1, t + 1, tmp + 8); // modifies t[1]...t[8] t[9] = c2; // r = r + t c2 = add (r, r, t); c += c2; t[0] = SECP256K1_P0; t[1] = SECP256K1_P1; t[2] = SECP256K1_P2; t[3] = SECP256K1_P3; t[4] = SECP256K1_P4; t[5] = SECP256K1_P5; t[6] = SECP256K1_P6; t[7] = SECP256K1_P7; for (u32 i = c; i > 0; i--) { sub (r, r, t); } for (int i = 7; i >= 0; i--) { if (r[i] < t[i]) break; if (r[i] > t[i]) { sub (r, r, t); break; } } } DECLSPEC void sqrt_mod (PRIVATE_AS u32 *r) { // Fermat's Little Theorem // secp256k1: y^2 = x^3 + 7 % p // y ^ (p - 1) = 1 // y ^ (p - 1) = (y^2) ^ ((p - 1) / 2) = 1 => y^2 = (y^2) ^ (((p - 1) / 2) + 1) // => y = (y^2) ^ ((((p - 1) / 2) + 1) / 2) // y = (y^2) ^ (((p - 1 + 2) / 2) / 2) = (y^2) ^ ((p + 1) / 4) // y1 = (x^3 + 7) ^ ((p + 1) / 4) // y2 = p - y1 (or y2 = y1 * -1 % p) u32 s[8]; s[0] = SECP256K1_P0 + 1; // because of (p + 1) / 4 or use add (s, s, 1) s[1] = SECP256K1_P1; s[2] = SECP256K1_P2; s[3] = SECP256K1_P3; s[4] = SECP256K1_P4; s[5] = SECP256K1_P5; s[6] = SECP256K1_P6; s[7] = SECP256K1_P7; u32 t[8] = { 0 }; t[0] = 1; for (u32 i = 255; i > 1; i--) // we just skip the last 2 multiplications (=> exp / 4) { mul_mod (t, t, t); // r * r u32 idx = i >> 5; u32 mask = 1 << (i & 0x1f); if (s[idx] & mask) { mul_mod (t, t, r); // t * r } } r[0] = t[0]; r[1] = t[1]; r[2] = t[2]; r[3] = t[3]; r[4] = t[4]; r[5] = t[5]; r[6] = t[6]; r[7] = t[7]; } // (inverse (a, p) * a) % p == 1 (or think of a * a^-1 = a / a = 1) DECLSPEC void inv_mod (PRIVATE_AS u32 *a) { // How often does this really happen? it should "almost" never happen (but would be safer) // if ((a[0] | a[1] | a[2] | a[3] | a[4] | a[5] | a[6] | a[7]) == 0) return; u32 t0[8]; t0[0] = a[0]; t0[1] = a[1]; t0[2] = a[2]; t0[3] = a[3]; t0[4] = a[4]; t0[5] = a[5]; t0[6] = a[6]; t0[7] = a[7]; u32 p[8]; p[0] = SECP256K1_P0; p[1] = SECP256K1_P1; p[2] = SECP256K1_P2; p[3] = SECP256K1_P3; p[4] = SECP256K1_P4; p[5] = SECP256K1_P5; p[6] = SECP256K1_P6; p[7] = SECP256K1_P7; u32 t1[8]; t1[0] = SECP256K1_P0; t1[1] = SECP256K1_P1; t1[2] = SECP256K1_P2; t1[3] = SECP256K1_P3; t1[4] = SECP256K1_P4; t1[5] = SECP256K1_P5; t1[6] = SECP256K1_P6; t1[7] = SECP256K1_P7; u32 t2[8] = { 0 }; t2[0] = 0x00000001; u32 t3[8] = { 0 }; u32 b = (t0[0] != t1[0]) | (t0[1] != t1[1]) | (t0[2] != t1[2]) | (t0[3] != t1[3]) | (t0[4] != t1[4]) | (t0[5] != t1[5]) | (t0[6] != t1[6]) | (t0[7] != t1[7]); while (b) { if ((t0[0] & 1) == 0) // even { t0[0] = t0[0] >> 1 | t0[1] << 31; t0[1] = t0[1] >> 1 | t0[2] << 31; t0[2] = t0[2] >> 1 | t0[3] << 31; t0[3] = t0[3] >> 1 | t0[4] << 31; t0[4] = t0[4] >> 1 | t0[5] << 31; t0[5] = t0[5] >> 1 | t0[6] << 31; t0[6] = t0[6] >> 1 | t0[7] << 31; t0[7] = t0[7] >> 1; u32 c = 0; if (t2[0] & 1) c = add (t2, t2, p); t2[0] = t2[0] >> 1 | t2[1] << 31; t2[1] = t2[1] >> 1 | t2[2] << 31; t2[2] = t2[2] >> 1 | t2[3] << 31; t2[3] = t2[3] >> 1 | t2[4] << 31; t2[4] = t2[4] >> 1 | t2[5] << 31; t2[5] = t2[5] >> 1 | t2[6] << 31; t2[6] = t2[6] >> 1 | t2[7] << 31; t2[7] = t2[7] >> 1 | c << 31; } else if ((t1[0] & 1) == 0) { t1[0] = t1[0] >> 1 | t1[1] << 31; t1[1] = t1[1] >> 1 | t1[2] << 31; t1[2] = t1[2] >> 1 | t1[3] << 31; t1[3] = t1[3] >> 1 | t1[4] << 31; t1[4] = t1[4] >> 1 | t1[5] << 31; t1[5] = t1[5] >> 1 | t1[6] << 31; t1[6] = t1[6] >> 1 | t1[7] << 31; t1[7] = t1[7] >> 1; u32 c = 0; if (t3[0] & 1) c = add (t3, t3, p); t3[0] = t3[0] >> 1 | t3[1] << 31; t3[1] = t3[1] >> 1 | t3[2] << 31; t3[2] = t3[2] >> 1 | t3[3] << 31; t3[3] = t3[3] >> 1 | t3[4] << 31; t3[4] = t3[4] >> 1 | t3[5] << 31; t3[5] = t3[5] >> 1 | t3[6] << 31; t3[6] = t3[6] >> 1 | t3[7] << 31; t3[7] = t3[7] >> 1 | c << 31; } else { u32 gt = 0; for (int i = 7; i >= 0; i--) { if (t0[i] > t1[i]) { gt = 1; break; } if (t0[i] < t1[i]) break; } if (gt) { sub (t0, t0, t1); t0[0] = t0[0] >> 1 | t0[1] << 31; t0[1] = t0[1] >> 1 | t0[2] << 31; t0[2] = t0[2] >> 1 | t0[3] << 31; t0[3] = t0[3] >> 1 | t0[4] << 31; t0[4] = t0[4] >> 1 | t0[5] << 31; t0[5] = t0[5] >> 1 | t0[6] << 31; t0[6] = t0[6] >> 1 | t0[7] << 31; t0[7] = t0[7] >> 1; u32 lt = 0; for (int i = 7; i >= 0; i--) { if (t2[i] < t3[i]) { lt = 1; break; } if (t2[i] > t3[i]) break; } if (lt) add (t2, t2, p); sub (t2, t2, t3); u32 c = 0; if (t2[0] & 1) c = add (t2, t2, p); t2[0] = t2[0] >> 1 | t2[1] << 31; t2[1] = t2[1] >> 1 | t2[2] << 31; t2[2] = t2[2] >> 1 | t2[3] << 31; t2[3] = t2[3] >> 1 | t2[4] << 31; t2[4] = t2[4] >> 1 | t2[5] << 31; t2[5] = t2[5] >> 1 | t2[6] << 31; t2[6] = t2[6] >> 1 | t2[7] << 31; t2[7] = t2[7] >> 1 | c << 31; } else { sub (t1, t1, t0); t1[0] = t1[0] >> 1 | t1[1] << 31; t1[1] = t1[1] >> 1 | t1[2] << 31; t1[2] = t1[2] >> 1 | t1[3] << 31; t1[3] = t1[3] >> 1 | t1[4] << 31; t1[4] = t1[4] >> 1 | t1[5] << 31; t1[5] = t1[5] >> 1 | t1[6] << 31; t1[6] = t1[6] >> 1 | t1[7] << 31; t1[7] = t1[7] >> 1; u32 lt = 0; for (int i = 7; i >= 0; i--) { if (t3[i] < t2[i]) { lt = 1; break; } if (t3[i] > t2[i]) break; } if (lt) add (t3, t3, p); sub (t3, t3, t2); u32 c = 0; if (t3[0] & 1) c = add (t3, t3, p); t3[0] = t3[0] >> 1 | t3[1] << 31; t3[1] = t3[1] >> 1 | t3[2] << 31; t3[2] = t3[2] >> 1 | t3[3] << 31; t3[3] = t3[3] >> 1 | t3[4] << 31; t3[4] = t3[4] >> 1 | t3[5] << 31; t3[5] = t3[5] >> 1 | t3[6] << 31; t3[6] = t3[6] >> 1 | t3[7] << 31; t3[7] = t3[7] >> 1 | c << 31; } } // update b: b = (t0[0] != t1[0]) | (t0[1] != t1[1]) | (t0[2] != t1[2]) | (t0[3] != t1[3]) | (t0[4] != t1[4]) | (t0[5] != t1[5]) | (t0[6] != t1[6]) | (t0[7] != t1[7]); } // set result: a[0] = t2[0]; a[1] = t2[1]; a[2] = t2[2]; a[3] = t2[3]; a[4] = t2[4]; a[5] = t2[5]; a[6] = t2[6]; a[7] = t2[7]; } /* // everything from the formulas below of course MOD the prime: // we use this formula: X = (3/2 * x^2)^2 - 2 * x * y^2 Y = (3/2 * x^2) * (x * y^2 - X) - y^4 Z = y * z this is identical to the more frequently used form: X = (3 * x^2)^2 - 8 * x * y^2 Y = 3 * x^2 * (4 * x * y^2 - X) - 8 * y^4 Z = 2 * y * z */ DECLSPEC void point_double (PRIVATE_AS u32 *x, PRIVATE_AS u32 *y, PRIVATE_AS u32 *z) { // How often does this really happen? it should "almost" never happen (but would be safer) /* if ((y[0] | y[1] | y[2] | y[3] | y[4] | y[5] | y[6] | y[7]) == 0) { x[0] = 0; x[1] = 0; x[2] = 0; x[3] = 0; x[4] = 0; x[5] = 0; x[6] = 0; x[7] = 0; y[0] = 0; y[1] = 0; y[2] = 0; y[3] = 0; y[4] = 0; y[5] = 0; y[6] = 0; y[7] = 0; z[0] = 0; z[1] = 0; z[2] = 0; z[3] = 0; z[4] = 0; z[5] = 0; z[6] = 0; z[7] = 0; return; } */ u32 t1[8]; t1[0] = x[0]; t1[1] = x[1]; t1[2] = x[2]; t1[3] = x[3]; t1[4] = x[4]; t1[5] = x[5]; t1[6] = x[6]; t1[7] = x[7]; u32 t2[8]; t2[0] = y[0]; t2[1] = y[1]; t2[2] = y[2]; t2[3] = y[3]; t2[4] = y[4]; t2[5] = y[5]; t2[6] = y[6]; t2[7] = y[7]; u32 t3[8]; t3[0] = z[0]; t3[1] = z[1]; t3[2] = z[2]; t3[3] = z[3]; t3[4] = z[4]; t3[5] = z[5]; t3[6] = z[6]; t3[7] = z[7]; u32 t4[8]; u32 t5[8]; u32 t6[8]; mul_mod (t4, t1, t1); // t4 = x^2 mul_mod (t5, t2, t2); // t5 = y^2 mul_mod (t1, t1, t5); // t1 = x*y^2 mul_mod (t5, t5, t5); // t5 = t5^2 = y^4 // here the z^2 and z^4 is not needed for a = 0 mul_mod (t3, t2, t3); // t3 = x * z add_mod (t2, t4, t4); // t2 = 2 * t4 = 2 * x^2 add_mod (t4, t4, t2); // t4 = 3 * t4 = 3 * x^2 // a * z^4 = 0 * 1^4 = 0 // don't discard the least significant bit it's important too! u32 c = 0; if (t4[0] & 1) { u32 t[8]; t[0] = SECP256K1_P0; t[1] = SECP256K1_P1; t[2] = SECP256K1_P2; t[3] = SECP256K1_P3; t[4] = SECP256K1_P4; t[5] = SECP256K1_P5; t[6] = SECP256K1_P6; t[7] = SECP256K1_P7; c = add (t4, t4, t); // t4 + SECP256K1_P } // right shift (t4 / 2): t4[0] = t4[0] >> 1 | t4[1] << 31; t4[1] = t4[1] >> 1 | t4[2] << 31; t4[2] = t4[2] >> 1 | t4[3] << 31; t4[3] = t4[3] >> 1 | t4[4] << 31; t4[4] = t4[4] >> 1 | t4[5] << 31; t4[5] = t4[5] >> 1 | t4[6] << 31; t4[6] = t4[6] >> 1 | t4[7] << 31; t4[7] = t4[7] >> 1 | c << 31; mul_mod (t6, t4, t4); // t6 = t4^2 = (3/2 * x^2)^2 add_mod (t2, t1, t1); // t2 = 2 * t1 sub_mod (t6, t6, t2); // t6 = t6 - t2 sub_mod (t1, t1, t6); // t1 = t1 - t6 mul_mod (t4, t4, t1); // t4 = t4 * t1 sub_mod (t1, t4, t5); // t1 = t4 - t5 // => x = t6, y = t1, z = t3: x[0] = t6[0]; x[1] = t6[1]; x[2] = t6[2]; x[3] = t6[3]; x[4] = t6[4]; x[5] = t6[5]; x[6] = t6[6]; x[7] = t6[7]; y[0] = t1[0]; y[1] = t1[1]; y[2] = t1[2]; y[3] = t1[3]; y[4] = t1[4]; y[5] = t1[5]; y[6] = t1[6]; y[7] = t1[7]; z[0] = t3[0]; z[1] = t3[1]; z[2] = t3[2]; z[3] = t3[3]; z[4] = t3[4]; z[5] = t3[5]; z[6] = t3[6]; z[7] = t3[7]; } /* * madd-2004-hmv: * (from https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html) * t1 = z1^2 * t2 = t1*z1 * t1 = t1*x2 * t2 = t2*y2 * t1 = t1-x1 * t2 = t2-y1 * z3 = z1*t1 * t3 = t1^2 * t4 = t3*t1 * t3 = t3*x1 * t1 = 2*t3 * x3 = t2^2 * x3 = x3-t1 * x3 = x3-t4 * t3 = t3-x3 * t3 = t3*t2 * t4 = t4*y1 * y3 = t3-t4 */ DECLSPEC void point_add (PRIVATE_AS u32 *x1, PRIVATE_AS u32 *y1, PRIVATE_AS u32 *z1, PRIVATE_AS const u32 *x2, PRIVATE_AS const u32 *y2) // z2 = 1 { // How often does this really happen? it should "almost" never happen (but would be safer) /* if ((y2[0] | y2[1] | y2[2] | y2[3] | y2[4] | y2[5] | y2[6] | y2[7]) == 0) return; if ((y1[0] | y1[1] | y1[2] | y1[3] | y1[4] | y1[5] | y1[6] | y1[7]) == 0) { x1[0] = x2[0]; x1[1] = x2[1]; x1[2] = x2[2]; x1[3] = x2[3]; x1[4] = x2[4]; x1[5] = x2[5]; x1[6] = x2[6]; x1[7] = x2[7]; y1[0] = y2[0]; y1[1] = y2[1]; y1[2] = y2[2]; y1[3] = y2[3]; y1[4] = y2[4]; y1[5] = y2[5]; y1[6] = y2[6]; y1[7] = y2[7]; z1[0] = z2[0]; z1[1] = z2[1]; z1[2] = z2[2]; z1[3] = z2[3]; z1[4] = z2[4]; z1[5] = z2[5]; z1[6] = z2[6]; z1[7] = z2[7]; return; } */ // if x1 == x2 and y2 == y2 and z2 == z2 we need to double instead? // x1/y1/z1: u32 t1[8]; t1[0] = x1[0]; t1[1] = x1[1]; t1[2] = x1[2]; t1[3] = x1[3]; t1[4] = x1[4]; t1[5] = x1[5]; t1[6] = x1[6]; t1[7] = x1[7]; u32 t2[8]; t2[0] = y1[0]; t2[1] = y1[1]; t2[2] = y1[2]; t2[3] = y1[3]; t2[4] = y1[4]; t2[5] = y1[5]; t2[6] = y1[6]; t2[7] = y1[7]; u32 t3[8]; t3[0] = z1[0]; t3[1] = z1[1]; t3[2] = z1[2]; t3[3] = z1[3]; t3[4] = z1[4]; t3[5] = z1[5]; t3[6] = z1[6]; t3[7] = z1[7]; // x2/y2: u32 t4[8]; t4[0] = x2[0]; t4[1] = x2[1]; t4[2] = x2[2]; t4[3] = x2[3]; t4[4] = x2[4]; t4[5] = x2[5]; t4[6] = x2[6]; t4[7] = x2[7]; u32 t5[8]; t5[0] = y2[0]; t5[1] = y2[1]; t5[2] = y2[2]; t5[3] = y2[3]; t5[4] = y2[4]; t5[5] = y2[5]; t5[6] = y2[6]; t5[7] = y2[7]; u32 t6[8]; u32 t7[8]; u32 t8[8]; u32 t9[8]; mul_mod (t6, t3, t3); // t6 = t3^2 mul_mod (t7, t6, t3); // t7 = t6*t3 mul_mod (t6, t6, t4); // t6 = t6*t4 mul_mod (t7, t7, t5); // t7 = t7*t5 sub_mod (t6, t6, t1); // t6 = t6-t1 sub_mod (t7, t7, t2); // t7 = t7-t2 mul_mod (t8, t3, t6); // t8 = t3*t6 mul_mod (t4, t6, t6); // t4 = t6^2 mul_mod (t9, t4, t6); // t9 = t4*t6 mul_mod (t4, t4, t1); // t4 = t4*t1 // left shift (t4 * 2): t6[7] = t4[7] << 1 | t4[6] >> 31; t6[6] = t4[6] << 1 | t4[5] >> 31; t6[5] = t4[5] << 1 | t4[4] >> 31; t6[4] = t4[4] << 1 | t4[3] >> 31; t6[3] = t4[3] << 1 | t4[2] >> 31; t6[2] = t4[2] << 1 | t4[1] >> 31; t6[1] = t4[1] << 1 | t4[0] >> 31; t6[0] = t4[0] << 1; // don't discard the most significant bit, it's important too! if (t4[7] & 0x80000000) { // use most significant bit and perform mod P, since we have: t4 * 2 % P u32 a[8] = { 0 }; a[1] = 1; a[0] = 0x000003d1; // omega (see: mul_mod ()) add (t6, t6, a); } mul_mod (t5, t7, t7); // t5 = t7*t7 sub_mod (t5, t5, t6); // t5 = t5-t6 sub_mod (t5, t5, t9); // t5 = t5-t9 sub_mod (t4, t4, t5); // t4 = t4-t5 mul_mod (t4, t4, t7); // t4 = t4*t7 mul_mod (t9, t9, t2); // t9 = t9*t2 sub_mod (t9, t4, t9); // t9 = t4-t9 x1[0] = t5[0]; x1[1] = t5[1]; x1[2] = t5[2]; x1[3] = t5[3]; x1[4] = t5[4]; x1[5] = t5[5]; x1[6] = t5[6]; x1[7] = t5[7]; y1[0] = t9[0]; y1[1] = t9[1]; y1[2] = t9[2]; y1[3] = t9[3]; y1[4] = t9[4]; y1[5] = t9[5]; y1[6] = t9[6]; y1[7] = t9[7]; z1[0] = t8[0]; z1[1] = t8[1]; z1[2] = t8[2]; z1[3] = t8[3]; z1[4] = t8[4]; z1[5] = t8[5]; z1[6] = t8[6]; z1[7] = t8[7]; } DECLSPEC void point_get_coords (PRIVATE_AS secp256k1_t *r, PRIVATE_AS const u32 *x, PRIVATE_AS const u32 *y) { /* pre-compute 1/-1, 3/-3, 5/-5, 7/-7 times P (x, y) for wNAF with window size 4 (max/min: +/- 2^3-1): -7, -5, -3, -1, 1, 3, 5, 7 +x1 ( 0) +y1 ( 8) -y1 (16) +x3 (24) +y3 (32) -y3 (40) +x5 (48) +y5 (56) -y5 (64) +x7 (72) +y7 (80) -y7 (88) */ // note: we use jacobian forms with (x, y, z) for computation, but affine // (or just converted to z = 1) for storage // 1: r->xy[ 0] = x[0]; r->xy[ 1] = x[1]; r->xy[ 2] = x[2]; r->xy[ 3] = x[3]; r->xy[ 4] = x[4]; r->xy[ 5] = x[5]; r->xy[ 6] = x[6]; r->xy[ 7] = x[7]; r->xy[ 8] = y[0]; r->xy[ 9] = y[1]; r->xy[10] = y[2]; r->xy[11] = y[3]; r->xy[12] = y[4]; r->xy[13] = y[5]; r->xy[14] = y[6]; r->xy[15] = y[7]; // -1: u32 p[8]; p[0] = SECP256K1_P0; p[1] = SECP256K1_P1; p[2] = SECP256K1_P2; p[3] = SECP256K1_P3; p[4] = SECP256K1_P4; p[5] = SECP256K1_P5; p[6] = SECP256K1_P6; p[7] = SECP256K1_P7; u32 neg[8]; neg[0] = y[0]; neg[1] = y[1]; neg[2] = y[2]; neg[3] = y[3]; neg[4] = y[4]; neg[5] = y[5]; neg[6] = y[6]; neg[7] = y[7]; sub_mod (neg, p, neg); // -y = p - y r->xy[16] = neg[0]; r->xy[17] = neg[1]; r->xy[18] = neg[2]; r->xy[19] = neg[3]; r->xy[20] = neg[4]; r->xy[21] = neg[5]; r->xy[22] = neg[6]; r->xy[23] = neg[7]; // copy of 1: u32 tx[8]; tx[0] = x[0]; tx[1] = x[1]; tx[2] = x[2]; tx[3] = x[3]; tx[4] = x[4]; tx[5] = x[5]; tx[6] = x[6]; tx[7] = x[7]; u32 ty[8]; ty[0] = y[0]; ty[1] = y[1]; ty[2] = y[2]; ty[3] = y[3]; ty[4] = y[4]; ty[5] = y[5]; ty[6] = y[6]; ty[7] = y[7]; u32 rx[8]; rx[0] = x[0]; rx[1] = x[1]; rx[2] = x[2]; rx[3] = x[3]; rx[4] = x[4]; rx[5] = x[5]; rx[6] = x[6]; rx[7] = x[7]; u32 ry[8]; ry[0] = y[0]; ry[1] = y[1]; ry[2] = y[2]; ry[3] = y[3]; ry[4] = y[4]; ry[5] = y[5]; ry[6] = y[6]; ry[7] = y[7]; u32 rz[8] = { 0 }; rz[0] = 1; // 3: point_double (rx, ry, rz); // 2 point_add (rx, ry, rz, tx, ty); // 3 // to affine: inv_mod (rz); mul_mod (neg, rz, rz); // neg is temporary variable (z^2) mul_mod (rx, rx, neg); mul_mod (rz, neg, rz); mul_mod (ry, ry, rz); r->xy[24] = rx[0]; r->xy[25] = rx[1]; r->xy[26] = rx[2]; r->xy[27] = rx[3]; r->xy[28] = rx[4]; r->xy[29] = rx[5]; r->xy[30] = rx[6]; r->xy[31] = rx[7]; r->xy[32] = ry[0]; r->xy[33] = ry[1]; r->xy[34] = ry[2]; r->xy[35] = ry[3]; r->xy[36] = ry[4]; r->xy[37] = ry[5]; r->xy[38] = ry[6]; r->xy[39] = ry[7]; // -3: neg[0] = ry[0]; neg[1] = ry[1]; neg[2] = ry[2]; neg[3] = ry[3]; neg[4] = ry[4]; neg[5] = ry[5]; neg[6] = ry[6]; neg[7] = ry[7]; sub_mod (neg, p, neg); r->xy[40] = neg[0]; r->xy[41] = neg[1]; r->xy[42] = neg[2]; r->xy[43] = neg[3]; r->xy[44] = neg[4]; r->xy[45] = neg[5]; r->xy[46] = neg[6]; r->xy[47] = neg[7]; // 5: rz[0] = 1; // actually we could take advantage of rz being 1 too (alternative point_add ()), rz[1] = 0; // but it is not important because this is performed only once per "hash" rz[2] = 0; rz[3] = 0; rz[4] = 0; rz[5] = 0; rz[6] = 0; rz[7] = 0; point_add (rx, ry, rz, tx, ty); // 4 point_add (rx, ry, rz, tx, ty); // 5 // to affine: inv_mod (rz); mul_mod (neg, rz, rz); mul_mod (rx, rx, neg); mul_mod (rz, neg, rz); mul_mod (ry, ry, rz); r->xy[48] = rx[0]; r->xy[49] = rx[1]; r->xy[50] = rx[2]; r->xy[51] = rx[3]; r->xy[52] = rx[4]; r->xy[53] = rx[5]; r->xy[54] = rx[6]; r->xy[55] = rx[7]; r->xy[56] = ry[0]; r->xy[57] = ry[1]; r->xy[58] = ry[2]; r->xy[59] = ry[3]; r->xy[60] = ry[4]; r->xy[61] = ry[5]; r->xy[62] = ry[6]; r->xy[63] = ry[7]; // -5: neg[0] = ry[0]; neg[1] = ry[1]; neg[2] = ry[2]; neg[3] = ry[3]; neg[4] = ry[4]; neg[5] = ry[5]; neg[6] = ry[6]; neg[7] = ry[7]; sub_mod (neg, p, neg); r->xy[64] = neg[0]; r->xy[65] = neg[1]; r->xy[66] = neg[2]; r->xy[67] = neg[3]; r->xy[68] = neg[4]; r->xy[69] = neg[5]; r->xy[70] = neg[6]; r->xy[71] = neg[7]; // 7: rz[0] = 1; rz[1] = 0; rz[2] = 0; rz[3] = 0; rz[4] = 0; rz[5] = 0; rz[6] = 0; rz[7] = 0; point_add (rx, ry, rz, tx, ty); // 6 point_add (rx, ry, rz, tx, ty); // 7 // to affine: inv_mod (rz); mul_mod (neg, rz, rz); mul_mod (rx, rx, neg); mul_mod (rz, neg, rz); mul_mod (ry, ry, rz); r->xy[72] = rx[0]; r->xy[73] = rx[1]; r->xy[74] = rx[2]; r->xy[75] = rx[3]; r->xy[76] = rx[4]; r->xy[77] = rx[5]; r->xy[78] = rx[6]; r->xy[79] = rx[7]; r->xy[80] = ry[0]; r->xy[81] = ry[1]; r->xy[82] = ry[2]; r->xy[83] = ry[3]; r->xy[84] = ry[4]; r->xy[85] = ry[5]; r->xy[86] = ry[6]; r->xy[87] = ry[7]; // -7: neg[0] = ry[0]; neg[1] = ry[1]; neg[2] = ry[2]; neg[3] = ry[3]; neg[4] = ry[4]; neg[5] = ry[5]; neg[6] = ry[6]; neg[7] = ry[7]; sub_mod (neg, p, neg); r->xy[88] = neg[0]; r->xy[89] = neg[1]; r->xy[90] = neg[2]; r->xy[91] = neg[3]; r->xy[92] = neg[4]; r->xy[93] = neg[5]; r->xy[94] = neg[6]; r->xy[95] = neg[7]; } /* * Convert the tweak/scalar k to w-NAF (window size is 4). * @param naf out: w-NAF form of the tweak/scalar, a pointer to an u32 array with a size of 33. * @param k in: tweak/scalar which should be converted, a pointer to an u32 array with a size of 8. * @return Returns the loop start index. */ DECLSPEC int convert_to_window_naf (PRIVATE_AS u32 *naf, PRIVATE_AS const u32 *k) { int loop_start = 0; u32 n[9]; n[0] = 0; // we need this extra slot sometimes for the subtraction to work n[1] = k[7]; n[2] = k[6]; n[3] = k[5]; n[4] = k[4]; n[5] = k[3]; n[6] = k[2]; n[7] = k[1]; n[8] = k[0]; for (int i = 0; i <= 256; i++) { if (n[8] & 1) { // for window size w = 4: // => 2^(w-0) = 2^4 = 16 (0x10) // => 2^(w-1) = 2^3 = 8 (0x08) int diff = n[8] & 0x0f; // n % 2^w == n & (2^w - 1) // convert diff to val according to this table: // 1 -> +1 -> 1 // 3 -> +3 -> 3 // 5 -> +5 -> 5 // 7 -> +7 -> 7 // 9 -> -7 -> 8 // 11 -> -5 -> 6 // 13 -> -3 -> 4 // 15 -> -1 -> 2 int val = diff; if (diff >= 0x08) { diff -= 0x10; val = 0x11 - val; } naf[i >> 3] |= val << ((i & 7) << 2); u32 t = n[8]; // t is the (temporary) old/unmodified value n[8] -= diff; // we need to take care of the carry/borrow: u32 k = 8; if (diff > 0) { while (n[k] > t) // overflow propagation { if (k == 0) break; // needed ? k--; t = n[k]; n[k]--; } } else // if (diff < 0) { while (t > n[k]) // overflow propagation { if (k == 0) break; k--; t = n[k]; n[k]++; } } // update start: loop_start = i; } // n = n / 2: n[8] = n[8] >> 1 | n[7] << 31; n[7] = n[7] >> 1 | n[6] << 31; n[6] = n[6] >> 1 | n[5] << 31; n[5] = n[5] >> 1 | n[4] << 31; n[4] = n[4] >> 1 | n[3] << 31; n[3] = n[3] >> 1 | n[2] << 31; n[2] = n[2] >> 1 | n[1] << 31; n[1] = n[1] >> 1 | n[0] << 31; n[0] = n[0] >> 1; } return loop_start; } /* * @param x1 out: x coordinate, a pointer to an u32 array with a size of 8. * @param y1 out: y coordinate, a pointer to an u32 array with a size of 8. * @param k in: tweak/scalar which should be converted, a pointer to an u32 array with a size of 8. * @param tmps in: a basepoint for the multiplication. * @return Returns the x coordinate with a leading parity/sign (for odd/even y), it is named a compressed coordinate. */ DECLSPEC void point_mul_xy (PRIVATE_AS u32 *x1, PRIVATE_AS u32 *y1, PRIVATE_AS const u32 *k, SECP256K1_TMPS_TYPE const secp256k1_t *tmps) { u32 naf[SECP256K1_NAF_SIZE] = { 0 }; int loop_start = convert_to_window_naf (naf, k); // first set: const u32 multiplier = (naf[loop_start >> 3] >> ((loop_start & 7) << 2)) & 0x0f; // or use u8 ? const u32 odd = multiplier & 1; const u32 x_pos = ((multiplier - 1 + odd) >> 1) * 24; const u32 y_pos = odd ? (x_pos + 8) : (x_pos + 16); x1[0] = tmps->xy[x_pos + 0]; x1[1] = tmps->xy[x_pos + 1]; x1[2] = tmps->xy[x_pos + 2]; x1[3] = tmps->xy[x_pos + 3]; x1[4] = tmps->xy[x_pos + 4]; x1[5] = tmps->xy[x_pos + 5]; x1[6] = tmps->xy[x_pos + 6]; x1[7] = tmps->xy[x_pos + 7]; y1[0] = tmps->xy[y_pos + 0]; y1[1] = tmps->xy[y_pos + 1]; y1[2] = tmps->xy[y_pos + 2]; y1[3] = tmps->xy[y_pos + 3]; y1[4] = tmps->xy[y_pos + 4]; y1[5] = tmps->xy[y_pos + 5]; y1[6] = tmps->xy[y_pos + 6]; y1[7] = tmps->xy[y_pos + 7]; u32 z1[8] = { 0 }; z1[0] = 1; /* * Start: */ // main loop (left-to-right binary algorithm): for (int pos = loop_start - 1; pos >= 0; pos--) // -1 because we've set/add the point already { // always double: point_double (x1, y1, z1); // add only if needed: const u32 multiplier = (naf[pos >> 3] >> ((pos & 7) << 2)) & 0x0f; if (multiplier) { /* m -> y | y = ((m - (m & 1)) / 2) * 24 ---------------------------------- 1 -> 0 | 1/2 * 24 = 0 2 -> 16 3 -> 24 | 3/2 * 24 = 24 4 -> 40 5 -> 48 | 5/2 * 24 = 2*24 6 -> 64 7 -> 72 | 7/2 * 24 = 3*24 8 -> 88 */ const u32 odd = multiplier & 1; const u32 x_pos = ((multiplier - 1 + odd) >> 1) * 24; const u32 y_pos = odd ? (x_pos + 8) : (x_pos + 16); u32 x2[8]; x2[0] = tmps->xy[x_pos + 0]; x2[1] = tmps->xy[x_pos + 1]; x2[2] = tmps->xy[x_pos + 2]; x2[3] = tmps->xy[x_pos + 3]; x2[4] = tmps->xy[x_pos + 4]; x2[5] = tmps->xy[x_pos + 5]; x2[6] = tmps->xy[x_pos + 6]; x2[7] = tmps->xy[x_pos + 7]; u32 y2[8]; y2[0] = tmps->xy[y_pos + 0]; y2[1] = tmps->xy[y_pos + 1]; y2[2] = tmps->xy[y_pos + 2]; y2[3] = tmps->xy[y_pos + 3]; y2[4] = tmps->xy[y_pos + 4]; y2[5] = tmps->xy[y_pos + 5]; y2[6] = tmps->xy[y_pos + 6]; y2[7] = tmps->xy[y_pos + 7]; // (x1, y1, z1) + multiplier * (x, y, z) = (x1, y1, z1) + (x2, y2, z2) point_add (x1, y1, z1, x2, y2); // optimization (there can't be any adds after an add for w-1 times): // (but it seems to be faster without this manipulation of "pos") //for (u32 i = 0; i < 3; i++) //{ // if (pos == 0) break; // point_double (x1, y1, z1); // pos--; //} } } /* * Get the corresponding affine coordinates x/y: * * Note: * x1_affine = x1_jacobian / z1^2 = x1_jacobian * z1_inv^2 * y1_affine = y1_jacobian / z1^2 = y1_jacobian * z1_inv^2 * */ inv_mod (z1); u32 z2[8]; mul_mod (z2, z1, z1); // z1^2 mul_mod (x1, x1, z2); // x1_affine mul_mod (z1, z2, z1); // z1^3 mul_mod (y1, y1, z1); // y1_affine // return values are already in x1 and y1 } /* * @param r out: x coordinate with leading parity/sign (for odd/even y), a pointer to an u32 array with a size of 9. * @param k in: tweak/scalar which should be converted, a pointer to an u32 array with a size of 8. * @param tmps in: a basepoint for the multiplication. * @return Returns the x coordinate with a leading parity/sign (for odd/even y), it is named a compressed coordinate. */ DECLSPEC void point_mul (PRIVATE_AS u32 *r, PRIVATE_AS const u32 *k, SECP256K1_TMPS_TYPE const secp256k1_t *tmps) { u32 x[8]; u32 y[8]; point_mul_xy (x, y, k, tmps); /* * output: */ // shift by 1 byte (8 bits) to make room and add the parity/sign (for odd/even y): r[8] = (x[0] << 24); r[7] = (x[0] >> 8) | (x[1] << 24); r[6] = (x[1] >> 8) | (x[2] << 24); r[5] = (x[2] >> 8) | (x[3] << 24); r[4] = (x[3] >> 8) | (x[4] << 24); r[3] = (x[4] >> 8) | (x[5] << 24); r[2] = (x[5] >> 8) | (x[6] << 24); r[1] = (x[6] >> 8) | (x[7] << 24); r[0] = (x[7] >> 8); const u32 type = 0x02 | (y[0] & 1); // (note: 0b10 | 0b01 = 0x03) r[0] = r[0] | type << 24; // 0x02 or 0x03 } /* * Transform a x coordinate and separate parity to secp256k1_t. * @param r out: x and y coordinates. * @param x in: x coordinate which should be converted, a pointer to an u32 array with a size of 8. * @param first_byte in: The parity of the y coordinate, a u32. * @return Returns 0 if successful, returns 1 if x is greater than the basepoint. */ DECLSPEC u32 transform_public (PRIVATE_AS secp256k1_t *r, PRIVATE_AS const u32 *x, const u32 first_byte) { u32 p[8]; p[0] = SECP256K1_P0; p[1] = SECP256K1_P1; p[2] = SECP256K1_P2; p[3] = SECP256K1_P3; p[4] = SECP256K1_P4; p[5] = SECP256K1_P5; p[6] = SECP256K1_P6; p[7] = SECP256K1_P7; // x must be smaller than p (because of y ^ 2 = x ^ 3 % p) for (int i = 7; i >= 0; i--) { if (x[i] < p[i]) break; if (x[i] > p[i]) return 1; } // get y^2 = x^3 + 7: u32 b[8] = { 0 }; b[0] = SECP256K1_B; u32 y[8]; mul_mod (y, x, x); mul_mod (y, y, x); add_mod (y, y, b); // get y = sqrt (y^2): sqrt_mod (y); // check if it's of the correct parity that we want (odd/even): if ((first_byte & 1) != (y[0] & 1)) { // y2 = p - y1 (or y2 = y1 * -1) sub_mod (y, p, y); } // get xy: point_get_coords (r, x, y); return 0; } /* * Parse a x coordinate with leading parity to secp256k1_t. * @param r out: x and y coordinates. * @param k in: x coordinate which should be converted with leading parity, a pointer to an u32 array with a size of 9. * @return Returns 0 if successful, returns 1 if x is greater than the basepoint or the parity has an unexpected value. */ DECLSPEC u32 parse_public (PRIVATE_AS secp256k1_t *r, PRIVATE_AS const u32 *k) { // verify: const u32 first_byte = k[0] & 0xff; if ((first_byte != '\x02') && (first_byte != '\x03')) { return 1; } // load k into x without the first byte: u32 x[8]; x[0] = (k[7] & 0xff00) << 16 | (k[7] & 0xff0000) | (k[7] & 0xff000000) >> 16 | (k[8] & 0xff); x[1] = (k[6] & 0xff00) << 16 | (k[6] & 0xff0000) | (k[6] & 0xff000000) >> 16 | (k[7] & 0xff); x[2] = (k[5] & 0xff00) << 16 | (k[5] & 0xff0000) | (k[5] & 0xff000000) >> 16 | (k[6] & 0xff); x[3] = (k[4] & 0xff00) << 16 | (k[4] & 0xff0000) | (k[4] & 0xff000000) >> 16 | (k[5] & 0xff); x[4] = (k[3] & 0xff00) << 16 | (k[3] & 0xff0000) | (k[3] & 0xff000000) >> 16 | (k[4] & 0xff); x[5] = (k[2] & 0xff00) << 16 | (k[2] & 0xff0000) | (k[2] & 0xff000000) >> 16 | (k[3] & 0xff); x[6] = (k[1] & 0xff00) << 16 | (k[1] & 0xff0000) | (k[1] & 0xff000000) >> 16 | (k[2] & 0xff); x[7] = (k[0] & 0xff00) << 16 | (k[0] & 0xff0000) | (k[0] & 0xff000000) >> 16 | (k[1] & 0xff); return transform_public (r, x, first_byte); } /* * Set precomputed values of the basepoint g to a secp256k1 structure. * @param r out: x and y coordinates. pre-computed points: (x1,y1,-y1),(x3,y3,-y3),(x5,y5,-y5),(x7,y7,-y7) */ DECLSPEC void set_precomputed_basepoint_g (PRIVATE_AS secp256k1_t *r) { // x1 r->xy[ 0] = SECP256K1_G_PRE_COMPUTED_00; r->xy[ 1] = SECP256K1_G_PRE_COMPUTED_01; r->xy[ 2] = SECP256K1_G_PRE_COMPUTED_02; r->xy[ 3] = SECP256K1_G_PRE_COMPUTED_03; r->xy[ 4] = SECP256K1_G_PRE_COMPUTED_04; r->xy[ 5] = SECP256K1_G_PRE_COMPUTED_05; r->xy[ 6] = SECP256K1_G_PRE_COMPUTED_06; r->xy[ 7] = SECP256K1_G_PRE_COMPUTED_07; // y1 r->xy[ 8] = SECP256K1_G_PRE_COMPUTED_08; r->xy[ 9] = SECP256K1_G_PRE_COMPUTED_09; r->xy[10] = SECP256K1_G_PRE_COMPUTED_10; r->xy[11] = SECP256K1_G_PRE_COMPUTED_11; r->xy[12] = SECP256K1_G_PRE_COMPUTED_12; r->xy[13] = SECP256K1_G_PRE_COMPUTED_13; r->xy[14] = SECP256K1_G_PRE_COMPUTED_14; r->xy[15] = SECP256K1_G_PRE_COMPUTED_15; // -y1 r->xy[16] = SECP256K1_G_PRE_COMPUTED_16; r->xy[17] = SECP256K1_G_PRE_COMPUTED_17; r->xy[18] = SECP256K1_G_PRE_COMPUTED_18; r->xy[19] = SECP256K1_G_PRE_COMPUTED_19; r->xy[20] = SECP256K1_G_PRE_COMPUTED_20; r->xy[21] = SECP256K1_G_PRE_COMPUTED_21; r->xy[22] = SECP256K1_G_PRE_COMPUTED_22; r->xy[23] = SECP256K1_G_PRE_COMPUTED_23; // x3 r->xy[24] = SECP256K1_G_PRE_COMPUTED_24; r->xy[25] = SECP256K1_G_PRE_COMPUTED_25; r->xy[26] = SECP256K1_G_PRE_COMPUTED_26; r->xy[27] = SECP256K1_G_PRE_COMPUTED_27; r->xy[28] = SECP256K1_G_PRE_COMPUTED_28; r->xy[29] = SECP256K1_G_PRE_COMPUTED_29; r->xy[30] = SECP256K1_G_PRE_COMPUTED_30; r->xy[31] = SECP256K1_G_PRE_COMPUTED_31; // y3 r->xy[32] = SECP256K1_G_PRE_COMPUTED_32; r->xy[33] = SECP256K1_G_PRE_COMPUTED_33; r->xy[34] = SECP256K1_G_PRE_COMPUTED_34; r->xy[35] = SECP256K1_G_PRE_COMPUTED_35; r->xy[36] = SECP256K1_G_PRE_COMPUTED_36; r->xy[37] = SECP256K1_G_PRE_COMPUTED_37; r->xy[38] = SECP256K1_G_PRE_COMPUTED_38; r->xy[39] = SECP256K1_G_PRE_COMPUTED_39; // -y3 r->xy[40] = SECP256K1_G_PRE_COMPUTED_40; r->xy[41] = SECP256K1_G_PRE_COMPUTED_41; r->xy[42] = SECP256K1_G_PRE_COMPUTED_42; r->xy[43] = SECP256K1_G_PRE_COMPUTED_43; r->xy[44] = SECP256K1_G_PRE_COMPUTED_44; r->xy[45] = SECP256K1_G_PRE_COMPUTED_45; r->xy[46] = SECP256K1_G_PRE_COMPUTED_46; r->xy[47] = SECP256K1_G_PRE_COMPUTED_47; // x5 r->xy[48] = SECP256K1_G_PRE_COMPUTED_48; r->xy[49] = SECP256K1_G_PRE_COMPUTED_49; r->xy[50] = SECP256K1_G_PRE_COMPUTED_50; r->xy[51] = SECP256K1_G_PRE_COMPUTED_51; r->xy[52] = SECP256K1_G_PRE_COMPUTED_52; r->xy[53] = SECP256K1_G_PRE_COMPUTED_53; r->xy[54] = SECP256K1_G_PRE_COMPUTED_54; r->xy[55] = SECP256K1_G_PRE_COMPUTED_55; // y5 r->xy[56] = SECP256K1_G_PRE_COMPUTED_56; r->xy[57] = SECP256K1_G_PRE_COMPUTED_57; r->xy[58] = SECP256K1_G_PRE_COMPUTED_58; r->xy[59] = SECP256K1_G_PRE_COMPUTED_59; r->xy[60] = SECP256K1_G_PRE_COMPUTED_60; r->xy[61] = SECP256K1_G_PRE_COMPUTED_61; r->xy[62] = SECP256K1_G_PRE_COMPUTED_62; r->xy[63] = SECP256K1_G_PRE_COMPUTED_63; // -y5 r->xy[64] = SECP256K1_G_PRE_COMPUTED_64; r->xy[65] = SECP256K1_G_PRE_COMPUTED_65; r->xy[66] = SECP256K1_G_PRE_COMPUTED_66; r->xy[67] = SECP256K1_G_PRE_COMPUTED_67; r->xy[68] = SECP256K1_G_PRE_COMPUTED_68; r->xy[69] = SECP256K1_G_PRE_COMPUTED_69; r->xy[70] = SECP256K1_G_PRE_COMPUTED_70; r->xy[71] = SECP256K1_G_PRE_COMPUTED_71; // x7 r->xy[72] = SECP256K1_G_PRE_COMPUTED_72; r->xy[73] = SECP256K1_G_PRE_COMPUTED_73; r->xy[74] = SECP256K1_G_PRE_COMPUTED_74; r->xy[75] = SECP256K1_G_PRE_COMPUTED_75; r->xy[76] = SECP256K1_G_PRE_COMPUTED_76; r->xy[77] = SECP256K1_G_PRE_COMPUTED_77; r->xy[78] = SECP256K1_G_PRE_COMPUTED_78; r->xy[79] = SECP256K1_G_PRE_COMPUTED_79; // y7 r->xy[80] = SECP256K1_G_PRE_COMPUTED_80; r->xy[81] = SECP256K1_G_PRE_COMPUTED_81; r->xy[82] = SECP256K1_G_PRE_COMPUTED_82; r->xy[83] = SECP256K1_G_PRE_COMPUTED_83; r->xy[84] = SECP256K1_G_PRE_COMPUTED_84; r->xy[85] = SECP256K1_G_PRE_COMPUTED_85; r->xy[86] = SECP256K1_G_PRE_COMPUTED_86; r->xy[87] = SECP256K1_G_PRE_COMPUTED_87; // -y7 r->xy[88] = SECP256K1_G_PRE_COMPUTED_88; r->xy[89] = SECP256K1_G_PRE_COMPUTED_89; r->xy[90] = SECP256K1_G_PRE_COMPUTED_90; r->xy[91] = SECP256K1_G_PRE_COMPUTED_91; r->xy[92] = SECP256K1_G_PRE_COMPUTED_92; r->xy[93] = SECP256K1_G_PRE_COMPUTED_93; r->xy[94] = SECP256K1_G_PRE_COMPUTED_94; r->xy[95] = SECP256K1_G_PRE_COMPUTED_95; } ================================================ FILE: src/main/resources/copyfromhashcat/inc_ecc_secp256k1.h ================================================ /** * Author......: See docs/credits.txt * License.....: MIT */ #ifndef INC_ECC_SECP256K1_H #define INC_ECC_SECP256K1_H // y^2 = x^3 + ax + b with a = 0 and b = 7 => y^2 = x^3 + 7: #define SECP256K1_B 7 // finite field Fp // p = FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE FFFFFC2F #define SECP256K1_P0 0xfffffc2f #define SECP256K1_P1 0xfffffffe #define SECP256K1_P2 0xffffffff #define SECP256K1_P3 0xffffffff #define SECP256K1_P4 0xffffffff #define SECP256K1_P5 0xffffffff #define SECP256K1_P6 0xffffffff #define SECP256K1_P7 0xffffffff // prime order N // n = FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364141 #define SECP256K1_N0 0xd0364141 #define SECP256K1_N1 0xbfd25e8c #define SECP256K1_N2 0xaf48a03b #define SECP256K1_N3 0xbaaedce6 #define SECP256K1_N4 0xfffffffe #define SECP256K1_N5 0xffffffff #define SECP256K1_N6 0xffffffff #define SECP256K1_N7 0xffffffff // the base point G in compressed form for transform_public // G = 02 79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB 2DCE28D9 59F2815B 16F81798 #define SECP256K1_G_PARITY 0x00000002 #define SECP256K1_G0 0x16f81798 #define SECP256K1_G1 0x59f2815b #define SECP256K1_G2 0x2dce28d9 #define SECP256K1_G3 0x029bfcdb #define SECP256K1_G4 0xce870b07 #define SECP256K1_G5 0x55a06295 #define SECP256K1_G6 0xf9dcbbac #define SECP256K1_G7 0x79be667e // the base point G in compressed form for parse_public // parity and reversed byte/char (8 bit) byte order // G = 02 79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB 2DCE28D9 59F2815B 16F81798 #define SECP256K1_G_STRING0 0x66be7902 #define SECP256K1_G_STRING1 0xbbdcf97e #define SECP256K1_G_STRING2 0x62a055ac #define SECP256K1_G_STRING3 0x0b87ce95 #define SECP256K1_G_STRING4 0xfc9b0207 #define SECP256K1_G_STRING5 0x28ce2ddb #define SECP256K1_G_STRING6 0x81f259d9 #define SECP256K1_G_STRING7 0x17f8165b #define SECP256K1_G_STRING8 0x00000098 // pre computed values, can be verified using private keys for // x1 is the same as the basepoint g // x1 WIF: KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn // x3 WIF: KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU74sHUHy8S // x5 WIF: KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU75s2EPgZf // x7 WIF: KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU76rnZwVdz // x1: 79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB 2DCE28D9 59F2815B 16F81798 // x1: 79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798 #define SECP256K1_G_PRE_COMPUTED_00 0x16f81798 #define SECP256K1_G_PRE_COMPUTED_01 0x59f2815b #define SECP256K1_G_PRE_COMPUTED_02 0x2dce28d9 #define SECP256K1_G_PRE_COMPUTED_03 0x029bfcdb #define SECP256K1_G_PRE_COMPUTED_04 0xce870b07 #define SECP256K1_G_PRE_COMPUTED_05 0x55a06295 #define SECP256K1_G_PRE_COMPUTED_06 0xf9dcbbac #define SECP256K1_G_PRE_COMPUTED_07 0x79be667e // y1: 483ADA77 26A3C465 5DA4FBFC 0E1108A8 FD17B448 A6855419 9C47D08F FB10D4B8 // y1: 483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8 #define SECP256K1_G_PRE_COMPUTED_08 0xfb10d4b8 #define SECP256K1_G_PRE_COMPUTED_09 0x9c47d08f #define SECP256K1_G_PRE_COMPUTED_10 0xa6855419 #define SECP256K1_G_PRE_COMPUTED_11 0xfd17b448 #define SECP256K1_G_PRE_COMPUTED_12 0x0e1108a8 #define SECP256K1_G_PRE_COMPUTED_13 0x5da4fbfc #define SECP256K1_G_PRE_COMPUTED_14 0x26a3c465 #define SECP256K1_G_PRE_COMPUTED_15 0x483ada77 // -y1: B7C52588 D95C3B9A A25B0403 F1EEF757 02E84BB7 597AABE6 63B82F6F 04EF2777 // -y1: B7C52588D95C3B9AA25B0403F1EEF75702E84BB7597AABE663B82F6F04EF2777 #define SECP256K1_G_PRE_COMPUTED_16 0x04ef2777 #define SECP256K1_G_PRE_COMPUTED_17 0x63b82f6f #define SECP256K1_G_PRE_COMPUTED_18 0x597aabe6 #define SECP256K1_G_PRE_COMPUTED_19 0x02e84bb7 #define SECP256K1_G_PRE_COMPUTED_20 0xf1eef757 #define SECP256K1_G_PRE_COMPUTED_21 0xa25b0403 #define SECP256K1_G_PRE_COMPUTED_22 0xd95c3b9a #define SECP256K1_G_PRE_COMPUTED_23 0xb7c52588 // x3: F9308A01 9258C310 49344F85 F89D5229 B531C845 836F99B0 8601F113 BCE036F9 // x3: F9308A019258C31049344F85F89D5229B531C845836F99B08601F113BCE036F9 #define SECP256K1_G_PRE_COMPUTED_24 0xbce036f9 #define SECP256K1_G_PRE_COMPUTED_25 0x8601f113 #define SECP256K1_G_PRE_COMPUTED_26 0x836f99b0 #define SECP256K1_G_PRE_COMPUTED_27 0xb531c845 #define SECP256K1_G_PRE_COMPUTED_28 0xf89d5229 #define SECP256K1_G_PRE_COMPUTED_29 0x49344f85 #define SECP256K1_G_PRE_COMPUTED_30 0x9258c310 #define SECP256K1_G_PRE_COMPUTED_31 0xf9308a01 // y3: 388F7B0F 632DE814 0FE337E6 2A37F356 6500A999 34C2231B 6CB9FD75 84B8E672 // y3: 388F7B0F632DE8140FE337E62A37F3566500A99934C2231B6CB9FD7584B8E672 #define SECP256K1_G_PRE_COMPUTED_32 0x84b8e672 #define SECP256K1_G_PRE_COMPUTED_33 0x6cb9fd75 #define SECP256K1_G_PRE_COMPUTED_34 0x34c2231b #define SECP256K1_G_PRE_COMPUTED_35 0x6500a999 #define SECP256K1_G_PRE_COMPUTED_36 0x2a37f356 #define SECP256K1_G_PRE_COMPUTED_37 0x0fe337e6 #define SECP256K1_G_PRE_COMPUTED_38 0x632de814 #define SECP256K1_G_PRE_COMPUTED_39 0x388f7b0f // -y3: C77084F0 9CD217EB F01CC819 D5C80CA9 9AFF5666 CB3DDCE4 93460289 7B4715BD // -y3: C77084F09CD217EBF01CC819D5C80CA99AFF5666CB3DDCE4934602897B4715BD #define SECP256K1_G_PRE_COMPUTED_40 0x7b4715bd #define SECP256K1_G_PRE_COMPUTED_41 0x93460289 #define SECP256K1_G_PRE_COMPUTED_42 0xcb3ddce4 #define SECP256K1_G_PRE_COMPUTED_43 0x9aff5666 #define SECP256K1_G_PRE_COMPUTED_44 0xd5c80ca9 #define SECP256K1_G_PRE_COMPUTED_45 0xf01cc819 #define SECP256K1_G_PRE_COMPUTED_46 0x9cd217eb #define SECP256K1_G_PRE_COMPUTED_47 0xc77084f0 // x5: 2F8BDE4D 1A072093 55B4A725 0A5C5128 E88B84BD DC619AB7 CBA8D569 B240EFE4 // x5: 2F8BDE4D1A07209355B4A7250A5C5128E88B84BDDC619AB7CBA8D569B240EFE4 #define SECP256K1_G_PRE_COMPUTED_48 0xb240efe4 #define SECP256K1_G_PRE_COMPUTED_49 0xcba8d569 #define SECP256K1_G_PRE_COMPUTED_50 0xdc619ab7 #define SECP256K1_G_PRE_COMPUTED_51 0xe88b84bd #define SECP256K1_G_PRE_COMPUTED_52 0x0a5c5128 #define SECP256K1_G_PRE_COMPUTED_53 0x55b4a725 #define SECP256K1_G_PRE_COMPUTED_54 0x1a072093 #define SECP256K1_G_PRE_COMPUTED_55 0x2f8bde4d // y5: D8AC2226 36E5E3D6 D4DBA9DD A6C9C426 F788271B AB0D6840 DCA87D3A A6AC62D6 // y5: D8AC222636E5E3D6D4DBA9DDA6C9C426F788271BAB0D6840DCA87D3AA6AC62D6 #define SECP256K1_G_PRE_COMPUTED_56 0xa6ac62d6 #define SECP256K1_G_PRE_COMPUTED_57 0xdca87d3a #define SECP256K1_G_PRE_COMPUTED_58 0xab0d6840 #define SECP256K1_G_PRE_COMPUTED_59 0xf788271b #define SECP256K1_G_PRE_COMPUTED_60 0xa6c9c426 #define SECP256K1_G_PRE_COMPUTED_61 0xd4dba9dd #define SECP256K1_G_PRE_COMPUTED_62 0x36e5e3d6 #define SECP256K1_G_PRE_COMPUTED_63 0xd8ac2226 // -y5: 2753DDD9 C91A1C29 2B245622 59363BD9 0877D8E4 54F297BF 235782C4 59539959 // -y5: 2753DDD9C91A1C292B24562259363BD90877D8E454F297BF235782C459539959 #define SECP256K1_G_PRE_COMPUTED_64 0x59539959 #define SECP256K1_G_PRE_COMPUTED_65 0x235782c4 #define SECP256K1_G_PRE_COMPUTED_66 0x54f297bf #define SECP256K1_G_PRE_COMPUTED_67 0x0877d8e4 #define SECP256K1_G_PRE_COMPUTED_68 0x59363bd9 #define SECP256K1_G_PRE_COMPUTED_69 0x2b245622 #define SECP256K1_G_PRE_COMPUTED_70 0xc91a1c29 #define SECP256K1_G_PRE_COMPUTED_71 0x2753ddd9 // x7: 5CBDF064 6E5DB4EA A398F365 F2EA7A0E 3D419B7E 0330E39C E92BDDED CAC4F9BC // x7: 5CBDF0646E5DB4EAA398F365F2EA7A0E3D419B7E0330E39CE92BDDEDCAC4F9BC #define SECP256K1_G_PRE_COMPUTED_72 0xcac4f9bc #define SECP256K1_G_PRE_COMPUTED_73 0xe92bdded #define SECP256K1_G_PRE_COMPUTED_74 0x0330e39c #define SECP256K1_G_PRE_COMPUTED_75 0x3d419b7e #define SECP256K1_G_PRE_COMPUTED_76 0xf2ea7a0e #define SECP256K1_G_PRE_COMPUTED_77 0xa398f365 #define SECP256K1_G_PRE_COMPUTED_78 0x6e5db4ea #define SECP256K1_G_PRE_COMPUTED_79 0x5cbdf064 // y7: 6AEBCA40 BA255960 A3178D6D 861A54DB A813D0B8 13FDE7B5 A5082628 087264DA // y7: 6AEBCA40BA255960A3178D6D861A54DBA813D0B813FDE7B5A5082628087264DA #define SECP256K1_G_PRE_COMPUTED_80 0x087264da #define SECP256K1_G_PRE_COMPUTED_81 0xa5082628 #define SECP256K1_G_PRE_COMPUTED_82 0x13fde7b5 #define SECP256K1_G_PRE_COMPUTED_83 0xa813d0b8 #define SECP256K1_G_PRE_COMPUTED_84 0x861a54db #define SECP256K1_G_PRE_COMPUTED_85 0xa3178d6d #define SECP256K1_G_PRE_COMPUTED_86 0xba255960 #define SECP256K1_G_PRE_COMPUTED_87 0x6aebca40 // -y7: 951435BF 45DAA69F 5CE87292 79E5AB24 57EC2F47 EC02184A 5AF7D9D6 F78D9755 // -y7: 951435BF45DAA69F5CE8729279E5AB2457EC2F47EC02184A5AF7D9D6F78D9755 #define SECP256K1_G_PRE_COMPUTED_88 0xf78d9755 #define SECP256K1_G_PRE_COMPUTED_89 0x5af7d9d6 #define SECP256K1_G_PRE_COMPUTED_90 0xec02184a #define SECP256K1_G_PRE_COMPUTED_91 0x57ec2f47 #define SECP256K1_G_PRE_COMPUTED_92 0x79e5ab24 #define SECP256K1_G_PRE_COMPUTED_93 0x5ce87292 #define SECP256K1_G_PRE_COMPUTED_94 0x45daa69f #define SECP256K1_G_PRE_COMPUTED_95 0x951435bf #define SECP256K1_PRE_COMPUTED_XY_SIZE 96 #define SECP256K1_NAF_SIZE 33 // 32+1, we need one extra slot #define PUBLIC_KEY_LENGTH_WITHOUT_PARITY 8 #define PUBLIC_KEY_LENGTH_X_Y_WITHOUT_PARITY 16 // 8+1 to make room for the parity #define PUBLIC_KEY_LENGTH_WITH_PARITY 9 // (32*8 == 256) #define PRIVATE_KEY_LENGTH 8 // change the type of input/tmps in your kernel (e.g. PRIVATE_AS / CONSTANT_AS): #ifndef SECP256K1_TMPS_TYPE #define SECP256K1_TMPS_TYPE GLOBAL_AS #endif typedef struct secp256k1 { u32 xy[SECP256K1_PRE_COMPUTED_XY_SIZE]; // pre-computed points: (x1,y1,-y1),(x3,y3,-y3),(x5,y5,-y5),(x7,y7,-y7) } secp256k1_t; DECLSPEC u32 transform_public (PRIVATE_AS secp256k1_t *r, PRIVATE_AS const u32 *x, const u32 first_byte); DECLSPEC u32 parse_public (PRIVATE_AS secp256k1_t *r, PRIVATE_AS const u32 *k); DECLSPEC void point_mul_xy (PRIVATE_AS u32 *x1, PRIVATE_AS u32 *y1, PRIVATE_AS const u32 *k, SECP256K1_TMPS_TYPE const secp256k1_t *tmps); DECLSPEC void point_mul (PRIVATE_AS u32 *r, PRIVATE_AS const u32 *k, SECP256K1_TMPS_TYPE const secp256k1_t *tmps); DECLSPEC void set_precomputed_basepoint_g (PRIVATE_AS secp256k1_t *r); #endif // INC_ECC_SECP256K1_H ================================================ FILE: src/main/resources/copyfromhashcat/inc_hash_ripemd160.cl ================================================ /** * Author......: See docs/credits.txt * License.....: MIT */ #include "inc_vendor.h" #include "inc_types.h" #include "inc_platform.h" #include "inc_common.h" #include "inc_hash_ripemd160.h" // important notes on this: // input buf unused bytes needs to be set to zero // input buf needs to be in algorithm native byte order (ripemd160 = LE, sha1 = BE, etc) // input buf needs to be 64 byte aligned when using ripemd160_update() DECLSPEC void ripemd160_transform (PRIVATE_AS const u32 *w0, PRIVATE_AS const u32 *w1, PRIVATE_AS const u32 *w2, PRIVATE_AS const u32 *w3, PRIVATE_AS u32 *digest) { u32 a1 = digest[0]; u32 b1 = digest[1]; u32 c1 = digest[2]; u32 d1 = digest[3]; u32 e1 = digest[4]; RIPEMD160_STEP_S (RIPEMD160_F , a1, b1, c1, d1, e1, w0[0], RIPEMD160C00, RIPEMD160S00); RIPEMD160_STEP_S (RIPEMD160_F , e1, a1, b1, c1, d1, w0[1], RIPEMD160C00, RIPEMD160S01); RIPEMD160_STEP_S (RIPEMD160_F , d1, e1, a1, b1, c1, w0[2], RIPEMD160C00, RIPEMD160S02); RIPEMD160_STEP_S (RIPEMD160_F , c1, d1, e1, a1, b1, w0[3], RIPEMD160C00, RIPEMD160S03); RIPEMD160_STEP_S (RIPEMD160_F , b1, c1, d1, e1, a1, w1[0], RIPEMD160C00, RIPEMD160S04); RIPEMD160_STEP_S (RIPEMD160_F , a1, b1, c1, d1, e1, w1[1], RIPEMD160C00, RIPEMD160S05); RIPEMD160_STEP_S (RIPEMD160_F , e1, a1, b1, c1, d1, w1[2], RIPEMD160C00, RIPEMD160S06); RIPEMD160_STEP_S (RIPEMD160_F , d1, e1, a1, b1, c1, w1[3], RIPEMD160C00, RIPEMD160S07); RIPEMD160_STEP_S (RIPEMD160_F , c1, d1, e1, a1, b1, w2[0], RIPEMD160C00, RIPEMD160S08); RIPEMD160_STEP_S (RIPEMD160_F , b1, c1, d1, e1, a1, w2[1], RIPEMD160C00, RIPEMD160S09); RIPEMD160_STEP_S (RIPEMD160_F , a1, b1, c1, d1, e1, w2[2], RIPEMD160C00, RIPEMD160S0A); RIPEMD160_STEP_S (RIPEMD160_F , e1, a1, b1, c1, d1, w2[3], RIPEMD160C00, RIPEMD160S0B); RIPEMD160_STEP_S (RIPEMD160_F , d1, e1, a1, b1, c1, w3[0], RIPEMD160C00, RIPEMD160S0C); RIPEMD160_STEP_S (RIPEMD160_F , c1, d1, e1, a1, b1, w3[1], RIPEMD160C00, RIPEMD160S0D); RIPEMD160_STEP_S (RIPEMD160_F , b1, c1, d1, e1, a1, w3[2], RIPEMD160C00, RIPEMD160S0E); RIPEMD160_STEP_S (RIPEMD160_F , a1, b1, c1, d1, e1, w3[3], RIPEMD160C00, RIPEMD160S0F); RIPEMD160_STEP_S (RIPEMD160_Go, e1, a1, b1, c1, d1, w1[3], RIPEMD160C10, RIPEMD160S10); RIPEMD160_STEP_S (RIPEMD160_Go, d1, e1, a1, b1, c1, w1[0], RIPEMD160C10, RIPEMD160S11); RIPEMD160_STEP_S (RIPEMD160_Go, c1, d1, e1, a1, b1, w3[1], RIPEMD160C10, RIPEMD160S12); RIPEMD160_STEP_S (RIPEMD160_Go, b1, c1, d1, e1, a1, w0[1], RIPEMD160C10, RIPEMD160S13); RIPEMD160_STEP_S (RIPEMD160_Go, a1, b1, c1, d1, e1, w2[2], RIPEMD160C10, RIPEMD160S14); RIPEMD160_STEP_S (RIPEMD160_Go, e1, a1, b1, c1, d1, w1[2], RIPEMD160C10, RIPEMD160S15); RIPEMD160_STEP_S (RIPEMD160_Go, d1, e1, a1, b1, c1, w3[3], RIPEMD160C10, RIPEMD160S16); RIPEMD160_STEP_S (RIPEMD160_Go, c1, d1, e1, a1, b1, w0[3], RIPEMD160C10, RIPEMD160S17); RIPEMD160_STEP_S (RIPEMD160_Go, b1, c1, d1, e1, a1, w3[0], RIPEMD160C10, RIPEMD160S18); RIPEMD160_STEP_S (RIPEMD160_Go, a1, b1, c1, d1, e1, w0[0], RIPEMD160C10, RIPEMD160S19); RIPEMD160_STEP_S (RIPEMD160_Go, e1, a1, b1, c1, d1, w2[1], RIPEMD160C10, RIPEMD160S1A); RIPEMD160_STEP_S (RIPEMD160_Go, d1, e1, a1, b1, c1, w1[1], RIPEMD160C10, RIPEMD160S1B); RIPEMD160_STEP_S (RIPEMD160_Go, c1, d1, e1, a1, b1, w0[2], RIPEMD160C10, RIPEMD160S1C); RIPEMD160_STEP_S (RIPEMD160_Go, b1, c1, d1, e1, a1, w3[2], RIPEMD160C10, RIPEMD160S1D); RIPEMD160_STEP_S (RIPEMD160_Go, a1, b1, c1, d1, e1, w2[3], RIPEMD160C10, RIPEMD160S1E); RIPEMD160_STEP_S (RIPEMD160_Go, e1, a1, b1, c1, d1, w2[0], RIPEMD160C10, RIPEMD160S1F); RIPEMD160_STEP_S (RIPEMD160_H , d1, e1, a1, b1, c1, w0[3], RIPEMD160C20, RIPEMD160S20); RIPEMD160_STEP_S (RIPEMD160_H , c1, d1, e1, a1, b1, w2[2], RIPEMD160C20, RIPEMD160S21); RIPEMD160_STEP_S (RIPEMD160_H , b1, c1, d1, e1, a1, w3[2], RIPEMD160C20, RIPEMD160S22); RIPEMD160_STEP_S (RIPEMD160_H , a1, b1, c1, d1, e1, w1[0], RIPEMD160C20, RIPEMD160S23); RIPEMD160_STEP_S (RIPEMD160_H , e1, a1, b1, c1, d1, w2[1], RIPEMD160C20, RIPEMD160S24); RIPEMD160_STEP_S (RIPEMD160_H , d1, e1, a1, b1, c1, w3[3], RIPEMD160C20, RIPEMD160S25); RIPEMD160_STEP_S (RIPEMD160_H , c1, d1, e1, a1, b1, w2[0], RIPEMD160C20, RIPEMD160S26); RIPEMD160_STEP_S (RIPEMD160_H , b1, c1, d1, e1, a1, w0[1], RIPEMD160C20, RIPEMD160S27); RIPEMD160_STEP_S (RIPEMD160_H , a1, b1, c1, d1, e1, w0[2], RIPEMD160C20, RIPEMD160S28); RIPEMD160_STEP_S (RIPEMD160_H , e1, a1, b1, c1, d1, w1[3], RIPEMD160C20, RIPEMD160S29); RIPEMD160_STEP_S (RIPEMD160_H , d1, e1, a1, b1, c1, w0[0], RIPEMD160C20, RIPEMD160S2A); RIPEMD160_STEP_S (RIPEMD160_H , c1, d1, e1, a1, b1, w1[2], RIPEMD160C20, RIPEMD160S2B); RIPEMD160_STEP_S (RIPEMD160_H , b1, c1, d1, e1, a1, w3[1], RIPEMD160C20, RIPEMD160S2C); RIPEMD160_STEP_S (RIPEMD160_H , a1, b1, c1, d1, e1, w2[3], RIPEMD160C20, RIPEMD160S2D); RIPEMD160_STEP_S (RIPEMD160_H , e1, a1, b1, c1, d1, w1[1], RIPEMD160C20, RIPEMD160S2E); RIPEMD160_STEP_S (RIPEMD160_H , d1, e1, a1, b1, c1, w3[0], RIPEMD160C20, RIPEMD160S2F); RIPEMD160_STEP_S (RIPEMD160_Io, c1, d1, e1, a1, b1, w0[1], RIPEMD160C30, RIPEMD160S30); RIPEMD160_STEP_S (RIPEMD160_Io, b1, c1, d1, e1, a1, w2[1], RIPEMD160C30, RIPEMD160S31); RIPEMD160_STEP_S (RIPEMD160_Io, a1, b1, c1, d1, e1, w2[3], RIPEMD160C30, RIPEMD160S32); RIPEMD160_STEP_S (RIPEMD160_Io, e1, a1, b1, c1, d1, w2[2], RIPEMD160C30, RIPEMD160S33); RIPEMD160_STEP_S (RIPEMD160_Io, d1, e1, a1, b1, c1, w0[0], RIPEMD160C30, RIPEMD160S34); RIPEMD160_STEP_S (RIPEMD160_Io, c1, d1, e1, a1, b1, w2[0], RIPEMD160C30, RIPEMD160S35); RIPEMD160_STEP_S (RIPEMD160_Io, b1, c1, d1, e1, a1, w3[0], RIPEMD160C30, RIPEMD160S36); RIPEMD160_STEP_S (RIPEMD160_Io, a1, b1, c1, d1, e1, w1[0], RIPEMD160C30, RIPEMD160S37); RIPEMD160_STEP_S (RIPEMD160_Io, e1, a1, b1, c1, d1, w3[1], RIPEMD160C30, RIPEMD160S38); RIPEMD160_STEP_S (RIPEMD160_Io, d1, e1, a1, b1, c1, w0[3], RIPEMD160C30, RIPEMD160S39); RIPEMD160_STEP_S (RIPEMD160_Io, c1, d1, e1, a1, b1, w1[3], RIPEMD160C30, RIPEMD160S3A); RIPEMD160_STEP_S (RIPEMD160_Io, b1, c1, d1, e1, a1, w3[3], RIPEMD160C30, RIPEMD160S3B); RIPEMD160_STEP_S (RIPEMD160_Io, a1, b1, c1, d1, e1, w3[2], RIPEMD160C30, RIPEMD160S3C); RIPEMD160_STEP_S (RIPEMD160_Io, e1, a1, b1, c1, d1, w1[1], RIPEMD160C30, RIPEMD160S3D); RIPEMD160_STEP_S (RIPEMD160_Io, d1, e1, a1, b1, c1, w1[2], RIPEMD160C30, RIPEMD160S3E); RIPEMD160_STEP_S (RIPEMD160_Io, c1, d1, e1, a1, b1, w0[2], RIPEMD160C30, RIPEMD160S3F); RIPEMD160_STEP_S (RIPEMD160_J , b1, c1, d1, e1, a1, w1[0], RIPEMD160C40, RIPEMD160S40); RIPEMD160_STEP_S (RIPEMD160_J , a1, b1, c1, d1, e1, w0[0], RIPEMD160C40, RIPEMD160S41); RIPEMD160_STEP_S (RIPEMD160_J , e1, a1, b1, c1, d1, w1[1], RIPEMD160C40, RIPEMD160S42); RIPEMD160_STEP_S (RIPEMD160_J , d1, e1, a1, b1, c1, w2[1], RIPEMD160C40, RIPEMD160S43); RIPEMD160_STEP_S (RIPEMD160_J , c1, d1, e1, a1, b1, w1[3], RIPEMD160C40, RIPEMD160S44); RIPEMD160_STEP_S (RIPEMD160_J , b1, c1, d1, e1, a1, w3[0], RIPEMD160C40, RIPEMD160S45); RIPEMD160_STEP_S (RIPEMD160_J , a1, b1, c1, d1, e1, w0[2], RIPEMD160C40, RIPEMD160S46); RIPEMD160_STEP_S (RIPEMD160_J , e1, a1, b1, c1, d1, w2[2], RIPEMD160C40, RIPEMD160S47); RIPEMD160_STEP_S (RIPEMD160_J , d1, e1, a1, b1, c1, w3[2], RIPEMD160C40, RIPEMD160S48); RIPEMD160_STEP_S (RIPEMD160_J , c1, d1, e1, a1, b1, w0[1], RIPEMD160C40, RIPEMD160S49); RIPEMD160_STEP_S (RIPEMD160_J , b1, c1, d1, e1, a1, w0[3], RIPEMD160C40, RIPEMD160S4A); RIPEMD160_STEP_S (RIPEMD160_J , a1, b1, c1, d1, e1, w2[0], RIPEMD160C40, RIPEMD160S4B); RIPEMD160_STEP_S (RIPEMD160_J , e1, a1, b1, c1, d1, w2[3], RIPEMD160C40, RIPEMD160S4C); RIPEMD160_STEP_S (RIPEMD160_J , d1, e1, a1, b1, c1, w1[2], RIPEMD160C40, RIPEMD160S4D); RIPEMD160_STEP_S (RIPEMD160_J , c1, d1, e1, a1, b1, w3[3], RIPEMD160C40, RIPEMD160S4E); RIPEMD160_STEP_S (RIPEMD160_J , b1, c1, d1, e1, a1, w3[1], RIPEMD160C40, RIPEMD160S4F); u32 a2 = digest[0]; u32 b2 = digest[1]; u32 c2 = digest[2]; u32 d2 = digest[3]; u32 e2 = digest[4]; RIPEMD160_STEP_S_WORKAROUND_BUG (RIPEMD160_J , a2, b2, c2, d2, e2, w1[1], RIPEMD160C50, RIPEMD160S50); RIPEMD160_STEP_S (RIPEMD160_J , e2, a2, b2, c2, d2, w3[2], RIPEMD160C50, RIPEMD160S51); RIPEMD160_STEP_S (RIPEMD160_J , d2, e2, a2, b2, c2, w1[3], RIPEMD160C50, RIPEMD160S52); RIPEMD160_STEP_S (RIPEMD160_J , c2, d2, e2, a2, b2, w0[0], RIPEMD160C50, RIPEMD160S53); RIPEMD160_STEP_S (RIPEMD160_J , b2, c2, d2, e2, a2, w2[1], RIPEMD160C50, RIPEMD160S54); RIPEMD160_STEP_S (RIPEMD160_J , a2, b2, c2, d2, e2, w0[2], RIPEMD160C50, RIPEMD160S55); RIPEMD160_STEP_S (RIPEMD160_J , e2, a2, b2, c2, d2, w2[3], RIPEMD160C50, RIPEMD160S56); RIPEMD160_STEP_S (RIPEMD160_J , d2, e2, a2, b2, c2, w1[0], RIPEMD160C50, RIPEMD160S57); RIPEMD160_STEP_S (RIPEMD160_J , c2, d2, e2, a2, b2, w3[1], RIPEMD160C50, RIPEMD160S58); RIPEMD160_STEP_S (RIPEMD160_J , b2, c2, d2, e2, a2, w1[2], RIPEMD160C50, RIPEMD160S59); RIPEMD160_STEP_S (RIPEMD160_J , a2, b2, c2, d2, e2, w3[3], RIPEMD160C50, RIPEMD160S5A); RIPEMD160_STEP_S (RIPEMD160_J , e2, a2, b2, c2, d2, w2[0], RIPEMD160C50, RIPEMD160S5B); RIPEMD160_STEP_S (RIPEMD160_J , d2, e2, a2, b2, c2, w0[1], RIPEMD160C50, RIPEMD160S5C); RIPEMD160_STEP_S (RIPEMD160_J , c2, d2, e2, a2, b2, w2[2], RIPEMD160C50, RIPEMD160S5D); RIPEMD160_STEP_S (RIPEMD160_J , b2, c2, d2, e2, a2, w0[3], RIPEMD160C50, RIPEMD160S5E); RIPEMD160_STEP_S (RIPEMD160_J , a2, b2, c2, d2, e2, w3[0], RIPEMD160C50, RIPEMD160S5F); RIPEMD160_STEP_S (RIPEMD160_Io, e2, a2, b2, c2, d2, w1[2], RIPEMD160C60, RIPEMD160S60); RIPEMD160_STEP_S (RIPEMD160_Io, d2, e2, a2, b2, c2, w2[3], RIPEMD160C60, RIPEMD160S61); RIPEMD160_STEP_S (RIPEMD160_Io, c2, d2, e2, a2, b2, w0[3], RIPEMD160C60, RIPEMD160S62); RIPEMD160_STEP_S (RIPEMD160_Io, b2, c2, d2, e2, a2, w1[3], RIPEMD160C60, RIPEMD160S63); RIPEMD160_STEP_S (RIPEMD160_Io, a2, b2, c2, d2, e2, w0[0], RIPEMD160C60, RIPEMD160S64); RIPEMD160_STEP_S (RIPEMD160_Io, e2, a2, b2, c2, d2, w3[1], RIPEMD160C60, RIPEMD160S65); RIPEMD160_STEP_S (RIPEMD160_Io, d2, e2, a2, b2, c2, w1[1], RIPEMD160C60, RIPEMD160S66); RIPEMD160_STEP_S (RIPEMD160_Io, c2, d2, e2, a2, b2, w2[2], RIPEMD160C60, RIPEMD160S67); RIPEMD160_STEP_S (RIPEMD160_Io, b2, c2, d2, e2, a2, w3[2], RIPEMD160C60, RIPEMD160S68); RIPEMD160_STEP_S (RIPEMD160_Io, a2, b2, c2, d2, e2, w3[3], RIPEMD160C60, RIPEMD160S69); RIPEMD160_STEP_S (RIPEMD160_Io, e2, a2, b2, c2, d2, w2[0], RIPEMD160C60, RIPEMD160S6A); RIPEMD160_STEP_S (RIPEMD160_Io, d2, e2, a2, b2, c2, w3[0], RIPEMD160C60, RIPEMD160S6B); RIPEMD160_STEP_S (RIPEMD160_Io, c2, d2, e2, a2, b2, w1[0], RIPEMD160C60, RIPEMD160S6C); RIPEMD160_STEP_S (RIPEMD160_Io, b2, c2, d2, e2, a2, w2[1], RIPEMD160C60, RIPEMD160S6D); RIPEMD160_STEP_S (RIPEMD160_Io, a2, b2, c2, d2, e2, w0[1], RIPEMD160C60, RIPEMD160S6E); RIPEMD160_STEP_S (RIPEMD160_Io, e2, a2, b2, c2, d2, w0[2], RIPEMD160C60, RIPEMD160S6F); RIPEMD160_STEP_S (RIPEMD160_H , d2, e2, a2, b2, c2, w3[3], RIPEMD160C70, RIPEMD160S70); RIPEMD160_STEP_S (RIPEMD160_H , c2, d2, e2, a2, b2, w1[1], RIPEMD160C70, RIPEMD160S71); RIPEMD160_STEP_S (RIPEMD160_H , b2, c2, d2, e2, a2, w0[1], RIPEMD160C70, RIPEMD160S72); RIPEMD160_STEP_S (RIPEMD160_H , a2, b2, c2, d2, e2, w0[3], RIPEMD160C70, RIPEMD160S73); RIPEMD160_STEP_S (RIPEMD160_H , e2, a2, b2, c2, d2, w1[3], RIPEMD160C70, RIPEMD160S74); RIPEMD160_STEP_S (RIPEMD160_H , d2, e2, a2, b2, c2, w3[2], RIPEMD160C70, RIPEMD160S75); RIPEMD160_STEP_S (RIPEMD160_H , c2, d2, e2, a2, b2, w1[2], RIPEMD160C70, RIPEMD160S76); RIPEMD160_STEP_S (RIPEMD160_H , b2, c2, d2, e2, a2, w2[1], RIPEMD160C70, RIPEMD160S77); RIPEMD160_STEP_S (RIPEMD160_H , a2, b2, c2, d2, e2, w2[3], RIPEMD160C70, RIPEMD160S78); RIPEMD160_STEP_S (RIPEMD160_H , e2, a2, b2, c2, d2, w2[0], RIPEMD160C70, RIPEMD160S79); RIPEMD160_STEP_S (RIPEMD160_H , d2, e2, a2, b2, c2, w3[0], RIPEMD160C70, RIPEMD160S7A); RIPEMD160_STEP_S (RIPEMD160_H , c2, d2, e2, a2, b2, w0[2], RIPEMD160C70, RIPEMD160S7B); RIPEMD160_STEP_S (RIPEMD160_H , b2, c2, d2, e2, a2, w2[2], RIPEMD160C70, RIPEMD160S7C); RIPEMD160_STEP_S (RIPEMD160_H , a2, b2, c2, d2, e2, w0[0], RIPEMD160C70, RIPEMD160S7D); RIPEMD160_STEP_S (RIPEMD160_H , e2, a2, b2, c2, d2, w1[0], RIPEMD160C70, RIPEMD160S7E); RIPEMD160_STEP_S (RIPEMD160_H , d2, e2, a2, b2, c2, w3[1], RIPEMD160C70, RIPEMD160S7F); RIPEMD160_STEP_S (RIPEMD160_Go, c2, d2, e2, a2, b2, w2[0], RIPEMD160C80, RIPEMD160S80); RIPEMD160_STEP_S (RIPEMD160_Go, b2, c2, d2, e2, a2, w1[2], RIPEMD160C80, RIPEMD160S81); RIPEMD160_STEP_S (RIPEMD160_Go, a2, b2, c2, d2, e2, w1[0], RIPEMD160C80, RIPEMD160S82); RIPEMD160_STEP_S (RIPEMD160_Go, e2, a2, b2, c2, d2, w0[1], RIPEMD160C80, RIPEMD160S83); RIPEMD160_STEP_S (RIPEMD160_Go, d2, e2, a2, b2, c2, w0[3], RIPEMD160C80, RIPEMD160S84); RIPEMD160_STEP_S (RIPEMD160_Go, c2, d2, e2, a2, b2, w2[3], RIPEMD160C80, RIPEMD160S85); RIPEMD160_STEP_S (RIPEMD160_Go, b2, c2, d2, e2, a2, w3[3], RIPEMD160C80, RIPEMD160S86); RIPEMD160_STEP_S (RIPEMD160_Go, a2, b2, c2, d2, e2, w0[0], RIPEMD160C80, RIPEMD160S87); RIPEMD160_STEP_S (RIPEMD160_Go, e2, a2, b2, c2, d2, w1[1], RIPEMD160C80, RIPEMD160S88); RIPEMD160_STEP_S (RIPEMD160_Go, d2, e2, a2, b2, c2, w3[0], RIPEMD160C80, RIPEMD160S89); RIPEMD160_STEP_S (RIPEMD160_Go, c2, d2, e2, a2, b2, w0[2], RIPEMD160C80, RIPEMD160S8A); RIPEMD160_STEP_S (RIPEMD160_Go, b2, c2, d2, e2, a2, w3[1], RIPEMD160C80, RIPEMD160S8B); RIPEMD160_STEP_S (RIPEMD160_Go, a2, b2, c2, d2, e2, w2[1], RIPEMD160C80, RIPEMD160S8C); RIPEMD160_STEP_S (RIPEMD160_Go, e2, a2, b2, c2, d2, w1[3], RIPEMD160C80, RIPEMD160S8D); RIPEMD160_STEP_S (RIPEMD160_Go, d2, e2, a2, b2, c2, w2[2], RIPEMD160C80, RIPEMD160S8E); RIPEMD160_STEP_S (RIPEMD160_Go, c2, d2, e2, a2, b2, w3[2], RIPEMD160C80, RIPEMD160S8F); RIPEMD160_STEP_S (RIPEMD160_F , b2, c2, d2, e2, a2, w3[0], RIPEMD160C90, RIPEMD160S90); RIPEMD160_STEP_S (RIPEMD160_F , a2, b2, c2, d2, e2, w3[3], RIPEMD160C90, RIPEMD160S91); RIPEMD160_STEP_S (RIPEMD160_F , e2, a2, b2, c2, d2, w2[2], RIPEMD160C90, RIPEMD160S92); RIPEMD160_STEP_S (RIPEMD160_F , d2, e2, a2, b2, c2, w1[0], RIPEMD160C90, RIPEMD160S93); RIPEMD160_STEP_S (RIPEMD160_F , c2, d2, e2, a2, b2, w0[1], RIPEMD160C90, RIPEMD160S94); RIPEMD160_STEP_S (RIPEMD160_F , b2, c2, d2, e2, a2, w1[1], RIPEMD160C90, RIPEMD160S95); RIPEMD160_STEP_S (RIPEMD160_F , a2, b2, c2, d2, e2, w2[0], RIPEMD160C90, RIPEMD160S96); RIPEMD160_STEP_S (RIPEMD160_F , e2, a2, b2, c2, d2, w1[3], RIPEMD160C90, RIPEMD160S97); RIPEMD160_STEP_S (RIPEMD160_F , d2, e2, a2, b2, c2, w1[2], RIPEMD160C90, RIPEMD160S98); RIPEMD160_STEP_S (RIPEMD160_F , c2, d2, e2, a2, b2, w0[2], RIPEMD160C90, RIPEMD160S99); RIPEMD160_STEP_S (RIPEMD160_F , b2, c2, d2, e2, a2, w3[1], RIPEMD160C90, RIPEMD160S9A); RIPEMD160_STEP_S (RIPEMD160_F , a2, b2, c2, d2, e2, w3[2], RIPEMD160C90, RIPEMD160S9B); RIPEMD160_STEP_S (RIPEMD160_F , e2, a2, b2, c2, d2, w0[0], RIPEMD160C90, RIPEMD160S9C); RIPEMD160_STEP_S (RIPEMD160_F , d2, e2, a2, b2, c2, w0[3], RIPEMD160C90, RIPEMD160S9D); RIPEMD160_STEP_S (RIPEMD160_F , c2, d2, e2, a2, b2, w2[1], RIPEMD160C90, RIPEMD160S9E); RIPEMD160_STEP_S (RIPEMD160_F , b2, c2, d2, e2, a2, w2[3], RIPEMD160C90, RIPEMD160S9F); const u32 a = digest[1] + c1 + d2; const u32 b = digest[2] + d1 + e2; const u32 c = digest[3] + e1 + a2; const u32 d = digest[4] + a1 + b2; const u32 e = digest[0] + b1 + c2; digest[0] = a; digest[1] = b; digest[2] = c; digest[3] = d; digest[4] = e; } DECLSPEC void ripemd160_init (PRIVATE_AS ripemd160_ctx_t *ctx) { ctx->h[0] = RIPEMD160M_A; ctx->h[1] = RIPEMD160M_B; ctx->h[2] = RIPEMD160M_C; ctx->h[3] = RIPEMD160M_D; ctx->h[4] = RIPEMD160M_E; ctx->w0[0] = 0; ctx->w0[1] = 0; ctx->w0[2] = 0; ctx->w0[3] = 0; ctx->w1[0] = 0; ctx->w1[1] = 0; ctx->w1[2] = 0; ctx->w1[3] = 0; ctx->w2[0] = 0; ctx->w2[1] = 0; ctx->w2[2] = 0; ctx->w2[3] = 0; ctx->w3[0] = 0; ctx->w3[1] = 0; ctx->w3[2] = 0; ctx->w3[3] = 0; ctx->len = 0; } DECLSPEC void ripemd160_update_64 (PRIVATE_AS ripemd160_ctx_t *ctx, PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const int len) { if (len == 0) return; const int pos = ctx->len & 63; ctx->len += len; if (pos == 0) { ctx->w0[0] = w0[0]; ctx->w0[1] = w0[1]; ctx->w0[2] = w0[2]; ctx->w0[3] = w0[3]; ctx->w1[0] = w1[0]; ctx->w1[1] = w1[1]; ctx->w1[2] = w1[2]; ctx->w1[3] = w1[3]; ctx->w2[0] = w2[0]; ctx->w2[1] = w2[1]; ctx->w2[2] = w2[2]; ctx->w2[3] = w2[3]; ctx->w3[0] = w3[0]; ctx->w3[1] = w3[1]; ctx->w3[2] = w3[2]; ctx->w3[3] = w3[3]; if (len == 64) { ripemd160_transform (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); ctx->w0[0] = 0; ctx->w0[1] = 0; ctx->w0[2] = 0; ctx->w0[3] = 0; ctx->w1[0] = 0; ctx->w1[1] = 0; ctx->w1[2] = 0; ctx->w1[3] = 0; ctx->w2[0] = 0; ctx->w2[1] = 0; ctx->w2[2] = 0; ctx->w2[3] = 0; ctx->w3[0] = 0; ctx->w3[1] = 0; ctx->w3[2] = 0; ctx->w3[3] = 0; } } else { if ((pos + len) < 64) { switch_buffer_by_offset_le_S (w0, w1, w2, w3, pos); ctx->w0[0] |= w0[0]; ctx->w0[1] |= w0[1]; ctx->w0[2] |= w0[2]; ctx->w0[3] |= w0[3]; ctx->w1[0] |= w1[0]; ctx->w1[1] |= w1[1]; ctx->w1[2] |= w1[2]; ctx->w1[3] |= w1[3]; ctx->w2[0] |= w2[0]; ctx->w2[1] |= w2[1]; ctx->w2[2] |= w2[2]; ctx->w2[3] |= w2[3]; ctx->w3[0] |= w3[0]; ctx->w3[1] |= w3[1]; ctx->w3[2] |= w3[2]; ctx->w3[3] |= w3[3]; } else { u32 c0[4] = { 0 }; u32 c1[4] = { 0 }; u32 c2[4] = { 0 }; u32 c3[4] = { 0 }; switch_buffer_by_offset_carry_le_S (w0, w1, w2, w3, c0, c1, c2, c3, pos); ctx->w0[0] |= w0[0]; ctx->w0[1] |= w0[1]; ctx->w0[2] |= w0[2]; ctx->w0[3] |= w0[3]; ctx->w1[0] |= w1[0]; ctx->w1[1] |= w1[1]; ctx->w1[2] |= w1[2]; ctx->w1[3] |= w1[3]; ctx->w2[0] |= w2[0]; ctx->w2[1] |= w2[1]; ctx->w2[2] |= w2[2]; ctx->w2[3] |= w2[3]; ctx->w3[0] |= w3[0]; ctx->w3[1] |= w3[1]; ctx->w3[2] |= w3[2]; ctx->w3[3] |= w3[3]; ripemd160_transform (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); ctx->w0[0] = c0[0]; ctx->w0[1] = c0[1]; ctx->w0[2] = c0[2]; ctx->w0[3] = c0[3]; ctx->w1[0] = c1[0]; ctx->w1[1] = c1[1]; ctx->w1[2] = c1[2]; ctx->w1[3] = c1[3]; ctx->w2[0] = c2[0]; ctx->w2[1] = c2[1]; ctx->w2[2] = c2[2]; ctx->w2[3] = c2[3]; ctx->w3[0] = c3[0]; ctx->w3[1] = c3[1]; ctx->w3[2] = c3[2]; ctx->w3[3] = c3[3]; } } } DECLSPEC void ripemd160_update (PRIVATE_AS ripemd160_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 64; pos1 += 64, pos4 += 16) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; ripemd160_update_64 (ctx, w0, w1, w2, w3, 64); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; ripemd160_update_64 (ctx, w0, w1, w2, w3, len - pos1); } DECLSPEC void ripemd160_update_swap (PRIVATE_AS ripemd160_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 64; pos1 += 64, pos4 += 16) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; w0[0] = hc_swap32_S (w0[0]); w0[1] = hc_swap32_S (w0[1]); w0[2] = hc_swap32_S (w0[2]); w0[3] = hc_swap32_S (w0[3]); w1[0] = hc_swap32_S (w1[0]); w1[1] = hc_swap32_S (w1[1]); w1[2] = hc_swap32_S (w1[2]); w1[3] = hc_swap32_S (w1[3]); w2[0] = hc_swap32_S (w2[0]); w2[1] = hc_swap32_S (w2[1]); w2[2] = hc_swap32_S (w2[2]); w2[3] = hc_swap32_S (w2[3]); w3[0] = hc_swap32_S (w3[0]); w3[1] = hc_swap32_S (w3[1]); w3[2] = hc_swap32_S (w3[2]); w3[3] = hc_swap32_S (w3[3]); ripemd160_update_64 (ctx, w0, w1, w2, w3, 64); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; w0[0] = hc_swap32_S (w0[0]); w0[1] = hc_swap32_S (w0[1]); w0[2] = hc_swap32_S (w0[2]); w0[3] = hc_swap32_S (w0[3]); w1[0] = hc_swap32_S (w1[0]); w1[1] = hc_swap32_S (w1[1]); w1[2] = hc_swap32_S (w1[2]); w1[3] = hc_swap32_S (w1[3]); w2[0] = hc_swap32_S (w2[0]); w2[1] = hc_swap32_S (w2[1]); w2[2] = hc_swap32_S (w2[2]); w2[3] = hc_swap32_S (w2[3]); w3[0] = hc_swap32_S (w3[0]); w3[1] = hc_swap32_S (w3[1]); w3[2] = hc_swap32_S (w3[2]); w3[3] = hc_swap32_S (w3[3]); ripemd160_update_64 (ctx, w0, w1, w2, w3, len - pos1); } DECLSPEC void ripemd160_update_utf16le (PRIVATE_AS ripemd160_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { if (hc_enc_scan (w, len)) { hc_enc_t hc_enc; hc_enc_init (&hc_enc); while (hc_enc_has_next (&hc_enc, len)) { u32 enc_buf[16] = { 0 }; const int enc_len = hc_enc_next (&hc_enc, w, len, 256, enc_buf, sizeof (enc_buf)); if (enc_len == -1) { ctx->len = -1; return; } ripemd160_update_64 (ctx, enc_buf + 0, enc_buf + 4, enc_buf + 8, enc_buf + 12, enc_len); } return; } u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 32; pos1 += 32, pos4 += 8) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le_S (w1, w2, w3); make_utf16le_S (w0, w0, w1); ripemd160_update_64 (ctx, w0, w1, w2, w3, 32 * 2); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le_S (w1, w2, w3); make_utf16le_S (w0, w0, w1); ripemd160_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } DECLSPEC void ripemd160_update_utf16le_swap (PRIVATE_AS ripemd160_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { if (hc_enc_scan (w, len)) { hc_enc_t hc_enc; hc_enc_init (&hc_enc); while (hc_enc_has_next (&hc_enc, len)) { u32 enc_buf[16] = { 0 }; const int enc_len = hc_enc_next (&hc_enc, w, len, 256, enc_buf, sizeof (enc_buf)); if (enc_len == -1) { ctx->len = -1; return; } enc_buf[ 0] = hc_swap32_S (enc_buf[ 0]); enc_buf[ 1] = hc_swap32_S (enc_buf[ 1]); enc_buf[ 2] = hc_swap32_S (enc_buf[ 2]); enc_buf[ 3] = hc_swap32_S (enc_buf[ 3]); enc_buf[ 4] = hc_swap32_S (enc_buf[ 4]); enc_buf[ 5] = hc_swap32_S (enc_buf[ 5]); enc_buf[ 6] = hc_swap32_S (enc_buf[ 6]); enc_buf[ 7] = hc_swap32_S (enc_buf[ 7]); enc_buf[ 8] = hc_swap32_S (enc_buf[ 8]); enc_buf[ 9] = hc_swap32_S (enc_buf[ 9]); enc_buf[10] = hc_swap32_S (enc_buf[10]); enc_buf[11] = hc_swap32_S (enc_buf[11]); enc_buf[12] = hc_swap32_S (enc_buf[12]); enc_buf[13] = hc_swap32_S (enc_buf[13]); enc_buf[14] = hc_swap32_S (enc_buf[14]); enc_buf[15] = hc_swap32_S (enc_buf[15]); ripemd160_update_64 (ctx, enc_buf + 0, enc_buf + 4, enc_buf + 8, enc_buf + 12, enc_len); } return; } u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 32; pos1 += 32, pos4 += 8) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le_S (w1, w2, w3); make_utf16le_S (w0, w0, w1); w0[0] = hc_swap32_S (w0[0]); w0[1] = hc_swap32_S (w0[1]); w0[2] = hc_swap32_S (w0[2]); w0[3] = hc_swap32_S (w0[3]); w1[0] = hc_swap32_S (w1[0]); w1[1] = hc_swap32_S (w1[1]); w1[2] = hc_swap32_S (w1[2]); w1[3] = hc_swap32_S (w1[3]); w2[0] = hc_swap32_S (w2[0]); w2[1] = hc_swap32_S (w2[1]); w2[2] = hc_swap32_S (w2[2]); w2[3] = hc_swap32_S (w2[3]); w3[0] = hc_swap32_S (w3[0]); w3[1] = hc_swap32_S (w3[1]); w3[2] = hc_swap32_S (w3[2]); w3[3] = hc_swap32_S (w3[3]); ripemd160_update_64 (ctx, w0, w1, w2, w3, 32 * 2); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le_S (w1, w2, w3); make_utf16le_S (w0, w0, w1); w0[0] = hc_swap32_S (w0[0]); w0[1] = hc_swap32_S (w0[1]); w0[2] = hc_swap32_S (w0[2]); w0[3] = hc_swap32_S (w0[3]); w1[0] = hc_swap32_S (w1[0]); w1[1] = hc_swap32_S (w1[1]); w1[2] = hc_swap32_S (w1[2]); w1[3] = hc_swap32_S (w1[3]); w2[0] = hc_swap32_S (w2[0]); w2[1] = hc_swap32_S (w2[1]); w2[2] = hc_swap32_S (w2[2]); w2[3] = hc_swap32_S (w2[3]); w3[0] = hc_swap32_S (w3[0]); w3[1] = hc_swap32_S (w3[1]); w3[2] = hc_swap32_S (w3[2]); w3[3] = hc_swap32_S (w3[3]); ripemd160_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } DECLSPEC void ripemd160_update_global (PRIVATE_AS ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 64; pos1 += 64, pos4 += 16) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; ripemd160_update_64 (ctx, w0, w1, w2, w3, 64); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; ripemd160_update_64 (ctx, w0, w1, w2, w3, len - pos1); } DECLSPEC void ripemd160_update_global_swap (PRIVATE_AS ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 64; pos1 += 64, pos4 += 16) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; w0[0] = hc_swap32_S (w0[0]); w0[1] = hc_swap32_S (w0[1]); w0[2] = hc_swap32_S (w0[2]); w0[3] = hc_swap32_S (w0[3]); w1[0] = hc_swap32_S (w1[0]); w1[1] = hc_swap32_S (w1[1]); w1[2] = hc_swap32_S (w1[2]); w1[3] = hc_swap32_S (w1[3]); w2[0] = hc_swap32_S (w2[0]); w2[1] = hc_swap32_S (w2[1]); w2[2] = hc_swap32_S (w2[2]); w2[3] = hc_swap32_S (w2[3]); w3[0] = hc_swap32_S (w3[0]); w3[1] = hc_swap32_S (w3[1]); w3[2] = hc_swap32_S (w3[2]); w3[3] = hc_swap32_S (w3[3]); ripemd160_update_64 (ctx, w0, w1, w2, w3, 64); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; w0[0] = hc_swap32_S (w0[0]); w0[1] = hc_swap32_S (w0[1]); w0[2] = hc_swap32_S (w0[2]); w0[3] = hc_swap32_S (w0[3]); w1[0] = hc_swap32_S (w1[0]); w1[1] = hc_swap32_S (w1[1]); w1[2] = hc_swap32_S (w1[2]); w1[3] = hc_swap32_S (w1[3]); w2[0] = hc_swap32_S (w2[0]); w2[1] = hc_swap32_S (w2[1]); w2[2] = hc_swap32_S (w2[2]); w2[3] = hc_swap32_S (w2[3]); w3[0] = hc_swap32_S (w3[0]); w3[1] = hc_swap32_S (w3[1]); w3[2] = hc_swap32_S (w3[2]); w3[3] = hc_swap32_S (w3[3]); ripemd160_update_64 (ctx, w0, w1, w2, w3, len - pos1); } DECLSPEC void ripemd160_update_global_utf16le (PRIVATE_AS ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { if (hc_enc_scan_global (w, len)) { hc_enc_t hc_enc; hc_enc_init (&hc_enc); while (hc_enc_has_next (&hc_enc, len)) { u32 enc_buf[16] = { 0 }; const int enc_len = hc_enc_next_global (&hc_enc, w, len, 256, enc_buf, sizeof (enc_buf)); if (enc_len == -1) { ctx->len = -1; return; } ripemd160_update_64 (ctx, enc_buf + 0, enc_buf + 4, enc_buf + 8, enc_buf + 12, enc_len); } return; } u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 32; pos1 += 32, pos4 += 8) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le_S (w1, w2, w3); make_utf16le_S (w0, w0, w1); ripemd160_update_64 (ctx, w0, w1, w2, w3, 32 * 2); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le_S (w1, w2, w3); make_utf16le_S (w0, w0, w1); ripemd160_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } DECLSPEC void ripemd160_update_global_utf16le_swap (PRIVATE_AS ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { if (hc_enc_scan_global (w, len)) { hc_enc_t hc_enc; hc_enc_init (&hc_enc); while (hc_enc_has_next (&hc_enc, len)) { u32 enc_buf[16] = { 0 }; const int enc_len = hc_enc_next_global (&hc_enc, w, len, 256, enc_buf, sizeof (enc_buf)); if (enc_len == -1) { ctx->len = -1; return; } enc_buf[ 0] = hc_swap32_S (enc_buf[ 0]); enc_buf[ 1] = hc_swap32_S (enc_buf[ 1]); enc_buf[ 2] = hc_swap32_S (enc_buf[ 2]); enc_buf[ 3] = hc_swap32_S (enc_buf[ 3]); enc_buf[ 4] = hc_swap32_S (enc_buf[ 4]); enc_buf[ 5] = hc_swap32_S (enc_buf[ 5]); enc_buf[ 6] = hc_swap32_S (enc_buf[ 6]); enc_buf[ 7] = hc_swap32_S (enc_buf[ 7]); enc_buf[ 8] = hc_swap32_S (enc_buf[ 8]); enc_buf[ 9] = hc_swap32_S (enc_buf[ 9]); enc_buf[10] = hc_swap32_S (enc_buf[10]); enc_buf[11] = hc_swap32_S (enc_buf[11]); enc_buf[12] = hc_swap32_S (enc_buf[12]); enc_buf[13] = hc_swap32_S (enc_buf[13]); enc_buf[14] = hc_swap32_S (enc_buf[14]); enc_buf[15] = hc_swap32_S (enc_buf[15]); ripemd160_update_64 (ctx, enc_buf + 0, enc_buf + 4, enc_buf + 8, enc_buf + 12, enc_len); } return; } u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 32; pos1 += 32, pos4 += 8) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le_S (w1, w2, w3); make_utf16le_S (w0, w0, w1); w0[0] = hc_swap32_S (w0[0]); w0[1] = hc_swap32_S (w0[1]); w0[2] = hc_swap32_S (w0[2]); w0[3] = hc_swap32_S (w0[3]); w1[0] = hc_swap32_S (w1[0]); w1[1] = hc_swap32_S (w1[1]); w1[2] = hc_swap32_S (w1[2]); w1[3] = hc_swap32_S (w1[3]); w2[0] = hc_swap32_S (w2[0]); w2[1] = hc_swap32_S (w2[1]); w2[2] = hc_swap32_S (w2[2]); w2[3] = hc_swap32_S (w2[3]); w3[0] = hc_swap32_S (w3[0]); w3[1] = hc_swap32_S (w3[1]); w3[2] = hc_swap32_S (w3[2]); w3[3] = hc_swap32_S (w3[3]); ripemd160_update_64 (ctx, w0, w1, w2, w3, 32 * 2); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le_S (w1, w2, w3); make_utf16le_S (w0, w0, w1); w0[0] = hc_swap32_S (w0[0]); w0[1] = hc_swap32_S (w0[1]); w0[2] = hc_swap32_S (w0[2]); w0[3] = hc_swap32_S (w0[3]); w1[0] = hc_swap32_S (w1[0]); w1[1] = hc_swap32_S (w1[1]); w1[2] = hc_swap32_S (w1[2]); w1[3] = hc_swap32_S (w1[3]); w2[0] = hc_swap32_S (w2[0]); w2[1] = hc_swap32_S (w2[1]); w2[2] = hc_swap32_S (w2[2]); w2[3] = hc_swap32_S (w2[3]); w3[0] = hc_swap32_S (w3[0]); w3[1] = hc_swap32_S (w3[1]); w3[2] = hc_swap32_S (w3[2]); w3[3] = hc_swap32_S (w3[3]); ripemd160_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } DECLSPEC void ripemd160_final (PRIVATE_AS ripemd160_ctx_t *ctx) { const int pos = ctx->len & 63; append_0x80_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos); if (pos >= 56) { ripemd160_transform (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); ctx->w0[0] = 0; ctx->w0[1] = 0; ctx->w0[2] = 0; ctx->w0[3] = 0; ctx->w1[0] = 0; ctx->w1[1] = 0; ctx->w1[2] = 0; ctx->w1[3] = 0; ctx->w2[0] = 0; ctx->w2[1] = 0; ctx->w2[2] = 0; ctx->w2[3] = 0; ctx->w3[0] = 0; ctx->w3[1] = 0; ctx->w3[2] = 0; ctx->w3[3] = 0; } ctx->w3[2] = ctx->len * 8; ctx->w3[3] = 0; ripemd160_transform (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); } // ripemd160_hmac DECLSPEC void ripemd160_hmac_init_64 (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w0, PRIVATE_AS const u32 *w1, PRIVATE_AS const u32 *w2, PRIVATE_AS const u32 *w3) { u32 a0[4]; u32 a1[4]; u32 a2[4]; u32 a3[4]; // ipad a0[0] = w0[0] ^ 0x36363636; a0[1] = w0[1] ^ 0x36363636; a0[2] = w0[2] ^ 0x36363636; a0[3] = w0[3] ^ 0x36363636; a1[0] = w1[0] ^ 0x36363636; a1[1] = w1[1] ^ 0x36363636; a1[2] = w1[2] ^ 0x36363636; a1[3] = w1[3] ^ 0x36363636; a2[0] = w2[0] ^ 0x36363636; a2[1] = w2[1] ^ 0x36363636; a2[2] = w2[2] ^ 0x36363636; a2[3] = w2[3] ^ 0x36363636; a3[0] = w3[0] ^ 0x36363636; a3[1] = w3[1] ^ 0x36363636; a3[2] = w3[2] ^ 0x36363636; a3[3] = w3[3] ^ 0x36363636; ripemd160_init (&ctx->ipad); ripemd160_update_64 (&ctx->ipad, a0, a1, a2, a3, 64); // opad u32 b0[4]; u32 b1[4]; u32 b2[4]; u32 b3[4]; b0[0] = w0[0] ^ 0x5c5c5c5c; b0[1] = w0[1] ^ 0x5c5c5c5c; b0[2] = w0[2] ^ 0x5c5c5c5c; b0[3] = w0[3] ^ 0x5c5c5c5c; b1[0] = w1[0] ^ 0x5c5c5c5c; b1[1] = w1[1] ^ 0x5c5c5c5c; b1[2] = w1[2] ^ 0x5c5c5c5c; b1[3] = w1[3] ^ 0x5c5c5c5c; b2[0] = w2[0] ^ 0x5c5c5c5c; b2[1] = w2[1] ^ 0x5c5c5c5c; b2[2] = w2[2] ^ 0x5c5c5c5c; b2[3] = w2[3] ^ 0x5c5c5c5c; b3[0] = w3[0] ^ 0x5c5c5c5c; b3[1] = w3[1] ^ 0x5c5c5c5c; b3[2] = w3[2] ^ 0x5c5c5c5c; b3[3] = w3[3] ^ 0x5c5c5c5c; ripemd160_init (&ctx->opad); ripemd160_update_64 (&ctx->opad, b0, b1, b2, b3, 64); } DECLSPEC void ripemd160_hmac_init (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; if (len > 64) { ripemd160_ctx_t tmp; ripemd160_init (&tmp); ripemd160_update (&tmp, w, len); ripemd160_final (&tmp); w0[0] = tmp.h[0]; w0[1] = tmp.h[1]; w0[2] = tmp.h[2]; w0[3] = tmp.h[3]; w1[0] = tmp.h[4]; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; } else { w0[0] = w[ 0]; w0[1] = w[ 1]; w0[2] = w[ 2]; w0[3] = w[ 3]; w1[0] = w[ 4]; w1[1] = w[ 5]; w1[2] = w[ 6]; w1[3] = w[ 7]; w2[0] = w[ 8]; w2[1] = w[ 9]; w2[2] = w[10]; w2[3] = w[11]; w3[0] = w[12]; w3[1] = w[13]; w3[2] = w[14]; w3[3] = w[15]; } ripemd160_hmac_init_64 (ctx, w0, w1, w2, w3); } DECLSPEC void ripemd160_hmac_init_swap (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; if (len > 64) { ripemd160_ctx_t tmp; ripemd160_init (&tmp); ripemd160_update_swap (&tmp, w, len); ripemd160_final (&tmp); w0[0] = tmp.h[0]; w0[1] = tmp.h[1]; w0[2] = tmp.h[2]; w0[3] = tmp.h[3]; w1[0] = tmp.h[4]; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; } else { w0[0] = hc_swap32_S (w[ 0]); w0[1] = hc_swap32_S (w[ 1]); w0[2] = hc_swap32_S (w[ 2]); w0[3] = hc_swap32_S (w[ 3]); w1[0] = hc_swap32_S (w[ 4]); w1[1] = hc_swap32_S (w[ 5]); w1[2] = hc_swap32_S (w[ 6]); w1[3] = hc_swap32_S (w[ 7]); w2[0] = hc_swap32_S (w[ 8]); w2[1] = hc_swap32_S (w[ 9]); w2[2] = hc_swap32_S (w[10]); w2[3] = hc_swap32_S (w[11]); w3[0] = hc_swap32_S (w[12]); w3[1] = hc_swap32_S (w[13]); w3[2] = hc_swap32_S (w[14]); w3[3] = hc_swap32_S (w[15]); } ripemd160_hmac_init_64 (ctx, w0, w1, w2, w3); } DECLSPEC void ripemd160_hmac_init_global (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; if (len > 64) { ripemd160_ctx_t tmp; ripemd160_init (&tmp); ripemd160_update_global (&tmp, w, len); ripemd160_final (&tmp); w0[0] = tmp.h[0]; w0[1] = tmp.h[1]; w0[2] = tmp.h[2]; w0[3] = tmp.h[3]; w1[0] = tmp.h[4]; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; } else { w0[0] = w[ 0]; w0[1] = w[ 1]; w0[2] = w[ 2]; w0[3] = w[ 3]; w1[0] = w[ 4]; w1[1] = w[ 5]; w1[2] = w[ 6]; w1[3] = w[ 7]; w2[0] = w[ 8]; w2[1] = w[ 9]; w2[2] = w[10]; w2[3] = w[11]; w3[0] = w[12]; w3[1] = w[13]; w3[2] = w[14]; w3[3] = w[15]; } ripemd160_hmac_init_64 (ctx, w0, w1, w2, w3); } DECLSPEC void ripemd160_hmac_init_global_swap (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; if (len > 64) { ripemd160_ctx_t tmp; ripemd160_init (&tmp); ripemd160_update_global_swap (&tmp, w, len); ripemd160_final (&tmp); w0[0] = tmp.h[0]; w0[1] = tmp.h[1]; w0[2] = tmp.h[2]; w0[3] = tmp.h[3]; w1[0] = tmp.h[4]; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; } else { w0[0] = hc_swap32_S (w[ 0]); w0[1] = hc_swap32_S (w[ 1]); w0[2] = hc_swap32_S (w[ 2]); w0[3] = hc_swap32_S (w[ 3]); w1[0] = hc_swap32_S (w[ 4]); w1[1] = hc_swap32_S (w[ 5]); w1[2] = hc_swap32_S (w[ 6]); w1[3] = hc_swap32_S (w[ 7]); w2[0] = hc_swap32_S (w[ 8]); w2[1] = hc_swap32_S (w[ 9]); w2[2] = hc_swap32_S (w[10]); w2[3] = hc_swap32_S (w[11]); w3[0] = hc_swap32_S (w[12]); w3[1] = hc_swap32_S (w[13]); w3[2] = hc_swap32_S (w[14]); w3[3] = hc_swap32_S (w[15]); } ripemd160_hmac_init_64 (ctx, w0, w1, w2, w3); } DECLSPEC void ripemd160_hmac_update_64 (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const int len) { ripemd160_update_64 (&ctx->ipad, w0, w1, w2, w3, len); } DECLSPEC void ripemd160_hmac_update (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { ripemd160_update (&ctx->ipad, w, len); } DECLSPEC void ripemd160_hmac_update_swap (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { ripemd160_update_swap (&ctx->ipad, w, len); } DECLSPEC void ripemd160_hmac_update_utf16le (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { ripemd160_update_utf16le (&ctx->ipad, w, len); } DECLSPEC void ripemd160_hmac_update_utf16le_swap (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { ripemd160_update_utf16le_swap (&ctx->ipad, w, len); } DECLSPEC void ripemd160_hmac_update_global (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { ripemd160_update_global (&ctx->ipad, w, len); } DECLSPEC void ripemd160_hmac_update_global_swap (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { ripemd160_update_global_swap (&ctx->ipad, w, len); } DECLSPEC void ripemd160_hmac_update_global_utf16le (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { ripemd160_update_global_utf16le (&ctx->ipad, w, len); } DECLSPEC void ripemd160_hmac_update_global_utf16le_swap (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { ripemd160_update_global_utf16le_swap (&ctx->ipad, w, len); } DECLSPEC void ripemd160_hmac_final (PRIVATE_AS ripemd160_hmac_ctx_t *ctx) { ripemd160_final (&ctx->ipad); ctx->opad.w0[0] = ctx->ipad.h[0]; ctx->opad.w0[1] = ctx->ipad.h[1]; ctx->opad.w0[2] = ctx->ipad.h[2]; ctx->opad.w0[3] = ctx->ipad.h[3]; ctx->opad.w1[0] = ctx->ipad.h[4]; ctx->opad.w1[1] = 0; ctx->opad.w1[2] = 0; ctx->opad.w1[3] = 0; ctx->opad.w2[0] = 0; ctx->opad.w2[1] = 0; ctx->opad.w2[2] = 0; ctx->opad.w2[3] = 0; ctx->opad.w3[0] = 0; ctx->opad.w3[1] = 0; ctx->opad.w3[2] = 0; ctx->opad.w3[3] = 0; ctx->opad.len += 20; ripemd160_final (&ctx->opad); } // while input buf can be a vector datatype, the length of the different elements can not DECLSPEC void ripemd160_transform_vector (PRIVATE_AS const u32x *w0, PRIVATE_AS const u32x *w1, PRIVATE_AS const u32x *w2, PRIVATE_AS const u32x *w3, PRIVATE_AS u32x *digest) { u32x a1 = digest[0]; u32x b1 = digest[1]; u32x c1 = digest[2]; u32x d1 = digest[3]; u32x e1 = digest[4]; RIPEMD160_STEP (RIPEMD160_F , a1, b1, c1, d1, e1, w0[0], RIPEMD160C00, RIPEMD160S00); RIPEMD160_STEP (RIPEMD160_F , e1, a1, b1, c1, d1, w0[1], RIPEMD160C00, RIPEMD160S01); RIPEMD160_STEP (RIPEMD160_F , d1, e1, a1, b1, c1, w0[2], RIPEMD160C00, RIPEMD160S02); RIPEMD160_STEP (RIPEMD160_F , c1, d1, e1, a1, b1, w0[3], RIPEMD160C00, RIPEMD160S03); RIPEMD160_STEP (RIPEMD160_F , b1, c1, d1, e1, a1, w1[0], RIPEMD160C00, RIPEMD160S04); RIPEMD160_STEP (RIPEMD160_F , a1, b1, c1, d1, e1, w1[1], RIPEMD160C00, RIPEMD160S05); RIPEMD160_STEP (RIPEMD160_F , e1, a1, b1, c1, d1, w1[2], RIPEMD160C00, RIPEMD160S06); RIPEMD160_STEP (RIPEMD160_F , d1, e1, a1, b1, c1, w1[3], RIPEMD160C00, RIPEMD160S07); RIPEMD160_STEP (RIPEMD160_F , c1, d1, e1, a1, b1, w2[0], RIPEMD160C00, RIPEMD160S08); RIPEMD160_STEP (RIPEMD160_F , b1, c1, d1, e1, a1, w2[1], RIPEMD160C00, RIPEMD160S09); RIPEMD160_STEP (RIPEMD160_F , a1, b1, c1, d1, e1, w2[2], RIPEMD160C00, RIPEMD160S0A); RIPEMD160_STEP (RIPEMD160_F , e1, a1, b1, c1, d1, w2[3], RIPEMD160C00, RIPEMD160S0B); RIPEMD160_STEP (RIPEMD160_F , d1, e1, a1, b1, c1, w3[0], RIPEMD160C00, RIPEMD160S0C); RIPEMD160_STEP (RIPEMD160_F , c1, d1, e1, a1, b1, w3[1], RIPEMD160C00, RIPEMD160S0D); RIPEMD160_STEP (RIPEMD160_F , b1, c1, d1, e1, a1, w3[2], RIPEMD160C00, RIPEMD160S0E); RIPEMD160_STEP (RIPEMD160_F , a1, b1, c1, d1, e1, w3[3], RIPEMD160C00, RIPEMD160S0F); RIPEMD160_STEP (RIPEMD160_Go, e1, a1, b1, c1, d1, w1[3], RIPEMD160C10, RIPEMD160S10); RIPEMD160_STEP (RIPEMD160_Go, d1, e1, a1, b1, c1, w1[0], RIPEMD160C10, RIPEMD160S11); RIPEMD160_STEP (RIPEMD160_Go, c1, d1, e1, a1, b1, w3[1], RIPEMD160C10, RIPEMD160S12); RIPEMD160_STEP (RIPEMD160_Go, b1, c1, d1, e1, a1, w0[1], RIPEMD160C10, RIPEMD160S13); RIPEMD160_STEP (RIPEMD160_Go, a1, b1, c1, d1, e1, w2[2], RIPEMD160C10, RIPEMD160S14); RIPEMD160_STEP (RIPEMD160_Go, e1, a1, b1, c1, d1, w1[2], RIPEMD160C10, RIPEMD160S15); RIPEMD160_STEP (RIPEMD160_Go, d1, e1, a1, b1, c1, w3[3], RIPEMD160C10, RIPEMD160S16); RIPEMD160_STEP (RIPEMD160_Go, c1, d1, e1, a1, b1, w0[3], RIPEMD160C10, RIPEMD160S17); RIPEMD160_STEP (RIPEMD160_Go, b1, c1, d1, e1, a1, w3[0], RIPEMD160C10, RIPEMD160S18); RIPEMD160_STEP (RIPEMD160_Go, a1, b1, c1, d1, e1, w0[0], RIPEMD160C10, RIPEMD160S19); RIPEMD160_STEP (RIPEMD160_Go, e1, a1, b1, c1, d1, w2[1], RIPEMD160C10, RIPEMD160S1A); RIPEMD160_STEP (RIPEMD160_Go, d1, e1, a1, b1, c1, w1[1], RIPEMD160C10, RIPEMD160S1B); RIPEMD160_STEP (RIPEMD160_Go, c1, d1, e1, a1, b1, w0[2], RIPEMD160C10, RIPEMD160S1C); RIPEMD160_STEP (RIPEMD160_Go, b1, c1, d1, e1, a1, w3[2], RIPEMD160C10, RIPEMD160S1D); RIPEMD160_STEP (RIPEMD160_Go, a1, b1, c1, d1, e1, w2[3], RIPEMD160C10, RIPEMD160S1E); RIPEMD160_STEP (RIPEMD160_Go, e1, a1, b1, c1, d1, w2[0], RIPEMD160C10, RIPEMD160S1F); RIPEMD160_STEP (RIPEMD160_H , d1, e1, a1, b1, c1, w0[3], RIPEMD160C20, RIPEMD160S20); RIPEMD160_STEP (RIPEMD160_H , c1, d1, e1, a1, b1, w2[2], RIPEMD160C20, RIPEMD160S21); RIPEMD160_STEP (RIPEMD160_H , b1, c1, d1, e1, a1, w3[2], RIPEMD160C20, RIPEMD160S22); RIPEMD160_STEP (RIPEMD160_H , a1, b1, c1, d1, e1, w1[0], RIPEMD160C20, RIPEMD160S23); RIPEMD160_STEP (RIPEMD160_H , e1, a1, b1, c1, d1, w2[1], RIPEMD160C20, RIPEMD160S24); RIPEMD160_STEP (RIPEMD160_H , d1, e1, a1, b1, c1, w3[3], RIPEMD160C20, RIPEMD160S25); RIPEMD160_STEP (RIPEMD160_H , c1, d1, e1, a1, b1, w2[0], RIPEMD160C20, RIPEMD160S26); RIPEMD160_STEP (RIPEMD160_H , b1, c1, d1, e1, a1, w0[1], RIPEMD160C20, RIPEMD160S27); RIPEMD160_STEP (RIPEMD160_H , a1, b1, c1, d1, e1, w0[2], RIPEMD160C20, RIPEMD160S28); RIPEMD160_STEP (RIPEMD160_H , e1, a1, b1, c1, d1, w1[3], RIPEMD160C20, RIPEMD160S29); RIPEMD160_STEP (RIPEMD160_H , d1, e1, a1, b1, c1, w0[0], RIPEMD160C20, RIPEMD160S2A); RIPEMD160_STEP (RIPEMD160_H , c1, d1, e1, a1, b1, w1[2], RIPEMD160C20, RIPEMD160S2B); RIPEMD160_STEP (RIPEMD160_H , b1, c1, d1, e1, a1, w3[1], RIPEMD160C20, RIPEMD160S2C); RIPEMD160_STEP (RIPEMD160_H , a1, b1, c1, d1, e1, w2[3], RIPEMD160C20, RIPEMD160S2D); RIPEMD160_STEP (RIPEMD160_H , e1, a1, b1, c1, d1, w1[1], RIPEMD160C20, RIPEMD160S2E); RIPEMD160_STEP (RIPEMD160_H , d1, e1, a1, b1, c1, w3[0], RIPEMD160C20, RIPEMD160S2F); RIPEMD160_STEP (RIPEMD160_Io, c1, d1, e1, a1, b1, w0[1], RIPEMD160C30, RIPEMD160S30); RIPEMD160_STEP (RIPEMD160_Io, b1, c1, d1, e1, a1, w2[1], RIPEMD160C30, RIPEMD160S31); RIPEMD160_STEP (RIPEMD160_Io, a1, b1, c1, d1, e1, w2[3], RIPEMD160C30, RIPEMD160S32); RIPEMD160_STEP (RIPEMD160_Io, e1, a1, b1, c1, d1, w2[2], RIPEMD160C30, RIPEMD160S33); RIPEMD160_STEP (RIPEMD160_Io, d1, e1, a1, b1, c1, w0[0], RIPEMD160C30, RIPEMD160S34); RIPEMD160_STEP (RIPEMD160_Io, c1, d1, e1, a1, b1, w2[0], RIPEMD160C30, RIPEMD160S35); RIPEMD160_STEP (RIPEMD160_Io, b1, c1, d1, e1, a1, w3[0], RIPEMD160C30, RIPEMD160S36); RIPEMD160_STEP (RIPEMD160_Io, a1, b1, c1, d1, e1, w1[0], RIPEMD160C30, RIPEMD160S37); RIPEMD160_STEP (RIPEMD160_Io, e1, a1, b1, c1, d1, w3[1], RIPEMD160C30, RIPEMD160S38); RIPEMD160_STEP (RIPEMD160_Io, d1, e1, a1, b1, c1, w0[3], RIPEMD160C30, RIPEMD160S39); RIPEMD160_STEP (RIPEMD160_Io, c1, d1, e1, a1, b1, w1[3], RIPEMD160C30, RIPEMD160S3A); RIPEMD160_STEP (RIPEMD160_Io, b1, c1, d1, e1, a1, w3[3], RIPEMD160C30, RIPEMD160S3B); RIPEMD160_STEP (RIPEMD160_Io, a1, b1, c1, d1, e1, w3[2], RIPEMD160C30, RIPEMD160S3C); RIPEMD160_STEP (RIPEMD160_Io, e1, a1, b1, c1, d1, w1[1], RIPEMD160C30, RIPEMD160S3D); RIPEMD160_STEP (RIPEMD160_Io, d1, e1, a1, b1, c1, w1[2], RIPEMD160C30, RIPEMD160S3E); RIPEMD160_STEP (RIPEMD160_Io, c1, d1, e1, a1, b1, w0[2], RIPEMD160C30, RIPEMD160S3F); RIPEMD160_STEP (RIPEMD160_J , b1, c1, d1, e1, a1, w1[0], RIPEMD160C40, RIPEMD160S40); RIPEMD160_STEP (RIPEMD160_J , a1, b1, c1, d1, e1, w0[0], RIPEMD160C40, RIPEMD160S41); RIPEMD160_STEP (RIPEMD160_J , e1, a1, b1, c1, d1, w1[1], RIPEMD160C40, RIPEMD160S42); RIPEMD160_STEP (RIPEMD160_J , d1, e1, a1, b1, c1, w2[1], RIPEMD160C40, RIPEMD160S43); RIPEMD160_STEP (RIPEMD160_J , c1, d1, e1, a1, b1, w1[3], RIPEMD160C40, RIPEMD160S44); RIPEMD160_STEP (RIPEMD160_J , b1, c1, d1, e1, a1, w3[0], RIPEMD160C40, RIPEMD160S45); RIPEMD160_STEP (RIPEMD160_J , a1, b1, c1, d1, e1, w0[2], RIPEMD160C40, RIPEMD160S46); RIPEMD160_STEP (RIPEMD160_J , e1, a1, b1, c1, d1, w2[2], RIPEMD160C40, RIPEMD160S47); RIPEMD160_STEP (RIPEMD160_J , d1, e1, a1, b1, c1, w3[2], RIPEMD160C40, RIPEMD160S48); RIPEMD160_STEP (RIPEMD160_J , c1, d1, e1, a1, b1, w0[1], RIPEMD160C40, RIPEMD160S49); RIPEMD160_STEP (RIPEMD160_J , b1, c1, d1, e1, a1, w0[3], RIPEMD160C40, RIPEMD160S4A); RIPEMD160_STEP (RIPEMD160_J , a1, b1, c1, d1, e1, w2[0], RIPEMD160C40, RIPEMD160S4B); RIPEMD160_STEP (RIPEMD160_J , e1, a1, b1, c1, d1, w2[3], RIPEMD160C40, RIPEMD160S4C); RIPEMD160_STEP (RIPEMD160_J , d1, e1, a1, b1, c1, w1[2], RIPEMD160C40, RIPEMD160S4D); RIPEMD160_STEP (RIPEMD160_J , c1, d1, e1, a1, b1, w3[3], RIPEMD160C40, RIPEMD160S4E); RIPEMD160_STEP (RIPEMD160_J , b1, c1, d1, e1, a1, w3[1], RIPEMD160C40, RIPEMD160S4F); u32x a2 = digest[0]; u32x b2 = digest[1]; u32x c2 = digest[2]; u32x d2 = digest[3]; u32x e2 = digest[4]; RIPEMD160_STEP_WORKAROUND_BUG (RIPEMD160_J , a2, b2, c2, d2, e2, w1[1], RIPEMD160C50, RIPEMD160S50); RIPEMD160_STEP (RIPEMD160_J , e2, a2, b2, c2, d2, w3[2], RIPEMD160C50, RIPEMD160S51); RIPEMD160_STEP (RIPEMD160_J , d2, e2, a2, b2, c2, w1[3], RIPEMD160C50, RIPEMD160S52); RIPEMD160_STEP (RIPEMD160_J , c2, d2, e2, a2, b2, w0[0], RIPEMD160C50, RIPEMD160S53); RIPEMD160_STEP (RIPEMD160_J , b2, c2, d2, e2, a2, w2[1], RIPEMD160C50, RIPEMD160S54); RIPEMD160_STEP (RIPEMD160_J , a2, b2, c2, d2, e2, w0[2], RIPEMD160C50, RIPEMD160S55); RIPEMD160_STEP (RIPEMD160_J , e2, a2, b2, c2, d2, w2[3], RIPEMD160C50, RIPEMD160S56); RIPEMD160_STEP (RIPEMD160_J , d2, e2, a2, b2, c2, w1[0], RIPEMD160C50, RIPEMD160S57); RIPEMD160_STEP (RIPEMD160_J , c2, d2, e2, a2, b2, w3[1], RIPEMD160C50, RIPEMD160S58); RIPEMD160_STEP (RIPEMD160_J , b2, c2, d2, e2, a2, w1[2], RIPEMD160C50, RIPEMD160S59); RIPEMD160_STEP (RIPEMD160_J , a2, b2, c2, d2, e2, w3[3], RIPEMD160C50, RIPEMD160S5A); RIPEMD160_STEP (RIPEMD160_J , e2, a2, b2, c2, d2, w2[0], RIPEMD160C50, RIPEMD160S5B); RIPEMD160_STEP (RIPEMD160_J , d2, e2, a2, b2, c2, w0[1], RIPEMD160C50, RIPEMD160S5C); RIPEMD160_STEP (RIPEMD160_J , c2, d2, e2, a2, b2, w2[2], RIPEMD160C50, RIPEMD160S5D); RIPEMD160_STEP (RIPEMD160_J , b2, c2, d2, e2, a2, w0[3], RIPEMD160C50, RIPEMD160S5E); RIPEMD160_STEP (RIPEMD160_J , a2, b2, c2, d2, e2, w3[0], RIPEMD160C50, RIPEMD160S5F); RIPEMD160_STEP (RIPEMD160_Io, e2, a2, b2, c2, d2, w1[2], RIPEMD160C60, RIPEMD160S60); RIPEMD160_STEP (RIPEMD160_Io, d2, e2, a2, b2, c2, w2[3], RIPEMD160C60, RIPEMD160S61); RIPEMD160_STEP (RIPEMD160_Io, c2, d2, e2, a2, b2, w0[3], RIPEMD160C60, RIPEMD160S62); RIPEMD160_STEP (RIPEMD160_Io, b2, c2, d2, e2, a2, w1[3], RIPEMD160C60, RIPEMD160S63); RIPEMD160_STEP (RIPEMD160_Io, a2, b2, c2, d2, e2, w0[0], RIPEMD160C60, RIPEMD160S64); RIPEMD160_STEP (RIPEMD160_Io, e2, a2, b2, c2, d2, w3[1], RIPEMD160C60, RIPEMD160S65); RIPEMD160_STEP (RIPEMD160_Io, d2, e2, a2, b2, c2, w1[1], RIPEMD160C60, RIPEMD160S66); RIPEMD160_STEP (RIPEMD160_Io, c2, d2, e2, a2, b2, w2[2], RIPEMD160C60, RIPEMD160S67); RIPEMD160_STEP (RIPEMD160_Io, b2, c2, d2, e2, a2, w3[2], RIPEMD160C60, RIPEMD160S68); RIPEMD160_STEP (RIPEMD160_Io, a2, b2, c2, d2, e2, w3[3], RIPEMD160C60, RIPEMD160S69); RIPEMD160_STEP (RIPEMD160_Io, e2, a2, b2, c2, d2, w2[0], RIPEMD160C60, RIPEMD160S6A); RIPEMD160_STEP (RIPEMD160_Io, d2, e2, a2, b2, c2, w3[0], RIPEMD160C60, RIPEMD160S6B); RIPEMD160_STEP (RIPEMD160_Io, c2, d2, e2, a2, b2, w1[0], RIPEMD160C60, RIPEMD160S6C); RIPEMD160_STEP (RIPEMD160_Io, b2, c2, d2, e2, a2, w2[1], RIPEMD160C60, RIPEMD160S6D); RIPEMD160_STEP (RIPEMD160_Io, a2, b2, c2, d2, e2, w0[1], RIPEMD160C60, RIPEMD160S6E); RIPEMD160_STEP (RIPEMD160_Io, e2, a2, b2, c2, d2, w0[2], RIPEMD160C60, RIPEMD160S6F); RIPEMD160_STEP (RIPEMD160_H , d2, e2, a2, b2, c2, w3[3], RIPEMD160C70, RIPEMD160S70); RIPEMD160_STEP (RIPEMD160_H , c2, d2, e2, a2, b2, w1[1], RIPEMD160C70, RIPEMD160S71); RIPEMD160_STEP (RIPEMD160_H , b2, c2, d2, e2, a2, w0[1], RIPEMD160C70, RIPEMD160S72); RIPEMD160_STEP (RIPEMD160_H , a2, b2, c2, d2, e2, w0[3], RIPEMD160C70, RIPEMD160S73); RIPEMD160_STEP (RIPEMD160_H , e2, a2, b2, c2, d2, w1[3], RIPEMD160C70, RIPEMD160S74); RIPEMD160_STEP (RIPEMD160_H , d2, e2, a2, b2, c2, w3[2], RIPEMD160C70, RIPEMD160S75); RIPEMD160_STEP (RIPEMD160_H , c2, d2, e2, a2, b2, w1[2], RIPEMD160C70, RIPEMD160S76); RIPEMD160_STEP (RIPEMD160_H , b2, c2, d2, e2, a2, w2[1], RIPEMD160C70, RIPEMD160S77); RIPEMD160_STEP (RIPEMD160_H , a2, b2, c2, d2, e2, w2[3], RIPEMD160C70, RIPEMD160S78); RIPEMD160_STEP (RIPEMD160_H , e2, a2, b2, c2, d2, w2[0], RIPEMD160C70, RIPEMD160S79); RIPEMD160_STEP (RIPEMD160_H , d2, e2, a2, b2, c2, w3[0], RIPEMD160C70, RIPEMD160S7A); RIPEMD160_STEP (RIPEMD160_H , c2, d2, e2, a2, b2, w0[2], RIPEMD160C70, RIPEMD160S7B); RIPEMD160_STEP (RIPEMD160_H , b2, c2, d2, e2, a2, w2[2], RIPEMD160C70, RIPEMD160S7C); RIPEMD160_STEP (RIPEMD160_H , a2, b2, c2, d2, e2, w0[0], RIPEMD160C70, RIPEMD160S7D); RIPEMD160_STEP (RIPEMD160_H , e2, a2, b2, c2, d2, w1[0], RIPEMD160C70, RIPEMD160S7E); RIPEMD160_STEP (RIPEMD160_H , d2, e2, a2, b2, c2, w3[1], RIPEMD160C70, RIPEMD160S7F); RIPEMD160_STEP (RIPEMD160_Go, c2, d2, e2, a2, b2, w2[0], RIPEMD160C80, RIPEMD160S80); RIPEMD160_STEP (RIPEMD160_Go, b2, c2, d2, e2, a2, w1[2], RIPEMD160C80, RIPEMD160S81); RIPEMD160_STEP (RIPEMD160_Go, a2, b2, c2, d2, e2, w1[0], RIPEMD160C80, RIPEMD160S82); RIPEMD160_STEP (RIPEMD160_Go, e2, a2, b2, c2, d2, w0[1], RIPEMD160C80, RIPEMD160S83); RIPEMD160_STEP (RIPEMD160_Go, d2, e2, a2, b2, c2, w0[3], RIPEMD160C80, RIPEMD160S84); RIPEMD160_STEP (RIPEMD160_Go, c2, d2, e2, a2, b2, w2[3], RIPEMD160C80, RIPEMD160S85); RIPEMD160_STEP (RIPEMD160_Go, b2, c2, d2, e2, a2, w3[3], RIPEMD160C80, RIPEMD160S86); RIPEMD160_STEP (RIPEMD160_Go, a2, b2, c2, d2, e2, w0[0], RIPEMD160C80, RIPEMD160S87); RIPEMD160_STEP (RIPEMD160_Go, e2, a2, b2, c2, d2, w1[1], RIPEMD160C80, RIPEMD160S88); RIPEMD160_STEP (RIPEMD160_Go, d2, e2, a2, b2, c2, w3[0], RIPEMD160C80, RIPEMD160S89); RIPEMD160_STEP (RIPEMD160_Go, c2, d2, e2, a2, b2, w0[2], RIPEMD160C80, RIPEMD160S8A); RIPEMD160_STEP (RIPEMD160_Go, b2, c2, d2, e2, a2, w3[1], RIPEMD160C80, RIPEMD160S8B); RIPEMD160_STEP (RIPEMD160_Go, a2, b2, c2, d2, e2, w2[1], RIPEMD160C80, RIPEMD160S8C); RIPEMD160_STEP (RIPEMD160_Go, e2, a2, b2, c2, d2, w1[3], RIPEMD160C80, RIPEMD160S8D); RIPEMD160_STEP (RIPEMD160_Go, d2, e2, a2, b2, c2, w2[2], RIPEMD160C80, RIPEMD160S8E); RIPEMD160_STEP (RIPEMD160_Go, c2, d2, e2, a2, b2, w3[2], RIPEMD160C80, RIPEMD160S8F); RIPEMD160_STEP (RIPEMD160_F , b2, c2, d2, e2, a2, w3[0], RIPEMD160C90, RIPEMD160S90); RIPEMD160_STEP (RIPEMD160_F , a2, b2, c2, d2, e2, w3[3], RIPEMD160C90, RIPEMD160S91); RIPEMD160_STEP (RIPEMD160_F , e2, a2, b2, c2, d2, w2[2], RIPEMD160C90, RIPEMD160S92); RIPEMD160_STEP (RIPEMD160_F , d2, e2, a2, b2, c2, w1[0], RIPEMD160C90, RIPEMD160S93); RIPEMD160_STEP (RIPEMD160_F , c2, d2, e2, a2, b2, w0[1], RIPEMD160C90, RIPEMD160S94); RIPEMD160_STEP (RIPEMD160_F , b2, c2, d2, e2, a2, w1[1], RIPEMD160C90, RIPEMD160S95); RIPEMD160_STEP (RIPEMD160_F , a2, b2, c2, d2, e2, w2[0], RIPEMD160C90, RIPEMD160S96); RIPEMD160_STEP (RIPEMD160_F , e2, a2, b2, c2, d2, w1[3], RIPEMD160C90, RIPEMD160S97); RIPEMD160_STEP (RIPEMD160_F , d2, e2, a2, b2, c2, w1[2], RIPEMD160C90, RIPEMD160S98); RIPEMD160_STEP (RIPEMD160_F , c2, d2, e2, a2, b2, w0[2], RIPEMD160C90, RIPEMD160S99); RIPEMD160_STEP (RIPEMD160_F , b2, c2, d2, e2, a2, w3[1], RIPEMD160C90, RIPEMD160S9A); RIPEMD160_STEP (RIPEMD160_F , a2, b2, c2, d2, e2, w3[2], RIPEMD160C90, RIPEMD160S9B); RIPEMD160_STEP (RIPEMD160_F , e2, a2, b2, c2, d2, w0[0], RIPEMD160C90, RIPEMD160S9C); RIPEMD160_STEP (RIPEMD160_F , d2, e2, a2, b2, c2, w0[3], RIPEMD160C90, RIPEMD160S9D); RIPEMD160_STEP (RIPEMD160_F , c2, d2, e2, a2, b2, w2[1], RIPEMD160C90, RIPEMD160S9E); RIPEMD160_STEP (RIPEMD160_F , b2, c2, d2, e2, a2, w2[3], RIPEMD160C90, RIPEMD160S9F); const u32x a = digest[1] + c1 + d2; const u32x b = digest[2] + d1 + e2; const u32x c = digest[3] + e1 + a2; const u32x d = digest[4] + a1 + b2; const u32x e = digest[0] + b1 + c2; digest[0] = a; digest[1] = b; digest[2] = c; digest[3] = d; digest[4] = e; } DECLSPEC void ripemd160_init_vector (PRIVATE_AS ripemd160_ctx_vector_t *ctx) { ctx->h[0] = RIPEMD160M_A; ctx->h[1] = RIPEMD160M_B; ctx->h[2] = RIPEMD160M_C; ctx->h[3] = RIPEMD160M_D; ctx->h[4] = RIPEMD160M_E; ctx->w0[0] = 0; ctx->w0[1] = 0; ctx->w0[2] = 0; ctx->w0[3] = 0; ctx->w1[0] = 0; ctx->w1[1] = 0; ctx->w1[2] = 0; ctx->w1[3] = 0; ctx->w2[0] = 0; ctx->w2[1] = 0; ctx->w2[2] = 0; ctx->w2[3] = 0; ctx->w3[0] = 0; ctx->w3[1] = 0; ctx->w3[2] = 0; ctx->w3[3] = 0; ctx->len = 0; } DECLSPEC void ripemd160_init_vector_from_scalar (PRIVATE_AS ripemd160_ctx_vector_t *ctx, PRIVATE_AS ripemd160_ctx_t *ctx0) { ctx->h[0] = ctx0->h[0]; ctx->h[1] = ctx0->h[1]; ctx->h[2] = ctx0->h[2]; ctx->h[3] = ctx0->h[3]; ctx->h[4] = ctx0->h[4]; ctx->w0[0] = ctx0->w0[0]; ctx->w0[1] = ctx0->w0[1]; ctx->w0[2] = ctx0->w0[2]; ctx->w0[3] = ctx0->w0[3]; ctx->w1[0] = ctx0->w1[0]; ctx->w1[1] = ctx0->w1[1]; ctx->w1[2] = ctx0->w1[2]; ctx->w1[3] = ctx0->w1[3]; ctx->w2[0] = ctx0->w2[0]; ctx->w2[1] = ctx0->w2[1]; ctx->w2[2] = ctx0->w2[2]; ctx->w2[3] = ctx0->w2[3]; ctx->w3[0] = ctx0->w3[0]; ctx->w3[1] = ctx0->w3[1]; ctx->w3[2] = ctx0->w3[2]; ctx->w3[3] = ctx0->w3[3]; ctx->len = ctx0->len; } DECLSPEC void ripemd160_update_vector_64 (PRIVATE_AS ripemd160_ctx_vector_t *ctx, PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const int len) { if (len == 0) return; const int pos = ctx->len & 63; ctx->len += len; if (pos == 0) { ctx->w0[0] = w0[0]; ctx->w0[1] = w0[1]; ctx->w0[2] = w0[2]; ctx->w0[3] = w0[3]; ctx->w1[0] = w1[0]; ctx->w1[1] = w1[1]; ctx->w1[2] = w1[2]; ctx->w1[3] = w1[3]; ctx->w2[0] = w2[0]; ctx->w2[1] = w2[1]; ctx->w2[2] = w2[2]; ctx->w2[3] = w2[3]; ctx->w3[0] = w3[0]; ctx->w3[1] = w3[1]; ctx->w3[2] = w3[2]; ctx->w3[3] = w3[3]; if (len == 64) { ripemd160_transform_vector (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); ctx->w0[0] = 0; ctx->w0[1] = 0; ctx->w0[2] = 0; ctx->w0[3] = 0; ctx->w1[0] = 0; ctx->w1[1] = 0; ctx->w1[2] = 0; ctx->w1[3] = 0; ctx->w2[0] = 0; ctx->w2[1] = 0; ctx->w2[2] = 0; ctx->w2[3] = 0; ctx->w3[0] = 0; ctx->w3[1] = 0; ctx->w3[2] = 0; ctx->w3[3] = 0; } } else { if ((pos + len) < 64) { switch_buffer_by_offset_le (w0, w1, w2, w3, pos); ctx->w0[0] |= w0[0]; ctx->w0[1] |= w0[1]; ctx->w0[2] |= w0[2]; ctx->w0[3] |= w0[3]; ctx->w1[0] |= w1[0]; ctx->w1[1] |= w1[1]; ctx->w1[2] |= w1[2]; ctx->w1[3] |= w1[3]; ctx->w2[0] |= w2[0]; ctx->w2[1] |= w2[1]; ctx->w2[2] |= w2[2]; ctx->w2[3] |= w2[3]; ctx->w3[0] |= w3[0]; ctx->w3[1] |= w3[1]; ctx->w3[2] |= w3[2]; ctx->w3[3] |= w3[3]; } else { u32x c0[4] = { 0 }; u32x c1[4] = { 0 }; u32x c2[4] = { 0 }; u32x c3[4] = { 0 }; switch_buffer_by_offset_carry_le (w0, w1, w2, w3, c0, c1, c2, c3, pos); ctx->w0[0] |= w0[0]; ctx->w0[1] |= w0[1]; ctx->w0[2] |= w0[2]; ctx->w0[3] |= w0[3]; ctx->w1[0] |= w1[0]; ctx->w1[1] |= w1[1]; ctx->w1[2] |= w1[2]; ctx->w1[3] |= w1[3]; ctx->w2[0] |= w2[0]; ctx->w2[1] |= w2[1]; ctx->w2[2] |= w2[2]; ctx->w2[3] |= w2[3]; ctx->w3[0] |= w3[0]; ctx->w3[1] |= w3[1]; ctx->w3[2] |= w3[2]; ctx->w3[3] |= w3[3]; ripemd160_transform_vector (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); ctx->w0[0] = c0[0]; ctx->w0[1] = c0[1]; ctx->w0[2] = c0[2]; ctx->w0[3] = c0[3]; ctx->w1[0] = c1[0]; ctx->w1[1] = c1[1]; ctx->w1[2] = c1[2]; ctx->w1[3] = c1[3]; ctx->w2[0] = c2[0]; ctx->w2[1] = c2[1]; ctx->w2[2] = c2[2]; ctx->w2[3] = c2[3]; ctx->w3[0] = c3[0]; ctx->w3[1] = c3[1]; ctx->w3[2] = c3[2]; ctx->w3[3] = c3[3]; } } } DECLSPEC void ripemd160_update_vector (PRIVATE_AS ripemd160_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len) { u32x w0[4]; u32x w1[4]; u32x w2[4]; u32x w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 64; pos1 += 64, pos4 += 16) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; ripemd160_update_vector_64 (ctx, w0, w1, w2, w3, 64); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; ripemd160_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1); } DECLSPEC void ripemd160_update_vector_swap (PRIVATE_AS ripemd160_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len) { u32x w0[4]; u32x w1[4]; u32x w2[4]; u32x w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 64; pos1 += 64, pos4 += 16) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; w0[0] = hc_swap32 (w0[0]); w0[1] = hc_swap32 (w0[1]); w0[2] = hc_swap32 (w0[2]); w0[3] = hc_swap32 (w0[3]); w1[0] = hc_swap32 (w1[0]); w1[1] = hc_swap32 (w1[1]); w1[2] = hc_swap32 (w1[2]); w1[3] = hc_swap32 (w1[3]); w2[0] = hc_swap32 (w2[0]); w2[1] = hc_swap32 (w2[1]); w2[2] = hc_swap32 (w2[2]); w2[3] = hc_swap32 (w2[3]); w3[0] = hc_swap32 (w3[0]); w3[1] = hc_swap32 (w3[1]); w3[2] = hc_swap32 (w3[2]); w3[3] = hc_swap32 (w3[3]); ripemd160_update_vector_64 (ctx, w0, w1, w2, w3, 64); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; w0[0] = hc_swap32 (w0[0]); w0[1] = hc_swap32 (w0[1]); w0[2] = hc_swap32 (w0[2]); w0[3] = hc_swap32 (w0[3]); w1[0] = hc_swap32 (w1[0]); w1[1] = hc_swap32 (w1[1]); w1[2] = hc_swap32 (w1[2]); w1[3] = hc_swap32 (w1[3]); w2[0] = hc_swap32 (w2[0]); w2[1] = hc_swap32 (w2[1]); w2[2] = hc_swap32 (w2[2]); w2[3] = hc_swap32 (w2[3]); w3[0] = hc_swap32 (w3[0]); w3[1] = hc_swap32 (w3[1]); w3[2] = hc_swap32 (w3[2]); w3[3] = hc_swap32 (w3[3]); ripemd160_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1); } DECLSPEC void ripemd160_update_vector_utf16le (PRIVATE_AS ripemd160_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len) { u32x w0[4]; u32x w1[4]; u32x w2[4]; u32x w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 32; pos1 += 32, pos4 += 8) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); ripemd160_update_vector_64 (ctx, w0, w1, w2, w3, 32 * 2); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); ripemd160_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } DECLSPEC void ripemd160_update_vector_utf16le_swap (PRIVATE_AS ripemd160_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len) { u32x w0[4]; u32x w1[4]; u32x w2[4]; u32x w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 32; pos1 += 32, pos4 += 8) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); w0[0] = hc_swap32 (w0[0]); w0[1] = hc_swap32 (w0[1]); w0[2] = hc_swap32 (w0[2]); w0[3] = hc_swap32 (w0[3]); w1[0] = hc_swap32 (w1[0]); w1[1] = hc_swap32 (w1[1]); w1[2] = hc_swap32 (w1[2]); w1[3] = hc_swap32 (w1[3]); w2[0] = hc_swap32 (w2[0]); w2[1] = hc_swap32 (w2[1]); w2[2] = hc_swap32 (w2[2]); w2[3] = hc_swap32 (w2[3]); w3[0] = hc_swap32 (w3[0]); w3[1] = hc_swap32 (w3[1]); w3[2] = hc_swap32 (w3[2]); w3[3] = hc_swap32 (w3[3]); ripemd160_update_vector_64 (ctx, w0, w1, w2, w3, 32 * 2); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); w0[0] = hc_swap32 (w0[0]); w0[1] = hc_swap32 (w0[1]); w0[2] = hc_swap32 (w0[2]); w0[3] = hc_swap32 (w0[3]); w1[0] = hc_swap32 (w1[0]); w1[1] = hc_swap32 (w1[1]); w1[2] = hc_swap32 (w1[2]); w1[3] = hc_swap32 (w1[3]); w2[0] = hc_swap32 (w2[0]); w2[1] = hc_swap32 (w2[1]); w2[2] = hc_swap32 (w2[2]); w2[3] = hc_swap32 (w2[3]); w3[0] = hc_swap32 (w3[0]); w3[1] = hc_swap32 (w3[1]); w3[2] = hc_swap32 (w3[2]); w3[3] = hc_swap32 (w3[3]); ripemd160_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } DECLSPEC void ripemd160_final_vector (PRIVATE_AS ripemd160_ctx_vector_t *ctx) { const int pos = ctx->len & 63; append_0x80_4x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos); if (pos >= 56) { ripemd160_transform_vector (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); ctx->w0[0] = 0; ctx->w0[1] = 0; ctx->w0[2] = 0; ctx->w0[3] = 0; ctx->w1[0] = 0; ctx->w1[1] = 0; ctx->w1[2] = 0; ctx->w1[3] = 0; ctx->w2[0] = 0; ctx->w2[1] = 0; ctx->w2[2] = 0; ctx->w2[3] = 0; ctx->w3[0] = 0; ctx->w3[1] = 0; ctx->w3[2] = 0; ctx->w3[3] = 0; } ctx->w3[2] = ctx->len * 8; ctx->w3[3] = 0; ripemd160_transform_vector (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); } // HMAC + Vector DECLSPEC void ripemd160_hmac_init_vector_64 (PRIVATE_AS ripemd160_hmac_ctx_vector_t *ctx, PRIVATE_AS const u32x *w0, PRIVATE_AS const u32x *w1, PRIVATE_AS const u32x *w2, PRIVATE_AS const u32x *w3) { u32x a0[4]; u32x a1[4]; u32x a2[4]; u32x a3[4]; // ipad a0[0] = w0[0] ^ 0x36363636; a0[1] = w0[1] ^ 0x36363636; a0[2] = w0[2] ^ 0x36363636; a0[3] = w0[3] ^ 0x36363636; a1[0] = w1[0] ^ 0x36363636; a1[1] = w1[1] ^ 0x36363636; a1[2] = w1[2] ^ 0x36363636; a1[3] = w1[3] ^ 0x36363636; a2[0] = w2[0] ^ 0x36363636; a2[1] = w2[1] ^ 0x36363636; a2[2] = w2[2] ^ 0x36363636; a2[3] = w2[3] ^ 0x36363636; a3[0] = w3[0] ^ 0x36363636; a3[1] = w3[1] ^ 0x36363636; a3[2] = w3[2] ^ 0x36363636; a3[3] = w3[3] ^ 0x36363636; ripemd160_init_vector (&ctx->ipad); ripemd160_update_vector_64 (&ctx->ipad, a0, a1, a2, a3, 64); // opad u32x b0[4]; u32x b1[4]; u32x b2[4]; u32x b3[4]; b0[0] = w0[0] ^ 0x5c5c5c5c; b0[1] = w0[1] ^ 0x5c5c5c5c; b0[2] = w0[2] ^ 0x5c5c5c5c; b0[3] = w0[3] ^ 0x5c5c5c5c; b1[0] = w1[0] ^ 0x5c5c5c5c; b1[1] = w1[1] ^ 0x5c5c5c5c; b1[2] = w1[2] ^ 0x5c5c5c5c; b1[3] = w1[3] ^ 0x5c5c5c5c; b2[0] = w2[0] ^ 0x5c5c5c5c; b2[1] = w2[1] ^ 0x5c5c5c5c; b2[2] = w2[2] ^ 0x5c5c5c5c; b2[3] = w2[3] ^ 0x5c5c5c5c; b3[0] = w3[0] ^ 0x5c5c5c5c; b3[1] = w3[1] ^ 0x5c5c5c5c; b3[2] = w3[2] ^ 0x5c5c5c5c; b3[3] = w3[3] ^ 0x5c5c5c5c; ripemd160_init_vector (&ctx->opad); ripemd160_update_vector_64 (&ctx->opad, b0, b1, b2, b3, 64); } DECLSPEC void ripemd160_hmac_init_vector (PRIVATE_AS ripemd160_hmac_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len) { u32x w0[4]; u32x w1[4]; u32x w2[4]; u32x w3[4]; if (len > 64) { ripemd160_ctx_vector_t tmp; ripemd160_init_vector (&tmp); ripemd160_update_vector (&tmp, w, len); ripemd160_final_vector (&tmp); w0[0] = tmp.h[0]; w0[1] = tmp.h[1]; w0[2] = tmp.h[2]; w0[3] = tmp.h[3]; w1[0] = tmp.h[4]; w1[1] = 0; w1[2] = 0; w1[3] = 0; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; } else { w0[0] = w[ 0]; w0[1] = w[ 1]; w0[2] = w[ 2]; w0[3] = w[ 3]; w1[0] = w[ 4]; w1[1] = w[ 5]; w1[2] = w[ 6]; w1[3] = w[ 7]; w2[0] = w[ 8]; w2[1] = w[ 9]; w2[2] = w[10]; w2[3] = w[11]; w3[0] = w[12]; w3[1] = w[13]; w3[2] = w[14]; w3[3] = w[15]; } ripemd160_hmac_init_vector_64 (ctx, w0, w1, w2, w3); } DECLSPEC void ripemd160_hmac_update_vector_64 (PRIVATE_AS ripemd160_hmac_ctx_vector_t *ctx, PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const int len) { ripemd160_update_vector_64 (&ctx->ipad, w0, w1, w2, w3, len); } DECLSPEC void ripemd160_hmac_update_vector (PRIVATE_AS ripemd160_hmac_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len) { ripemd160_update_vector (&ctx->ipad, w, len); } DECLSPEC void ripemd160_hmac_final_vector (PRIVATE_AS ripemd160_hmac_ctx_vector_t *ctx) { ripemd160_final_vector (&ctx->ipad); ctx->opad.w0[0] = ctx->ipad.h[0]; ctx->opad.w0[1] = ctx->ipad.h[1]; ctx->opad.w0[2] = ctx->ipad.h[2]; ctx->opad.w0[3] = ctx->ipad.h[3]; ctx->opad.w1[0] = ctx->ipad.h[4]; ctx->opad.w1[1] = 0; ctx->opad.w1[2] = 0; ctx->opad.w1[3] = 0; ctx->opad.w2[0] = 0; ctx->opad.w2[1] = 0; ctx->opad.w2[2] = 0; ctx->opad.w2[3] = 0; ctx->opad.w3[0] = 0; ctx->opad.w3[1] = 0; ctx->opad.w3[2] = 0; ctx->opad.w3[3] = 0; ctx->opad.len += 20; ripemd160_final_vector (&ctx->opad); } ================================================ FILE: src/main/resources/copyfromhashcat/inc_hash_ripemd160.h ================================================ /** * Author......: See docs/credits.txt * License.....: MIT */ #ifndef INC_HASH_RIPEMD160_H #define INC_HASH_RIPEMD160_H #define RIPEMD160_F(x,y,z) ((x) ^ (y) ^ (z)) #define RIPEMD160_G(x,y,z) ((z) ^ ((x) & ((y) ^ (z)))) /* x ? y : z */ #define RIPEMD160_H(x,y,z) (((x) | ~(y)) ^ (z)) #define RIPEMD160_I(x,y,z) ((y) ^ ((z) & ((x) ^ (y)))) /* z ? x : y */ #define RIPEMD160_J(x,y,z) ((x) ^ ((y) | ~(z))) #ifdef USE_BITSELECT #define RIPEMD160_Go(x,y,z) (bitselect ((z), (y), (x))) #define RIPEMD160_Io(x,y,z) (bitselect ((y), (x), (z))) #else #define RIPEMD160_Go(x,y,z) (RIPEMD160_G ((x), (y), (z))) #define RIPEMD160_Io(x,y,z) (RIPEMD160_I ((x), (y), (z))) #endif #define RIPEMD160_STEP_S(f,a,b,c,d,e,x,K,s) \ { \ a += K; \ a += x; \ a += f (b, c, d); \ a = hc_rotl32_S (a, s); \ a += e; \ c = hc_rotl32_S (c, 10u); \ } #define RIPEMD160_STEP(f,a,b,c,d,e,x,K,s) \ { \ a += make_u32x (K); \ a += x; \ a += f (b, c, d); \ a = hc_rotl32 (a, s); \ a += e; \ c = hc_rotl32 (c, 10u); \ } #define ROTATE_LEFT_WORKAROUND_BUG(a,n) ((a << n) | (a >> (32 - n))) #define RIPEMD160_STEP_S_WORKAROUND_BUG(f,a,b,c,d,e,x,K,s) \ { \ a += K; \ a += x; \ a += f (b, c, d); \ a = ROTATE_LEFT_WORKAROUND_BUG (a, s); \ a += e; \ c = hc_rotl32_S (c, 10u); \ } #define RIPEMD160_STEP_WORKAROUND_BUG(f,a,b,c,d,e,x,K,s) \ { \ a += make_u32x (K); \ a += x; \ a += f (b, c, d); \ a = ROTATE_LEFT_WORKAROUND_BUG (a, s); \ a += e; \ c = hc_rotl32 (c, 10u); \ } typedef struct ripemd160_ctx { u32 h[5]; u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int len; } ripemd160_ctx_t; typedef struct ripemd160_hmac_ctx { ripemd160_ctx_t ipad; ripemd160_ctx_t opad; } ripemd160_hmac_ctx_t; typedef struct ripemd160_ctx_vector { u32x h[5]; u32x w0[4]; u32x w1[4]; u32x w2[4]; u32x w3[4]; int len; } ripemd160_ctx_vector_t; typedef struct ripemd160_hmac_ctx_vector { ripemd160_ctx_vector_t ipad; ripemd160_ctx_vector_t opad; } ripemd160_hmac_ctx_vector_t; DECLSPEC void ripemd160_transform (PRIVATE_AS const u32 *w0, PRIVATE_AS const u32 *w1, PRIVATE_AS const u32 *w2, PRIVATE_AS const u32 *w3, PRIVATE_AS u32 *digest); DECLSPEC void ripemd160_init (PRIVATE_AS ripemd160_ctx_t *ctx); DECLSPEC void ripemd160_update_64 (PRIVATE_AS ripemd160_ctx_t *ctx, PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const int len); DECLSPEC void ripemd160_update (PRIVATE_AS ripemd160_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void ripemd160_update_swap (PRIVATE_AS ripemd160_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void ripemd160_update_utf16le (PRIVATE_AS ripemd160_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void ripemd160_update_utf16le_swap (PRIVATE_AS ripemd160_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void ripemd160_update_global (PRIVATE_AS ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void ripemd160_update_global_swap (PRIVATE_AS ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void ripemd160_update_global_utf16le (PRIVATE_AS ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void ripemd160_update_global_utf16le_swap (PRIVATE_AS ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void ripemd160_final (PRIVATE_AS ripemd160_ctx_t *ctx); DECLSPEC void ripemd160_hmac_init_64 (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w0, PRIVATE_AS const u32 *w1, PRIVATE_AS const u32 *w2, PRIVATE_AS const u32 *w3); DECLSPEC void ripemd160_hmac_init (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void ripemd160_hmac_init_swap (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void ripemd160_hmac_init_global (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void ripemd160_hmac_init_global_swap (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void ripemd160_hmac_update_64 (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const int len); DECLSPEC void ripemd160_hmac_update (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void ripemd160_hmac_update_swap (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void ripemd160_hmac_update_utf16le (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void ripemd160_hmac_update_utf16le_swap (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void ripemd160_hmac_update_global (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void ripemd160_hmac_update_global_swap (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void ripemd160_hmac_update_global_utf16le (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void ripemd160_hmac_update_global_utf16le_swap (PRIVATE_AS ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void ripemd160_hmac_final (PRIVATE_AS ripemd160_hmac_ctx_t *ctx); DECLSPEC void ripemd160_transform_vector (PRIVATE_AS const u32x *w0, PRIVATE_AS const u32x *w1, PRIVATE_AS const u32x *w2, PRIVATE_AS const u32x *w3, PRIVATE_AS u32x *digest); DECLSPEC void ripemd160_init_vector (PRIVATE_AS ripemd160_ctx_vector_t *ctx); DECLSPEC void ripemd160_init_vector_from_scalar (PRIVATE_AS ripemd160_ctx_vector_t *ctx, PRIVATE_AS ripemd160_ctx_t *ctx0); DECLSPEC void ripemd160_update_vector_64 (PRIVATE_AS ripemd160_ctx_vector_t *ctx, PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const int len); DECLSPEC void ripemd160_update_vector (PRIVATE_AS ripemd160_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len); DECLSPEC void ripemd160_update_vector_swap (PRIVATE_AS ripemd160_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len); DECLSPEC void ripemd160_update_vector_utf16le (PRIVATE_AS ripemd160_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len); DECLSPEC void ripemd160_update_vector_utf16le_swap (PRIVATE_AS ripemd160_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len); DECLSPEC void ripemd160_final_vector (PRIVATE_AS ripemd160_ctx_vector_t *ctx); DECLSPEC void ripemd160_hmac_init_vector_64 (PRIVATE_AS ripemd160_hmac_ctx_vector_t *ctx, PRIVATE_AS const u32x *w0, PRIVATE_AS const u32x *w1, PRIVATE_AS const u32x *w2, PRIVATE_AS const u32x *w3); DECLSPEC void ripemd160_hmac_init_vector (PRIVATE_AS ripemd160_hmac_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len); DECLSPEC void ripemd160_hmac_update_vector_64 (PRIVATE_AS ripemd160_hmac_ctx_vector_t *ctx, PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const int len); DECLSPEC void ripemd160_hmac_update_vector (PRIVATE_AS ripemd160_hmac_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len); DECLSPEC void ripemd160_hmac_final_vector (PRIVATE_AS ripemd160_hmac_ctx_vector_t *ctx); #endif // INC_HASH_RIPEMD160_H ================================================ FILE: src/main/resources/copyfromhashcat/inc_hash_sha256.cl ================================================ /** * Author......: See docs/credits.txt * License.....: MIT */ #include "inc_vendor.h" #include "inc_types.h" #include "inc_platform.h" #include "inc_common.h" #include "inc_hash_sha256.h" CONSTANT_VK u32a k_sha256[64] = { SHA256C00, SHA256C01, SHA256C02, SHA256C03, SHA256C04, SHA256C05, SHA256C06, SHA256C07, SHA256C08, SHA256C09, SHA256C0a, SHA256C0b, SHA256C0c, SHA256C0d, SHA256C0e, SHA256C0f, SHA256C10, SHA256C11, SHA256C12, SHA256C13, SHA256C14, SHA256C15, SHA256C16, SHA256C17, SHA256C18, SHA256C19, SHA256C1a, SHA256C1b, SHA256C1c, SHA256C1d, SHA256C1e, SHA256C1f, SHA256C20, SHA256C21, SHA256C22, SHA256C23, SHA256C24, SHA256C25, SHA256C26, SHA256C27, SHA256C28, SHA256C29, SHA256C2a, SHA256C2b, SHA256C2c, SHA256C2d, SHA256C2e, SHA256C2f, SHA256C30, SHA256C31, SHA256C32, SHA256C33, SHA256C34, SHA256C35, SHA256C36, SHA256C37, SHA256C38, SHA256C39, SHA256C3a, SHA256C3b, SHA256C3c, SHA256C3d, SHA256C3e, SHA256C3f, }; // important notes on this: // input buf unused bytes needs to be set to zero // input buf needs to be in algorithm native byte order (md5 = LE, sha256 = BE, etc) // input buf needs to be 64 byte aligned when using sha256_update() DECLSPEC void sha256_transform (PRIVATE_AS const u32 *w0, PRIVATE_AS const u32 *w1, PRIVATE_AS const u32 *w2, PRIVATE_AS const u32 *w3, PRIVATE_AS u32 *digest) { u32 a = digest[0]; u32 b = digest[1]; u32 c = digest[2]; u32 d = digest[3]; u32 e = digest[4]; u32 f = digest[5]; u32 g = digest[6]; u32 h = digest[7]; u32 w0_t = w0[0]; u32 w1_t = w0[1]; u32 w2_t = w0[2]; u32 w3_t = w0[3]; u32 w4_t = w1[0]; u32 w5_t = w1[1]; u32 w6_t = w1[2]; u32 w7_t = w1[3]; u32 w8_t = w2[0]; u32 w9_t = w2[1]; u32 wa_t = w2[2]; u32 wb_t = w2[3]; u32 wc_t = w3[0]; u32 wd_t = w3[1]; u32 we_t = w3[2]; u32 wf_t = w3[3]; #define ROUND_EXPAND_S() \ { \ w0_t = SHA256_EXPAND_S (we_t, w9_t, w1_t, w0_t); \ w1_t = SHA256_EXPAND_S (wf_t, wa_t, w2_t, w1_t); \ w2_t = SHA256_EXPAND_S (w0_t, wb_t, w3_t, w2_t); \ w3_t = SHA256_EXPAND_S (w1_t, wc_t, w4_t, w3_t); \ w4_t = SHA256_EXPAND_S (w2_t, wd_t, w5_t, w4_t); \ w5_t = SHA256_EXPAND_S (w3_t, we_t, w6_t, w5_t); \ w6_t = SHA256_EXPAND_S (w4_t, wf_t, w7_t, w6_t); \ w7_t = SHA256_EXPAND_S (w5_t, w0_t, w8_t, w7_t); \ w8_t = SHA256_EXPAND_S (w6_t, w1_t, w9_t, w8_t); \ w9_t = SHA256_EXPAND_S (w7_t, w2_t, wa_t, w9_t); \ wa_t = SHA256_EXPAND_S (w8_t, w3_t, wb_t, wa_t); \ wb_t = SHA256_EXPAND_S (w9_t, w4_t, wc_t, wb_t); \ wc_t = SHA256_EXPAND_S (wa_t, w5_t, wd_t, wc_t); \ wd_t = SHA256_EXPAND_S (wb_t, w6_t, we_t, wd_t); \ we_t = SHA256_EXPAND_S (wc_t, w7_t, wf_t, we_t); \ wf_t = SHA256_EXPAND_S (wd_t, w8_t, w0_t, wf_t); \ } #define ROUND_STEP_S(i) \ { \ SHA256_STEP_S (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, k_sha256[i + 0]); \ SHA256_STEP_S (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, k_sha256[i + 1]); \ SHA256_STEP_S (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, k_sha256[i + 2]); \ SHA256_STEP_S (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, k_sha256[i + 3]); \ SHA256_STEP_S (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, k_sha256[i + 4]); \ SHA256_STEP_S (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, k_sha256[i + 5]); \ SHA256_STEP_S (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, k_sha256[i + 6]); \ SHA256_STEP_S (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, k_sha256[i + 7]); \ SHA256_STEP_S (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, k_sha256[i + 8]); \ SHA256_STEP_S (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, k_sha256[i + 9]); \ SHA256_STEP_S (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, k_sha256[i + 10]); \ SHA256_STEP_S (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, k_sha256[i + 11]); \ SHA256_STEP_S (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, k_sha256[i + 12]); \ SHA256_STEP_S (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, k_sha256[i + 13]); \ SHA256_STEP_S (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, k_sha256[i + 14]); \ SHA256_STEP_S (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, k_sha256[i + 15]); \ } ROUND_STEP_S (0); #ifdef _unroll #pragma unroll #endif for (int i = 16; i < 64; i += 16) { ROUND_EXPAND_S (); ROUND_STEP_S (i); } #undef ROUND_EXPAND_S #undef ROUND_STEP_S digest[0] += a; digest[1] += b; digest[2] += c; digest[3] += d; digest[4] += e; digest[5] += f; digest[6] += g; digest[7] += h; } DECLSPEC void sha256_init (PRIVATE_AS sha256_ctx_t *ctx) { ctx->h[0] = SHA256M_A; ctx->h[1] = SHA256M_B; ctx->h[2] = SHA256M_C; ctx->h[3] = SHA256M_D; ctx->h[4] = SHA256M_E; ctx->h[5] = SHA256M_F; ctx->h[6] = SHA256M_G; ctx->h[7] = SHA256M_H; ctx->w0[0] = 0; ctx->w0[1] = 0; ctx->w0[2] = 0; ctx->w0[3] = 0; ctx->w1[0] = 0; ctx->w1[1] = 0; ctx->w1[2] = 0; ctx->w1[3] = 0; ctx->w2[0] = 0; ctx->w2[1] = 0; ctx->w2[2] = 0; ctx->w2[3] = 0; ctx->w3[0] = 0; ctx->w3[1] = 0; ctx->w3[2] = 0; ctx->w3[3] = 0; ctx->len = 0; } DECLSPEC void sha256_update_64 (PRIVATE_AS sha256_ctx_t *ctx, PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const int len) { if (len == 0) return; const int pos = ctx->len & 63; ctx->len += len; if (pos == 0) { ctx->w0[0] = w0[0]; ctx->w0[1] = w0[1]; ctx->w0[2] = w0[2]; ctx->w0[3] = w0[3]; ctx->w1[0] = w1[0]; ctx->w1[1] = w1[1]; ctx->w1[2] = w1[2]; ctx->w1[3] = w1[3]; ctx->w2[0] = w2[0]; ctx->w2[1] = w2[1]; ctx->w2[2] = w2[2]; ctx->w2[3] = w2[3]; ctx->w3[0] = w3[0]; ctx->w3[1] = w3[1]; ctx->w3[2] = w3[2]; ctx->w3[3] = w3[3]; if (len == 64) { sha256_transform (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); ctx->w0[0] = 0; ctx->w0[1] = 0; ctx->w0[2] = 0; ctx->w0[3] = 0; ctx->w1[0] = 0; ctx->w1[1] = 0; ctx->w1[2] = 0; ctx->w1[3] = 0; ctx->w2[0] = 0; ctx->w2[1] = 0; ctx->w2[2] = 0; ctx->w2[3] = 0; ctx->w3[0] = 0; ctx->w3[1] = 0; ctx->w3[2] = 0; ctx->w3[3] = 0; } } else { if ((pos + len) < 64) { switch_buffer_by_offset_be_S (w0, w1, w2, w3, pos); ctx->w0[0] |= w0[0]; ctx->w0[1] |= w0[1]; ctx->w0[2] |= w0[2]; ctx->w0[3] |= w0[3]; ctx->w1[0] |= w1[0]; ctx->w1[1] |= w1[1]; ctx->w1[2] |= w1[2]; ctx->w1[3] |= w1[3]; ctx->w2[0] |= w2[0]; ctx->w2[1] |= w2[1]; ctx->w2[2] |= w2[2]; ctx->w2[3] |= w2[3]; ctx->w3[0] |= w3[0]; ctx->w3[1] |= w3[1]; ctx->w3[2] |= w3[2]; ctx->w3[3] |= w3[3]; } else { u32 c0[4] = { 0 }; u32 c1[4] = { 0 }; u32 c2[4] = { 0 }; u32 c3[4] = { 0 }; switch_buffer_by_offset_carry_be_S (w0, w1, w2, w3, c0, c1, c2, c3, pos); ctx->w0[0] |= w0[0]; ctx->w0[1] |= w0[1]; ctx->w0[2] |= w0[2]; ctx->w0[3] |= w0[3]; ctx->w1[0] |= w1[0]; ctx->w1[1] |= w1[1]; ctx->w1[2] |= w1[2]; ctx->w1[3] |= w1[3]; ctx->w2[0] |= w2[0]; ctx->w2[1] |= w2[1]; ctx->w2[2] |= w2[2]; ctx->w2[3] |= w2[3]; ctx->w3[0] |= w3[0]; ctx->w3[1] |= w3[1]; ctx->w3[2] |= w3[2]; ctx->w3[3] |= w3[3]; sha256_transform (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); ctx->w0[0] = c0[0]; ctx->w0[1] = c0[1]; ctx->w0[2] = c0[2]; ctx->w0[3] = c0[3]; ctx->w1[0] = c1[0]; ctx->w1[1] = c1[1]; ctx->w1[2] = c1[2]; ctx->w1[3] = c1[3]; ctx->w2[0] = c2[0]; ctx->w2[1] = c2[1]; ctx->w2[2] = c2[2]; ctx->w2[3] = c2[3]; ctx->w3[0] = c3[0]; ctx->w3[1] = c3[1]; ctx->w3[2] = c3[2]; ctx->w3[3] = c3[3]; } } } DECLSPEC void sha256_update (PRIVATE_AS sha256_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 64; pos1 += 64, pos4 += 16) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; sha256_update_64 (ctx, w0, w1, w2, w3, 64); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; sha256_update_64 (ctx, w0, w1, w2, w3, len - pos1); } DECLSPEC void sha256_update_swap (PRIVATE_AS sha256_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 64; pos1 += 64, pos4 += 16) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; w0[0] = hc_swap32_S (w0[0]); w0[1] = hc_swap32_S (w0[1]); w0[2] = hc_swap32_S (w0[2]); w0[3] = hc_swap32_S (w0[3]); w1[0] = hc_swap32_S (w1[0]); w1[1] = hc_swap32_S (w1[1]); w1[2] = hc_swap32_S (w1[2]); w1[3] = hc_swap32_S (w1[3]); w2[0] = hc_swap32_S (w2[0]); w2[1] = hc_swap32_S (w2[1]); w2[2] = hc_swap32_S (w2[2]); w2[3] = hc_swap32_S (w2[3]); w3[0] = hc_swap32_S (w3[0]); w3[1] = hc_swap32_S (w3[1]); w3[2] = hc_swap32_S (w3[2]); w3[3] = hc_swap32_S (w3[3]); sha256_update_64 (ctx, w0, w1, w2, w3, 64); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; w0[0] = hc_swap32_S (w0[0]); w0[1] = hc_swap32_S (w0[1]); w0[2] = hc_swap32_S (w0[2]); w0[3] = hc_swap32_S (w0[3]); w1[0] = hc_swap32_S (w1[0]); w1[1] = hc_swap32_S (w1[1]); w1[2] = hc_swap32_S (w1[2]); w1[3] = hc_swap32_S (w1[3]); w2[0] = hc_swap32_S (w2[0]); w2[1] = hc_swap32_S (w2[1]); w2[2] = hc_swap32_S (w2[2]); w2[3] = hc_swap32_S (w2[3]); w3[0] = hc_swap32_S (w3[0]); w3[1] = hc_swap32_S (w3[1]); w3[2] = hc_swap32_S (w3[2]); w3[3] = hc_swap32_S (w3[3]); sha256_update_64 (ctx, w0, w1, w2, w3, len - pos1); } DECLSPEC void sha256_update_utf16le (PRIVATE_AS sha256_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { if (hc_enc_scan (w, len)) { hc_enc_t hc_enc; hc_enc_init (&hc_enc); while (hc_enc_has_next (&hc_enc, len)) { u32 enc_buf[16] = { 0 }; const int enc_len = hc_enc_next (&hc_enc, w, len, 256, enc_buf, sizeof (enc_buf)); if (enc_len == -1) { ctx->len = -1; return; } sha256_update_64 (ctx, enc_buf + 0, enc_buf + 4, enc_buf + 8, enc_buf + 12, enc_len); } return; } u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 32; pos1 += 32, pos4 += 8) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le_S (w1, w2, w3); make_utf16le_S (w0, w0, w1); sha256_update_64 (ctx, w0, w1, w2, w3, 32 * 2); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le_S (w1, w2, w3); make_utf16le_S (w0, w0, w1); sha256_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } DECLSPEC void sha256_update_utf16le_swap (PRIVATE_AS sha256_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { if (hc_enc_scan (w, len)) { hc_enc_t hc_enc; hc_enc_init (&hc_enc); while (hc_enc_has_next (&hc_enc, len)) { u32 enc_buf[16] = { 0 }; const int enc_len = hc_enc_next (&hc_enc, w, len, 256, enc_buf, sizeof (enc_buf)); if (enc_len == -1) { ctx->len = -1; return; } enc_buf[ 0] = hc_swap32_S (enc_buf[ 0]); enc_buf[ 1] = hc_swap32_S (enc_buf[ 1]); enc_buf[ 2] = hc_swap32_S (enc_buf[ 2]); enc_buf[ 3] = hc_swap32_S (enc_buf[ 3]); enc_buf[ 4] = hc_swap32_S (enc_buf[ 4]); enc_buf[ 5] = hc_swap32_S (enc_buf[ 5]); enc_buf[ 6] = hc_swap32_S (enc_buf[ 6]); enc_buf[ 7] = hc_swap32_S (enc_buf[ 7]); enc_buf[ 8] = hc_swap32_S (enc_buf[ 8]); enc_buf[ 9] = hc_swap32_S (enc_buf[ 9]); enc_buf[10] = hc_swap32_S (enc_buf[10]); enc_buf[11] = hc_swap32_S (enc_buf[11]); enc_buf[12] = hc_swap32_S (enc_buf[12]); enc_buf[13] = hc_swap32_S (enc_buf[13]); enc_buf[14] = hc_swap32_S (enc_buf[14]); enc_buf[15] = hc_swap32_S (enc_buf[15]); sha256_update_64 (ctx, enc_buf + 0, enc_buf + 4, enc_buf + 8, enc_buf + 12, enc_len); } return; } u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 32; pos1 += 32, pos4 += 8) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le_S (w1, w2, w3); make_utf16le_S (w0, w0, w1); w0[0] = hc_swap32_S (w0[0]); w0[1] = hc_swap32_S (w0[1]); w0[2] = hc_swap32_S (w0[2]); w0[3] = hc_swap32_S (w0[3]); w1[0] = hc_swap32_S (w1[0]); w1[1] = hc_swap32_S (w1[1]); w1[2] = hc_swap32_S (w1[2]); w1[3] = hc_swap32_S (w1[3]); w2[0] = hc_swap32_S (w2[0]); w2[1] = hc_swap32_S (w2[1]); w2[2] = hc_swap32_S (w2[2]); w2[3] = hc_swap32_S (w2[3]); w3[0] = hc_swap32_S (w3[0]); w3[1] = hc_swap32_S (w3[1]); w3[2] = hc_swap32_S (w3[2]); w3[3] = hc_swap32_S (w3[3]); sha256_update_64 (ctx, w0, w1, w2, w3, 32 * 2); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le_S (w1, w2, w3); make_utf16le_S (w0, w0, w1); w0[0] = hc_swap32_S (w0[0]); w0[1] = hc_swap32_S (w0[1]); w0[2] = hc_swap32_S (w0[2]); w0[3] = hc_swap32_S (w0[3]); w1[0] = hc_swap32_S (w1[0]); w1[1] = hc_swap32_S (w1[1]); w1[2] = hc_swap32_S (w1[2]); w1[3] = hc_swap32_S (w1[3]); w2[0] = hc_swap32_S (w2[0]); w2[1] = hc_swap32_S (w2[1]); w2[2] = hc_swap32_S (w2[2]); w2[3] = hc_swap32_S (w2[3]); w3[0] = hc_swap32_S (w3[0]); w3[1] = hc_swap32_S (w3[1]); w3[2] = hc_swap32_S (w3[2]); w3[3] = hc_swap32_S (w3[3]); sha256_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } DECLSPEC void sha256_update_global (PRIVATE_AS sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 64; pos1 += 64, pos4 += 16) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; sha256_update_64 (ctx, w0, w1, w2, w3, 64); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; sha256_update_64 (ctx, w0, w1, w2, w3, len - pos1); } DECLSPEC void sha256_update_global_swap (PRIVATE_AS sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 64; pos1 += 64, pos4 += 16) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; w0[0] = hc_swap32_S (w0[0]); w0[1] = hc_swap32_S (w0[1]); w0[2] = hc_swap32_S (w0[2]); w0[3] = hc_swap32_S (w0[3]); w1[0] = hc_swap32_S (w1[0]); w1[1] = hc_swap32_S (w1[1]); w1[2] = hc_swap32_S (w1[2]); w1[3] = hc_swap32_S (w1[3]); w2[0] = hc_swap32_S (w2[0]); w2[1] = hc_swap32_S (w2[1]); w2[2] = hc_swap32_S (w2[2]); w2[3] = hc_swap32_S (w2[3]); w3[0] = hc_swap32_S (w3[0]); w3[1] = hc_swap32_S (w3[1]); w3[2] = hc_swap32_S (w3[2]); w3[3] = hc_swap32_S (w3[3]); sha256_update_64 (ctx, w0, w1, w2, w3, 64); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; w0[0] = hc_swap32_S (w0[0]); w0[1] = hc_swap32_S (w0[1]); w0[2] = hc_swap32_S (w0[2]); w0[3] = hc_swap32_S (w0[3]); w1[0] = hc_swap32_S (w1[0]); w1[1] = hc_swap32_S (w1[1]); w1[2] = hc_swap32_S (w1[2]); w1[3] = hc_swap32_S (w1[3]); w2[0] = hc_swap32_S (w2[0]); w2[1] = hc_swap32_S (w2[1]); w2[2] = hc_swap32_S (w2[2]); w2[3] = hc_swap32_S (w2[3]); w3[0] = hc_swap32_S (w3[0]); w3[1] = hc_swap32_S (w3[1]); w3[2] = hc_swap32_S (w3[2]); w3[3] = hc_swap32_S (w3[3]); sha256_update_64 (ctx, w0, w1, w2, w3, len - pos1); } DECLSPEC void sha256_update_global_utf16le (PRIVATE_AS sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { if (hc_enc_scan_global (w, len)) { hc_enc_t hc_enc; hc_enc_init (&hc_enc); while (hc_enc_has_next (&hc_enc, len)) { u32 enc_buf[16] = { 0 }; const int enc_len = hc_enc_next_global (&hc_enc, w, len, 256, enc_buf, sizeof (enc_buf)); if (enc_len == -1) { ctx->len = -1; return; } sha256_update_64 (ctx, enc_buf + 0, enc_buf + 4, enc_buf + 8, enc_buf + 12, enc_len); } return; } u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 32; pos1 += 32, pos4 += 8) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le_S (w1, w2, w3); make_utf16le_S (w0, w0, w1); sha256_update_64 (ctx, w0, w1, w2, w3, 32 * 2); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le_S (w1, w2, w3); make_utf16le_S (w0, w0, w1); sha256_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } DECLSPEC void sha256_update_global_utf16le_swap (PRIVATE_AS sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { if (hc_enc_scan_global (w, len)) { hc_enc_t hc_enc; hc_enc_init (&hc_enc); while (hc_enc_has_next (&hc_enc, len)) { u32 enc_buf[16] = { 0 }; const int enc_len = hc_enc_next_global (&hc_enc, w, len, 256, enc_buf, sizeof (enc_buf)); if (enc_len == -1) { ctx->len = -1; return; } enc_buf[ 0] = hc_swap32_S (enc_buf[ 0]); enc_buf[ 1] = hc_swap32_S (enc_buf[ 1]); enc_buf[ 2] = hc_swap32_S (enc_buf[ 2]); enc_buf[ 3] = hc_swap32_S (enc_buf[ 3]); enc_buf[ 4] = hc_swap32_S (enc_buf[ 4]); enc_buf[ 5] = hc_swap32_S (enc_buf[ 5]); enc_buf[ 6] = hc_swap32_S (enc_buf[ 6]); enc_buf[ 7] = hc_swap32_S (enc_buf[ 7]); enc_buf[ 8] = hc_swap32_S (enc_buf[ 8]); enc_buf[ 9] = hc_swap32_S (enc_buf[ 9]); enc_buf[10] = hc_swap32_S (enc_buf[10]); enc_buf[11] = hc_swap32_S (enc_buf[11]); enc_buf[12] = hc_swap32_S (enc_buf[12]); enc_buf[13] = hc_swap32_S (enc_buf[13]); enc_buf[14] = hc_swap32_S (enc_buf[14]); enc_buf[15] = hc_swap32_S (enc_buf[15]); sha256_update_64 (ctx, enc_buf + 0, enc_buf + 4, enc_buf + 8, enc_buf + 12, enc_len); } return; } u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 32; pos1 += 32, pos4 += 8) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le_S (w1, w2, w3); make_utf16le_S (w0, w0, w1); w0[0] = hc_swap32_S (w0[0]); w0[1] = hc_swap32_S (w0[1]); w0[2] = hc_swap32_S (w0[2]); w0[3] = hc_swap32_S (w0[3]); w1[0] = hc_swap32_S (w1[0]); w1[1] = hc_swap32_S (w1[1]); w1[2] = hc_swap32_S (w1[2]); w1[3] = hc_swap32_S (w1[3]); w2[0] = hc_swap32_S (w2[0]); w2[1] = hc_swap32_S (w2[1]); w2[2] = hc_swap32_S (w2[2]); w2[3] = hc_swap32_S (w2[3]); w3[0] = hc_swap32_S (w3[0]); w3[1] = hc_swap32_S (w3[1]); w3[2] = hc_swap32_S (w3[2]); w3[3] = hc_swap32_S (w3[3]); sha256_update_64 (ctx, w0, w1, w2, w3, 32 * 2); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le_S (w1, w2, w3); make_utf16le_S (w0, w0, w1); w0[0] = hc_swap32_S (w0[0]); w0[1] = hc_swap32_S (w0[1]); w0[2] = hc_swap32_S (w0[2]); w0[3] = hc_swap32_S (w0[3]); w1[0] = hc_swap32_S (w1[0]); w1[1] = hc_swap32_S (w1[1]); w1[2] = hc_swap32_S (w1[2]); w1[3] = hc_swap32_S (w1[3]); w2[0] = hc_swap32_S (w2[0]); w2[1] = hc_swap32_S (w2[1]); w2[2] = hc_swap32_S (w2[2]); w2[3] = hc_swap32_S (w2[3]); w3[0] = hc_swap32_S (w3[0]); w3[1] = hc_swap32_S (w3[1]); w3[2] = hc_swap32_S (w3[2]); w3[3] = hc_swap32_S (w3[3]); sha256_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } DECLSPEC void sha256_final (PRIVATE_AS sha256_ctx_t *ctx) { const int pos = ctx->len & 63; append_0x80_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3); if (pos >= 56) { sha256_transform (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); ctx->w0[0] = 0; ctx->w0[1] = 0; ctx->w0[2] = 0; ctx->w0[3] = 0; ctx->w1[0] = 0; ctx->w1[1] = 0; ctx->w1[2] = 0; ctx->w1[3] = 0; ctx->w2[0] = 0; ctx->w2[1] = 0; ctx->w2[2] = 0; ctx->w2[3] = 0; ctx->w3[0] = 0; ctx->w3[1] = 0; ctx->w3[2] = 0; ctx->w3[3] = 0; } ctx->w3[2] = 0; ctx->w3[3] = ctx->len * 8; sha256_transform (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); } // sha256_hmac DECLSPEC void sha256_hmac_init_64 (PRIVATE_AS sha256_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w0, PRIVATE_AS const u32 *w1, PRIVATE_AS const u32 *w2, PRIVATE_AS const u32 *w3) { u32 a0[4]; u32 a1[4]; u32 a2[4]; u32 a3[4]; // ipad a0[0] = w0[0] ^ 0x36363636; a0[1] = w0[1] ^ 0x36363636; a0[2] = w0[2] ^ 0x36363636; a0[3] = w0[3] ^ 0x36363636; a1[0] = w1[0] ^ 0x36363636; a1[1] = w1[1] ^ 0x36363636; a1[2] = w1[2] ^ 0x36363636; a1[3] = w1[3] ^ 0x36363636; a2[0] = w2[0] ^ 0x36363636; a2[1] = w2[1] ^ 0x36363636; a2[2] = w2[2] ^ 0x36363636; a2[3] = w2[3] ^ 0x36363636; a3[0] = w3[0] ^ 0x36363636; a3[1] = w3[1] ^ 0x36363636; a3[2] = w3[2] ^ 0x36363636; a3[3] = w3[3] ^ 0x36363636; sha256_init (&ctx->ipad); sha256_update_64 (&ctx->ipad, a0, a1, a2, a3, 64); // opad u32 b0[4]; u32 b1[4]; u32 b2[4]; u32 b3[4]; b0[0] = w0[0] ^ 0x5c5c5c5c; b0[1] = w0[1] ^ 0x5c5c5c5c; b0[2] = w0[2] ^ 0x5c5c5c5c; b0[3] = w0[3] ^ 0x5c5c5c5c; b1[0] = w1[0] ^ 0x5c5c5c5c; b1[1] = w1[1] ^ 0x5c5c5c5c; b1[2] = w1[2] ^ 0x5c5c5c5c; b1[3] = w1[3] ^ 0x5c5c5c5c; b2[0] = w2[0] ^ 0x5c5c5c5c; b2[1] = w2[1] ^ 0x5c5c5c5c; b2[2] = w2[2] ^ 0x5c5c5c5c; b2[3] = w2[3] ^ 0x5c5c5c5c; b3[0] = w3[0] ^ 0x5c5c5c5c; b3[1] = w3[1] ^ 0x5c5c5c5c; b3[2] = w3[2] ^ 0x5c5c5c5c; b3[3] = w3[3] ^ 0x5c5c5c5c; sha256_init (&ctx->opad); sha256_update_64 (&ctx->opad, b0, b1, b2, b3, 64); } DECLSPEC void sha256_hmac_init (PRIVATE_AS sha256_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; if (len > 64) { sha256_ctx_t tmp; sha256_init (&tmp); sha256_update (&tmp, w, len); sha256_final (&tmp); w0[0] = tmp.h[0]; w0[1] = tmp.h[1]; w0[2] = tmp.h[2]; w0[3] = tmp.h[3]; w1[0] = tmp.h[4]; w1[1] = tmp.h[5]; w1[2] = tmp.h[6]; w1[3] = tmp.h[7]; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; } else { w0[0] = w[ 0]; w0[1] = w[ 1]; w0[2] = w[ 2]; w0[3] = w[ 3]; w1[0] = w[ 4]; w1[1] = w[ 5]; w1[2] = w[ 6]; w1[3] = w[ 7]; w2[0] = w[ 8]; w2[1] = w[ 9]; w2[2] = w[10]; w2[3] = w[11]; w3[0] = w[12]; w3[1] = w[13]; w3[2] = w[14]; w3[3] = w[15]; } sha256_hmac_init_64 (ctx, w0, w1, w2, w3); } DECLSPEC void sha256_hmac_init_swap (PRIVATE_AS sha256_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; if (len > 64) { sha256_ctx_t tmp; sha256_init (&tmp); sha256_update_swap (&tmp, w, len); sha256_final (&tmp); w0[0] = tmp.h[0]; w0[1] = tmp.h[1]; w0[2] = tmp.h[2]; w0[3] = tmp.h[3]; w1[0] = tmp.h[4]; w1[1] = tmp.h[5]; w1[2] = tmp.h[6]; w1[3] = tmp.h[7]; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; } else { w0[0] = hc_swap32_S (w[ 0]); w0[1] = hc_swap32_S (w[ 1]); w0[2] = hc_swap32_S (w[ 2]); w0[3] = hc_swap32_S (w[ 3]); w1[0] = hc_swap32_S (w[ 4]); w1[1] = hc_swap32_S (w[ 5]); w1[2] = hc_swap32_S (w[ 6]); w1[3] = hc_swap32_S (w[ 7]); w2[0] = hc_swap32_S (w[ 8]); w2[1] = hc_swap32_S (w[ 9]); w2[2] = hc_swap32_S (w[10]); w2[3] = hc_swap32_S (w[11]); w3[0] = hc_swap32_S (w[12]); w3[1] = hc_swap32_S (w[13]); w3[2] = hc_swap32_S (w[14]); w3[3] = hc_swap32_S (w[15]); } sha256_hmac_init_64 (ctx, w0, w1, w2, w3); } DECLSPEC void sha256_hmac_init_global (PRIVATE_AS sha256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; if (len > 64) { sha256_ctx_t tmp; sha256_init (&tmp); sha256_update_global (&tmp, w, len); sha256_final (&tmp); w0[0] = tmp.h[0]; w0[1] = tmp.h[1]; w0[2] = tmp.h[2]; w0[3] = tmp.h[3]; w1[0] = tmp.h[4]; w1[1] = tmp.h[5]; w1[2] = tmp.h[6]; w1[3] = tmp.h[7]; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; } else { w0[0] = w[ 0]; w0[1] = w[ 1]; w0[2] = w[ 2]; w0[3] = w[ 3]; w1[0] = w[ 4]; w1[1] = w[ 5]; w1[2] = w[ 6]; w1[3] = w[ 7]; w2[0] = w[ 8]; w2[1] = w[ 9]; w2[2] = w[10]; w2[3] = w[11]; w3[0] = w[12]; w3[1] = w[13]; w3[2] = w[14]; w3[3] = w[15]; } sha256_hmac_init_64 (ctx, w0, w1, w2, w3); } DECLSPEC void sha256_hmac_init_global_swap (PRIVATE_AS sha256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; if (len > 64) { sha256_ctx_t tmp; sha256_init (&tmp); sha256_update_global_swap (&tmp, w, len); sha256_final (&tmp); w0[0] = tmp.h[0]; w0[1] = tmp.h[1]; w0[2] = tmp.h[2]; w0[3] = tmp.h[3]; w1[0] = tmp.h[4]; w1[1] = tmp.h[5]; w1[2] = tmp.h[6]; w1[3] = tmp.h[7]; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; } else { w0[0] = hc_swap32_S (w[ 0]); w0[1] = hc_swap32_S (w[ 1]); w0[2] = hc_swap32_S (w[ 2]); w0[3] = hc_swap32_S (w[ 3]); w1[0] = hc_swap32_S (w[ 4]); w1[1] = hc_swap32_S (w[ 5]); w1[2] = hc_swap32_S (w[ 6]); w1[3] = hc_swap32_S (w[ 7]); w2[0] = hc_swap32_S (w[ 8]); w2[1] = hc_swap32_S (w[ 9]); w2[2] = hc_swap32_S (w[10]); w2[3] = hc_swap32_S (w[11]); w3[0] = hc_swap32_S (w[12]); w3[1] = hc_swap32_S (w[13]); w3[2] = hc_swap32_S (w[14]); w3[3] = hc_swap32_S (w[15]); } sha256_hmac_init_64 (ctx, w0, w1, w2, w3); } DECLSPEC void sha256_hmac_update_64 (PRIVATE_AS sha256_hmac_ctx_t *ctx, PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const int len) { sha256_update_64 (&ctx->ipad, w0, w1, w2, w3, len); } DECLSPEC void sha256_hmac_update (PRIVATE_AS sha256_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { sha256_update (&ctx->ipad, w, len); } DECLSPEC void sha256_hmac_update_swap (PRIVATE_AS sha256_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { sha256_update_swap (&ctx->ipad, w, len); } DECLSPEC void sha256_hmac_update_utf16le (PRIVATE_AS sha256_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { sha256_update_utf16le (&ctx->ipad, w, len); } DECLSPEC void sha256_hmac_update_utf16le_swap (PRIVATE_AS sha256_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { sha256_update_utf16le_swap (&ctx->ipad, w, len); } DECLSPEC void sha256_hmac_update_global (PRIVATE_AS sha256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { sha256_update_global (&ctx->ipad, w, len); } DECLSPEC void sha256_hmac_update_global_swap (PRIVATE_AS sha256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { sha256_update_global_swap (&ctx->ipad, w, len); } DECLSPEC void sha256_hmac_update_global_utf16le (PRIVATE_AS sha256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { sha256_update_global_utf16le (&ctx->ipad, w, len); } DECLSPEC void sha256_hmac_update_global_utf16le_swap (PRIVATE_AS sha256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { sha256_update_global_utf16le_swap (&ctx->ipad, w, len); } DECLSPEC void sha256_hmac_final (PRIVATE_AS sha256_hmac_ctx_t *ctx) { sha256_final (&ctx->ipad); ctx->opad.w0[0] = ctx->ipad.h[0]; ctx->opad.w0[1] = ctx->ipad.h[1]; ctx->opad.w0[2] = ctx->ipad.h[2]; ctx->opad.w0[3] = ctx->ipad.h[3]; ctx->opad.w1[0] = ctx->ipad.h[4]; ctx->opad.w1[1] = ctx->ipad.h[5]; ctx->opad.w1[2] = ctx->ipad.h[6]; ctx->opad.w1[3] = ctx->ipad.h[7]; ctx->opad.w2[0] = 0; ctx->opad.w2[1] = 0; ctx->opad.w2[2] = 0; ctx->opad.w2[3] = 0; ctx->opad.w3[0] = 0; ctx->opad.w3[1] = 0; ctx->opad.w3[2] = 0; ctx->opad.w3[3] = 0; ctx->opad.len += 32; sha256_final (&ctx->opad); } // while input buf can be a vector datatype, the length of the different elements can not DECLSPEC void sha256_transform_vector (PRIVATE_AS const u32x *w0, PRIVATE_AS const u32x *w1, PRIVATE_AS const u32x *w2, PRIVATE_AS const u32x *w3, PRIVATE_AS u32x *digest) { u32x a = digest[0]; u32x b = digest[1]; u32x c = digest[2]; u32x d = digest[3]; u32x e = digest[4]; u32x f = digest[5]; u32x g = digest[6]; u32x h = digest[7]; u32x w0_t = w0[0]; u32x w1_t = w0[1]; u32x w2_t = w0[2]; u32x w3_t = w0[3]; u32x w4_t = w1[0]; u32x w5_t = w1[1]; u32x w6_t = w1[2]; u32x w7_t = w1[3]; u32x w8_t = w2[0]; u32x w9_t = w2[1]; u32x wa_t = w2[2]; u32x wb_t = w2[3]; u32x wc_t = w3[0]; u32x wd_t = w3[1]; u32x we_t = w3[2]; u32x wf_t = w3[3]; #define ROUND_EXPAND() \ { \ w0_t = SHA256_EXPAND (we_t, w9_t, w1_t, w0_t); \ w1_t = SHA256_EXPAND (wf_t, wa_t, w2_t, w1_t); \ w2_t = SHA256_EXPAND (w0_t, wb_t, w3_t, w2_t); \ w3_t = SHA256_EXPAND (w1_t, wc_t, w4_t, w3_t); \ w4_t = SHA256_EXPAND (w2_t, wd_t, w5_t, w4_t); \ w5_t = SHA256_EXPAND (w3_t, we_t, w6_t, w5_t); \ w6_t = SHA256_EXPAND (w4_t, wf_t, w7_t, w6_t); \ w7_t = SHA256_EXPAND (w5_t, w0_t, w8_t, w7_t); \ w8_t = SHA256_EXPAND (w6_t, w1_t, w9_t, w8_t); \ w9_t = SHA256_EXPAND (w7_t, w2_t, wa_t, w9_t); \ wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); \ wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); \ wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); \ wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); \ we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); \ wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); \ } #define ROUND_STEP(i) \ { \ SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, k_sha256[i + 0]); \ SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, k_sha256[i + 1]); \ SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, w2_t, k_sha256[i + 2]); \ SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, w3_t, k_sha256[i + 3]); \ SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, w4_t, k_sha256[i + 4]); \ SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, w5_t, k_sha256[i + 5]); \ SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, w6_t, k_sha256[i + 6]); \ SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, w7_t, k_sha256[i + 7]); \ SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w8_t, k_sha256[i + 8]); \ SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w9_t, k_sha256[i + 9]); \ SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, k_sha256[i + 10]); \ SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, k_sha256[i + 11]); \ SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, k_sha256[i + 12]); \ SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, k_sha256[i + 13]); \ SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, k_sha256[i + 14]); \ SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, k_sha256[i + 15]); \ } ROUND_STEP (0); #ifdef _unroll #pragma unroll #endif for (int i = 16; i < 64; i += 16) { ROUND_EXPAND (); ROUND_STEP (i); } #undef ROUND_EXPAND #undef ROUND_STEP digest[0] += a; digest[1] += b; digest[2] += c; digest[3] += d; digest[4] += e; digest[5] += f; digest[6] += g; digest[7] += h; } DECLSPEC void sha256_init_vector (PRIVATE_AS sha256_ctx_vector_t *ctx) { ctx->h[0] = SHA256M_A; ctx->h[1] = SHA256M_B; ctx->h[2] = SHA256M_C; ctx->h[3] = SHA256M_D; ctx->h[4] = SHA256M_E; ctx->h[5] = SHA256M_F; ctx->h[6] = SHA256M_G; ctx->h[7] = SHA256M_H; ctx->w0[0] = 0; ctx->w0[1] = 0; ctx->w0[2] = 0; ctx->w0[3] = 0; ctx->w1[0] = 0; ctx->w1[1] = 0; ctx->w1[2] = 0; ctx->w1[3] = 0; ctx->w2[0] = 0; ctx->w2[1] = 0; ctx->w2[2] = 0; ctx->w2[3] = 0; ctx->w3[0] = 0; ctx->w3[1] = 0; ctx->w3[2] = 0; ctx->w3[3] = 0; ctx->len = 0; } DECLSPEC void sha256_init_vector_from_scalar (PRIVATE_AS sha256_ctx_vector_t *ctx, PRIVATE_AS sha256_ctx_t *ctx0) { ctx->h[0] = ctx0->h[0]; ctx->h[1] = ctx0->h[1]; ctx->h[2] = ctx0->h[2]; ctx->h[3] = ctx0->h[3]; ctx->h[4] = ctx0->h[4]; ctx->h[5] = ctx0->h[5]; ctx->h[6] = ctx0->h[6]; ctx->h[7] = ctx0->h[7]; ctx->w0[0] = ctx0->w0[0]; ctx->w0[1] = ctx0->w0[1]; ctx->w0[2] = ctx0->w0[2]; ctx->w0[3] = ctx0->w0[3]; ctx->w1[0] = ctx0->w1[0]; ctx->w1[1] = ctx0->w1[1]; ctx->w1[2] = ctx0->w1[2]; ctx->w1[3] = ctx0->w1[3]; ctx->w2[0] = ctx0->w2[0]; ctx->w2[1] = ctx0->w2[1]; ctx->w2[2] = ctx0->w2[2]; ctx->w2[3] = ctx0->w2[3]; ctx->w3[0] = ctx0->w3[0]; ctx->w3[1] = ctx0->w3[1]; ctx->w3[2] = ctx0->w3[2]; ctx->w3[3] = ctx0->w3[3]; ctx->len = ctx0->len; } DECLSPEC void sha256_update_vector_64 (PRIVATE_AS sha256_ctx_vector_t *ctx, PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const int len) { if (len == 0) return; const int pos = ctx->len & 63; ctx->len += len; if (pos == 0) { ctx->w0[0] = w0[0]; ctx->w0[1] = w0[1]; ctx->w0[2] = w0[2]; ctx->w0[3] = w0[3]; ctx->w1[0] = w1[0]; ctx->w1[1] = w1[1]; ctx->w1[2] = w1[2]; ctx->w1[3] = w1[3]; ctx->w2[0] = w2[0]; ctx->w2[1] = w2[1]; ctx->w2[2] = w2[2]; ctx->w2[3] = w2[3]; ctx->w3[0] = w3[0]; ctx->w3[1] = w3[1]; ctx->w3[2] = w3[2]; ctx->w3[3] = w3[3]; if (len == 64) { sha256_transform_vector (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); ctx->w0[0] = 0; ctx->w0[1] = 0; ctx->w0[2] = 0; ctx->w0[3] = 0; ctx->w1[0] = 0; ctx->w1[1] = 0; ctx->w1[2] = 0; ctx->w1[3] = 0; ctx->w2[0] = 0; ctx->w2[1] = 0; ctx->w2[2] = 0; ctx->w2[3] = 0; ctx->w3[0] = 0; ctx->w3[1] = 0; ctx->w3[2] = 0; ctx->w3[3] = 0; } } else { if ((pos + len) < 64) { switch_buffer_by_offset_be (w0, w1, w2, w3, pos); ctx->w0[0] |= w0[0]; ctx->w0[1] |= w0[1]; ctx->w0[2] |= w0[2]; ctx->w0[3] |= w0[3]; ctx->w1[0] |= w1[0]; ctx->w1[1] |= w1[1]; ctx->w1[2] |= w1[2]; ctx->w1[3] |= w1[3]; ctx->w2[0] |= w2[0]; ctx->w2[1] |= w2[1]; ctx->w2[2] |= w2[2]; ctx->w2[3] |= w2[3]; ctx->w3[0] |= w3[0]; ctx->w3[1] |= w3[1]; ctx->w3[2] |= w3[2]; ctx->w3[3] |= w3[3]; } else { u32x c0[4] = { 0 }; u32x c1[4] = { 0 }; u32x c2[4] = { 0 }; u32x c3[4] = { 0 }; switch_buffer_by_offset_carry_be (w0, w1, w2, w3, c0, c1, c2, c3, pos); ctx->w0[0] |= w0[0]; ctx->w0[1] |= w0[1]; ctx->w0[2] |= w0[2]; ctx->w0[3] |= w0[3]; ctx->w1[0] |= w1[0]; ctx->w1[1] |= w1[1]; ctx->w1[2] |= w1[2]; ctx->w1[3] |= w1[3]; ctx->w2[0] |= w2[0]; ctx->w2[1] |= w2[1]; ctx->w2[2] |= w2[2]; ctx->w2[3] |= w2[3]; ctx->w3[0] |= w3[0]; ctx->w3[1] |= w3[1]; ctx->w3[2] |= w3[2]; ctx->w3[3] |= w3[3]; sha256_transform_vector (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); ctx->w0[0] = c0[0]; ctx->w0[1] = c0[1]; ctx->w0[2] = c0[2]; ctx->w0[3] = c0[3]; ctx->w1[0] = c1[0]; ctx->w1[1] = c1[1]; ctx->w1[2] = c1[2]; ctx->w1[3] = c1[3]; ctx->w2[0] = c2[0]; ctx->w2[1] = c2[1]; ctx->w2[2] = c2[2]; ctx->w2[3] = c2[3]; ctx->w3[0] = c3[0]; ctx->w3[1] = c3[1]; ctx->w3[2] = c3[2]; ctx->w3[3] = c3[3]; } } } DECLSPEC void sha256_update_vector (PRIVATE_AS sha256_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len) { u32x w0[4]; u32x w1[4]; u32x w2[4]; u32x w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 64; pos1 += 64, pos4 += 16) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; sha256_update_vector_64 (ctx, w0, w1, w2, w3, 64); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; sha256_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1); } DECLSPEC void sha256_update_vector_swap (PRIVATE_AS sha256_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len) { u32x w0[4]; u32x w1[4]; u32x w2[4]; u32x w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 64; pos1 += 64, pos4 += 16) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; w0[0] = hc_swap32 (w0[0]); w0[1] = hc_swap32 (w0[1]); w0[2] = hc_swap32 (w0[2]); w0[3] = hc_swap32 (w0[3]); w1[0] = hc_swap32 (w1[0]); w1[1] = hc_swap32 (w1[1]); w1[2] = hc_swap32 (w1[2]); w1[3] = hc_swap32 (w1[3]); w2[0] = hc_swap32 (w2[0]); w2[1] = hc_swap32 (w2[1]); w2[2] = hc_swap32 (w2[2]); w2[3] = hc_swap32 (w2[3]); w3[0] = hc_swap32 (w3[0]); w3[1] = hc_swap32 (w3[1]); w3[2] = hc_swap32 (w3[2]); w3[3] = hc_swap32 (w3[3]); sha256_update_vector_64 (ctx, w0, w1, w2, w3, 64); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; w2[0] = w[pos4 + 8]; w2[1] = w[pos4 + 9]; w2[2] = w[pos4 + 10]; w2[3] = w[pos4 + 11]; w3[0] = w[pos4 + 12]; w3[1] = w[pos4 + 13]; w3[2] = w[pos4 + 14]; w3[3] = w[pos4 + 15]; w0[0] = hc_swap32 (w0[0]); w0[1] = hc_swap32 (w0[1]); w0[2] = hc_swap32 (w0[2]); w0[3] = hc_swap32 (w0[3]); w1[0] = hc_swap32 (w1[0]); w1[1] = hc_swap32 (w1[1]); w1[2] = hc_swap32 (w1[2]); w1[3] = hc_swap32 (w1[3]); w2[0] = hc_swap32 (w2[0]); w2[1] = hc_swap32 (w2[1]); w2[2] = hc_swap32 (w2[2]); w2[3] = hc_swap32 (w2[3]); w3[0] = hc_swap32 (w3[0]); w3[1] = hc_swap32 (w3[1]); w3[2] = hc_swap32 (w3[2]); w3[3] = hc_swap32 (w3[3]); sha256_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1); } DECLSPEC void sha256_update_vector_utf16le (PRIVATE_AS sha256_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len) { u32x w0[4]; u32x w1[4]; u32x w2[4]; u32x w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 32; pos1 += 32, pos4 += 8) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); sha256_update_vector_64 (ctx, w0, w1, w2, w3, 32 * 2); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); sha256_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } DECLSPEC void sha256_update_vector_utf16le_swap (PRIVATE_AS sha256_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len) { u32x w0[4]; u32x w1[4]; u32x w2[4]; u32x w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 32; pos1 += 32, pos4 += 8) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); w0[0] = hc_swap32 (w0[0]); w0[1] = hc_swap32 (w0[1]); w0[2] = hc_swap32 (w0[2]); w0[3] = hc_swap32 (w0[3]); w1[0] = hc_swap32 (w1[0]); w1[1] = hc_swap32 (w1[1]); w1[2] = hc_swap32 (w1[2]); w1[3] = hc_swap32 (w1[3]); w2[0] = hc_swap32 (w2[0]); w2[1] = hc_swap32 (w2[1]); w2[2] = hc_swap32 (w2[2]); w2[3] = hc_swap32 (w2[3]); w3[0] = hc_swap32 (w3[0]); w3[1] = hc_swap32 (w3[1]); w3[2] = hc_swap32 (w3[2]); w3[3] = hc_swap32 (w3[3]); sha256_update_vector_64 (ctx, w0, w1, w2, w3, 32 * 2); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); w0[0] = hc_swap32 (w0[0]); w0[1] = hc_swap32 (w0[1]); w0[2] = hc_swap32 (w0[2]); w0[3] = hc_swap32 (w0[3]); w1[0] = hc_swap32 (w1[0]); w1[1] = hc_swap32 (w1[1]); w1[2] = hc_swap32 (w1[2]); w1[3] = hc_swap32 (w1[3]); w2[0] = hc_swap32 (w2[0]); w2[1] = hc_swap32 (w2[1]); w2[2] = hc_swap32 (w2[2]); w2[3] = hc_swap32 (w2[3]); w3[0] = hc_swap32 (w3[0]); w3[1] = hc_swap32 (w3[1]); w3[2] = hc_swap32 (w3[2]); w3[3] = hc_swap32 (w3[3]); sha256_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } DECLSPEC void sha256_update_vector_utf16beN (PRIVATE_AS sha256_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len) { u32x w0[4]; u32x w1[4]; u32x w2[4]; u32x w3[4]; int pos1; int pos4; for (pos1 = 0, pos4 = 0; pos1 < len - 32; pos1 += 32, pos4 += 8) { w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16beN (w1, w2, w3); make_utf16beN (w0, w0, w1); sha256_update_vector_64 (ctx, w0, w1, w2, w3, 32 * 2); } w0[0] = w[pos4 + 0]; w0[1] = w[pos4 + 1]; w0[2] = w[pos4 + 2]; w0[3] = w[pos4 + 3]; w1[0] = w[pos4 + 4]; w1[1] = w[pos4 + 5]; w1[2] = w[pos4 + 6]; w1[3] = w[pos4 + 7]; make_utf16beN (w1, w2, w3); make_utf16beN (w0, w0, w1); sha256_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } DECLSPEC void sha256_final_vector (PRIVATE_AS sha256_ctx_vector_t *ctx) { const int pos = ctx->len & 63; append_0x80_4x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3); if (pos >= 56) { sha256_transform_vector (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); ctx->w0[0] = 0; ctx->w0[1] = 0; ctx->w0[2] = 0; ctx->w0[3] = 0; ctx->w1[0] = 0; ctx->w1[1] = 0; ctx->w1[2] = 0; ctx->w1[3] = 0; ctx->w2[0] = 0; ctx->w2[1] = 0; ctx->w2[2] = 0; ctx->w2[3] = 0; ctx->w3[0] = 0; ctx->w3[1] = 0; ctx->w3[2] = 0; ctx->w3[3] = 0; } ctx->w3[2] = 0; ctx->w3[3] = ctx->len * 8; sha256_transform_vector (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h); } // HMAC + Vector DECLSPEC void sha256_hmac_init_vector_64 (PRIVATE_AS sha256_hmac_ctx_vector_t *ctx, PRIVATE_AS const u32x *w0, PRIVATE_AS const u32x *w1, PRIVATE_AS const u32x *w2, PRIVATE_AS const u32x *w3) { u32x a0[4]; u32x a1[4]; u32x a2[4]; u32x a3[4]; // ipad a0[0] = w0[0] ^ 0x36363636; a0[1] = w0[1] ^ 0x36363636; a0[2] = w0[2] ^ 0x36363636; a0[3] = w0[3] ^ 0x36363636; a1[0] = w1[0] ^ 0x36363636; a1[1] = w1[1] ^ 0x36363636; a1[2] = w1[2] ^ 0x36363636; a1[3] = w1[3] ^ 0x36363636; a2[0] = w2[0] ^ 0x36363636; a2[1] = w2[1] ^ 0x36363636; a2[2] = w2[2] ^ 0x36363636; a2[3] = w2[3] ^ 0x36363636; a3[0] = w3[0] ^ 0x36363636; a3[1] = w3[1] ^ 0x36363636; a3[2] = w3[2] ^ 0x36363636; a3[3] = w3[3] ^ 0x36363636; sha256_init_vector (&ctx->ipad); sha256_update_vector_64 (&ctx->ipad, a0, a1, a2, a3, 64); // opad u32x b0[4]; u32x b1[4]; u32x b2[4]; u32x b3[4]; b0[0] = w0[0] ^ 0x5c5c5c5c; b0[1] = w0[1] ^ 0x5c5c5c5c; b0[2] = w0[2] ^ 0x5c5c5c5c; b0[3] = w0[3] ^ 0x5c5c5c5c; b1[0] = w1[0] ^ 0x5c5c5c5c; b1[1] = w1[1] ^ 0x5c5c5c5c; b1[2] = w1[2] ^ 0x5c5c5c5c; b1[3] = w1[3] ^ 0x5c5c5c5c; b2[0] = w2[0] ^ 0x5c5c5c5c; b2[1] = w2[1] ^ 0x5c5c5c5c; b2[2] = w2[2] ^ 0x5c5c5c5c; b2[3] = w2[3] ^ 0x5c5c5c5c; b3[0] = w3[0] ^ 0x5c5c5c5c; b3[1] = w3[1] ^ 0x5c5c5c5c; b3[2] = w3[2] ^ 0x5c5c5c5c; b3[3] = w3[3] ^ 0x5c5c5c5c; sha256_init_vector (&ctx->opad); sha256_update_vector_64 (&ctx->opad, b0, b1, b2, b3, 64); } DECLSPEC void sha256_hmac_init_vector (PRIVATE_AS sha256_hmac_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len) { u32x w0[4]; u32x w1[4]; u32x w2[4]; u32x w3[4]; if (len > 64) { sha256_ctx_vector_t tmp; sha256_init_vector (&tmp); sha256_update_vector (&tmp, w, len); sha256_final_vector (&tmp); w0[0] = tmp.h[0]; w0[1] = tmp.h[1]; w0[2] = tmp.h[2]; w0[3] = tmp.h[3]; w1[0] = tmp.h[4]; w1[1] = tmp.h[5]; w1[2] = tmp.h[6]; w1[3] = tmp.h[7]; w2[0] = 0; w2[1] = 0; w2[2] = 0; w2[3] = 0; w3[0] = 0; w3[1] = 0; w3[2] = 0; w3[3] = 0; } else { w0[0] = w[ 0]; w0[1] = w[ 1]; w0[2] = w[ 2]; w0[3] = w[ 3]; w1[0] = w[ 4]; w1[1] = w[ 5]; w1[2] = w[ 6]; w1[3] = w[ 7]; w2[0] = w[ 8]; w2[1] = w[ 9]; w2[2] = w[10]; w2[3] = w[11]; w3[0] = w[12]; w3[1] = w[13]; w3[2] = w[14]; w3[3] = w[15]; } sha256_hmac_init_vector_64 (ctx, w0, w1, w2, w3); } DECLSPEC void sha256_hmac_update_vector_64 (PRIVATE_AS sha256_hmac_ctx_vector_t *ctx, PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const int len) { sha256_update_vector_64 (&ctx->ipad, w0, w1, w2, w3, len); } DECLSPEC void sha256_hmac_update_vector (PRIVATE_AS sha256_hmac_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len) { sha256_update_vector (&ctx->ipad, w, len); } DECLSPEC void sha256_hmac_final_vector (PRIVATE_AS sha256_hmac_ctx_vector_t *ctx) { sha256_final_vector (&ctx->ipad); ctx->opad.w0[0] = ctx->ipad.h[0]; ctx->opad.w0[1] = ctx->ipad.h[1]; ctx->opad.w0[2] = ctx->ipad.h[2]; ctx->opad.w0[3] = ctx->ipad.h[3]; ctx->opad.w1[0] = ctx->ipad.h[4]; ctx->opad.w1[1] = ctx->ipad.h[5]; ctx->opad.w1[2] = ctx->ipad.h[6]; ctx->opad.w1[3] = ctx->ipad.h[7]; ctx->opad.w2[0] = 0; ctx->opad.w2[1] = 0; ctx->opad.w2[2] = 0; ctx->opad.w2[3] = 0; ctx->opad.w3[0] = 0; ctx->opad.w3[1] = 0; ctx->opad.w3[2] = 0; ctx->opad.w3[3] = 0; ctx->opad.len += 32; sha256_final_vector (&ctx->opad); } ================================================ FILE: src/main/resources/copyfromhashcat/inc_hash_sha256.h ================================================ /** * Author......: See docs/credits.txt * License.....: MIT */ #ifndef INC_HASH_SHA256_H #define INC_HASH_SHA256_H #define SHIFT_RIGHT_32(x,n) ((x) >> (n)) #define SHA256_S0_S(x) (hc_rotl32_S ((x), 25u) ^ hc_rotl32_S ((x), 14u) ^ SHIFT_RIGHT_32 ((x), 3u)) #define SHA256_S1_S(x) (hc_rotl32_S ((x), 15u) ^ hc_rotl32_S ((x), 13u) ^ SHIFT_RIGHT_32 ((x), 10u)) #define SHA256_S2_S(x) (hc_rotl32_S ((x), 30u) ^ hc_rotl32_S ((x), 19u) ^ hc_rotl32_S ((x), 10u)) #define SHA256_S3_S(x) (hc_rotl32_S ((x), 26u) ^ hc_rotl32_S ((x), 21u) ^ hc_rotl32_S ((x), 7u)) #define SHA256_S0(x) (hc_rotl32 ((x), 25u) ^ hc_rotl32 ((x), 14u) ^ SHIFT_RIGHT_32 ((x), 3u)) #define SHA256_S1(x) (hc_rotl32 ((x), 15u) ^ hc_rotl32 ((x), 13u) ^ SHIFT_RIGHT_32 ((x), 10u)) #define SHA256_S2(x) (hc_rotl32 ((x), 30u) ^ hc_rotl32 ((x), 19u) ^ hc_rotl32 ((x), 10u)) #define SHA256_S3(x) (hc_rotl32 ((x), 26u) ^ hc_rotl32 ((x), 21u) ^ hc_rotl32 ((x), 7u)) #define SHA256_F0(x,y,z) (((x) & (y)) | ((z) & ((x) ^ (y)))) #define SHA256_F1(x,y,z) ((z) ^ ((x) & ((y) ^ (z)))) #ifdef USE_BITSELECT #define SHA256_F0o(x,y,z) (bitselect ((x), (y), ((x) ^ (z)))) #define SHA256_F1o(x,y,z) (bitselect ((z), (y), (x))) #else #define SHA256_F0o(x,y,z) (SHA256_F0 ((x), (y), (z))) #define SHA256_F1o(x,y,z) (SHA256_F1 ((x), (y), (z))) #endif #define SHA256_STEP_S(F0,F1,a,b,c,d,e,f,g,h,x,K) \ { \ h = hc_add3_S (h, K, x); \ h = hc_add3_S (h, SHA256_S3_S (e), F1 (e,f,g)); \ d += h; \ h = hc_add3_S (h, SHA256_S2_S (a), F0 (a,b,c)); \ } #define SHA256_EXPAND_S(x,y,z,w) (SHA256_S1_S (x) + y + SHA256_S0_S (z) + w) #define SHA256_STEP(F0,F1,a,b,c,d,e,f,g,h,x,K) \ { \ h = hc_add3 (h, make_u32x (K), x); \ h = hc_add3 (h, SHA256_S3 (e), F1 (e,f,g)); \ d += h; \ h = hc_add3 (h, SHA256_S2 (a), F0 (a,b,c)); \ } #define SHA256_EXPAND(x,y,z,w) (SHA256_S1 (x) + y + SHA256_S0 (z) + w) typedef struct sha256_ctx { u32 h[8]; u32 w0[4]; u32 w1[4]; u32 w2[4]; u32 w3[4]; int len; } sha256_ctx_t; typedef struct sha256_hmac_ctx { sha256_ctx_t ipad; sha256_ctx_t opad; } sha256_hmac_ctx_t; typedef struct sha256_ctx_vector { u32x h[8]; u32x w0[4]; u32x w1[4]; u32x w2[4]; u32x w3[4]; int len; } sha256_ctx_vector_t; typedef struct sha256_hmac_ctx_vector { sha256_ctx_vector_t ipad; sha256_ctx_vector_t opad; } sha256_hmac_ctx_vector_t; DECLSPEC void sha256_transform (PRIVATE_AS const u32 *w0, PRIVATE_AS const u32 *w1, PRIVATE_AS const u32 *w2, PRIVATE_AS const u32 *w3, PRIVATE_AS u32 *digest); DECLSPEC void sha256_init (PRIVATE_AS sha256_ctx_t *ctx); DECLSPEC void sha256_update_64 (PRIVATE_AS sha256_ctx_t *ctx, PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const int len); DECLSPEC void sha256_update (PRIVATE_AS sha256_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void sha256_update_swap (PRIVATE_AS sha256_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void sha256_update_utf16le (PRIVATE_AS sha256_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void sha256_update_utf16le_swap (PRIVATE_AS sha256_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void sha256_update_global (PRIVATE_AS sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha256_update_global_swap (PRIVATE_AS sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha256_update_global_utf16le (PRIVATE_AS sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha256_update_global_utf16le_swap (PRIVATE_AS sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha256_final (PRIVATE_AS sha256_ctx_t *ctx); DECLSPEC void sha256_hmac_init_64 (PRIVATE_AS sha256_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w0, PRIVATE_AS const u32 *w1, PRIVATE_AS const u32 *w2, PRIVATE_AS const u32 *w3); DECLSPEC void sha256_hmac_init (PRIVATE_AS sha256_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void sha256_hmac_init_swap (PRIVATE_AS sha256_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void sha256_hmac_init_global (PRIVATE_AS sha256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha256_hmac_init_global_swap (PRIVATE_AS sha256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha256_hmac_update_64 (PRIVATE_AS sha256_hmac_ctx_t *ctx, PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const int len); DECLSPEC void sha256_hmac_update (PRIVATE_AS sha256_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void sha256_hmac_update_swap (PRIVATE_AS sha256_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void sha256_hmac_update_utf16le (PRIVATE_AS sha256_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void sha256_hmac_update_utf16le_swap (PRIVATE_AS sha256_hmac_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len); DECLSPEC void sha256_hmac_update_global (PRIVATE_AS sha256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha256_hmac_update_global_swap (PRIVATE_AS sha256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha256_hmac_update_global_utf16le (PRIVATE_AS sha256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha256_hmac_update_global_utf16le_swap (PRIVATE_AS sha256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha256_hmac_final (PRIVATE_AS sha256_hmac_ctx_t *ctx); DECLSPEC void sha256_transform_vector (PRIVATE_AS const u32x *w0, PRIVATE_AS const u32x *w1, PRIVATE_AS const u32x *w2, PRIVATE_AS const u32x *w3, PRIVATE_AS u32x *digest); DECLSPEC void sha256_init_vector (PRIVATE_AS sha256_ctx_vector_t *ctx); DECLSPEC void sha256_init_vector_from_scalar (PRIVATE_AS sha256_ctx_vector_t *ctx, PRIVATE_AS sha256_ctx_t *ctx0); DECLSPEC void sha256_update_vector_64 (PRIVATE_AS sha256_ctx_vector_t *ctx, PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const int len); DECLSPEC void sha256_update_vector (PRIVATE_AS sha256_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len); DECLSPEC void sha256_update_vector_swap (PRIVATE_AS sha256_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len); DECLSPEC void sha256_update_vector_utf16le (PRIVATE_AS sha256_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len); DECLSPEC void sha256_update_vector_utf16le_swap (PRIVATE_AS sha256_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len); DECLSPEC void sha256_update_vector_utf16beN (PRIVATE_AS sha256_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len); DECLSPEC void sha256_final_vector (PRIVATE_AS sha256_ctx_vector_t *ctx); DECLSPEC void sha256_hmac_init_vector_64 (PRIVATE_AS sha256_hmac_ctx_vector_t *ctx, PRIVATE_AS const u32x *w0, PRIVATE_AS const u32x *w1, PRIVATE_AS const u32x *w2, PRIVATE_AS const u32x *w3); DECLSPEC void sha256_hmac_init_vector (PRIVATE_AS sha256_hmac_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len); DECLSPEC void sha256_hmac_update_vector_64 (PRIVATE_AS sha256_hmac_ctx_vector_t *ctx, PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const int len); DECLSPEC void sha256_hmac_update_vector (PRIVATE_AS sha256_hmac_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len); DECLSPEC void sha256_hmac_final_vector (PRIVATE_AS sha256_hmac_ctx_vector_t *ctx); #endif ================================================ FILE: src/main/resources/copyfromhashcat/inc_platform.cl ================================================ /** * Author......: See docs/credits.txt * License.....: MIT */ #include "inc_vendor.h" #include "inc_types.h" #include "inc_platform.h" #ifdef IS_NATIVE #define FIXED_THREAD_COUNT(n) #define SYNC_THREADS() #endif #ifdef IS_AMD DECLSPEC u64x rotl64 (const u64x a, const int n) { return rotr64 (a, 64 - n); } DECLSPEC u64x rotr64 (const u64x a, const int n) { #if VECT_SIZE == 1 return rotr64_S (a, n); #else return ((a >> n) | ((a << (64 - n)))); #endif } DECLSPEC u64 rotl64_S (const u64 a, const int n) { return rotr64_S (a, 64 - n); } DECLSPEC u64 rotr64_S (const u64 a, const int n) { vconv64_t in; in.v64 = a; const u32 a0 = in.v32.a; const u32 a1 = in.v32.b; vconv64_t out; if (n < 32) { out.v32.a = amd_bitalign (a1, a0, n); out.v32.b = amd_bitalign (a0, a1, n); } else { out.v32.a = amd_bitalign (a0, a1, n - 32); out.v32.b = amd_bitalign (a1, a0, n - 32); } return out.v64; } #endif // IS_AMD #if defined IS_CUDA #if ATTACK_EXEC == 11 CONSTANT_VK u32 generic_constant[8192]; // 32k #if ATTACK_KERN == 0 #define bfs_buf g_bfs_buf #define rules_buf ((const kernel_rule_t *) generic_constant) #define words_buf_s g_words_buf_s #define words_buf_r g_words_buf_r #elif ATTACK_KERN == 1 #define bfs_buf g_bfs_buf #define rules_buf g_rules_buf #define words_buf_s g_words_buf_s #define words_buf_r g_words_buf_r #elif ATTACK_KERN == 3 #define rules_buf g_rules_buf #define bfs_buf ((const bf_t *) generic_constant) #define words_buf_s ((const bs_word_t *) generic_constant) #define words_buf_r ((const u32x *) generic_constant) #endif // ATTACK_KERN #endif // ATTACK_EXEC DECLSPEC u32 hc_atomic_dec (GLOBAL_AS u32 *p) { volatile const u32 val = 1; return atomicSub (p, val); } DECLSPEC u32 hc_atomic_inc (GLOBAL_AS u32 *p) { volatile const u32 val = 1; return atomicAdd (p, val); } DECLSPEC u32 hc_atomic_or (GLOBAL_AS u32 *p, volatile const u32 val) { return atomicOr (p, val); } DECLSPEC size_t get_global_id (const u32 dimindx __attribute__((unused))) { return (blockIdx.x * blockDim.x) + threadIdx.x; } DECLSPEC size_t get_local_id (const u32 dimindx __attribute__((unused))) { return threadIdx.x; } DECLSPEC size_t get_local_size (const u32 dimindx __attribute__((unused))) { // verify return blockDim.x; } DECLSPEC u32x rotl32 (const u32x a, const int n) { return ((a << n) | ((a >> (32 - n)))); } DECLSPEC u32x rotr32 (const u32x a, const int n) { return ((a >> n) | ((a << (32 - n)))); } DECLSPEC u32 rotl32_S (const u32 a, const int n) { return ((a << n) | ((a >> (32 - n)))); } DECLSPEC u32 rotr32_S (const u32 a, const int n) { return ((a >> n) | ((a << (32 - n)))); } DECLSPEC u64x rotl64 (const u64x a, const int n) { return ((a << n) | ((a >> (64 - n)))); } DECLSPEC u64x rotr64 (const u64x a, const int n) { return ((a >> n) | ((a << (64 - n)))); } DECLSPEC u64 rotl64_S (const u64 a, const int n) { return ((a << n) | ((a >> (64 - n)))); } DECLSPEC u64 rotr64_S (const u64 a, const int n) { return ((a >> n) | ((a << (64 - n)))); } #define FIXED_THREAD_COUNT(n) __launch_bounds__((n), 0) #define SYNC_THREADS() __syncthreads () #endif // IS_CUDA #if defined IS_HIP #if ATTACK_EXEC == 11 CONSTANT_VK u32 generic_constant[8192] __attribute__((used)); // 32k #if ATTACK_KERN == 0 #define bfs_buf g_bfs_buf #define rules_buf ((const kernel_rule_t *) generic_constant) #define words_buf_s g_words_buf_s #define words_buf_r g_words_buf_r #elif ATTACK_KERN == 1 #define bfs_buf g_bfs_buf #define rules_buf g_rules_buf #define words_buf_s g_words_buf_s #define words_buf_r g_words_buf_r #elif ATTACK_KERN == 3 #define rules_buf g_rules_buf #define bfs_buf ((const bf_t *) generic_constant) #define words_buf_s ((const bs_word_t *) generic_constant) #define words_buf_r ((const u32x *) generic_constant) #endif // ATTACK_KERN #endif // ATTACK_EXEC DECLSPEC u32 hc_atomic_dec (GLOBAL_AS u32 *p) { volatile const u32 val = 1; return atomicSub (p, val); } DECLSPEC u32 hc_atomic_inc (GLOBAL_AS u32 *p) { volatile const u32 val = 1; return atomicAdd (p, val); } DECLSPEC u32 hc_atomic_or (GLOBAL_AS u32 *p, volatile const u32 val) { return atomicOr (p, val); } DECLSPEC size_t get_global_id (const u32 dimindx __attribute__((unused))) { return (blockIdx.x * blockDim.x) + threadIdx.x; } DECLSPEC size_t get_local_id (const u32 dimindx __attribute__((unused))) { return threadIdx.x; } DECLSPEC size_t get_local_size (const u32 dimindx __attribute__((unused))) { // verify return blockDim.x; } DECLSPEC u32x rotl32 (const u32x a, const int n) { return ((a << n) | ((a >> (32 - n)))); } DECLSPEC u32x rotr32 (const u32x a, const int n) { return ((a >> n) | ((a << (32 - n)))); } DECLSPEC u32 rotl32_S (const u32 a, const int n) { return ((a << n) | ((a >> (32 - n)))); } DECLSPEC u32 rotr32_S (const u32 a, const int n) { return ((a >> n) | ((a << (32 - n)))); } DECLSPEC u64x rotl64 (const u64x a, const int n) { return rotr64 (a, 64 - n); } DECLSPEC u32 amd_bitalign_S (const u32 a, const u32 b, const int n) { u32 r = 0; __asm__ ("V_ALIGNBIT_B32 %0, %1, %2, %3;" : "=v"(r): "v"(a), "v"(b), "I"(n)); return r; } DECLSPEC u64x rotr64 (const u64x a, const int n) { #if VECT_SIZE == 1 return rotr64_S (a, n); #else return ((a >> n) | ((a << (64 - n)))); #endif } DECLSPEC u64 rotl64_S (const u64 a, const int n) { return rotr64_S (a, 64 - n); } DECLSPEC u64 rotr64_S (const u64 a, const int n) { vconv64_t in; in.v64 = a; const u32 a0 = in.v32.a; const u32 a1 = in.v32.b; vconv64_t out; if (n < 32) { out.v32.a = amd_bitalign_S (a1, a0, n); out.v32.b = amd_bitalign_S (a0, a1, n); } else { out.v32.a = amd_bitalign_S (a0, a1, n - 32); out.v32.b = amd_bitalign_S (a1, a0, n - 32); } return out.v64; } #define FIXED_THREAD_COUNT(n) __launch_bounds__((n), 0) #define SYNC_THREADS() __syncthreads () #endif // IS_HIP #ifdef IS_METAL DECLSPEC u32 hc_atomic_dec (volatile GLOBAL_AS u32 *p) { volatile const u32 val = 1; volatile GLOBAL_AS atomic_int *pd = (volatile GLOBAL_AS atomic_int *) p; return atomic_fetch_sub_explicit (pd, val, memory_order_relaxed); } DECLSPEC u32 hc_atomic_inc (volatile GLOBAL_AS u32 *p) { volatile const u32 val = 1; volatile GLOBAL_AS atomic_int *pd = (volatile GLOBAL_AS atomic_int *) p; return atomic_fetch_add_explicit (pd, val, memory_order_relaxed); } DECLSPEC u32 hc_atomic_or (volatile GLOBAL_AS u32 *p, volatile const u32 val) { volatile GLOBAL_AS atomic_int *pd = (volatile GLOBAL_AS atomic_int *) p; return atomic_fetch_or_explicit (pd, val, memory_order_relaxed); } #define FIXED_THREAD_COUNT(n) #define SYNC_THREADS() threadgroup_barrier (mem_flags::mem_threadgroup) #endif // IS_METAL #ifdef IS_OPENCL DECLSPEC u32 hc_atomic_dec (volatile GLOBAL_AS u32 *p) { volatile const u32 val = 1; return atomic_sub (p, val); } DECLSPEC u32 hc_atomic_inc (volatile GLOBAL_AS u32 *p) { volatile const u32 val = 1; return atomic_add (p, val); } DECLSPEC u32 hc_atomic_or (volatile GLOBAL_AS u32 *p, volatile const u32 val) { return atomic_or (p, val); } #define FIXED_THREAD_COUNT(n) __attribute__((reqd_work_group_size((n), 1, 1))) #define SYNC_THREADS() barrier (CLK_LOCAL_MEM_FENCE) #endif // IS_OPENCL ================================================ FILE: src/main/resources/copyfromhashcat/inc_platform.h ================================================ /** * Author......: See docs/credits.txt * License.....: MIT */ #ifndef INC_PLATFORM_H #define INC_PLATFORM_H DECLSPEC u32 hc_atomic_dec (volatile GLOBAL_AS u32 *p); DECLSPEC u32 hc_atomic_inc (volatile GLOBAL_AS u32 *p); DECLSPEC u32 hc_atomic_or (volatile GLOBAL_AS u32 *p, volatile const u32 val); #ifdef IS_AMD DECLSPEC u32 hc_atomic_dec (volatile GLOBAL_AS u32 *p); DECLSPEC u32 hc_atomic_inc (volatile GLOBAL_AS u32 *p); DECLSPEC u32 hc_atomic_or (volatile GLOBAL_AS u32 *p, volatile const u32 val); DECLSPEC u64x rotl64 (const u64x a, const int n); DECLSPEC u64x rotr64 (const u64x a, const int n); DECLSPEC u64 rotl64_S (const u64 a, const int n); DECLSPEC u64 rotr64_S (const u64 a, const int n); #endif // IS_AMD #ifdef IS_CUDA DECLSPEC u32 hc_atomic_dec (volatile GLOBAL_AS u32 *p); DECLSPEC u32 hc_atomic_inc (volatile GLOBAL_AS u32 *p); DECLSPEC u32 hc_atomic_or (volatile GLOBAL_AS u32 *p, volatile const u32 val); DECLSPEC size_t get_global_id (const u32 dimindx __attribute__((unused))); DECLSPEC size_t get_local_id (const u32 dimindx __attribute__((unused))); DECLSPEC size_t get_local_size (const u32 dimindx __attribute__((unused))); DECLSPEC u32x rotl32 (const u32x a, const int n); DECLSPEC u32x rotr32 (const u32x a, const int n); DECLSPEC u32 rotl32_S (const u32 a, const int n); DECLSPEC u32 rotr32_S (const u32 a, const int n); DECLSPEC u64x rotl64 (const u64x a, const int n); DECLSPEC u64x rotr64 (const u64x a, const int n); DECLSPEC u64 rotl64_S (const u64 a, const int n); DECLSPEC u64 rotr64_S (const u64 a, const int n); //#define rotate(a,n) (((a) << (n)) | ((a) >> (32 - (n)))) #define bitselect(a,b,c) ((a) ^ ((c) & ((b) ^ (a)))) #endif // IS_CUDA #ifdef IS_HIP DECLSPEC u32 hc_atomic_dec (volatile GLOBAL_AS u32 *p); DECLSPEC u32 hc_atomic_inc (volatile GLOBAL_AS u32 *p); DECLSPEC u32 hc_atomic_or (volatile GLOBAL_AS u32 *p, volatile const u32 val); DECLSPEC size_t get_global_id (const u32 dimindx); DECLSPEC size_t get_local_id (const u32 dimindx); DECLSPEC size_t get_local_size (const u32 dimindx); DECLSPEC u32x rotl32 (const u32x a, const int n); DECLSPEC u32x rotr32 (const u32x a, const int n); DECLSPEC u32 rotl32_S (const u32 a, const int n); DECLSPEC u32 rotr32_S (const u32 a, const int n); DECLSPEC u64x rotl64 (const u64x a, const int n); DECLSPEC u64x rotr64 (const u64x a, const int n); DECLSPEC u64 rotl64_S (const u64 a, const int n); DECLSPEC u64 rotr64_S (const u64 a, const int n); //#define rotate(a,n) (((a) << (n)) | ((a) >> (32 - (n)))) #define bitselect(a,b,c) ((a) ^ ((c) & ((b) ^ (a)))) #endif // IS_HIP #ifdef IS_METAL DECLSPEC u32 hc_atomic_dec (volatile GLOBAL_AS u32 *p); DECLSPEC u32 hc_atomic_inc (volatile GLOBAL_AS u32 *p); DECLSPEC u32 hc_atomic_or (volatile GLOBAL_AS u32 *p, volatile const u32 val); #define get_global_id(param) hc_gid #define get_local_id(param) hc_lid #define get_local_size(param) hc_lsz DECLSPEC u32x rotl32 (const u32x a, const int n); DECLSPEC u32x rotr32 (const u32x a, const int n); DECLSPEC u32 rotl32_S (const u32 a, const int n); DECLSPEC u32 rotr32_S (const u32 a, const int n); DECLSPEC u64x rotl64 (const u64x a, const int n); DECLSPEC u64x rotr64 (const u64x a, const int n); DECLSPEC u64 rotl64_S (const u64 a, const int n); DECLSPEC u64 rotr64_S (const u64 a, const int n); #define bitselect(a,b,c) ((a) ^ ((c) & ((b) ^ (a)))) #endif // IS_METAL #endif // INC_PLATFORM_H ================================================ FILE: src/main/resources/copyfromhashcat/inc_types.h ================================================ /** * Author......: See docs/credits.txt * License.....: MIT */ #ifndef INC_TYPES_H #define INC_TYPES_H #if ATTACK_MODE == 9 #define BITMAP_MASK kernel_param->bitmap_mask #define BITMAP_SHIFT1 kernel_param->bitmap_shift1 #define BITMAP_SHIFT2 kernel_param->bitmap_shift2 #define SALT_POS_HOST (kernel_param->pws_pos + gid) #define LOOP_POS kernel_param->loop_pos #define LOOP_CNT kernel_param->loop_cnt #define IL_CNT kernel_param->il_cnt #define DIGESTS_CNT 1 #define DIGESTS_OFFSET_HOST (kernel_param->pws_pos + gid) #define COMBS_MODE kernel_param->combs_mode #define SALT_REPEAT kernel_param->salt_repeat #define PWS_POS kernel_param->pws_pos #define GID_CNT kernel_param->gid_max #else #define BITMAP_MASK kernel_param->bitmap_mask #define BITMAP_SHIFT1 kernel_param->bitmap_shift1 #define BITMAP_SHIFT2 kernel_param->bitmap_shift2 #define SALT_POS_HOST kernel_param->salt_pos_host #define LOOP_POS kernel_param->loop_pos #define LOOP_CNT kernel_param->loop_cnt #define IL_CNT kernel_param->il_cnt #define DIGESTS_CNT kernel_param->digests_cnt #define DIGESTS_OFFSET_HOST kernel_param->digests_offset_host #define COMBS_MODE kernel_param->combs_mode #define SALT_REPEAT kernel_param->salt_repeat #define PWS_POS kernel_param->pws_pos #define GID_CNT kernel_param->gid_max #endif #ifdef IS_CUDA // https://docs.nvidia.com/cuda/nvrtc/index.html#integer-size typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; typedef unsigned long long ullong; #endif #ifdef IS_METAL typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; #define ullong ulong #endif #ifdef IS_OPENCL typedef ulong ullong; typedef ulong2 ullong2; typedef ulong4 ullong4; typedef ulong8 ullong8; typedef ulong16 ullong16; #endif #ifdef KERNEL_STATIC typedef uchar u8; typedef ushort u16; typedef uint u32; #ifdef IS_METAL typedef ulong u64; #else typedef ullong u64; #endif #else typedef uint8_t u8; typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; #endif //testwise disabled //typedef u8 u8a __attribute__ ((aligned (8))); //typedef u16 u16a __attribute__ ((aligned (8))); //typedef u32 u32a __attribute__ ((aligned (8))); //typedef u64 u64a __attribute__ ((aligned (8))); typedef u8 u8a; typedef u16 u16a; typedef u32 u32a; typedef u64 u64a; #ifndef NEW_SIMD_CODE #undef VECT_SIZE #define VECT_SIZE 1 #endif #define CONCAT(a, b) a##b #define VTYPE(type, width) CONCAT(type, width) // emulated is always VECT_SIZE = 1 #if VECT_SIZE == 1 typedef u8 u8x; typedef u16 u16x; typedef u32 u32x; typedef u64 u64x; #define make_u8x (u8) #define make_u16x (u16) #define make_u32x (u32) #define make_u64x (u64) #else #if defined IS_CUDA || defined IS_HIP #ifndef __device_builtin__ #define __device_builtin__ #endif #ifndef __builtin_align__ #define __builtin_align__(x) #endif #if VECT_SIZE == 2 struct __device_builtin__ __builtin_align__(2) u8x { u8 s0; u8 s1; inline __device__ u8x (const u8 a, const u8 b) : s0(a), s1(b) { } inline __device__ u8x (const u8 a) : s0(a), s1(a) { } inline __device__ u8x (void) : s0(0), s1(0) { } inline __device__ ~u8x (void) { } }; struct __device_builtin__ __builtin_align__(4) u16x { u16 s0; u16 s1; inline __device__ u16x (const u16 a, const u16 b) : s0(a), s1(b) { } inline __device__ u16x (const u16 a) : s0(a), s1(a) { } inline __device__ u16x (void) : s0(0), s1(0) { } inline __device__ ~u16x (void) { } }; struct __device_builtin__ __builtin_align__(8) u32x { u32 s0; u32 s1; inline __device__ u32x (const u32 a, const u32 b) : s0(a), s1(b) { } inline __device__ u32x (const u32 a) : s0(a), s1(a) { } inline __device__ u32x (void) : s0(0), s1(0) { } inline __device__ ~u32x (void) { } }; struct __device_builtin__ __builtin_align__(16) u64x { u64 s0; u64 s1; inline __device__ u64x (const u64 a, const u64 b) : s0(a), s1(b) { } inline __device__ u64x (const u64 a) : s0(a), s1(a) { } inline __device__ u64x (void) : s0(0), s1(0) { } inline __device__ ~u64x (void) { } }; inline __device__ bool operator != (const u32x a, const u32 b) { return ((a.s0 != b) && (a.s1 != b)); } inline __device__ bool operator != (const u32x a, const u32x b) { return ((a.s0 != b.s0) && (a.s1 != b.s1)); } inline __device__ void operator ^= (u32x &a, const u32 b) { a.s0 ^= b; a.s1 ^= b; } inline __device__ void operator ^= (u32x &a, const u32x b) { a.s0 ^= b.s0; a.s1 ^= b.s1; } inline __device__ void operator |= (u32x &a, const u32 b) { a.s0 |= b; a.s1 |= b; } inline __device__ void operator |= (u32x &a, const u32x b) { a.s0 |= b.s0; a.s1 |= b.s1; } inline __device__ void operator &= (u32x &a, const u32 b) { a.s0 &= b; a.s1 &= b; } inline __device__ void operator &= (u32x &a, const u32x b) { a.s0 &= b.s0; a.s1 &= b.s1; } inline __device__ void operator += (u32x &a, const u32 b) { a.s0 += b; a.s1 += b; } inline __device__ void operator += (u32x &a, const u32x b) { a.s0 += b.s0; a.s1 += b.s1; } inline __device__ void operator -= (u32x &a, const u32 b) { a.s0 -= b; a.s1 -= b; } inline __device__ void operator -= (u32x &a, const u32x b) { a.s0 -= b.s0; a.s1 -= b.s1; } inline __device__ void operator *= (u32x &a, const u32 b) { a.s0 *= b; a.s1 *= b; } inline __device__ void operator *= (u32x &a, const u32x b) { a.s0 *= b.s0; a.s1 *= b.s1; } inline __device__ void operator >>= (u32x &a, const u32 b) { a.s0 >>= b; a.s1 >>= b; } inline __device__ void operator >>= (u32x &a, const u32x b) { a.s0 >>= b.s0; a.s1 >>= b.s1; } inline __device__ void operator <<= (u32x &a, const u32 b) { a.s0 <<= b; a.s1 <<= b; } inline __device__ void operator <<= (u32x &a, const u32x b) { a.s0 <<= b.s0; a.s1 <<= b.s1; } inline __device__ u32x operator << (const u32x a, const u32 b) { return u32x ((a.s0 << b), (a.s1 << b) ); } inline __device__ u32x operator << (const u32x a, const u32x b) { return u32x ((a.s0 << b.s0), (a.s1 << b.s1)); } inline __device__ u32x operator >> (const u32x a, const u32 b) { return u32x ((a.s0 >> b), (a.s1 >> b) ); } inline __device__ u32x operator >> (const u32x a, const u32x b) { return u32x ((a.s0 >> b.s0), (a.s1 >> b.s1)); } inline __device__ u32x operator ^ (const u32x a, const u32 b) { return u32x ((a.s0 ^ b), (a.s1 ^ b) ); } inline __device__ u32x operator ^ (const u32x a, const u32x b) { return u32x ((a.s0 ^ b.s0), (a.s1 ^ b.s1)); } inline __device__ u32x operator | (const u32x a, const u32 b) { return u32x ((a.s0 | b), (a.s1 | b) ); } inline __device__ u32x operator | (const u32x a, const u32x b) { return u32x ((a.s0 | b.s0), (a.s1 | b.s1)); } inline __device__ u32x operator & (const u32x a, const u32 b) { return u32x ((a.s0 & b), (a.s1 & b) ); } inline __device__ u32x operator & (const u32x a, const u32x b) { return u32x ((a.s0 & b.s0), (a.s1 & b.s1)); } inline __device__ u32x operator + (const u32x a, const u32 b) { return u32x ((a.s0 + b), (a.s1 + b) ); } inline __device__ u32x operator + (const u32x a, const u32x b) { return u32x ((a.s0 + b.s0), (a.s1 + b.s1)); } inline __device__ u32x operator - (const u32x a, const u32 b) { return u32x ((a.s0 - b), (a.s1 - b) ); } inline __device__ u32x operator - (const u32x a, const u32x b) { return u32x ((a.s0 - b.s0), (a.s1 - b.s1)); } inline __device__ u32x operator * (const u32x a, const u32 b) { return u32x ((a.s0 * b), (a.s1 * b) ); } inline __device__ u32x operator * (const u32x a, const u32x b) { return u32x ((a.s0 * b.s0), (a.s1 * b.s1)); } inline __device__ u32x operator % (const u32x a, const u32 b) { return u32x ((a.s0 % b), (a.s1 % b) ); } inline __device__ u32x operator % (const u32x a, const u32x b) { return u32x ((a.s0 % b.s0), (a.s1 % b.s1)); } inline __device__ u32x operator ~ (const u32x a) { return u32x (~a.s0, ~a.s1); } inline __device__ bool operator != (const u64x a, const u64 b) { return ((a.s0 != b) && (a.s1 != b)); } inline __device__ bool operator != (const u64x a, const u64x b) { return ((a.s0 != b.s0) && (a.s1 != b.s1)); } inline __device__ void operator ^= (u64x &a, const u64 b) { a.s0 ^= b; a.s1 ^= b; } inline __device__ void operator ^= (u64x &a, const u64x b) { a.s0 ^= b.s0; a.s1 ^= b.s1; } inline __device__ void operator |= (u64x &a, const u64 b) { a.s0 |= b; a.s1 |= b; } inline __device__ void operator |= (u64x &a, const u64x b) { a.s0 |= b.s0; a.s1 |= b.s1; } inline __device__ void operator &= (u64x &a, const u64 b) { a.s0 &= b; a.s1 &= b; } inline __device__ void operator &= (u64x &a, const u64x b) { a.s0 &= b.s0; a.s1 &= b.s1; } inline __device__ void operator += (u64x &a, const u64 b) { a.s0 += b; a.s1 += b; } inline __device__ void operator += (u64x &a, const u64x b) { a.s0 += b.s0; a.s1 += b.s1; } inline __device__ void operator -= (u64x &a, const u64 b) { a.s0 -= b; a.s1 -= b; } inline __device__ void operator -= (u64x &a, const u64x b) { a.s0 -= b.s0; a.s1 -= b.s1; } inline __device__ void operator *= (u64x &a, const u64 b) { a.s0 *= b; a.s1 *= b; } inline __device__ void operator *= (u64x &a, const u64x b) { a.s0 *= b.s0; a.s1 *= b.s1; } inline __device__ void operator >>= (u64x &a, const u64 b) { a.s0 >>= b; a.s1 >>= b; } inline __device__ void operator >>= (u64x &a, const u64x b) { a.s0 >>= b.s0; a.s1 >>= b.s1; } inline __device__ void operator <<= (u64x &a, const u64 b) { a.s0 <<= b; a.s1 <<= b; } inline __device__ void operator <<= (u64x &a, const u64x b) { a.s0 <<= b.s0; a.s1 <<= b.s1; } inline __device__ u64x operator << (const u64x a, const u64 b) { return u64x ((a.s0 << b), (a.s1 << b) ); } inline __device__ u64x operator << (const u64x a, const u64x b) { return u64x ((a.s0 << b.s0), (a.s1 << b.s1)); } inline __device__ u64x operator >> (const u64x a, const u64 b) { return u64x ((a.s0 >> b), (a.s1 >> b) ); } inline __device__ u64x operator >> (const u64x a, const u64x b) { return u64x ((a.s0 >> b.s0), (a.s1 >> b.s1)); } inline __device__ u64x operator ^ (const u64x a, const u64 b) { return u64x ((a.s0 ^ b), (a.s1 ^ b) ); } inline __device__ u64x operator ^ (const u64x a, const u64x b) { return u64x ((a.s0 ^ b.s0), (a.s1 ^ b.s1)); } inline __device__ u64x operator | (const u64x a, const u64 b) { return u64x ((a.s0 | b), (a.s1 | b) ); } inline __device__ u64x operator | (const u64x a, const u64x b) { return u64x ((a.s0 | b.s0), (a.s1 | b.s1)); } inline __device__ u64x operator & (const u64x a, const u64 b) { return u64x ((a.s0 & b), (a.s1 & b) ); } inline __device__ u64x operator & (const u64x a, const u64x b) { return u64x ((a.s0 & b.s0), (a.s1 & b.s1)); } inline __device__ u64x operator + (const u64x a, const u64 b) { return u64x ((a.s0 + b), (a.s1 + b) ); } inline __device__ u64x operator + (const u64x a, const u64x b) { return u64x ((a.s0 + b.s0), (a.s1 + b.s1)); } inline __device__ u64x operator - (const u64x a, const u64 b) { return u64x ((a.s0 - b), (a.s1 - b) ); } inline __device__ u64x operator - (const u64x a, const u64x b) { return u64x ((a.s0 - b.s0), (a.s1 - b.s1)); } inline __device__ u64x operator * (const u64x a, const u64 b) { return u64x ((a.s0 * b), (a.s1 * b) ); } inline __device__ u64x operator * (const u64x a, const u64x b) { return u64x ((a.s0 * b.s0), (a.s1 * b.s1)); } inline __device__ u64x operator % (const u64x a, const u64 b) { return u64x ((a.s0 % b), (a.s1 % b) ); } inline __device__ u64x operator % (const u64x a, const u64x b) { return u64x ((a.s0 % b.s0), (a.s1 % b.s1)); } inline __device__ u64x operator ~ (const u64x a) { return u64x (~a.s0, ~a.s1); } #endif #if VECT_SIZE == 4 struct __device_builtin__ __builtin_align__(4) u8x { u8 s0; u8 s1; u8 s2; u8 s3; inline __device__ u8x (const u8 a, const u8 b, const u8 c, const u8 d) : s0(a), s1(b), s2(c), s3(d) { } inline __device__ u8x (const u8 a) : s0(a), s1(a), s2(a), s3(a) { } inline __device__ u8x (void) : s0(0), s1(0), s2(0), s3(0) { } inline __device__ ~u8x (void) { } }; struct __device_builtin__ __builtin_align__(8) u16x { u16 s0; u16 s1; u16 s2; u16 s3; inline __device__ u16x (const u16 a, const u16 b, const u16 c, const u16 d) : s0(a), s1(b), s2(c), s3(d) { } inline __device__ u16x (const u16 a) : s0(a), s1(a), s2(a), s3(a) { } inline __device__ u16x (void) : s0(0), s1(0), s2(0), s3(0) { } inline __device__ ~u16x (void) { } }; struct __device_builtin__ __builtin_align__(16) u32x { u32 s0; u32 s1; u32 s2; u32 s3; inline __device__ u32x (const u32 a, const u32 b, const u32 c, const u32 d) : s0(a), s1(b), s2(c), s3(d) { } inline __device__ u32x (const u32 a) : s0(a), s1(a), s2(a), s3(a) { } inline __device__ u32x (void) : s0(0), s1(0), s2(0), s3(0) { } inline __device__ ~u32x (void) { } }; struct __device_builtin__ __builtin_align__(32) u64x { u64 s0; u64 s1; u64 s2; u64 s3; inline __device__ u64x (const u64 a, const u64 b, const u64 c, const u64 d) : s0(a), s1(b), s2(c), s3(d) { } inline __device__ u64x (const u64 a) : s0(a), s1(a), s2(a), s3(a) { } inline __device__ u64x (void) : s0(0), s1(0), s2(0), s3(0) { } inline __device__ ~u64x (void) { } }; inline __device__ bool operator != (const u32x a, const u32 b) { return ((a.s0 != b) && (a.s1 != b) && (a.s2 != b) && (a.s3 != b) ); } inline __device__ bool operator != (const u32x a, const u32x b) { return ((a.s0 != b.s0) && (a.s1 != b.s1) && (a.s2 != b.s2) && (a.s3 != b.s3)); } inline __device__ void operator ^= (u32x &a, const u32 b) { a.s0 ^= b; a.s1 ^= b; a.s2 ^= b; a.s3 ^= b; } inline __device__ void operator ^= (u32x &a, const u32x b) { a.s0 ^= b.s0; a.s1 ^= b.s1; a.s2 ^= b.s2; a.s3 ^= b.s3; } inline __device__ void operator |= (u32x &a, const u32 b) { a.s0 |= b; a.s1 |= b; a.s2 |= b; a.s3 |= b; } inline __device__ void operator |= (u32x &a, const u32x b) { a.s0 |= b.s0; a.s1 |= b.s1; a.s2 |= b.s2; a.s3 |= b.s3; } inline __device__ void operator &= (u32x &a, const u32 b) { a.s0 &= b; a.s1 &= b; a.s2 &= b; a.s3 &= b; } inline __device__ void operator &= (u32x &a, const u32x b) { a.s0 &= b.s0; a.s1 &= b.s1; a.s2 &= b.s2; a.s3 &= b.s3; } inline __device__ void operator += (u32x &a, const u32 b) { a.s0 += b; a.s1 += b; a.s2 += b; a.s3 += b; } inline __device__ void operator += (u32x &a, const u32x b) { a.s0 += b.s0; a.s1 += b.s1; a.s2 += b.s2; a.s3 += b.s3; } inline __device__ void operator -= (u32x &a, const u32 b) { a.s0 -= b; a.s1 -= b; a.s2 -= b; a.s3 -= b; } inline __device__ void operator -= (u32x &a, const u32x b) { a.s0 -= b.s0; a.s1 -= b.s1; a.s2 -= b.s2; a.s3 -= b.s3; } inline __device__ void operator *= (u32x &a, const u32 b) { a.s0 *= b; a.s1 *= b; a.s2 *= b; a.s3 *= b; } inline __device__ void operator *= (u32x &a, const u32x b) { a.s0 *= b.s0; a.s1 *= b.s1; a.s2 *= b.s2; a.s3 *= b.s3; } inline __device__ void operator >>= (u32x &a, const u32 b) { a.s0 >>= b; a.s1 >>= b; a.s2 >>= b; a.s3 >>= b; } inline __device__ void operator >>= (u32x &a, const u32x b) { a.s0 >>= b.s0; a.s1 >>= b.s1; a.s2 >>= b.s2; a.s3 >>= b.s3; } inline __device__ void operator <<= (u32x &a, const u32 b) { a.s0 <<= b; a.s1 <<= b; a.s2 <<= b; a.s3 <<= b; } inline __device__ void operator <<= (u32x &a, const u32x b) { a.s0 <<= b.s0; a.s1 <<= b.s1; a.s2 <<= b.s2; a.s3 <<= b.s3; } inline __device__ u32x operator << (const u32x a, const u32 b) { return u32x ((a.s0 << b), (a.s1 << b) , (a.s2 << b), (a.s3 << b) ); } inline __device__ u32x operator << (const u32x a, const u32x b) { return u32x ((a.s0 << b.s0), (a.s1 << b.s1), (a.s2 << b.s2), (a.s3 << b.s3)); } inline __device__ u32x operator >> (const u32x a, const u32 b) { return u32x ((a.s0 >> b), (a.s1 >> b) , (a.s2 >> b), (a.s3 >> b) ); } inline __device__ u32x operator >> (const u32x a, const u32x b) { return u32x ((a.s0 >> b.s0), (a.s1 >> b.s1), (a.s2 >> b.s2), (a.s3 >> b.s3)); } inline __device__ u32x operator ^ (const u32x a, const u32 b) { return u32x ((a.s0 ^ b), (a.s1 ^ b) , (a.s2 ^ b), (a.s3 ^ b) ); } inline __device__ u32x operator ^ (const u32x a, const u32x b) { return u32x ((a.s0 ^ b.s0), (a.s1 ^ b.s1), (a.s2 ^ b.s2), (a.s3 ^ b.s3)); } inline __device__ u32x operator | (const u32x a, const u32 b) { return u32x ((a.s0 | b), (a.s1 | b) , (a.s2 | b), (a.s3 | b) ); } inline __device__ u32x operator | (const u32x a, const u32x b) { return u32x ((a.s0 | b.s0), (a.s1 | b.s1), (a.s2 | b.s2), (a.s3 | b.s3)); } inline __device__ u32x operator & (const u32x a, const u32 b) { return u32x ((a.s0 & b), (a.s1 & b) , (a.s2 & b), (a.s3 & b) ); } inline __device__ u32x operator & (const u32x a, const u32x b) { return u32x ((a.s0 & b.s0), (a.s1 & b.s1), (a.s2 & b.s2), (a.s3 & b.s3)); } inline __device__ u32x operator + (const u32x a, const u32 b) { return u32x ((a.s0 + b), (a.s1 + b) , (a.s2 + b), (a.s3 + b) ); } inline __device__ u32x operator + (const u32x a, const u32x b) { return u32x ((a.s0 + b.s0), (a.s1 + b.s1), (a.s2 + b.s2), (a.s3 + b.s3)); } inline __device__ u32x operator - (const u32x a, const u32 b) { return u32x ((a.s0 - b), (a.s1 - b) , (a.s2 - b), (a.s3 - b) ); } inline __device__ u32x operator - (const u32x a, const u32x b) { return u32x ((a.s0 - b.s0), (a.s1 - b.s1), (a.s2 - b.s2), (a.s3 - b.s3)); } inline __device__ u32x operator * (const u32x a, const u32 b) { return u32x ((a.s0 * b), (a.s1 * b) , (a.s2 * b), (a.s3 * b) ); } inline __device__ u32x operator * (const u32x a, const u32x b) { return u32x ((a.s0 * b.s0), (a.s1 * b.s1), (a.s2 * b.s2), (a.s3 * b.s3)); } inline __device__ u32x operator % (const u32x a, const u32 b) { return u32x ((a.s0 % b), (a.s1 % b) , (a.s2 % b), (a.s3 % b) ); } inline __device__ u32x operator % (const u32x a, const u32x b) { return u32x ((a.s0 % b.s0), (a.s1 % b.s1), (a.s2 % b.s2), (a.s3 % b.s3)); } inline __device__ u32x operator ~ (const u32x a) { return u32x (~a.s0, ~a.s1, ~a.s2, ~a.s3); } inline __device__ bool operator != (const u64x a, const u64 b) { return ((a.s0 != b) && (a.s1 != b) && (a.s2 != b) && (a.s3 != b) ); } inline __device__ bool operator != (const u64x a, const u64x b) { return ((a.s0 != b.s0) && (a.s1 != b.s1) && (a.s2 != b.s2) && (a.s3 != b.s3)); } inline __device__ void operator ^= (u64x &a, const u64 b) { a.s0 ^= b; a.s1 ^= b; a.s2 ^= b; a.s3 ^= b; } inline __device__ void operator ^= (u64x &a, const u64x b) { a.s0 ^= b.s0; a.s1 ^= b.s1; a.s2 ^= b.s2; a.s3 ^= b.s3; } inline __device__ void operator |= (u64x &a, const u64 b) { a.s0 |= b; a.s1 |= b; a.s2 |= b; a.s3 |= b; } inline __device__ void operator |= (u64x &a, const u64x b) { a.s0 |= b.s0; a.s1 |= b.s1; a.s2 |= b.s2; a.s3 |= b.s3; } inline __device__ void operator &= (u64x &a, const u64 b) { a.s0 &= b; a.s1 &= b; a.s2 &= b; a.s3 &= b; } inline __device__ void operator &= (u64x &a, const u64x b) { a.s0 &= b.s0; a.s1 &= b.s1; a.s2 &= b.s2; a.s3 &= b.s3; } inline __device__ void operator += (u64x &a, const u64 b) { a.s0 += b; a.s1 += b; a.s2 += b; a.s3 += b; } inline __device__ void operator += (u64x &a, const u64x b) { a.s0 += b.s0; a.s1 += b.s1; a.s2 += b.s2; a.s3 += b.s3; } inline __device__ void operator -= (u64x &a, const u64 b) { a.s0 -= b; a.s1 -= b; a.s2 -= b; a.s3 -= b; } inline __device__ void operator -= (u64x &a, const u64x b) { a.s0 -= b.s0; a.s1 -= b.s1; a.s2 -= b.s2; a.s3 -= b.s3; } inline __device__ void operator *= (u64x &a, const u64 b) { a.s0 *= b; a.s1 *= b; a.s2 *= b; a.s3 *= b; } inline __device__ void operator *= (u64x &a, const u64x b) { a.s0 *= b.s0; a.s1 *= b.s1; a.s2 *= b.s2; a.s3 *= b.s3; } inline __device__ void operator >>= (u64x &a, const u64 b) { a.s0 >>= b; a.s1 >>= b; a.s2 >>= b; a.s3 >>= b; } inline __device__ void operator >>= (u64x &a, const u64x b) { a.s0 >>= b.s0; a.s1 >>= b.s1; a.s2 >>= b.s2; a.s3 >>= b.s3; } inline __device__ void operator <<= (u64x &a, const u64 b) { a.s0 <<= b; a.s1 <<= b; a.s2 <<= b; a.s3 <<= b; } inline __device__ void operator <<= (u64x &a, const u64x b) { a.s0 <<= b.s0; a.s1 <<= b.s1; a.s2 <<= b.s2; a.s3 <<= b.s3; } inline __device__ u64x operator << (const u64x a, const u64 b) { return u64x ((a.s0 << b), (a.s1 << b) , (a.s2 << b), (a.s3 << b) ); } inline __device__ u64x operator << (const u64x a, const u64x b) { return u64x ((a.s0 << b.s0), (a.s1 << b.s1), (a.s2 << b.s2), (a.s3 << b.s3)); } inline __device__ u64x operator >> (const u64x a, const u64 b) { return u64x ((a.s0 >> b), (a.s1 >> b) , (a.s2 >> b), (a.s3 >> b) ); } inline __device__ u64x operator >> (const u64x a, const u64x b) { return u64x ((a.s0 >> b.s0), (a.s1 >> b.s1), (a.s2 >> b.s2), (a.s3 >> b.s3)); } inline __device__ u64x operator ^ (const u64x a, const u64 b) { return u64x ((a.s0 ^ b), (a.s1 ^ b) , (a.s2 ^ b), (a.s3 ^ b) ); } inline __device__ u64x operator ^ (const u64x a, const u64x b) { return u64x ((a.s0 ^ b.s0), (a.s1 ^ b.s1), (a.s2 ^ b.s2), (a.s3 ^ b.s3)); } inline __device__ u64x operator | (const u64x a, const u64 b) { return u64x ((a.s0 | b), (a.s1 | b) , (a.s2 | b), (a.s3 | b) ); } inline __device__ u64x operator | (const u64x a, const u64x b) { return u64x ((a.s0 | b.s0), (a.s1 | b.s1), (a.s2 | b.s2), (a.s3 | b.s3)); } inline __device__ u64x operator & (const u64x a, const u64 b) { return u64x ((a.s0 & b), (a.s1 & b) , (a.s2 & b), (a.s3 & b) ); } inline __device__ u64x operator & (const u64x a, const u64x b) { return u64x ((a.s0 & b.s0), (a.s1 & b.s1), (a.s2 & b.s2), (a.s3 & b.s3)); } inline __device__ u64x operator + (const u64x a, const u64 b) { return u64x ((a.s0 + b), (a.s1 + b) , (a.s2 + b), (a.s3 + b) ); } inline __device__ u64x operator + (const u64x a, const u64x b) { return u64x ((a.s0 + b.s0), (a.s1 + b.s1), (a.s2 + b.s2), (a.s3 + b.s3)); } inline __device__ u64x operator - (const u64x a, const u64 b) { return u64x ((a.s0 - b), (a.s1 - b) , (a.s2 - b), (a.s3 - b) ); } inline __device__ u64x operator - (const u64x a, const u64x b) { return u64x ((a.s0 - b.s0), (a.s1 - b.s1), (a.s2 - b.s2), (a.s3 - b.s3)); } inline __device__ u64x operator * (const u64x a, const u64 b) { return u64x ((a.s0 * b), (a.s1 * b) , (a.s2 * b), (a.s3 * b) ); } inline __device__ u64x operator * (const u64x a, const u64x b) { return u64x ((a.s0 * b.s0), (a.s1 * b.s1), (a.s2 * b.s2), (a.s3 * b.s3)); } inline __device__ u64x operator % (const u64x a, const u32 b) { return u64x ((a.s0 % b), (a.s1 % b) , (a.s2 % b), (a.s3 % b) ); } inline __device__ u64x operator % (const u64x a, const u64x b) { return u64x ((a.s0 % b.s0), (a.s1 % b.s1), (a.s2 % b.s2), (a.s3 % b.s3)); } inline __device__ u64x operator ~ (const u64x a) { return u64x (~a.s0, ~a.s1, ~a.s2, ~a.s3); } #endif #if VECT_SIZE == 8 struct __device_builtin__ __builtin_align__(8) u8x { u8 s0; u8 s1; u8 s2; u8 s3; u8 s4; u8 s5; u8 s6; u8 s7; inline __device__ u8x (const u8 a, const u8 b, const u8 c, const u8 d, const u8 e, const u8 f, const u8 g, const u8 h) : s0(a), s1(b), s2(c), s3(d), s4(e), s5(f), s6(g), s7(h) { } inline __device__ u8x (const u8 a) : s0(a), s1(a), s2(a), s3(a), s4(a), s5(a), s6(a), s7(a) { } inline __device__ u8x (void) : s0(0), s1(0), s2(0), s3(0), s4(0), s5(0), s6(0), s7(0) { } inline __device__ ~u8x (void) { } }; struct __device_builtin__ __builtin_align__(16) u16x { u16 s0; u16 s1; u16 s2; u16 s3; u16 s4; u16 s5; u16 s6; u16 s7; inline __device__ u16x (const u16 a, const u16 b, const u16 c, const u16 d, const u16 e, const u16 f, const u16 g, const u16 h) : s0(a), s1(b), s2(c), s3(d), s4(e), s5(f), s6(g), s7(h) { } inline __device__ u16x (const u16 a) : s0(a), s1(a), s2(a), s3(a), s4(a), s5(a), s6(a), s7(a) { } inline __device__ u16x (void) : s0(0), s1(0), s2(0), s3(0), s4(0), s5(0), s6(0), s7(0) { } inline __device__ ~u16x (void) { } }; struct __device_builtin__ __builtin_align__(32) u32x { u32 s0; u32 s1; u32 s2; u32 s3; u32 s4; u32 s5; u32 s6; u32 s7; inline __device__ u32x (const u32 a, const u32 b, const u32 c, const u32 d, const u32 e, const u32 f, const u32 g, const u32 h) : s0(a), s1(b), s2(c), s3(d), s4(e), s5(f), s6(g), s7(h) { } inline __device__ u32x (const u32 a) : s0(a), s1(a), s2(a), s3(a), s4(a), s5(a), s6(a), s7(a) { } inline __device__ u32x (void) : s0(0), s1(0), s2(0), s3(0), s4(0), s5(0), s6(0), s7(0) { } inline __device__ ~u32x (void) { } }; struct __device_builtin__ __builtin_align__(64) u64x { u64 s0; u64 s1; u64 s2; u64 s3; u64 s4; u64 s5; u64 s6; u64 s7; inline __device__ u64x (const u64 a, const u64 b, const u64 c, const u64 d, const u64 e, const u64 f, const u64 g, const u64 h) : s0(a), s1(b), s2(c), s3(d), s4(e), s5(f), s6(g), s7(h) { } inline __device__ u64x (const u64 a) : s0(a), s1(a), s2(a), s3(a), s4(a), s5(a), s6(a), s7(a) { } inline __device__ u64x (void) : s0(0), s1(0), s2(0), s3(0), s4(0), s5(0), s6(0), s7(0) { } inline __device__ ~u64x (void) { } }; inline __device__ bool operator != (const u32x a, const u32 b) { return ((a.s0 != b) && (a.s1 != b) && (a.s2 != b) && (a.s3 != b) && (a.s4 != b) && (a.s5 != b) && (a.s6 != b) && (a.s7 != b) ); } inline __device__ bool operator != (const u32x a, const u32x b) { return ((a.s0 != b.s0) && (a.s1 != b.s1) && (a.s2 != b.s2) && (a.s3 != b.s3) && (a.s4 != b.s4) && (a.s5 != b.s5) && (a.s6 != b.s6) && (a.s7 != b.s7)); } inline __device__ void operator ^= (u32x &a, const u32 b) { a.s0 ^= b; a.s1 ^= b; a.s2 ^= b; a.s3 ^= b; a.s4 ^= b; a.s5 ^= b; a.s6 ^= b; a.s7 ^= b; } inline __device__ void operator ^= (u32x &a, const u32x b) { a.s0 ^= b.s0; a.s1 ^= b.s1; a.s2 ^= b.s2; a.s3 ^= b.s3; a.s4 ^= b.s4; a.s5 ^= b.s5; a.s6 ^= b.s6; a.s7 ^= b.s7; } inline __device__ void operator |= (u32x &a, const u32 b) { a.s0 |= b; a.s1 |= b; a.s2 |= b; a.s3 |= b; a.s4 |= b; a.s5 |= b; a.s6 |= b; a.s7 |= b; } inline __device__ void operator |= (u32x &a, const u32x b) { a.s0 |= b.s0; a.s1 |= b.s1; a.s2 |= b.s2; a.s3 |= b.s3; a.s4 |= b.s4; a.s5 |= b.s5; a.s6 |= b.s6; a.s7 |= b.s7; } inline __device__ void operator &= (u32x &a, const u32 b) { a.s0 &= b; a.s1 &= b; a.s2 &= b; a.s3 &= b; a.s4 &= b; a.s5 &= b; a.s6 &= b; a.s7 &= b; } inline __device__ void operator &= (u32x &a, const u32x b) { a.s0 &= b.s0; a.s1 &= b.s1; a.s2 &= b.s2; a.s3 &= b.s3; a.s4 &= b.s4; a.s5 &= b.s5; a.s6 &= b.s6; a.s7 &= b.s7; } inline __device__ void operator += (u32x &a, const u32 b) { a.s0 += b; a.s1 += b; a.s2 += b; a.s3 += b; a.s4 += b; a.s5 += b; a.s6 += b; a.s7 += b; } inline __device__ void operator += (u32x &a, const u32x b) { a.s0 += b.s0; a.s1 += b.s1; a.s2 += b.s2; a.s3 += b.s3; a.s4 += b.s4; a.s5 += b.s5; a.s6 += b.s6; a.s7 += b.s7; } inline __device__ void operator -= (u32x &a, const u32 b) { a.s0 -= b; a.s1 -= b; a.s2 -= b; a.s3 -= b; a.s4 -= b; a.s5 -= b; a.s6 -= b; a.s7 -= b; } inline __device__ void operator -= (u32x &a, const u32x b) { a.s0 -= b.s0; a.s1 -= b.s1; a.s2 -= b.s2; a.s3 -= b.s3; a.s4 -= b.s4; a.s5 -= b.s5; a.s6 -= b.s6; a.s7 -= b.s7; } inline __device__ void operator *= (u32x &a, const u32 b) { a.s0 *= b; a.s1 *= b; a.s2 *= b; a.s3 *= b; a.s4 *= b; a.s5 *= b; a.s6 *= b; a.s7 *= b; } inline __device__ void operator *= (u32x &a, const u32x b) { a.s0 *= b.s0; a.s1 *= b.s1; a.s2 *= b.s2; a.s3 *= b.s3; a.s4 *= b.s4; a.s5 *= b.s5; a.s6 *= b.s6; a.s7 *= b.s7; } inline __device__ void operator >>= (u32x &a, const u32 b) { a.s0 >>= b; a.s1 >>= b; a.s2 >>= b; a.s3 >>= b; a.s4 >>= b; a.s5 >>= b; a.s6 >>= b; a.s7 >>= b; } inline __device__ void operator >>= (u32x &a, const u32x b) { a.s0 >>= b.s0; a.s1 >>= b.s1; a.s2 >>= b.s2; a.s3 >>= b.s3; a.s4 >>= b.s4; a.s5 >>= b.s5; a.s6 >>= b.s6; a.s7 >>= b.s7; } inline __device__ void operator <<= (u32x &a, const u32 b) { a.s0 <<= b; a.s1 <<= b; a.s2 <<= b; a.s3 <<= b; a.s4 <<= b; a.s5 <<= b; a.s6 <<= b; a.s7 <<= b; } inline __device__ void operator <<= (u32x &a, const u32x b) { a.s0 <<= b.s0; a.s1 <<= b.s1; a.s2 <<= b.s2; a.s3 <<= b.s3; a.s4 <<= b.s4; a.s5 <<= b.s5; a.s6 <<= b.s6; a.s7 <<= b.s7; } inline __device__ u32x operator << (const u32x a, const u32 b) { return u32x ((a.s0 << b), (a.s1 << b) , (a.s2 << b), (a.s3 << b) , (a.s4 << b), (a.s5 << b) , (a.s6 << b), (a.s7 << b) ); } inline __device__ u32x operator << (const u32x a, const u32x b) { return u32x ((a.s0 << b.s0), (a.s1 << b.s1), (a.s2 << b.s2), (a.s3 << b.s3), (a.s4 << b.s4), (a.s5 << b.s5), (a.s6 << b.s6), (a.s7 << b.s7)); } inline __device__ u32x operator >> (const u32x a, const u32 b) { return u32x ((a.s0 >> b), (a.s1 >> b) , (a.s2 >> b), (a.s3 >> b) , (a.s4 >> b), (a.s5 >> b) , (a.s6 >> b), (a.s7 >> b) ); } inline __device__ u32x operator >> (const u32x a, const u32x b) { return u32x ((a.s0 >> b.s0), (a.s1 >> b.s1), (a.s2 >> b.s2), (a.s3 >> b.s3), (a.s4 >> b.s4), (a.s5 >> b.s5), (a.s6 >> b.s6), (a.s7 >> b.s7)); } inline __device__ u32x operator ^ (const u32x a, const u32 b) { return u32x ((a.s0 ^ b), (a.s1 ^ b) , (a.s2 ^ b), (a.s3 ^ b) , (a.s4 ^ b), (a.s5 ^ b) , (a.s6 ^ b), (a.s7 ^ b) ); } inline __device__ u32x operator ^ (const u32x a, const u32x b) { return u32x ((a.s0 ^ b.s0), (a.s1 ^ b.s1), (a.s2 ^ b.s2), (a.s3 ^ b.s3), (a.s4 ^ b.s4), (a.s5 ^ b.s5), (a.s6 ^ b.s6), (a.s7 ^ b.s7)); } inline __device__ u32x operator | (const u32x a, const u32 b) { return u32x ((a.s0 | b), (a.s1 | b) , (a.s2 | b), (a.s3 | b) , (a.s4 | b), (a.s5 | b) , (a.s6 | b), (a.s7 | b) ); } inline __device__ u32x operator | (const u32x a, const u32x b) { return u32x ((a.s0 | b.s0), (a.s1 | b.s1), (a.s2 | b.s2), (a.s3 | b.s3), (a.s4 | b.s4), (a.s5 | b.s5), (a.s6 | b.s6), (a.s7 | b.s7)); } inline __device__ u32x operator & (const u32x a, const u32 b) { return u32x ((a.s0 & b), (a.s1 & b) , (a.s2 & b), (a.s3 & b) , (a.s4 & b), (a.s5 & b) , (a.s6 & b), (a.s7 & b) ); } inline __device__ u32x operator & (const u32x a, const u32x b) { return u32x ((a.s0 & b.s0), (a.s1 & b.s1), (a.s2 & b.s2), (a.s3 & b.s3), (a.s4 & b.s4), (a.s5 & b.s5), (a.s6 & b.s6), (a.s7 & b.s7)); } inline __device__ u32x operator + (const u32x a, const u32 b) { return u32x ((a.s0 + b), (a.s1 + b) , (a.s2 + b), (a.s3 + b) , (a.s4 + b), (a.s5 + b) , (a.s6 + b), (a.s7 + b) ); } inline __device__ u32x operator + (const u32x a, const u32x b) { return u32x ((a.s0 + b.s0), (a.s1 + b.s1), (a.s2 + b.s2), (a.s3 + b.s3), (a.s4 + b.s4), (a.s5 + b.s5), (a.s6 + b.s6), (a.s7 + b.s7)); } inline __device__ u32x operator - (const u32x a, const u32 b) { return u32x ((a.s0 - b), (a.s1 - b) , (a.s2 - b), (a.s3 - b) , (a.s4 - b), (a.s5 - b) , (a.s6 - b), (a.s7 - b) ); } inline __device__ u32x operator - (const u32x a, const u32x b) { return u32x ((a.s0 - b.s0), (a.s1 - b.s1), (a.s2 - b.s2), (a.s3 - b.s3), (a.s4 - b.s4), (a.s5 - b.s5), (a.s6 - b.s6), (a.s7 - b.s7)); } inline __device__ u32x operator * (const u32x a, const u32 b) { return u32x ((a.s0 * b), (a.s1 * b) , (a.s2 * b), (a.s3 * b) , (a.s4 * b), (a.s5 * b) , (a.s6 * b), (a.s7 * b) ); } inline __device__ u32x operator * (const u32x a, const u32x b) { return u32x ((a.s0 * b.s0), (a.s1 * b.s1), (a.s2 * b.s2), (a.s3 * b.s3), (a.s4 * b.s4), (a.s5 * b.s5), (a.s6 * b.s6), (a.s7 * b.s7)); } inline __device__ u32x operator % (const u32x a, const u32 b) { return u32x ((a.s0 % b), (a.s1 % b) , (a.s2 % b), (a.s3 % b) , (a.s4 % b), (a.s5 % b) , (a.s6 % b), (a.s7 % b) ); } inline __device__ u32x operator % (const u32x a, const u32x b) { return u32x ((a.s0 % b.s0), (a.s1 % b.s1), (a.s2 % b.s2), (a.s3 % b.s3), (a.s4 % b.s4), (a.s5 % b.s5), (a.s6 % b.s6), (a.s7 % b.s7)); } inline __device__ u32x operator ~ (const u32x a) { return u32x (~a.s0, ~a.s1, ~a.s2, ~a.s3, ~a.s4, ~a.s5, ~a.s6, ~a.s7); } inline __device__ bool operator != (const u64x a, const u64 b) { return ((a.s0 != b) && (a.s1 != b) && (a.s2 != b) && (a.s3 != b) && (a.s4 != b) && (a.s5 != b) && (a.s6 != b) && (a.s7 != b) ); } inline __device__ bool operator != (const u64x a, const u64x b) { return ((a.s0 != b.s0) && (a.s1 != b.s1) && (a.s2 != b.s2) && (a.s3 != b.s3) && (a.s4 != b.s4) && (a.s5 != b.s5) && (a.s6 != b.s6) && (a.s7 != b.s7)); } inline __device__ void operator ^= (u64x &a, const u64 b) { a.s0 ^= b; a.s1 ^= b; a.s2 ^= b; a.s3 ^= b; a.s4 ^= b; a.s5 ^= b; a.s6 ^= b; a.s7 ^= b; } inline __device__ void operator ^= (u64x &a, const u64x b) { a.s0 ^= b.s0; a.s1 ^= b.s1; a.s2 ^= b.s2; a.s3 ^= b.s3; a.s4 ^= b.s4; a.s5 ^= b.s5; a.s6 ^= b.s6; a.s7 ^= b.s7; } inline __device__ void operator |= (u64x &a, const u64 b) { a.s0 |= b; a.s1 |= b; a.s2 |= b; a.s3 |= b; a.s4 |= b; a.s5 |= b; a.s6 |= b; a.s7 |= b; } inline __device__ void operator |= (u64x &a, const u64x b) { a.s0 |= b.s0; a.s1 |= b.s1; a.s2 |= b.s2; a.s3 |= b.s3; a.s4 |= b.s4; a.s5 |= b.s5; a.s6 |= b.s6; a.s7 |= b.s7; } inline __device__ void operator &= (u64x &a, const u64 b) { a.s0 &= b; a.s1 &= b; a.s2 &= b; a.s3 &= b; a.s4 &= b; a.s5 &= b; a.s6 &= b; a.s7 &= b; } inline __device__ void operator &= (u64x &a, const u64x b) { a.s0 &= b.s0; a.s1 &= b.s1; a.s2 &= b.s2; a.s3 &= b.s3; a.s4 &= b.s4; a.s5 &= b.s5; a.s6 &= b.s6; a.s7 &= b.s7; } inline __device__ void operator += (u64x &a, const u64 b) { a.s0 += b; a.s1 += b; a.s2 += b; a.s3 += b; a.s4 += b; a.s5 += b; a.s6 += b; a.s7 += b; } inline __device__ void operator += (u64x &a, const u64x b) { a.s0 += b.s0; a.s1 += b.s1; a.s2 += b.s2; a.s3 += b.s3; a.s4 += b.s4; a.s5 += b.s5; a.s6 += b.s6; a.s7 += b.s7; } inline __device__ void operator -= (u64x &a, const u64 b) { a.s0 -= b; a.s1 -= b; a.s2 -= b; a.s3 -= b; a.s4 -= b; a.s5 -= b; a.s6 -= b; a.s7 -= b; } inline __device__ void operator -= (u64x &a, const u64x b) { a.s0 -= b.s0; a.s1 -= b.s1; a.s2 -= b.s2; a.s3 -= b.s3; a.s4 -= b.s4; a.s5 -= b.s5; a.s6 -= b.s6; a.s7 -= b.s7; } inline __device__ void operator *= (u64x &a, const u64 b) { a.s0 *= b; a.s1 *= b; a.s2 *= b; a.s3 *= b; a.s4 *= b; a.s5 *= b; a.s6 *= b; a.s7 *= b; } inline __device__ void operator *= (u64x &a, const u64x b) { a.s0 *= b.s0; a.s1 *= b.s1; a.s2 *= b.s2; a.s3 *= b.s3; a.s4 *= b.s4; a.s5 *= b.s5; a.s6 *= b.s6; a.s7 *= b.s7; } inline __device__ void operator >>= (u64x &a, const u64 b) { a.s0 >>= b; a.s1 >>= b; a.s2 >>= b; a.s3 >>= b; a.s4 >>= b; a.s5 >>= b; a.s6 >>= b; a.s7 >>= b; } inline __device__ void operator >>= (u64x &a, const u64x b) { a.s0 >>= b.s0; a.s1 >>= b.s1; a.s2 >>= b.s2; a.s3 >>= b.s3; a.s4 >>= b.s4; a.s5 >>= b.s5; a.s6 >>= b.s6; a.s7 >>= b.s7; } inline __device__ void operator <<= (u64x &a, const u64 b) { a.s0 <<= b; a.s1 <<= b; a.s2 <<= b; a.s3 <<= b; a.s4 <<= b; a.s5 <<= b; a.s6 <<= b; a.s7 <<= b; } inline __device__ void operator <<= (u64x &a, const u64x b) { a.s0 <<= b.s0; a.s1 <<= b.s1; a.s2 <<= b.s2; a.s3 <<= b.s3; a.s4 <<= b.s4; a.s5 <<= b.s5; a.s6 <<= b.s6; a.s7 <<= b.s7; } inline __device__ u64x operator << (const u64x a, const u64 b) { return u64x ((a.s0 << b), (a.s1 << b) , (a.s2 << b), (a.s3 << b) , (a.s4 << b), (a.s5 << b) , (a.s6 << b), (a.s7 << b) ); } inline __device__ u64x operator << (const u64x a, const u64x b) { return u64x ((a.s0 << b.s0), (a.s1 << b.s1), (a.s2 << b.s2), (a.s3 << b.s3), (a.s4 << b.s4), (a.s5 << b.s5), (a.s6 << b.s6), (a.s7 << b.s7)); } inline __device__ u64x operator >> (const u64x a, const u64 b) { return u64x ((a.s0 >> b), (a.s1 >> b) , (a.s2 >> b), (a.s3 >> b) , (a.s4 >> b), (a.s5 >> b) , (a.s6 >> b), (a.s7 >> b) ); } inline __device__ u64x operator >> (const u64x a, const u64x b) { return u64x ((a.s0 >> b.s0), (a.s1 >> b.s1), (a.s2 >> b.s2), (a.s3 >> b.s3), (a.s4 >> b.s4), (a.s5 >> b.s5), (a.s6 >> b.s6), (a.s7 >> b.s7)); } inline __device__ u64x operator ^ (const u64x a, const u64 b) { return u64x ((a.s0 ^ b), (a.s1 ^ b) , (a.s2 ^ b), (a.s3 ^ b) , (a.s4 ^ b), (a.s5 ^ b) , (a.s6 ^ b), (a.s7 ^ b) ); } inline __device__ u64x operator ^ (const u64x a, const u64x b) { return u64x ((a.s0 ^ b.s0), (a.s1 ^ b.s1), (a.s2 ^ b.s2), (a.s3 ^ b.s3), (a.s4 ^ b.s4), (a.s5 ^ b.s5), (a.s6 ^ b.s6), (a.s7 ^ b.s7)); } inline __device__ u64x operator | (const u64x a, const u64 b) { return u64x ((a.s0 | b), (a.s1 | b) , (a.s2 | b), (a.s3 | b) , (a.s4 | b), (a.s5 | b) , (a.s6 | b), (a.s7 | b) ); } inline __device__ u64x operator | (const u64x a, const u64x b) { return u64x ((a.s0 | b.s0), (a.s1 | b.s1), (a.s2 | b.s2), (a.s3 | b.s3), (a.s4 | b.s4), (a.s5 | b.s5), (a.s6 | b.s6), (a.s7 | b.s7)); } inline __device__ u64x operator & (const u64x a, const u64 b) { return u64x ((a.s0 & b), (a.s1 & b) , (a.s2 & b), (a.s3 & b) , (a.s4 & b), (a.s5 & b) , (a.s6 & b), (a.s7 & b) ); } inline __device__ u64x operator & (const u64x a, const u64x b) { return u64x ((a.s0 & b.s0), (a.s1 & b.s1), (a.s2 & b.s2), (a.s3 & b.s3), (a.s4 & b.s4), (a.s5 & b.s5), (a.s6 & b.s6), (a.s7 & b.s7)); } inline __device__ u64x operator + (const u64x a, const u64 b) { return u64x ((a.s0 + b), (a.s1 + b) , (a.s2 + b), (a.s3 + b) , (a.s4 + b), (a.s5 + b) , (a.s6 + b), (a.s7 + b) ); } inline __device__ u64x operator + (const u64x a, const u64x b) { return u64x ((a.s0 + b.s0), (a.s1 + b.s1), (a.s2 + b.s2), (a.s3 + b.s3), (a.s4 + b.s4), (a.s5 + b.s5), (a.s6 + b.s6), (a.s7 + b.s7)); } inline __device__ u64x operator - (const u64x a, const u64 b) { return u64x ((a.s0 - b), (a.s1 - b) , (a.s2 - b), (a.s3 - b) , (a.s4 - b), (a.s5 - b) , (a.s6 - b), (a.s7 - b) ); } inline __device__ u64x operator - (const u64x a, const u64x b) { return u64x ((a.s0 - b.s0), (a.s1 - b.s1), (a.s2 - b.s2), (a.s3 - b.s3), (a.s4 - b.s4), (a.s5 - b.s5), (a.s6 - b.s6), (a.s7 - b.s7)); } inline __device__ u64x operator * (const u64x a, const u64 b) { return u64x ((a.s0 * b), (a.s1 * b) , (a.s2 * b), (a.s3 * b) , (a.s4 * b), (a.s5 * b) , (a.s6 * b), (a.s7 * b) ); } inline __device__ u64x operator * (const u64x a, const u64x b) { return u64x ((a.s0 * b.s0), (a.s1 * b.s1), (a.s2 * b.s2), (a.s3 * b.s3), (a.s4 * b.s4), (a.s5 * b.s5), (a.s6 * b.s6), (a.s7 * b.s7)); } inline __device__ u64x operator % (const u64x a, const u64 b) { return u64x ((a.s0 % b), (a.s1 % b) , (a.s2 % b), (a.s3 % b) , (a.s4 % b), (a.s5 % b) , (a.s6 % b), (a.s7 % b) ); } inline __device__ u64x operator % (const u64x a, const u64x b) { return u64x ((a.s0 % b.s0), (a.s1 % b.s1), (a.s2 % b.s2), (a.s3 % b.s3), (a.s4 % b.s4), (a.s5 % b.s5), (a.s6 % b.s6), (a.s7 % b.s7)); } inline __device__ u64x operator ~ (const u64x a) { return u64x (~a.s0, ~a.s1, ~a.s2, ~a.s3, ~a.s4, ~a.s5, ~a.s6, ~a.s7); } #endif #if VECT_SIZE == 16 struct __device_builtin__ __builtin_align__(16) u8x { u8 s0; u8 s1; u8 s2; u8 s3; u8 s4; u8 s5; u8 s6; u8 s7; u8 s8; u8 s9; u8 sa; u8 sb; u8 sc; u8 sd; u8 se; u8 sf; inline __device__ u8x (const u8 a, const u8 b, const u8 c, const u8 d, const u8 e, const u8 f, const u8 g, const u8 h, const u8 i, const u8 j, const u8 k, const u8 l, const u8 m, const u8 n, const u8 o, const u8 p) : s0(a), s1(b), s2(c), s3(d), s4(e), s5(f), s6(g), s7(h), s8(i), s9(j), sa(k), sb(l), sc(m), sd(n), se(o), sf(p) { } inline __device__ u8x (const u8 a) : s0(a), s1(a), s2(a), s3(a), s4(a), s5(a), s6(a), s7(a), s8(a), s9(a), sa(a), sb(a), sc(a), sd(a), se(a), sf(a) { } inline __device__ u8x (void) : s0(0), s1(0), s2(0), s3(0), s4(0), s5(0), s6(0), s7(0), s8(0), s9(0), sa(0), sb(0), sc(0), sd(0), se(0), sf(0) { } inline __device__ ~u8x (void) { } }; struct __device_builtin__ __builtin_align__(32) u16x { u16 s0; u16 s1; u16 s2; u16 s3; u16 s4; u16 s5; u16 s6; u16 s7; u16 s8; u16 s9; u16 sa; u16 sb; u16 sc; u16 sd; u16 se; u16 sf; inline __device__ u16x (const u16 a, const u16 b, const u16 c, const u16 d, const u16 e, const u16 f, const u16 g, const u16 h, const u16 i, const u16 j, const u16 k, const u16 l, const u16 m, const u16 n, const u16 o, const u16 p) : s0(a), s1(b), s2(c), s3(d), s4(e), s5(f), s6(g), s7(h), s8(i), s9(j), sa(k), sb(l), sc(m), sd(n), se(o), sf(p) { } inline __device__ u16x (const u16 a) : s0(a), s1(a), s2(a), s3(a), s4(a), s5(a), s6(a), s7(a), s8(a), s9(a), sa(a), sb(a), sc(a), sd(a), se(a), sf(a) { } inline __device__ u16x (void) : s0(0), s1(0), s2(0), s3(0), s4(0), s5(0), s6(0), s7(0), s8(0), s9(0), sa(0), sb(0), sc(0), sd(0), se(0), sf(0){ } inline __device__ ~u16x (void) { } }; struct __device_builtin__ __builtin_align__(64) u32x { u32 s0; u32 s1; u32 s2; u32 s3; u32 s4; u32 s5; u32 s6; u32 s7; u32 s8; u32 s9; u32 sa; u32 sb; u32 sc; u32 sd; u32 se; u32 sf; inline __device__ u32x (const u32 a, const u32 b, const u32 c, const u32 d, const u32 e, const u32 f, const u32 g, const u32 h, const u32 i, const u32 j, const u32 k, const u32 l, const u32 m, const u32 n, const u32 o, const u32 p) : s0(a), s1(b), s2(c), s3(d), s4(e), s5(f), s6(g), s7(h), s8(i), s9(j), sa(k), sb(l), sc(m), sd(n), se(o), sf(p) { } inline __device__ u32x (const u32 a) : s0(a), s1(a), s2(a), s3(a), s4(a), s5(a), s6(a), s7(a), s8(a), s9(a), sa(a), sb(a), sc(a), sd(a), se(a), sf(a) { } inline __device__ u32x (void) : s0(0), s1(0), s2(0), s3(0), s4(0), s5(0), s6(0), s7(0), s8(0), s9(0), sa(0), sb(0), sc(0), sd(0), se(0), sf(0){ } inline __device__ ~u32x (void) { } }; struct __device_builtin__ __builtin_align__(128) u64x { u64 s0; u64 s1; u64 s2; u64 s3; u64 s4; u64 s5; u64 s6; u64 s7; u64 s8; u64 s9; u64 sa; u64 sb; u64 sc; u64 sd; u64 se; u64 sf; inline __device__ u64x (const u64 a, const u64 b, const u64 c, const u64 d, const u64 e, const u64 f, const u64 g, const u64 h, const u64 i, const u64 j, const u64 k, const u64 l, const u64 m, const u64 n, const u64 o, const u64 p) : s0(a), s1(b), s2(c), s3(d), s4(e), s5(f), s6(g), s7(h), s8(i), s9(j), sa(k), sb(l), sc(m), sd(n), se(o), sf(p) { } inline __device__ u64x (const u64 a) : s0(a), s1(a), s2(a), s3(a), s4(a), s5(a), s6(a), s7(a), s8(a), s9(a), sa(a), sb(a), sc(a), sd(a), se(a), sf(a) { } inline __device__ u64x (void) : s0(0), s1(0), s2(0), s3(0), s4(0), s5(0), s6(0), s7(0), s8(0), s9(0), sa(0), sb(0), sc(0), sd(0), se(0), sf(0) { } inline __device__ ~u64x (void) { } }; inline __device__ bool operator != (const u32x a, const u32 b) { return ((a.s0 != b) && (a.s1 != b) && (a.s2 != b) && (a.s3 != b) && (a.s4 != b) && (a.s5 != b) && (a.s6 != b) && (a.s7 != b) && (a.s8 != b) && (a.s9 != b) && (a.sa != b) && (a.sb != b) && (a.sc != b) && (a.sd != b) && (a.se != b) && (a.sf != b) ); } inline __device__ bool operator != (const u32x a, const u32x b) { return ((a.s0 != b.s0) && (a.s1 != b.s1) && (a.s2 != b.s2) && (a.s3 != b.s3) && (a.s4 != b.s4) && (a.s5 != b.s5) && (a.s6 != b.s6) && (a.s7 != b.s7) && (a.s8 != b.s8) && (a.s9 != b.s9) && (a.sa != b.sa) && (a.sb != b.sb) && (a.sc != b.sc) && (a.sd != b.sd) && (a.se != b.se) && (a.sf != b.sf)); } inline __device__ void operator ^= (u32x &a, const u32 b) { a.s0 ^= b; a.s1 ^= b; a.s2 ^= b; a.s3 ^= b; a.s4 ^= b; a.s5 ^= b; a.s6 ^= b; a.s7 ^= b; a.s8 ^= b; a.s9 ^= b; a.sa ^= b; a.sb ^= b; a.sc ^= b; a.sd ^= b; a.se ^= b; a.sf ^= b; } inline __device__ void operator ^= (u32x &a, const u32x b) { a.s0 ^= b.s0; a.s1 ^= b.s1; a.s2 ^= b.s2; a.s3 ^= b.s3; a.s4 ^= b.s4; a.s5 ^= b.s5; a.s6 ^= b.s6; a.s7 ^= b.s7; a.s8 ^= b.s8; a.s9 ^= b.s9; a.sa ^= b.sa; a.sb ^= b.sb; a.sc ^= b.sc; a.sd ^= b.sd; a.se ^= b.se; a.sf ^= b.sf; } inline __device__ void operator |= (u32x &a, const u32 b) { a.s0 |= b; a.s1 |= b; a.s2 |= b; a.s3 |= b; a.s4 |= b; a.s5 |= b; a.s6 |= b; a.s7 |= b; a.s8 |= b; a.s9 |= b; a.sa |= b; a.sb |= b; a.sc |= b; a.sd |= b; a.se |= b; a.sf |= b; } inline __device__ void operator |= (u32x &a, const u32x b) { a.s0 |= b.s0; a.s1 |= b.s1; a.s2 |= b.s2; a.s3 |= b.s3; a.s4 |= b.s4; a.s5 |= b.s5; a.s6 |= b.s6; a.s7 |= b.s7; a.s8 |= b.s8; a.s9 |= b.s9; a.sa |= b.sa; a.sb |= b.sb; a.sc |= b.sc; a.sd |= b.sd; a.se |= b.se; a.sf |= b.sf; } inline __device__ void operator &= (u32x &a, const u32 b) { a.s0 &= b; a.s1 &= b; a.s2 &= b; a.s3 &= b; a.s4 &= b; a.s5 &= b; a.s6 &= b; a.s7 &= b; a.s8 &= b; a.s9 &= b; a.sa &= b; a.sb &= b; a.sc &= b; a.sd &= b; a.se &= b; a.sf &= b; } inline __device__ void operator &= (u32x &a, const u32x b) { a.s0 &= b.s0; a.s1 &= b.s1; a.s2 &= b.s2; a.s3 &= b.s3; a.s4 &= b.s4; a.s5 &= b.s5; a.s6 &= b.s6; a.s7 &= b.s7; a.s8 &= b.s8; a.s9 &= b.s9; a.sa &= b.sa; a.sb &= b.sb; a.sc &= b.sc; a.sd &= b.sd; a.se &= b.se; a.sf &= b.sf; } inline __device__ void operator += (u32x &a, const u32 b) { a.s0 += b; a.s1 += b; a.s2 += b; a.s3 += b; a.s4 += b; a.s5 += b; a.s6 += b; a.s7 += b; a.s8 += b; a.s9 += b; a.sa += b; a.sb += b; a.sc += b; a.sd += b; a.se += b; a.sf += b; } inline __device__ void operator += (u32x &a, const u32x b) { a.s0 += b.s0; a.s1 += b.s1; a.s2 += b.s2; a.s3 += b.s3; a.s4 += b.s4; a.s5 += b.s5; a.s6 += b.s6; a.s7 += b.s7; a.s8 += b.s8; a.s9 += b.s9; a.sa += b.sa; a.sb += b.sb; a.sc += b.sc; a.sd += b.sd; a.se += b.se; a.sf += b.sf; } inline __device__ void operator -= (u32x &a, const u32 b) { a.s0 -= b; a.s1 -= b; a.s2 -= b; a.s3 -= b; a.s4 -= b; a.s5 -= b; a.s6 -= b; a.s7 -= b; a.s8 -= b; a.s9 -= b; a.sa -= b; a.sb -= b; a.sc -= b; a.sd -= b; a.se -= b; a.sf -= b; } inline __device__ void operator -= (u32x &a, const u32x b) { a.s0 -= b.s0; a.s1 -= b.s1; a.s2 -= b.s2; a.s3 -= b.s3; a.s4 -= b.s4; a.s5 -= b.s5; a.s6 -= b.s6; a.s7 -= b.s7; a.s8 -= b.s8; a.s9 -= b.s9; a.sa -= b.sa; a.sb -= b.sb; a.sc -= b.sc; a.sd -= b.sd; a.se -= b.se; a.sf -= b.sf; } inline __device__ void operator *= (u32x &a, const u32 b) { a.s0 *= b; a.s1 *= b; a.s2 *= b; a.s3 *= b; a.s4 *= b; a.s5 *= b; a.s6 *= b; a.s7 *= b; a.s8 *= b; a.s9 *= b; a.sa *= b; a.sb *= b; a.sc *= b; a.sd *= b; a.se *= b; a.sf *= b; } inline __device__ void operator *= (u32x &a, const u32x b) { a.s0 *= b.s0; a.s1 *= b.s1; a.s2 *= b.s2; a.s3 *= b.s3; a.s4 *= b.s4; a.s5 *= b.s5; a.s6 *= b.s6; a.s7 *= b.s7; a.s8 *= b.s8; a.s9 *= b.s9; a.sa *= b.sa; a.sb *= b.sb; a.sc *= b.sc; a.sd *= b.sd; a.se *= b.se; a.sf *= b.sf; } inline __device__ void operator >>= (u32x &a, const u32 b) { a.s0 >>= b; a.s1 >>= b; a.s2 >>= b; a.s3 >>= b; a.s4 >>= b; a.s5 >>= b; a.s6 >>= b; a.s7 >>= b; a.s8 >>= b; a.s9 >>= b; a.sa >>= b; a.sb >>= b; a.sc >>= b; a.sd >>= b; a.se >>= b; a.sf >>= b; } inline __device__ void operator >>= (u32x &a, const u32x b) { a.s0 >>= b.s0; a.s1 >>= b.s1; a.s2 >>= b.s2; a.s3 >>= b.s3; a.s4 >>= b.s4; a.s5 >>= b.s5; a.s6 >>= b.s6; a.s7 >>= b.s7; a.s8 >>= b.s8; a.s9 >>= b.s9; a.sa >>= b.sa; a.sb >>= b.sb; a.sc >>= b.sc; a.sd >>= b.sd; a.se >>= b.se; a.sf >>= b.sf; } inline __device__ void operator <<= (u32x &a, const u32 b) { a.s0 <<= b; a.s1 <<= b; a.s2 <<= b; a.s3 <<= b; a.s4 <<= b; a.s5 <<= b; a.s6 <<= b; a.s7 <<= b; a.s8 <<= b; a.s9 <<= b; a.sa <<= b; a.sb <<= b; a.sc <<= b; a.sd <<= b; a.se <<= b; a.sf <<= b; } inline __device__ void operator <<= (u32x &a, const u32x b) { a.s0 <<= b.s0; a.s1 <<= b.s1; a.s2 <<= b.s2; a.s3 <<= b.s3; a.s4 <<= b.s4; a.s5 <<= b.s5; a.s6 <<= b.s6; a.s7 <<= b.s7; a.s8 <<= b.s8; a.s9 <<= b.s9; a.sa <<= b.sa; a.sb <<= b.sb; a.sc <<= b.sc; a.sd <<= b.sd; a.se <<= b.se; a.sf <<= b.sf; } inline __device__ u32x operator << (const u32x a, const u32 b) { return u32x ((a.s0 << b), (a.s1 << b) , (a.s2 << b), (a.s3 << b) , (a.s4 << b), (a.s5 << b) , (a.s6 << b), (a.s7 << b), (a.s8 << b), (a.s9 << b) , (a.sa << b), (a.sb << b) , (a.sc << b), (a.sd << b) , (a.se << b), (a.sf << b) ); } inline __device__ u32x operator << (const u32x a, const u32x b) { return u32x ((a.s0 << b.s0), (a.s1 << b.s1), (a.s2 << b.s2), (a.s3 << b.s3), (a.s4 << b.s4), (a.s5 << b.s5), (a.s6 << b.s6), (a.s7 << b.s7), (a.s8 << b.s8), (a.s9 << b.s9), (a.sa << b.sa), (a.sb << b.sb), (a.sc << b.sc), (a.sd << b.sd), (a.se << b.se), (a.sf << b.sf)); } inline __device__ u32x operator >> (const u32x a, const u32 b) { return u32x ((a.s0 >> b), (a.s1 >> b) , (a.s2 >> b), (a.s3 >> b) , (a.s4 >> b), (a.s5 >> b) , (a.s6 >> b), (a.s7 >> b), (a.s8 >> b), (a.s9 >> b) , (a.sa >> b), (a.sb >> b) , (a.sc >> b), (a.sd >> b) , (a.se >> b), (a.sf >> b) ); } inline __device__ u32x operator >> (const u32x a, const u32x b) { return u32x ((a.s0 >> b.s0), (a.s1 >> b.s1), (a.s2 >> b.s2), (a.s3 >> b.s3), (a.s4 >> b.s4), (a.s5 >> b.s5), (a.s6 >> b.s6), (a.s7 >> b.s7), (a.s8 >> b.s8), (a.s9 >> b.s9), (a.sa >> b.sa), (a.sb >> b.sb), (a.sc >> b.sc), (a.sd >> b.sd), (a.se >> b.se), (a.sf >> b.sf)); } inline __device__ u32x operator ^ (const u32x a, const u32 b) { return u32x ((a.s0 ^ b), (a.s1 ^ b) , (a.s2 ^ b), (a.s3 ^ b) , (a.s4 ^ b), (a.s5 ^ b) , (a.s6 ^ b), (a.s7 ^ b), (a.s8 ^ b), (a.s9 ^ b) , (a.sa ^ b), (a.sb ^ b) , (a.sc ^ b), (a.sd ^ b) , (a.se ^ b), (a.sf ^ b) ); } inline __device__ u32x operator ^ (const u32x a, const u32x b) { return u32x ((a.s0 ^ b.s0), (a.s1 ^ b.s1), (a.s2 ^ b.s2), (a.s3 ^ b.s3), (a.s4 ^ b.s4), (a.s5 ^ b.s5), (a.s6 ^ b.s6), (a.s7 ^ b.s7), (a.s8 ^ b.s8), (a.s9 ^ b.s9), (a.sa ^ b.sa), (a.sb ^ b.sb), (a.sc ^ b.sc), (a.sd ^ b.sd), (a.se ^ b.se), (a.sf ^ b.sf)); } inline __device__ u32x operator | (const u32x a, const u32 b) { return u32x ((a.s0 | b), (a.s1 | b) , (a.s2 | b), (a.s3 | b) , (a.s4 | b), (a.s5 | b) , (a.s6 | b), (a.s7 | b), (a.s8 | b), (a.s9 | b) , (a.sa | b), (a.sb | b) , (a.sc | b), (a.sd | b) , (a.se | b), (a.sf | b) ); } inline __device__ u32x operator | (const u32x a, const u32x b) { return u32x ((a.s0 | b.s0), (a.s1 | b.s1), (a.s2 | b.s2), (a.s3 | b.s3), (a.s4 | b.s4), (a.s5 | b.s5), (a.s6 | b.s6), (a.s7 | b.s7), (a.s8 | b.s8), (a.s9 | b.s9), (a.sa | b.sa), (a.sb | b.sb), (a.sc | b.sc), (a.sd | b.sd), (a.se | b.se), (a.sf | b.sf)); } inline __device__ u32x operator & (const u32x a, const u32 b) { return u32x ((a.s0 & b), (a.s1 & b) , (a.s2 & b), (a.s3 & b) , (a.s4 & b), (a.s5 & b) , (a.s6 & b), (a.s7 & b), (a.s8 & b), (a.s9 & b) , (a.sa & b), (a.sb & b) , (a.sc & b), (a.sd & b) , (a.se & b), (a.sf & b) ); } inline __device__ u32x operator & (const u32x a, const u32x b) { return u32x ((a.s0 & b.s0), (a.s1 & b.s1), (a.s2 & b.s2), (a.s3 & b.s3), (a.s4 & b.s4), (a.s5 & b.s5), (a.s6 & b.s6), (a.s7 & b.s7), (a.s8 & b.s8), (a.s9 & b.s9), (a.sa & b.sa), (a.sb & b.sb), (a.sc & b.sc), (a.sd & b.sd), (a.se & b.se), (a.sf & b.sf)); } inline __device__ u32x operator + (const u32x a, const u32 b) { return u32x ((a.s0 + b), (a.s1 + b) , (a.s2 + b), (a.s3 + b) , (a.s4 + b), (a.s5 + b) , (a.s6 + b), (a.s7 + b), (a.s8 + b), (a.s9 + b) , (a.sa + b), (a.sb + b) , (a.sc + b), (a.sd + b) , (a.se + b), (a.sf + b) ); } inline __device__ u32x operator + (const u32x a, const u32x b) { return u32x ((a.s0 + b.s0), (a.s1 + b.s1), (a.s2 + b.s2), (a.s3 + b.s3), (a.s4 + b.s4), (a.s5 + b.s5), (a.s6 + b.s6), (a.s7 + b.s7), (a.s8 + b.s8), (a.s9 + b.s9), (a.sa + b.sa), (a.sb + b.sb), (a.sc + b.sc), (a.sd + b.sd), (a.se + b.se), (a.sf + b.sf)); } inline __device__ u32x operator - (const u32x a, const u32 b) { return u32x ((a.s0 - b), (a.s1 - b) , (a.s2 - b), (a.s3 - b) , (a.s4 - b), (a.s5 - b) , (a.s6 - b), (a.s7 - b), (a.s8 - b), (a.s9 - b) , (a.sa - b), (a.sb - b) , (a.sc - b), (a.sd - b) , (a.se - b), (a.sf - b) ); } inline __device__ u32x operator - (const u32x a, const u32x b) { return u32x ((a.s0 - b.s0), (a.s1 - b.s1), (a.s2 - b.s2), (a.s3 - b.s3), (a.s4 - b.s4), (a.s5 - b.s5), (a.s6 - b.s6), (a.s7 - b.s7), (a.s8 - b.s8), (a.s9 - b.s9), (a.sa - b.sa), (a.sb - b.sb), (a.sc - b.sc), (a.sd - b.sd), (a.se - b.se), (a.sf - b.sf)); } inline __device__ u32x operator * (const u32x a, const u32 b) { return u32x ((a.s0 * b), (a.s1 * b) , (a.s2 * b), (a.s3 * b) , (a.s4 * b), (a.s5 * b) , (a.s6 * b), (a.s7 * b), (a.s8 * b), (a.s9 * b) , (a.sa * b), (a.sb * b) , (a.sc * b), (a.sd * b) , (a.se * b), (a.sf * b) ); } inline __device__ u32x operator * (const u32x a, const u32x b) { return u32x ((a.s0 * b.s0), (a.s1 * b.s1), (a.s2 * b.s2), (a.s3 * b.s3), (a.s4 * b.s4), (a.s5 * b.s5), (a.s6 * b.s6), (a.s7 * b.s7), (a.s8 * b.s8), (a.s9 * b.s9), (a.sa * b.sa), (a.sb * b.sb), (a.sc * b.sc), (a.sd * b.sd), (a.se * b.se), (a.sf * b.sf)); } inline __device__ u32x operator % (const u32x a, const u32 b) { return u32x ((a.s0 % b), (a.s1 % b) , (a.s2 % b), (a.s3 % b) , (a.s4 % b), (a.s5 % b) , (a.s6 % b), (a.s7 % b), (a.s8 % b), (a.s9 % b) , (a.sa % b), (a.sb % b) , (a.sc % b), (a.sd % b) , (a.se % b), (a.sf % b) ); } inline __device__ u32x operator % (const u32x a, const u32x b) { return u32x ((a.s0 % b.s0), (a.s1 % b.s1), (a.s2 % b.s2), (a.s3 % b.s3), (a.s4 % b.s4), (a.s5 % b.s5), (a.s6 % b.s6), (a.s7 % b.s7), (a.s8 % b.s8), (a.s9 % b.s9), (a.sa % b.sa), (a.sb % b.sb), (a.sc % b.sc), (a.sd % b.sd), (a.se % b.se), (a.sf % b.sf)); } inline __device__ u32x operator ~ (const u32x a) { return u32x (~a.s0, ~a.s1, ~a.s2, ~a.s3, ~a.s4, ~a.s5, ~a.s6, ~a.s7, ~a.s8, ~a.s9, ~a.sa, ~a.sb, ~a.sc, ~a.sd, ~a.se, ~a.sf); } inline __device__ bool operator != (const u64x a, const u64 b) { return ((a.s0 != b) && (a.s1 != b) && (a.s2 != b) && (a.s3 != b) && (a.s4 != b) && (a.s5 != b) && (a.s6 != b) && (a.s7 != b) && (a.s8 != b) && (a.s9 != b) && (a.sa != b) && (a.sb != b) && (a.sc != b) && (a.sd != b) && (a.se != b) && (a.sf != b) ); } inline __device__ bool operator != (const u64x a, const u64x b) { return ((a.s0 != b.s0) && (a.s1 != b.s1) && (a.s2 != b.s2) && (a.s3 != b.s3) && (a.s4 != b.s4) && (a.s5 != b.s5) && (a.s6 != b.s6) && (a.s7 != b.s7) && (a.s8 != b.s8) && (a.s9 != b.s9) && (a.sa != b.sa) && (a.sb != b.sb) && (a.sc != b.sc) && (a.sd != b.sd) && (a.se != b.se) && (a.sf != b.sf)); } inline __device__ void operator ^= (u64x &a, const u64 b) { a.s0 ^= b; a.s1 ^= b; a.s2 ^= b; a.s3 ^= b; a.s4 ^= b; a.s5 ^= b; a.s6 ^= b; a.s7 ^= b; a.s8 ^= b; a.s9 ^= b; a.sa ^= b; a.sb ^= b; a.sc ^= b; a.sd ^= b; a.se ^= b; a.sf ^= b; } inline __device__ void operator ^= (u64x &a, const u64x b) { a.s0 ^= b.s0; a.s1 ^= b.s1; a.s2 ^= b.s2; a.s3 ^= b.s3; a.s4 ^= b.s4; a.s5 ^= b.s5; a.s6 ^= b.s6; a.s7 ^= b.s7; a.s8 ^= b.s8; a.s9 ^= b.s9; a.sa ^= b.sa; a.sb ^= b.sb; a.sc ^= b.sc; a.sd ^= b.sd; a.se ^= b.se; a.sf ^= b.sf; } inline __device__ void operator |= (u64x &a, const u64 b) { a.s0 |= b; a.s1 |= b; a.s2 |= b; a.s3 |= b; a.s4 |= b; a.s5 |= b; a.s6 |= b; a.s7 |= b; a.s8 |= b; a.s9 |= b; a.sa |= b; a.sb |= b; a.sc |= b; a.sd |= b; a.se |= b; a.sf |= b; } inline __device__ void operator |= (u64x &a, const u64x b) { a.s0 |= b.s0; a.s1 |= b.s1; a.s2 |= b.s2; a.s3 |= b.s3; a.s4 |= b.s4; a.s5 |= b.s5; a.s6 |= b.s6; a.s7 |= b.s7; a.s8 |= b.s8; a.s9 |= b.s9; a.sa |= b.sa; a.sb |= b.sb; a.sc |= b.sc; a.sd |= b.sd; a.se |= b.se; a.sf |= b.sf; } inline __device__ void operator &= (u64x &a, const u64 b) { a.s0 &= b; a.s1 &= b; a.s2 &= b; a.s3 &= b; a.s4 &= b; a.s5 &= b; a.s6 &= b; a.s7 &= b; a.s8 &= b; a.s9 &= b; a.sa &= b; a.sb &= b; a.sc &= b; a.sd &= b; a.se &= b; a.sf &= b; } inline __device__ void operator &= (u64x &a, const u64x b) { a.s0 &= b.s0; a.s1 &= b.s1; a.s2 &= b.s2; a.s3 &= b.s3; a.s4 &= b.s4; a.s5 &= b.s5; a.s6 &= b.s6; a.s7 &= b.s7; a.s8 &= b.s8; a.s9 &= b.s9; a.sa &= b.sa; a.sb &= b.sb; a.sc &= b.sc; a.sd &= b.sd; a.se &= b.se; a.sf &= b.sf; } inline __device__ void operator += (u64x &a, const u64 b) { a.s0 += b; a.s1 += b; a.s2 += b; a.s3 += b; a.s4 += b; a.s5 += b; a.s6 += b; a.s7 += b; a.s8 += b; a.s9 += b; a.sa += b; a.sb += b; a.sc += b; a.sd += b; a.se += b; a.sf += b; } inline __device__ void operator += (u64x &a, const u64x b) { a.s0 += b.s0; a.s1 += b.s1; a.s2 += b.s2; a.s3 += b.s3; a.s4 += b.s4; a.s5 += b.s5; a.s6 += b.s6; a.s7 += b.s7; a.s8 += b.s8; a.s9 += b.s9; a.sa += b.sa; a.sb += b.sb; a.sc += b.sc; a.sd += b.sd; a.se += b.se; a.sf += b.sf; } inline __device__ void operator -= (u64x &a, const u64 b) { a.s0 -= b; a.s1 -= b; a.s2 -= b; a.s3 -= b; a.s4 -= b; a.s5 -= b; a.s6 -= b; a.s7 -= b; a.s8 -= b; a.s9 -= b; a.sa -= b; a.sb -= b; a.sc -= b; a.sd -= b; a.se -= b; a.sf -= b; } inline __device__ void operator -= (u64x &a, const u64x b) { a.s0 -= b.s0; a.s1 -= b.s1; a.s2 -= b.s2; a.s3 -= b.s3; a.s4 -= b.s4; a.s5 -= b.s5; a.s6 -= b.s6; a.s7 -= b.s7; a.s8 -= b.s8; a.s9 -= b.s9; a.sa -= b.sa; a.sb -= b.sb; a.sc -= b.sc; a.sd -= b.sd; a.se -= b.se; a.sf -= b.sf; } inline __device__ void operator *= (u64x &a, const u64 b) { a.s0 *= b; a.s1 *= b; a.s2 *= b; a.s3 *= b; a.s4 *= b; a.s5 *= b; a.s6 *= b; a.s7 *= b; a.s8 *= b; a.s9 *= b; a.sa *= b; a.sb *= b; a.sc *= b; a.sd *= b; a.se *= b; a.sf *= b; } inline __device__ void operator *= (u64x &a, const u64x b) { a.s0 *= b.s0; a.s1 *= b.s1; a.s2 *= b.s2; a.s3 *= b.s3; a.s4 *= b.s4; a.s5 *= b.s5; a.s6 *= b.s6; a.s7 *= b.s7; a.s8 *= b.s8; a.s9 *= b.s9; a.sa *= b.sa; a.sb *= b.sb; a.sc *= b.sc; a.sd *= b.sd; a.se *= b.se; a.sf *= b.sf; } inline __device__ void operator >>= (u64x &a, const u64 b) { a.s0 >>= b; a.s1 >>= b; a.s2 >>= b; a.s3 >>= b; a.s4 >>= b; a.s5 >>= b; a.s6 >>= b; a.s7 >>= b; a.s8 >>= b; a.s9 >>= b; a.sa >>= b; a.sb >>= b; a.sc >>= b; a.sd >>= b; a.se >>= b; a.sf >>= b; } inline __device__ void operator >>= (u64x &a, const u64x b) { a.s0 >>= b.s0; a.s1 >>= b.s1; a.s2 >>= b.s2; a.s3 >>= b.s3; a.s4 >>= b.s4; a.s5 >>= b.s5; a.s6 >>= b.s6; a.s7 >>= b.s7; a.s8 >>= b.s8; a.s9 >>= b.s9; a.sa >>= b.sa; a.sb >>= b.sb; a.sc >>= b.sc; a.sd >>= b.sd; a.se >>= b.se; a.sf >>= b.sf; } inline __device__ void operator <<= (u64x &a, const u64 b) { a.s0 <<= b; a.s1 <<= b; a.s2 <<= b; a.s3 <<= b; a.s4 <<= b; a.s5 <<= b; a.s6 <<= b; a.s7 <<= b; a.s8 <<= b; a.s9 <<= b; a.sa <<= b; a.sb <<= b; a.sc <<= b; a.sd <<= b; a.se <<= b; a.sf <<= b; } inline __device__ void operator <<= (u64x &a, const u64x b) { a.s0 <<= b.s0; a.s1 <<= b.s1; a.s2 <<= b.s2; a.s3 <<= b.s3; a.s4 <<= b.s4; a.s5 <<= b.s5; a.s6 <<= b.s6; a.s7 <<= b.s7; a.s8 <<= b.s8; a.s9 <<= b.s9; a.sa <<= b.sa; a.sb <<= b.sb; a.sc <<= b.sc; a.sd <<= b.sd; a.se <<= b.se; a.sf <<= b.sf; } inline __device__ u64x operator << (const u64x a, const u64 b) { return u64x ((a.s0 << b), (a.s1 << b) , (a.s2 << b), (a.s3 << b) , (a.s4 << b), (a.s5 << b) , (a.s6 << b), (a.s7 << b), (a.s8 << b), (a.s9 << b) , (a.sa << b), (a.sb << b) , (a.sc << b), (a.sd << b) , (a.se << b), (a.sf << b) ); } inline __device__ u64x operator << (const u64x a, const u64x b) { return u64x ((a.s0 << b.s0), (a.s1 << b.s1), (a.s2 << b.s2), (a.s3 << b.s3), (a.s4 << b.s4), (a.s5 << b.s5), (a.s6 << b.s6), (a.s7 << b.s7), (a.s8 << b.s8), (a.s9 << b.s9), (a.sa << b.sa), (a.sb << b.sb), (a.sc << b.sc), (a.sd << b.sd), (a.se << b.se), (a.sf << b.sf)); } inline __device__ u64x operator >> (const u64x a, const u64 b) { return u64x ((a.s0 >> b), (a.s1 >> b) , (a.s2 >> b), (a.s3 >> b) , (a.s4 >> b), (a.s5 >> b) , (a.s6 >> b), (a.s7 >> b), (a.s8 >> b), (a.s9 >> b) , (a.sa >> b), (a.sb >> b) , (a.sc >> b), (a.sd >> b) , (a.se >> b), (a.sf >> b) ); } inline __device__ u64x operator >> (const u64x a, const u64x b) { return u64x ((a.s0 >> b.s0), (a.s1 >> b.s1), (a.s2 >> b.s2), (a.s3 >> b.s3), (a.s4 >> b.s4), (a.s5 >> b.s5), (a.s6 >> b.s6), (a.s7 >> b.s7), (a.s8 >> b.s8), (a.s9 >> b.s9), (a.sa >> b.sa), (a.sb >> b.sb), (a.sc >> b.sc), (a.sd >> b.sd), (a.se >> b.se), (a.sf >> b.sf)); } inline __device__ u64x operator ^ (const u64x a, const u64 b) { return u64x ((a.s0 ^ b), (a.s1 ^ b) , (a.s2 ^ b), (a.s3 ^ b) , (a.s4 ^ b), (a.s5 ^ b) , (a.s6 ^ b), (a.s7 ^ b), (a.s8 ^ b), (a.s9 ^ b) , (a.sa ^ b), (a.sb ^ b) , (a.sc ^ b), (a.sd ^ b) , (a.se ^ b), (a.sf ^ b) ); } inline __device__ u64x operator ^ (const u64x a, const u64x b) { return u64x ((a.s0 ^ b.s0), (a.s1 ^ b.s1), (a.s2 ^ b.s2), (a.s3 ^ b.s3), (a.s4 ^ b.s4), (a.s5 ^ b.s5), (a.s6 ^ b.s6), (a.s7 ^ b.s7), (a.s8 ^ b.s8), (a.s9 ^ b.s9), (a.sa ^ b.sa), (a.sb ^ b.sb), (a.sc ^ b.sc), (a.sd ^ b.sd), (a.se ^ b.se), (a.sf ^ b.sf)); } inline __device__ u64x operator | (const u64x a, const u64 b) { return u64x ((a.s0 | b), (a.s1 | b) , (a.s2 | b), (a.s3 | b) , (a.s4 | b), (a.s5 | b) , (a.s6 | b), (a.s7 | b), (a.s8 | b), (a.s9 | b) , (a.sa | b), (a.sb | b) , (a.sc | b), (a.sd | b) , (a.se | b), (a.sf | b) ); } inline __device__ u64x operator | (const u64x a, const u64x b) { return u64x ((a.s0 | b.s0), (a.s1 | b.s1), (a.s2 | b.s2), (a.s3 | b.s3), (a.s4 | b.s4), (a.s5 | b.s5), (a.s6 | b.s6), (a.s7 | b.s7), (a.s8 | b.s8), (a.s9 | b.s9), (a.sa | b.sa), (a.sb | b.sb), (a.sc | b.sc), (a.sd | b.sd), (a.se | b.se), (a.sf | b.sf)); } inline __device__ u64x operator & (const u64x a, const u64 b) { return u64x ((a.s0 & b), (a.s1 & b) , (a.s2 & b), (a.s3 & b) , (a.s4 & b), (a.s5 & b) , (a.s6 & b), (a.s7 & b), (a.s8 & b), (a.s9 & b) , (a.sa & b), (a.sb & b) , (a.sc & b), (a.sd & b) , (a.se & b), (a.sf & b) ); } inline __device__ u64x operator & (const u64x a, const u64x b) { return u64x ((a.s0 & b.s0), (a.s1 & b.s1), (a.s2 & b.s2), (a.s3 & b.s3), (a.s4 & b.s4), (a.s5 & b.s5), (a.s6 & b.s6), (a.s7 & b.s7), (a.s8 & b.s8), (a.s9 & b.s9), (a.sa & b.sa), (a.sb & b.sb), (a.sc & b.sc), (a.sd & b.sd), (a.se & b.se), (a.sf & b.sf)); } inline __device__ u64x operator + (const u64x a, const u64 b) { return u64x ((a.s0 + b), (a.s1 + b) , (a.s2 + b), (a.s3 + b) , (a.s4 + b), (a.s5 + b) , (a.s6 + b), (a.s7 + b), (a.s8 + b), (a.s9 + b) , (a.sa + b), (a.sb + b) , (a.sc + b), (a.sd + b) , (a.se + b), (a.sf + b) ); } inline __device__ u64x operator + (const u64x a, const u64x b) { return u64x ((a.s0 + b.s0), (a.s1 + b.s1), (a.s2 + b.s2), (a.s3 + b.s3), (a.s4 + b.s4), (a.s5 + b.s5), (a.s6 + b.s6), (a.s7 + b.s7), (a.s8 + b.s8), (a.s9 + b.s9), (a.sa + b.sa), (a.sb + b.sb), (a.sc + b.sc), (a.sd + b.sd), (a.se + b.se), (a.sf + b.sf)); } inline __device__ u64x operator - (const u64x a, const u64 b) { return u64x ((a.s0 - b), (a.s1 - b) , (a.s2 - b), (a.s3 - b) , (a.s4 - b), (a.s5 - b) , (a.s6 - b), (a.s7 - b), (a.s8 - b), (a.s9 - b) , (a.sa - b), (a.sb - b) , (a.sc - b), (a.sd - b) , (a.se - b), (a.sf - b) ); } inline __device__ u64x operator - (const u64x a, const u64x b) { return u64x ((a.s0 - b.s0), (a.s1 - b.s1), (a.s2 - b.s2), (a.s3 - b.s3), (a.s4 - b.s4), (a.s5 - b.s5), (a.s6 - b.s6), (a.s7 - b.s7), (a.s8 - b.s8), (a.s9 - b.s9), (a.sa - b.sa), (a.sb - b.sb), (a.sc - b.sc), (a.sd - b.sd), (a.se - b.se), (a.sf - b.sf)); } inline __device__ u64x operator * (const u64x a, const u64 b) { return u64x ((a.s0 * b), (a.s1 * b) , (a.s2 * b), (a.s3 * b) , (a.s4 * b), (a.s5 * b) , (a.s6 * b), (a.s7 * b), (a.s8 * b), (a.s9 * b) , (a.sa * b), (a.sb * b) , (a.sc * b), (a.sd * b) , (a.se * b), (a.sf * b) ); } inline __device__ u64x operator * (const u64x a, const u64x b) { return u64x ((a.s0 * b.s0), (a.s1 * b.s1), (a.s2 * b.s2), (a.s3 * b.s3), (a.s4 * b.s4), (a.s5 * b.s5), (a.s6 * b.s6), (a.s7 * b.s7), (a.s8 * b.s8), (a.s9 * b.s9), (a.sa * b.sa), (a.sb * b.sb), (a.sc * b.sc), (a.sd * b.sd), (a.se * b.se), (a.sf * b.sf)); } inline __device__ u64x operator % (const u64x a, const u64 b) { return u64x ((a.s0 % b), (a.s1 % b) , (a.s2 % b), (a.s3 % b) , (a.s4 % b), (a.s5 % b) , (a.s6 % b), (a.s7 % b), (a.s8 % b), (a.s9 % b) , (a.sa % b), (a.sb % b) , (a.sc % b), (a.sd % b) , (a.se % b), (a.sf % b) ); } inline __device__ u64x operator % (const u64x a, const u64x b) { return u64x ((a.s0 % b.s0), (a.s1 % b.s1), (a.s2 % b.s2), (a.s3 % b.s3), (a.s4 % b.s4), (a.s5 % b.s5), (a.s6 % b.s6), (a.s7 % b.s7), (a.s8 % b.s8), (a.s9 % b.s9), (a.sa % b.sa), (a.sb % b.sb), (a.sc % b.sc), (a.sd % b.sd), (a.se % b.se), (a.sf % b.sf)); } inline __device__ u64x operator ~ (const u64x a) { return u64x (~a.s0, ~a.s1, ~a.s2, ~a.s3, ~a.s4, ~a.s5, ~a.s6, ~a.s7, ~a.s8, ~a.s9, ~a.sa, ~a.sb, ~a.sc, ~a.sd, ~a.se, ~a.sf); } #endif typedef __device_builtin__ struct u8x u8x; typedef __device_builtin__ struct u16x u16x; typedef __device_builtin__ struct u32x u32x; typedef __device_builtin__ struct u64x u64x; #define make_u8x u8x #define make_u16x u16x #define make_u32x u32x #define make_u64x u64x #else typedef VTYPE(uchar, VECT_SIZE) u8x; typedef VTYPE(ushort, VECT_SIZE) u16x; typedef VTYPE(uint, VECT_SIZE) u32x; typedef VTYPE(ullong, VECT_SIZE) u64x; #ifndef IS_METAL #define make_u8x (u8x) #define make_u16x (u16x) #define make_u32x (u32x) #define make_u64x (u64x) #else #define make_u8x u8x #define make_u16x u16x #define make_u32x u32x #define make_u64x u64x #endif #endif #endif // unions typedef union vconv32 { u64 v32; struct { u16 a; u16 b; } v16; struct { u8 a; u8 b; u8 c; u8 d; } v8; } vconv32_t; typedef union vconv64 { u64 v64; struct { u32 a; u32 b; } v32; struct { u16 a; u16 b; u16 c; u16 d; } v16; struct { u8 a; u8 b; u8 c; u8 d; u8 e; u8 f; u8 g; u8 h; } v8; } vconv64_t; /** * Author......: See docs/credits.txt * License.....: MIT */ typedef enum siphash_constants { SIPHASHM_0=0x736f6d6570736575UL, SIPHASHM_1=0x646f72616e646f6dUL, SIPHASHM_2=0x6c7967656e657261UL, SIPHASHM_3=0x7465646279746573UL } siphash_constants_t; typedef enum bcrypt_constants { BCRYPTM_0=0x4f727068U, BCRYPTM_1=0x65616e42U, BCRYPTM_2=0x65686f6cU, BCRYPTM_3=0x64657253U, BCRYPTM_4=0x63727944U, BCRYPTM_5=0x6f756274U } bcrypt_constants_t; typedef enum md4_constants { MD4M_A=0x67452301U, MD4M_B=0xefcdab89U, MD4M_C=0x98badcfeU, MD4M_D=0x10325476U, MD4S00=3, MD4S01=7, MD4S02=11, MD4S03=19, MD4S10=3, MD4S11=5, MD4S12=9, MD4S13=13, MD4S20=3, MD4S21=9, MD4S22=11, MD4S23=15, MD4C00=0x00000000U, MD4C01=0x5a827999U, MD4C02=0x6ed9eba1U } md4_constants_t; typedef enum md5_constants { MD5M_A=0x67452301U, MD5M_B=0xefcdab89U, MD5M_C=0x98badcfeU, MD5M_D=0x10325476U, MD5S00=7, MD5S01=12, MD5S02=17, MD5S03=22, MD5S10=5, MD5S11=9, MD5S12=14, MD5S13=20, MD5S20=4, MD5S21=11, MD5S22=16, MD5S23=23, MD5S30=6, MD5S31=10, MD5S32=15, MD5S33=21, MD5C00=0xd76aa478U, MD5C01=0xe8c7b756U, MD5C02=0x242070dbU, MD5C03=0xc1bdceeeU, MD5C04=0xf57c0fafU, MD5C05=0x4787c62aU, MD5C06=0xa8304613U, MD5C07=0xfd469501U, MD5C08=0x698098d8U, MD5C09=0x8b44f7afU, MD5C0a=0xffff5bb1U, MD5C0b=0x895cd7beU, MD5C0c=0x6b901122U, MD5C0d=0xfd987193U, MD5C0e=0xa679438eU, MD5C0f=0x49b40821U, MD5C10=0xf61e2562U, MD5C11=0xc040b340U, MD5C12=0x265e5a51U, MD5C13=0xe9b6c7aaU, MD5C14=0xd62f105dU, MD5C15=0x02441453U, MD5C16=0xd8a1e681U, MD5C17=0xe7d3fbc8U, MD5C18=0x21e1cde6U, MD5C19=0xc33707d6U, MD5C1a=0xf4d50d87U, MD5C1b=0x455a14edU, MD5C1c=0xa9e3e905U, MD5C1d=0xfcefa3f8U, MD5C1e=0x676f02d9U, MD5C1f=0x8d2a4c8aU, MD5C20=0xfffa3942U, MD5C21=0x8771f681U, MD5C22=0x6d9d6122U, MD5C23=0xfde5380cU, MD5C24=0xa4beea44U, MD5C25=0x4bdecfa9U, MD5C26=0xf6bb4b60U, MD5C27=0xbebfbc70U, MD5C28=0x289b7ec6U, MD5C29=0xeaa127faU, MD5C2a=0xd4ef3085U, MD5C2b=0x04881d05U, MD5C2c=0xd9d4d039U, MD5C2d=0xe6db99e5U, MD5C2e=0x1fa27cf8U, MD5C2f=0xc4ac5665U, MD5C30=0xf4292244U, MD5C31=0x432aff97U, MD5C32=0xab9423a7U, MD5C33=0xfc93a039U, MD5C34=0x655b59c3U, MD5C35=0x8f0ccc92U, MD5C36=0xffeff47dU, MD5C37=0x85845dd1U, MD5C38=0x6fa87e4fU, MD5C39=0xfe2ce6e0U, MD5C3a=0xa3014314U, MD5C3b=0x4e0811a1U, MD5C3c=0xf7537e82U, MD5C3d=0xbd3af235U, MD5C3e=0x2ad7d2bbU, MD5C3f=0xeb86d391U } md5_constants_t; typedef enum sha1_constants { SHA1M_A=0x67452301U, SHA1M_B=0xefcdab89U, SHA1M_C=0x98badcfeU, SHA1M_D=0x10325476U, SHA1M_E=0xc3d2e1f0U, SHA1C00=0x5a827999U, SHA1C01=0x6ed9eba1U, SHA1C02=0x8f1bbcdcU, SHA1C03=0xca62c1d6U } sha1_constants_t; typedef enum sha2_32_constants { // SHA-224 Initial Hash Values SHA224M_A=0xc1059ed8U, SHA224M_B=0x367cd507U, SHA224M_C=0x3070dd17U, SHA224M_D=0xf70e5939U, SHA224M_E=0xffc00b31U, SHA224M_F=0x68581511U, SHA224M_G=0x64f98fa7U, SHA224M_H=0xbefa4fa4U, // SHA-224 Constants SHA224C00=0x428a2f98U, SHA224C01=0x71374491U, SHA224C02=0xb5c0fbcfU, SHA224C03=0xe9b5dba5U, SHA224C04=0x3956c25bU, SHA224C05=0x59f111f1U, SHA224C06=0x923f82a4U, SHA224C07=0xab1c5ed5U, SHA224C08=0xd807aa98U, SHA224C09=0x12835b01U, SHA224C0a=0x243185beU, SHA224C0b=0x550c7dc3U, SHA224C0c=0x72be5d74U, SHA224C0d=0x80deb1feU, SHA224C0e=0x9bdc06a7U, SHA224C0f=0xc19bf174U, SHA224C10=0xe49b69c1U, SHA224C11=0xefbe4786U, SHA224C12=0x0fc19dc6U, SHA224C13=0x240ca1ccU, SHA224C14=0x2de92c6fU, SHA224C15=0x4a7484aaU, SHA224C16=0x5cb0a9dcU, SHA224C17=0x76f988daU, SHA224C18=0x983e5152U, SHA224C19=0xa831c66dU, SHA224C1a=0xb00327c8U, SHA224C1b=0xbf597fc7U, SHA224C1c=0xc6e00bf3U, SHA224C1d=0xd5a79147U, SHA224C1e=0x06ca6351U, SHA224C1f=0x14292967U, SHA224C20=0x27b70a85U, SHA224C21=0x2e1b2138U, SHA224C22=0x4d2c6dfcU, SHA224C23=0x53380d13U, SHA224C24=0x650a7354U, SHA224C25=0x766a0abbU, SHA224C26=0x81c2c92eU, SHA224C27=0x92722c85U, SHA224C28=0xa2bfe8a1U, SHA224C29=0xa81a664bU, SHA224C2a=0xc24b8b70U, SHA224C2b=0xc76c51a3U, SHA224C2c=0xd192e819U, SHA224C2d=0xd6990624U, SHA224C2e=0xf40e3585U, SHA224C2f=0x106aa070U, SHA224C30=0x19a4c116U, SHA224C31=0x1e376c08U, SHA224C32=0x2748774cU, SHA224C33=0x34b0bcb5U, SHA224C34=0x391c0cb3U, SHA224C35=0x4ed8aa4aU, SHA224C36=0x5b9cca4fU, SHA224C37=0x682e6ff3U, SHA224C38=0x748f82eeU, SHA224C39=0x78a5636fU, SHA224C3a=0x84c87814U, SHA224C3b=0x8cc70208U, SHA224C3c=0x90befffaU, SHA224C3d=0xa4506cebU, SHA224C3e=0xbef9a3f7U, SHA224C3f=0xc67178f2U, // SHA-256 Initial Hash Values SHA256M_A=0x6a09e667U, SHA256M_B=0xbb67ae85U, SHA256M_C=0x3c6ef372U, SHA256M_D=0xa54ff53aU, SHA256M_E=0x510e527fU, SHA256M_F=0x9b05688cU, SHA256M_G=0x1f83d9abU, SHA256M_H=0x5be0cd19U, // SHA-256 Constants SHA256C00=0x428a2f98U, SHA256C01=0x71374491U, SHA256C02=0xb5c0fbcfU, SHA256C03=0xe9b5dba5U, SHA256C04=0x3956c25bU, SHA256C05=0x59f111f1U, SHA256C06=0x923f82a4U, SHA256C07=0xab1c5ed5U, SHA256C08=0xd807aa98U, SHA256C09=0x12835b01U, SHA256C0a=0x243185beU, SHA256C0b=0x550c7dc3U, SHA256C0c=0x72be5d74U, SHA256C0d=0x80deb1feU, SHA256C0e=0x9bdc06a7U, SHA256C0f=0xc19bf174U, SHA256C10=0xe49b69c1U, SHA256C11=0xefbe4786U, SHA256C12=0x0fc19dc6U, SHA256C13=0x240ca1ccU, SHA256C14=0x2de92c6fU, SHA256C15=0x4a7484aaU, SHA256C16=0x5cb0a9dcU, SHA256C17=0x76f988daU, SHA256C18=0x983e5152U, SHA256C19=0xa831c66dU, SHA256C1a=0xb00327c8U, SHA256C1b=0xbf597fc7U, SHA256C1c=0xc6e00bf3U, SHA256C1d=0xd5a79147U, SHA256C1e=0x06ca6351U, SHA256C1f=0x14292967U, SHA256C20=0x27b70a85U, SHA256C21=0x2e1b2138U, SHA256C22=0x4d2c6dfcU, SHA256C23=0x53380d13U, SHA256C24=0x650a7354U, SHA256C25=0x766a0abbU, SHA256C26=0x81c2c92eU, SHA256C27=0x92722c85U, SHA256C28=0xa2bfe8a1U, SHA256C29=0xa81a664bU, SHA256C2a=0xc24b8b70U, SHA256C2b=0xc76c51a3U, SHA256C2c=0xd192e819U, SHA256C2d=0xd6990624U, SHA256C2e=0xf40e3585U, SHA256C2f=0x106aa070U, SHA256C30=0x19a4c116U, SHA256C31=0x1e376c08U, SHA256C32=0x2748774cU, SHA256C33=0x34b0bcb5U, SHA256C34=0x391c0cb3U, SHA256C35=0x4ed8aa4aU, SHA256C36=0x5b9cca4fU, SHA256C37=0x682e6ff3U, SHA256C38=0x748f82eeU, SHA256C39=0x78a5636fU, SHA256C3a=0x84c87814U, SHA256C3b=0x8cc70208U, SHA256C3c=0x90befffaU, SHA256C3d=0xa4506cebU, SHA256C3e=0xbef9a3f7U, SHA256C3f=0xc67178f2U, } sha2_32_constants_t; typedef enum sha2_64_constants { // SHA-384 Initial Hash Values SHA384M_A=0xcbbb9d5dc1059ed8UL, SHA384M_B=0x629a292a367cd507UL, SHA384M_C=0x9159015a3070dd17UL, SHA384M_D=0x152fecd8f70e5939UL, SHA384M_E=0x67332667ffc00b31UL, SHA384M_F=0x8eb44a8768581511UL, SHA384M_G=0xdb0c2e0d64f98fa7UL, SHA384M_H=0x47b5481dbefa4fa4UL, // SHA-512 Initial Hash Values SHA512M_A=0x6a09e667f3bcc908UL, SHA512M_B=0xbb67ae8584caa73bUL, SHA512M_C=0x3c6ef372fe94f82bUL, SHA512M_D=0xa54ff53a5f1d36f1UL, SHA512M_E=0x510e527fade682d1UL, SHA512M_F=0x9b05688c2b3e6c1fUL, SHA512M_G=0x1f83d9abfb41bd6bUL, SHA512M_H=0x5be0cd19137e2179UL, // SHA-384/512 Constants SHA512C00=0x428a2f98d728ae22UL, SHA512C01=0x7137449123ef65cdUL, SHA512C02=0xb5c0fbcfec4d3b2fUL, SHA512C03=0xe9b5dba58189dbbcUL, SHA512C04=0x3956c25bf348b538UL, SHA512C05=0x59f111f1b605d019UL, SHA512C06=0x923f82a4af194f9bUL, SHA512C07=0xab1c5ed5da6d8118UL, SHA512C08=0xd807aa98a3030242UL, SHA512C09=0x12835b0145706fbeUL, SHA512C0a=0x243185be4ee4b28cUL, SHA512C0b=0x550c7dc3d5ffb4e2UL, SHA512C0c=0x72be5d74f27b896fUL, SHA512C0d=0x80deb1fe3b1696b1UL, SHA512C0e=0x9bdc06a725c71235UL, SHA512C0f=0xc19bf174cf692694UL, SHA512C10=0xe49b69c19ef14ad2UL, SHA512C11=0xefbe4786384f25e3UL, SHA512C12=0x0fc19dc68b8cd5b5UL, SHA512C13=0x240ca1cc77ac9c65UL, SHA512C14=0x2de92c6f592b0275UL, SHA512C15=0x4a7484aa6ea6e483UL, SHA512C16=0x5cb0a9dcbd41fbd4UL, SHA512C17=0x76f988da831153b5UL, SHA512C18=0x983e5152ee66dfabUL, SHA512C19=0xa831c66d2db43210UL, SHA512C1a=0xb00327c898fb213fUL, SHA512C1b=0xbf597fc7beef0ee4UL, SHA512C1c=0xc6e00bf33da88fc2UL, SHA512C1d=0xd5a79147930aa725UL, SHA512C1e=0x06ca6351e003826fUL, SHA512C1f=0x142929670a0e6e70UL, SHA512C20=0x27b70a8546d22ffcUL, SHA512C21=0x2e1b21385c26c926UL, SHA512C22=0x4d2c6dfc5ac42aedUL, SHA512C23=0x53380d139d95b3dfUL, SHA512C24=0x650a73548baf63deUL, SHA512C25=0x766a0abb3c77b2a8UL, SHA512C26=0x81c2c92e47edaee6UL, SHA512C27=0x92722c851482353bUL, SHA512C28=0xa2bfe8a14cf10364UL, SHA512C29=0xa81a664bbc423001UL, SHA512C2a=0xc24b8b70d0f89791UL, SHA512C2b=0xc76c51a30654be30UL, SHA512C2c=0xd192e819d6ef5218UL, SHA512C2d=0xd69906245565a910UL, SHA512C2e=0xf40e35855771202aUL, SHA512C2f=0x106aa07032bbd1b8UL, SHA512C30=0x19a4c116b8d2d0c8UL, SHA512C31=0x1e376c085141ab53UL, SHA512C32=0x2748774cdf8eeb99UL, SHA512C33=0x34b0bcb5e19b48a8UL, SHA512C34=0x391c0cb3c5c95a63UL, SHA512C35=0x4ed8aa4ae3418acbUL, SHA512C36=0x5b9cca4f7763e373UL, SHA512C37=0x682e6ff3d6b2b8a3UL, SHA512C38=0x748f82ee5defb2fcUL, SHA512C39=0x78a5636f43172f60UL, SHA512C3a=0x84c87814a1f0ab72UL, SHA512C3b=0x8cc702081a6439ecUL, SHA512C3c=0x90befffa23631e28UL, SHA512C3d=0xa4506cebde82bde9UL, SHA512C3e=0xbef9a3f7b2c67915UL, SHA512C3f=0xc67178f2e372532bUL, SHA512C40=0xca273eceea26619cUL, SHA512C41=0xd186b8c721c0c207UL, SHA512C42=0xeada7dd6cde0eb1eUL, SHA512C43=0xf57d4f7fee6ed178UL, SHA512C44=0x06f067aa72176fbaUL, SHA512C45=0x0a637dc5a2c898a6UL, SHA512C46=0x113f9804bef90daeUL, SHA512C47=0x1b710b35131c471bUL, SHA512C48=0x28db77f523047d84UL, SHA512C49=0x32caab7b40c72493UL, SHA512C4a=0x3c9ebe0a15c9bebcUL, SHA512C4b=0x431d67c49c100d4cUL, SHA512C4c=0x4cc5d4becb3e42b6UL, SHA512C4d=0x597f299cfc657e2aUL, SHA512C4e=0x5fcb6fab3ad6faecUL, SHA512C4f=0x6c44198c4a475817UL } sha2_64_constants_t; typedef enum ripemd160_constants { RIPEMD160M_A=0x67452301U, RIPEMD160M_B=0xefcdab89U, RIPEMD160M_C=0x98badcfeU, RIPEMD160M_D=0x10325476U, RIPEMD160M_E=0xc3d2e1f0U, RIPEMD160C00=0x00000000U, RIPEMD160C10=0x5a827999U, RIPEMD160C20=0x6ed9eba1U, RIPEMD160C30=0x8f1bbcdcU, RIPEMD160C40=0xa953fd4eU, RIPEMD160C50=0x50a28be6U, RIPEMD160C60=0x5c4dd124U, RIPEMD160C70=0x6d703ef3U, RIPEMD160C80=0x7a6d76e9U, RIPEMD160C90=0x00000000U, RIPEMD160S00=11, RIPEMD160S01=14, RIPEMD160S02=15, RIPEMD160S03=12, RIPEMD160S04=5, RIPEMD160S05=8, RIPEMD160S06=7, RIPEMD160S07=9, RIPEMD160S08=11, RIPEMD160S09=13, RIPEMD160S0A=14, RIPEMD160S0B=15, RIPEMD160S0C=6, RIPEMD160S0D=7, RIPEMD160S0E=9, RIPEMD160S0F=8, RIPEMD160S10=7, RIPEMD160S11=6, RIPEMD160S12=8, RIPEMD160S13=13, RIPEMD160S14=11, RIPEMD160S15=9, RIPEMD160S16=7, RIPEMD160S17=15, RIPEMD160S18=7, RIPEMD160S19=12, RIPEMD160S1A=15, RIPEMD160S1B=9, RIPEMD160S1C=11, RIPEMD160S1D=7, RIPEMD160S1E=13, RIPEMD160S1F=12, RIPEMD160S20=11, RIPEMD160S21=13, RIPEMD160S22=6, RIPEMD160S23=7, RIPEMD160S24=14, RIPEMD160S25=9, RIPEMD160S26=13, RIPEMD160S27=15, RIPEMD160S28=14, RIPEMD160S29=8, RIPEMD160S2A=13, RIPEMD160S2B=6, RIPEMD160S2C=5, RIPEMD160S2D=12, RIPEMD160S2E=7, RIPEMD160S2F=5, RIPEMD160S30=11, RIPEMD160S31=12, RIPEMD160S32=14, RIPEMD160S33=15, RIPEMD160S34=14, RIPEMD160S35=15, RIPEMD160S36=9, RIPEMD160S37=8, RIPEMD160S38=9, RIPEMD160S39=14, RIPEMD160S3A=5, RIPEMD160S3B=6, RIPEMD160S3C=8, RIPEMD160S3D=6, RIPEMD160S3E=5, RIPEMD160S3F=12, RIPEMD160S40=9, RIPEMD160S41=15, RIPEMD160S42=5, RIPEMD160S43=11, RIPEMD160S44=6, RIPEMD160S45=8, RIPEMD160S46=13, RIPEMD160S47=12, RIPEMD160S48=5, RIPEMD160S49=12, RIPEMD160S4A=13, RIPEMD160S4B=14, RIPEMD160S4C=11, RIPEMD160S4D=8, RIPEMD160S4E=5, RIPEMD160S4F=6, RIPEMD160S50=8, RIPEMD160S51=9, RIPEMD160S52=9, RIPEMD160S53=11, RIPEMD160S54=13, RIPEMD160S55=15, RIPEMD160S56=15, RIPEMD160S57=5, RIPEMD160S58=7, RIPEMD160S59=7, RIPEMD160S5A=8, RIPEMD160S5B=11, RIPEMD160S5C=14, RIPEMD160S5D=14, RIPEMD160S5E=12, RIPEMD160S5F=6, RIPEMD160S60=9, RIPEMD160S61=13, RIPEMD160S62=15, RIPEMD160S63=7, RIPEMD160S64=12, RIPEMD160S65=8, RIPEMD160S66=9, RIPEMD160S67=11, RIPEMD160S68=7, RIPEMD160S69=7, RIPEMD160S6A=12, RIPEMD160S6B=7, RIPEMD160S6C=6, RIPEMD160S6D=15, RIPEMD160S6E=13, RIPEMD160S6F=11, RIPEMD160S70=9, RIPEMD160S71=7, RIPEMD160S72=15, RIPEMD160S73=11, RIPEMD160S74=8, RIPEMD160S75=6, RIPEMD160S76=6, RIPEMD160S77=14, RIPEMD160S78=12, RIPEMD160S79=13, RIPEMD160S7A=5, RIPEMD160S7B=14, RIPEMD160S7C=13, RIPEMD160S7D=13, RIPEMD160S7E=7, RIPEMD160S7F=5, RIPEMD160S80=15, RIPEMD160S81=5, RIPEMD160S82=8, RIPEMD160S83=11, RIPEMD160S84=14, RIPEMD160S85=14, RIPEMD160S86=6, RIPEMD160S87=14, RIPEMD160S88=6, RIPEMD160S89=9, RIPEMD160S8A=12, RIPEMD160S8B=9, RIPEMD160S8C=12, RIPEMD160S8D=5, RIPEMD160S8E=15, RIPEMD160S8F=8, RIPEMD160S90=8, RIPEMD160S91=5, RIPEMD160S92=12, RIPEMD160S93=9, RIPEMD160S94=12, RIPEMD160S95=5, RIPEMD160S96=14, RIPEMD160S97=6, RIPEMD160S98=8, RIPEMD160S99=13, RIPEMD160S9A=6, RIPEMD160S9B=5, RIPEMD160S9C=15, RIPEMD160S9D=13, RIPEMD160S9E=11, RIPEMD160S9F=11 } ripemd160_constants_t; typedef enum keccak_constants { KECCAK_RNDC_00=0x0000000000000001UL, KECCAK_RNDC_01=0x0000000000008082UL, KECCAK_RNDC_02=0x800000000000808aUL, KECCAK_RNDC_03=0x8000000080008000UL, KECCAK_RNDC_04=0x000000000000808bUL, KECCAK_RNDC_05=0x0000000080000001UL, KECCAK_RNDC_06=0x8000000080008081UL, KECCAK_RNDC_07=0x8000000000008009UL, KECCAK_RNDC_08=0x000000000000008aUL, KECCAK_RNDC_09=0x0000000000000088UL, KECCAK_RNDC_10=0x0000000080008009UL, KECCAK_RNDC_11=0x000000008000000aUL, KECCAK_RNDC_12=0x000000008000808bUL, KECCAK_RNDC_13=0x800000000000008bUL, KECCAK_RNDC_14=0x8000000000008089UL, KECCAK_RNDC_15=0x8000000000008003UL, KECCAK_RNDC_16=0x8000000000008002UL, KECCAK_RNDC_17=0x8000000000000080UL, KECCAK_RNDC_18=0x000000000000800aUL, KECCAK_RNDC_19=0x800000008000000aUL, KECCAK_RNDC_20=0x8000000080008081UL, KECCAK_RNDC_21=0x8000000000008080UL, KECCAK_RNDC_22=0x0000000080000001UL, KECCAK_RNDC_23=0x8000000080008008UL, KECCAK_PILN_00=10, KECCAK_PILN_01=7, KECCAK_PILN_02=11, KECCAK_PILN_03=17, KECCAK_PILN_04=18, KECCAK_PILN_05=3, KECCAK_PILN_06=5, KECCAK_PILN_07=16, KECCAK_PILN_08=8, KECCAK_PILN_09=21, KECCAK_PILN_10=24, KECCAK_PILN_11=4, KECCAK_PILN_12=15, KECCAK_PILN_13=23, KECCAK_PILN_14=19, KECCAK_PILN_15=13, KECCAK_PILN_16=12, KECCAK_PILN_17=2, KECCAK_PILN_18=20, KECCAK_PILN_19=14, KECCAK_PILN_20=22, KECCAK_PILN_21=9, KECCAK_PILN_22=6, KECCAK_PILN_23=1, KECCAK_ROTC_00=1, KECCAK_ROTC_01=3, KECCAK_ROTC_02=6, KECCAK_ROTC_03=10, KECCAK_ROTC_04=15, KECCAK_ROTC_05=21, KECCAK_ROTC_06=28, KECCAK_ROTC_07=36, KECCAK_ROTC_08=45, KECCAK_ROTC_09=55, KECCAK_ROTC_10=2, KECCAK_ROTC_11=14, KECCAK_ROTC_12=27, KECCAK_ROTC_13=41, KECCAK_ROTC_14=56, KECCAK_ROTC_15=8, KECCAK_ROTC_16=25, KECCAK_ROTC_17=43, KECCAK_ROTC_18=62, KECCAK_ROTC_19=18, KECCAK_ROTC_20=39, KECCAK_ROTC_21=61, KECCAK_ROTC_22=20, KECCAK_ROTC_23=44, } keccak_constants_t; typedef enum mysql323_constants { MYSQL323_A=0x50305735U, MYSQL323_B=0x12345671U } mysql323_constants_t; typedef enum fortigate_constants { FORTIGATE_A=0x2eba88a3U, FORTIGATE_B=0x4ab04c42U, FORTIGATE_C=0xc1307953U, FORTIGATE_D=0x3fcc0731U, FORTIGATE_E=0x299032a1U, FORTIGATE_F=0x705b81a9U } fortigate_constants_t; typedef enum blake2b_constants { BLAKE2B_IV_00=0x6a09e667f3bcc908UL, BLAKE2B_IV_01=0xbb67ae8584caa73bUL, BLAKE2B_IV_02=0x3c6ef372fe94f82bUL, BLAKE2B_IV_03=0xa54ff53a5f1d36f1UL, BLAKE2B_IV_04=0x510e527fade682d1UL, BLAKE2B_IV_05=0x9b05688c2b3e6c1fUL, BLAKE2B_IV_06=0x1f83d9abfb41bd6bUL, BLAKE2B_IV_07=0x5be0cd19137e2179UL } blake2b_constants_t; typedef enum blake2s_constants { BLAKE2S_IV_00=0x6a09e667, BLAKE2S_IV_01=0xbb67ae85, BLAKE2S_IV_02=0x3c6ef372, BLAKE2S_IV_03=0xa54ff53a, BLAKE2S_IV_04=0x510e527f, BLAKE2S_IV_05=0x9b05688c, BLAKE2S_IV_06=0x1f83d9ab, BLAKE2S_IV_07=0x5be0cd19 } blake2s_constants_t; typedef enum sm3_constants { // SM3 Initial Hash Values SM3_IV_A=0x7380166fUL, SM3_IV_B=0x4914b2b9UL, SM3_IV_C=0x172442d7UL, SM3_IV_D=0xda8a0600UL, SM3_IV_E=0xa96f30bcUL, SM3_IV_F=0x163138aaUL, SM3_IV_G=0xe38dee4dUL, SM3_IV_H=0xb0fb0e4eUL, // SM3 Tj round constants SM3_T00=0x79CC4519UL, SM3_T01=0xF3988A32UL, SM3_T02=0xE7311465UL, SM3_T03=0xCE6228CBUL, SM3_T04=0x9CC45197UL, SM3_T05=0x3988A32FUL, SM3_T06=0x7311465EUL, SM3_T07=0xE6228CBCUL, SM3_T08=0xCC451979UL, SM3_T09=0x988A32F3UL, SM3_T10=0x311465E7UL, SM3_T11=0x6228CBCEUL, SM3_T12=0xC451979CUL, SM3_T13=0x88A32F39UL, SM3_T14=0x11465E73UL, SM3_T15=0x228CBCE6UL, SM3_T16=0x9D8A7A87UL, SM3_T17=0x3B14F50FUL, SM3_T18=0x7629EA1EUL, SM3_T19=0xEC53D43CUL, SM3_T20=0xD8A7A879UL, SM3_T21=0xB14F50F3UL, SM3_T22=0x629EA1E7UL, SM3_T23=0xC53D43CEUL, SM3_T24=0x8A7A879DUL, SM3_T25=0x14F50F3BUL, SM3_T26=0x29EA1E76UL, SM3_T27=0x53D43CECUL, SM3_T28=0xA7A879D8UL, SM3_T29=0x4F50F3B1UL, SM3_T30=0x9EA1E762UL, SM3_T31=0x3D43CEC5UL, SM3_T32=0x7A879D8AUL, SM3_T33=0xF50F3B14UL, SM3_T34=0xEA1E7629UL, SM3_T35=0xD43CEC53UL, SM3_T36=0xA879D8A7UL, SM3_T37=0x50F3B14FUL, SM3_T38=0xA1E7629EUL, SM3_T39=0x43CEC53DUL, SM3_T40=0x879D8A7AUL, SM3_T41=0x0F3B14F5UL, SM3_T42=0x1E7629EAUL, SM3_T43=0x3CEC53D4UL, SM3_T44=0x79D8A7A8UL, SM3_T45=0xF3B14F50UL, SM3_T46=0xE7629EA1UL, SM3_T47=0xCEC53D43UL, SM3_T48=0x9D8A7A87UL, SM3_T49=0x3B14F50FUL, SM3_T50=0x7629EA1EUL, SM3_T51=0xEC53D43CUL, SM3_T52=0xD8A7A879UL, SM3_T53=0xB14F50F3UL, SM3_T54=0x629EA1E7UL, SM3_T55=0xC53D43CEUL, SM3_T56=0x8A7A879DUL, SM3_T57=0x14F50F3BUL, SM3_T58=0x29EA1E76UL, SM3_T59=0x53D43CECUL, SM3_T60=0xA7A879D8UL, SM3_T61=0x4F50F3B1UL, SM3_T62=0x9EA1E762UL, SM3_T63=0x3D43CEC5UL } sm3_constants_t; typedef enum combinator_mode { COMBINATOR_MODE_BASE_LEFT = 10001, COMBINATOR_MODE_BASE_RIGHT = 10002 } combinator_mode_t; #ifdef KERNEL_STATIC typedef struct digest { u32 digest_buf[DGST_ELEM]; } digest_t; #endif typedef struct kernel_param { // We can only move attributes into this struct which do not use special declarations like __global u32 bitmap_mask; // 24 u32 bitmap_shift1; // 25 u32 bitmap_shift2; // 26 u32 salt_pos_host; // 27 u32 loop_pos; // 28 u32 loop_cnt; // 29 u32 il_cnt; // 30 u32 digests_cnt; // 31 u32 digests_offset_host; // 32 u32 combs_mode; // 33 u32 salt_repeat; // 34 u64 pws_pos; // 35 u64 gid_max; // 36 } kernel_param_t; typedef struct salt { u32 salt_buf[64]; u32 salt_buf_pc[64]; u32 salt_len; u32 salt_len_pc; u32 salt_iter; u32 salt_iter2; u32 salt_sign[2]; u32 salt_repeats; u32 orig_pos; u32 digests_cnt; u32 digests_done; u32 digests_offset; u32 scrypt_N; u32 scrypt_r; u32 scrypt_p; } salt_t; typedef struct { u32 key; u64 val; } hcstat_table_t; typedef struct { u32 cs_buf[0x100]; u32 cs_len; } cs_t; typedef struct { u32 cmds[32]; } kernel_rule_t; typedef struct pw { u32 i[64]; u32 pw_len; } pw_t; typedef struct pw_idx { u32 off; u32 cnt; u32 len; } pw_idx_t; typedef struct bf { u32 i; } bf_t; typedef struct bs_word { u32 b[32]; } bs_word_t; typedef struct plain { u64 gidvid; u32 il_pos; u32 salt_pos; u32 digest_pos; u32 hash_pos; u32 extra1; u32 extra2; } plain_t; typedef struct keyboard_layout_mapping { u32 src_char; int src_len; u32 dst_char; int dst_len; } keyboard_layout_mapping_t; typedef struct hc_enc { int pos; // source offset u32 cbuf; // carry buffer int clen; // carry length } hc_enc_t; #endif ================================================ FILE: src/main/resources/copyfromhashcat/inc_vendor.h ================================================ /** * Author......: See docs/credits.txt * License.....: MIT */ #ifndef INC_VENDOR_H #define INC_VENDOR_H #if defined HC_CPU_OPENCL_EMU_H #define IS_NATIVE #elif defined __CUDACC__ #define IS_CUDA #elif defined __HIPCC__ #define IS_HIP #elif defined __METAL__ || defined __METAL_MACOS__ #define IS_METAL #else #define IS_OPENCL #endif #if defined IS_METAL #include using namespace metal; #endif #if defined IS_NATIVE #define CONSTANT_VK #define CONSTANT_AS #define GLOBAL_AS #define LOCAL_VK #define LOCAL_AS #define PRIVATE_AS #define KERNEL_FQ #elif defined IS_CUDA #define CONSTANT_VK __constant__ #define CONSTANT_AS #define GLOBAL_AS #define LOCAL_VK __shared__ #define LOCAL_AS #define PRIVATE_AS #define KERNEL_FQ extern "C" __global__ #elif defined IS_HIP #define CONSTANT_VK __constant__ #define CONSTANT_AS #define GLOBAL_AS #define LOCAL_VK __shared__ #define LOCAL_AS #define PRIVATE_AS #define KERNEL_FQ extern "C" __global__ #elif defined IS_METAL #define CONSTANT_VK constant #define CONSTANT_AS constant #define GLOBAL_AS device #define LOCAL_VK threadgroup #define LOCAL_AS threadgroup #define PRIVATE_AS thread #define KERNEL_FQ kernel #elif defined IS_OPENCL #define CONSTANT_VK __constant #define CONSTANT_AS __constant #define GLOBAL_AS __global #define LOCAL_VK __local #define LOCAL_AS __local #define PRIVATE_AS #define KERNEL_FQ __kernel #endif #ifndef MAYBE_UNUSED #define MAYBE_UNUSED #endif /** * device type */ #define DEVICE_TYPE_CPU 2 #define DEVICE_TYPE_GPU 4 #define DEVICE_TYPE_ACCEL 8 #if DEVICE_TYPE == DEVICE_TYPE_CPU #define IS_CPU #elif DEVICE_TYPE == DEVICE_TYPE_GPU #define IS_GPU #elif DEVICE_TYPE == DEVICE_TYPE_ACCEL #define IS_ACCEL #endif /** * vendor specific */ #if VENDOR_ID == (1 << 0) #define IS_AMD #elif VENDOR_ID == (1 << 1) #define IS_APPLE #define IS_GENERIC #elif VENDOR_ID == (1 << 2) #define IS_INTEL_BEIGNET #define IS_GENERIC #elif VENDOR_ID == (1 << 3) #define IS_INTEL_SDK #define IS_GENERIC #elif VENDOR_ID == (1 << 4) #define IS_MESA #define IS_GENERIC #elif VENDOR_ID == (1 << 5) #define IS_NV #elif VENDOR_ID == (1 << 6) #define IS_POCL #define IS_GENERIC #elif VENDOR_ID == (1 << 8) #define IS_AMD_USE_HIP #else #define IS_GENERIC #endif #if defined IS_AMD && HAS_VPERM == 1 #define IS_ROCM #endif #define LOCAL_MEM_TYPE_LOCAL 1 #define LOCAL_MEM_TYPE_GLOBAL 2 #if LOCAL_MEM_TYPE == LOCAL_MEM_TYPE_LOCAL #define REAL_SHM #endif // So far, only used by -m 22100 and only affects NVIDIA on OpenCL. CUDA seems to work fine. #ifdef FORCE_DISABLE_SHM #undef REAL_SHM #endif #ifdef REAL_SHM #define SHM_TYPE LOCAL_AS #else #define SHM_TYPE CONSTANT_AS #endif /** * function declarations can have a large influence depending on the opencl runtime * fast but pure kernels on rocm is a good example */ #ifdef NO_INLINE #define HC_INLINE #else #define HC_INLINE inline static #endif #if defined IS_AMD && defined IS_GPU #define DECLSPEC HC_INLINE #elif defined IS_HIP #define DECLSPEC __device__ HC_INLINE #else #define DECLSPEC #endif /** * AMD specific */ #ifdef IS_AMD #if defined(cl_amd_media_ops) #pragma OPENCL EXTENSION cl_amd_media_ops : enable #endif #if defined(cl_amd_media_ops2) #pragma OPENCL EXTENSION cl_amd_media_ops2 : enable #endif #endif // Whitelist some OpenCL specific functions // This could create more stable kernels on systems with bad OpenCL drivers #ifdef IS_CUDA #define USE_BITSELECT #define USE_ROTATE #endif #ifdef IS_HIP #define USE_BITSELECT #define USE_ROTATE #endif #ifdef IS_ROCM #define USE_BITSELECT #define USE_ROTATE #endif #ifdef IS_INTEL_SDK #ifdef IS_CPU //#define USE_BITSELECT //#define USE_ROTATE #endif #endif #ifdef IS_OPENCL //#define USE_BITSELECT //#define USE_ROTATE //#define USE_SWIZZLE #endif #ifdef IS_METAL #define USE_ROTATE // Metal support max VECT_SIZE = 4 #define s0 x #define s1 y #define s2 z #define s3 w #endif #endif // INC_VENDOR_H ================================================ FILE: src/main/resources/inc_defines.h ================================================ #define KERNEL_STATIC #define DGST_ELEM 4 #define DGST_R0 0 #define DGST_R1 1 #define DGST_R2 2 #define DGST_R3 3 #define SECP256K1_TMPS_TYPE CONSTANT_AS ================================================ FILE: src/main/resources/inc_ecc_secp256k1custom.cl ================================================ /** * Author......: Bernard Ladenthin, 2020 * License.....: MIT */ /* // example private key (in) // hex: 68e23530deb6d5011ab56d8ad9f7b4a3b424f1112f08606357497495929f72dc // decimal: 47440210799387980664936216788675555637818488436833759923669526136462528967388 // WiF // to generate the public key (out) // 025d99d81d9e731e0d7eebd1c858b1155da7981b1f0a16d322a361f8b589ad2e3b // hex: k_local[7] = 0x68e23530; k_local[6] = 0xdeb6d501; k_local[5] = 0x1ab56d8a; k_local[4] = 0xd9f7b4a3; k_local[3] = 0xb424f111; k_local[2] = 0x2f086063; k_local[1] = 0x57497495; k_local[0] = 0x929f72dc; */ // ==== BEGIN: SYNCHRONIZED WITH JAVA CONSTANTS (Do not modify without updating Java) ==== // ==== Base Units ==== #define BITS_PER_BYTE 8 #define U32_PER_WORD 1 #define U32_NUM_BYTES 4 #define BYTE_SHIFT_TO_U32_MSB 24 // ==== private key ==== #define PRIVATE_KEY_MAX_NUM_BITS 256 #define PRIVATE_KEY_MAX_NUM_BYTES (PRIVATE_KEY_MAX_NUM_BITS / BITS_PER_BYTE) // 32 #define PRIVATE_KEY_MAX_NUM_WORDS (PRIVATE_KEY_MAX_NUM_BYTES / U32_NUM_BYTES) // 8 // ==== SEC format prefixes ==== #define SEC_PREFIX_NUM_BITS BITS_PER_BYTE #define SEC_PREFIX_NUM_BYTES 1 #define SEC_PREFIX_NUM_WORDS U32_PER_WORD #define SEC_PREFIX_UNCOMPRESSED_ECDSA_POINT 0x04 #define SEC_PREFIX_COMPRESSED_ECDSA_POINT_EVEN_Y 0x02 #define SEC_PREFIX_COMPRESSED_ECDSA_POINT_ODD_Y 0x03 // ==== SEC format prefixes shifted versions (for use in u32[0] with MSB-first layout) ==== #define SEC_PREFIX_SHIFTED_NUM_BYTES U32_NUM_BYTES #define SEC_PREFIX_UNCOMPRESSED_ECDSA_POINT_SHIFTED (SEC_PREFIX_UNCOMPRESSED_ECDSA_POINT << BYTE_SHIFT_TO_U32_MSB) #define SEC_PREFIX_COMPRESSED_ECDSA_POINT_EVEN_Y_SHIFTED (SEC_PREFIX_COMPRESSED_ECDSA_POINT_EVEN_Y << BYTE_SHIFT_TO_U32_MSB) #define SEC_PREFIX_COMPRESSED_ECDSA_POINT_ODD_Y_SHIFTED (SEC_PREFIX_COMPRESSED_ECDSA_POINT_ODD_Y << BYTE_SHIFT_TO_U32_MSB) // ==== x, y coordinate length ==== #define ONE_COORDINATE_NUM_BITS 256 #define ONE_COORDINATE_NUM_BYTES (ONE_COORDINATE_NUM_BITS / BITS_PER_BYTE) // 32 #define TWO_COORDINATES_NUM_BITS (ONE_COORDINATE_NUM_BITS * 2) // 512 #define TWO_COORDINATES_NUM_BYTES (ONE_COORDINATE_NUM_BYTES * 2) // 64 #define ONE_COORDINATE_NUM_WORDS (ONE_COORDINATE_NUM_BYTES / U32_NUM_BYTES) // 8 #define TWO_COORDINATE_NUM_WORDS (ONE_COORDINATE_NUM_WORDS * 2) // 16 // ==== public key length ==== #define SEC_PUBLIC_KEY_UNCOMPRESSED_NUM_BITS (SEC_PREFIX_NUM_BITS + TWO_COORDINATES_NUM_BITS) // 520 #define SEC_PUBLIC_KEY_UNCOMPRESSED_NUM_BYTES (SEC_PREFIX_NUM_BYTES + TWO_COORDINATES_NUM_BYTES) // 65 #define SEC_PUBLIC_KEY_UNCOMPRESSED_WORDS (SEC_PREFIX_NUM_WORDS + TWO_COORDINATE_NUM_WORDS) // 17 #define SEC_PUBLIC_KEY_COMPRESSED_NUM_BITS (SEC_PREFIX_NUM_BITS + ONE_COORDINATE_NUM_BITS) // 264 #define SEC_PUBLIC_KEY_COMPRESSED_NUM_BYTES (SEC_PREFIX_NUM_BYTES + ONE_COORDINATE_NUM_BYTES) // 33 #define SEC_PUBLIC_KEY_COMPRESSED_WORDS (SEC_PREFIX_NUM_WORDS + ONE_COORDINATE_NUM_WORDS) // 9 // === Hash sizes === #define SHA256_INPUT_BLOCK_SIZE_BITS 512 #define SHA256_INPUT_BLOCK_SIZE_BYTES (SHA256_INPUT_BLOCK_SIZE_BITS / BITS_PER_BYTE) // 64 #define SHA256_INPUT_BLOCK_SIZE_WORDS (SHA256_INPUT_BLOCK_SIZE_BYTES / U32_NUM_BYTES) // 16 #define RIPEMD160_INPUT_BLOCK_SIZE_BITS 512 #define RIPEMD160_INPUT_BLOCK_SIZE_BYTES (RIPEMD160_INPUT_BLOCK_SIZE_BITS / BITS_PER_BYTE) // 64 #define RIPEMD160_INPUT_BLOCK_SIZE_WORDS (RIPEMD160_INPUT_BLOCK_SIZE_BYTES / U32_NUM_BYTES) // 16 #define SHA256_HASH_NUM_BITS 256 #define SHA256_HASH_NUM_BYTES (SHA256_HASH_NUM_BITS / BITS_PER_BYTE) // 32 #define SHA256_HASH_NUM_WORDS (SHA256_HASH_NUM_BYTES / U32_NUM_BYTES) // 8 #define RIPEMD160_HASH_NUM_BITS 160 #define RIPEMD160_HASH_NUM_BYTES (RIPEMD160_HASH_NUM_BITS / BITS_PER_BYTE) // 20 #define RIPEMD160_HASH_NUM_WORDS (RIPEMD160_HASH_NUM_BYTES / U32_NUM_BYTES) // 5 #define SHA256_INPUT_BLOCKS_FOR_UNCOMPRESSED_SEC 2 #define SHA256_INPUT_TOTAL_BITS_UNCOMPRESSED (SHA256_INPUT_BLOCKS_FOR_UNCOMPRESSED_SEC * SHA256_INPUT_BLOCK_SIZE_BITS) // 1024 #define SHA256_INPUT_TOTAL_BYTES_UNCOMPRESSED (SHA256_INPUT_BLOCKS_FOR_UNCOMPRESSED_SEC * SHA256_INPUT_BLOCK_SIZE_BYTES) // 128 #define SHA256_INPUT_TOTAL_WORDS_UNCOMPRESSED (SHA256_INPUT_BLOCKS_FOR_UNCOMPRESSED_SEC * SHA256_INPUT_BLOCK_SIZE_WORDS) // 32 #define SHA256_INPUT_BLOCKS_FOR_COMPRESSED_SEC 1 #define SHA256_INPUT_TOTAL_BITS_COMPRESSED (SHA256_INPUT_BLOCKS_FOR_COMPRESSED_SEC * SHA256_INPUT_BLOCK_SIZE_BITS) // 512 #define SHA256_INPUT_TOTAL_BYTES_COMPRESSED (SHA256_INPUT_BLOCKS_FOR_COMPRESSED_SEC * SHA256_INPUT_BLOCK_SIZE_BYTES) // 64 #define SHA256_INPUT_TOTAL_WORDS_COMPRESSED (SHA256_INPUT_BLOCKS_FOR_COMPRESSED_SEC * SHA256_INPUT_BLOCK_SIZE_WORDS) // 16 // ==== Individual Chunk Sizes (Words in OpenCL) ==== #define CHUNK_SIZE_00_NUM_WORDS_BIG_ENDIAN_X ONE_COORDINATE_NUM_WORDS #define CHUNK_SIZE_01_NUM_WORDS_BIG_ENDIAN_Y ONE_COORDINATE_NUM_WORDS #define CHUNK_SIZE_10_NUM_WORDS_RIPEMD160_UNCOMPRESSED RIPEMD160_HASH_NUM_WORDS #define CHUNK_SIZE_11_NUM_WORDS_RIPEMD160_COMPRESSED RIPEMD160_HASH_NUM_WORDS // ==== Offsets Within a Chunk ==== #define CHUNK_OFFSET_00_NUM_WORDS_BIG_ENDIAN_X 0 #define CHUNK_OFFSET_01_NUM_WORDS_BIG_ENDIAN_Y (CHUNK_OFFSET_00_NUM_WORDS_BIG_ENDIAN_X + CHUNK_SIZE_00_NUM_WORDS_BIG_ENDIAN_X) #define CHUNK_OFFSET_10_NUM_WORDS_RIPEMD160_UNCOMPRESSED (CHUNK_OFFSET_01_NUM_WORDS_BIG_ENDIAN_Y + CHUNK_SIZE_01_NUM_WORDS_BIG_ENDIAN_Y) #define CHUNK_OFFSET_11_NUM_WORDS_RIPEMD160_COMPRESSED (CHUNK_OFFSET_10_NUM_WORDS_RIPEMD160_UNCOMPRESSED + CHUNK_SIZE_10_NUM_WORDS_RIPEMD160_UNCOMPRESSED) #define CHUNK_OFFSET_99_NUM_WORDS_END_OF_CHUNK (CHUNK_OFFSET_11_NUM_WORDS_RIPEMD160_COMPRESSED + CHUNK_SIZE_11_NUM_WORDS_RIPEMD160_COMPRESSED) // ==== Total Chunk Size ==== #define CHUNK_SIZE_NUM_WORDS CHUNK_OFFSET_99_NUM_WORDS_END_OF_CHUNK // ==== END: SYNCHRONIZED WITH JAVA CONSTANTS ==== /** * @brief * Precomputed multiples of the base point G used in wNAF-based scalar multiplication. * * This table includes: * - ±1·G, ±3·G, ±5·G, ±7·G (total: 8 point pairs) * - Each point consists of (x, y) coordinates, 256 bits each * - For each y, the negative value is precomputed as well * * Memory layout: * - 4 window values (±1, ±3, ±5, ±7) * - 8 points × 2 coordinates (x, y) = 16 × 32 bytes = 512 bytes * - Each coordinate consists of 8 × u32 = 256 bits * - 8 (x) + 8 (y) + 8 (–y) = 24 coordinates per point (for sign flipping) * - Total: 96 × 4 bytes = **384 bytes** for each coordinate * - Overall memory usage: 96 × 4 = **384 bytes** * * This constant fits well into the GPU’s __constant memory space (64 KB on RTX 3090) * and benefits from fast broadcast access across all threads in a workgroup. * * Note: * Using __constant ensures: * - Reduced register pressure * - No redundant memory transfers per thread * - Better caching performance vs. global memory * * This allows thousands of threads to reuse the same precomputed data efficiently, * which is crucial in large scalar multiplication kernels on GPGPU. */ __constant secp256k1_t g_precomputed = { .xy = { // x1 SECP256K1_G_PRE_COMPUTED_00, SECP256K1_G_PRE_COMPUTED_01, SECP256K1_G_PRE_COMPUTED_02, SECP256K1_G_PRE_COMPUTED_03, SECP256K1_G_PRE_COMPUTED_04, SECP256K1_G_PRE_COMPUTED_05, SECP256K1_G_PRE_COMPUTED_06, SECP256K1_G_PRE_COMPUTED_07, // y1 SECP256K1_G_PRE_COMPUTED_08, SECP256K1_G_PRE_COMPUTED_09, SECP256K1_G_PRE_COMPUTED_10, SECP256K1_G_PRE_COMPUTED_11, SECP256K1_G_PRE_COMPUTED_12, SECP256K1_G_PRE_COMPUTED_13, SECP256K1_G_PRE_COMPUTED_14, SECP256K1_G_PRE_COMPUTED_15, // -y1 SECP256K1_G_PRE_COMPUTED_16, SECP256K1_G_PRE_COMPUTED_17, SECP256K1_G_PRE_COMPUTED_18, SECP256K1_G_PRE_COMPUTED_19, SECP256K1_G_PRE_COMPUTED_20, SECP256K1_G_PRE_COMPUTED_21, SECP256K1_G_PRE_COMPUTED_22, SECP256K1_G_PRE_COMPUTED_23, // x3 SECP256K1_G_PRE_COMPUTED_24, SECP256K1_G_PRE_COMPUTED_25, SECP256K1_G_PRE_COMPUTED_26, SECP256K1_G_PRE_COMPUTED_27, SECP256K1_G_PRE_COMPUTED_28, SECP256K1_G_PRE_COMPUTED_29, SECP256K1_G_PRE_COMPUTED_30, SECP256K1_G_PRE_COMPUTED_31, // y3 SECP256K1_G_PRE_COMPUTED_32, SECP256K1_G_PRE_COMPUTED_33, SECP256K1_G_PRE_COMPUTED_34, SECP256K1_G_PRE_COMPUTED_35, SECP256K1_G_PRE_COMPUTED_36, SECP256K1_G_PRE_COMPUTED_37, SECP256K1_G_PRE_COMPUTED_38, SECP256K1_G_PRE_COMPUTED_39, // -y3 SECP256K1_G_PRE_COMPUTED_40, SECP256K1_G_PRE_COMPUTED_41, SECP256K1_G_PRE_COMPUTED_42, SECP256K1_G_PRE_COMPUTED_43, SECP256K1_G_PRE_COMPUTED_44, SECP256K1_G_PRE_COMPUTED_45, SECP256K1_G_PRE_COMPUTED_46, SECP256K1_G_PRE_COMPUTED_47, // x5 SECP256K1_G_PRE_COMPUTED_48, SECP256K1_G_PRE_COMPUTED_49, SECP256K1_G_PRE_COMPUTED_50, SECP256K1_G_PRE_COMPUTED_51, SECP256K1_G_PRE_COMPUTED_52, SECP256K1_G_PRE_COMPUTED_53, SECP256K1_G_PRE_COMPUTED_54, SECP256K1_G_PRE_COMPUTED_55, // y5 SECP256K1_G_PRE_COMPUTED_56, SECP256K1_G_PRE_COMPUTED_57, SECP256K1_G_PRE_COMPUTED_58, SECP256K1_G_PRE_COMPUTED_59, SECP256K1_G_PRE_COMPUTED_60, SECP256K1_G_PRE_COMPUTED_61, SECP256K1_G_PRE_COMPUTED_62, SECP256K1_G_PRE_COMPUTED_63, // -y5 SECP256K1_G_PRE_COMPUTED_64, SECP256K1_G_PRE_COMPUTED_65, SECP256K1_G_PRE_COMPUTED_66, SECP256K1_G_PRE_COMPUTED_67, SECP256K1_G_PRE_COMPUTED_68, SECP256K1_G_PRE_COMPUTED_69, SECP256K1_G_PRE_COMPUTED_70, SECP256K1_G_PRE_COMPUTED_71, // x7 SECP256K1_G_PRE_COMPUTED_72, SECP256K1_G_PRE_COMPUTED_73, SECP256K1_G_PRE_COMPUTED_74, SECP256K1_G_PRE_COMPUTED_75, SECP256K1_G_PRE_COMPUTED_76, SECP256K1_G_PRE_COMPUTED_77, SECP256K1_G_PRE_COMPUTED_78, SECP256K1_G_PRE_COMPUTED_79, // y7 SECP256K1_G_PRE_COMPUTED_80, SECP256K1_G_PRE_COMPUTED_81, SECP256K1_G_PRE_COMPUTED_82, SECP256K1_G_PRE_COMPUTED_83, SECP256K1_G_PRE_COMPUTED_84, SECP256K1_G_PRE_COMPUTED_85, SECP256K1_G_PRE_COMPUTED_86, SECP256K1_G_PRE_COMPUTED_87, // -y7 SECP256K1_G_PRE_COMPUTED_88, SECP256K1_G_PRE_COMPUTED_89, SECP256K1_G_PRE_COMPUTED_90, SECP256K1_G_PRE_COMPUTED_91, SECP256K1_G_PRE_COMPUTED_92, SECP256K1_G_PRE_COMPUTED_93, SECP256K1_G_PRE_COMPUTED_94, SECP256K1_G_PRE_COMPUTED_95 } }; // Coordinates per point #define COORDS_PER_POINT (ONE_COORDINATE_NUM_WORDS * 2) // Precomputed base point offsets #define G_OFFSET_X1 (0) #define G_OFFSET_Y1 (G_OFFSET_X1 + ONE_COORDINATE_NUM_WORDS) #define G_OFFSET_NEG_Y1 (G_OFFSET_Y1 + ONE_COORDINATE_NUM_WORDS) #define G_OFFSET_X3 (G_OFFSET_NEG_Y1 + ONE_COORDINATE_NUM_WORDS) #define G_OFFSET_Y3 (G_OFFSET_X3 + ONE_COORDINATE_NUM_WORDS) #define G_OFFSET_NEG_Y3 (G_OFFSET_Y3 + ONE_COORDINATE_NUM_WORDS) #define G_OFFSET_X5 (G_OFFSET_NEG_Y3 + ONE_COORDINATE_NUM_WORDS) #define G_OFFSET_Y5 (G_OFFSET_X5 + ONE_COORDINATE_NUM_WORDS) #define G_OFFSET_NEG_Y5 (G_OFFSET_Y5 + ONE_COORDINATE_NUM_WORDS) #define G_OFFSET_X7 (G_OFFSET_NEG_Y5 + ONE_COORDINATE_NUM_WORDS) #define G_OFFSET_Y7 (G_OFFSET_X7 + ONE_COORDINATE_NUM_WORDS) #define G_OFFSET_NEG_Y7 (G_OFFSET_Y7 + ONE_COORDINATE_NUM_WORDS) #define G_PRECOMPUTED_TOTAL_WORDS (G_OFFSET_NEG_Y7 + ONE_COORDINATE_NUM_WORDS) DECLSPEC void point_add_xy (PRIVATE_AS u32 *x1, PRIVATE_AS u32 *y1, PRIVATE_AS const u32 *x2, PRIVATE_AS const u32 *y2) { u32 z1[8] = { 0 }; z1[0] = 1; point_add(x1, y1, z1, x2, y2); // z1 now holds z of result -> need to transform back to affine inv_mod(z1); u32 z2[8]; mul_mod(z2, z1, z1); // z^2 mul_mod(x1, x1, z2); // x_affine = x / z^2 mul_mod(z2, z2, z1); // z^3 mul_mod(y1, y1, z2); // y_affine = y / z^3 } /** * @brief Copies a given number of u32 values from __constant to __private memory. * * Performs a direct word-wise copy of 32-bit values from a statically allocated * constant memory region (e.g., precomputed lookup tables) into private memory * (thread-local registers or stack). * * This is useful when working with values stored in `__constant` space such as * secp256k1 precomputed base points that need to be accessed with full * read/write flexibility in local registers. * * @param dst Destination array of u32 values in __private address space. * @param src Source array of u32 values in __constant address space. * @param word_count Number of 32-bit words (u32) to copy. */ inline void copy_constant_u32_array_private_u32(u32 *dst, __constant const u32 *src, const int word_count) { #pragma unroll for (int i = 0; i < word_count; i++) { dst[i] = src[i]; } } /** * @brief Copies a given number of u32 values from one u32 array to another. * * Performs a direct word-wise copy of 32-bit values from src to dst. * * @param dst Destination array of u32 values. * @param src Source array of u32 values. * @param word_count Number of u32 values to copy. */ inline void copy_global_u32_array_private_u32(u32 *dst, __global const u32 *src, const int word_count) { #pragma unroll for (int i = 0; i < word_count; i++) { dst[i] = src[i]; } } /** * @brief Copies a given number of u32 values from one u32 array to another. * * Performs a direct word-wise copy of 32-bit values from src to dst. * * @param dst Destination array of u32 values. * @param src Source array of u32 values. * @param word_count Number of u32 values to copy. */ inline void copy_private_u32_array_global_u32(__global u32 *dst, const u32 *src, const int word_count) { #pragma unroll for (int i = 0; i < word_count; i++) { dst[i] = src[i]; } } /** * @brief Copies the raw bytes of a u32 array into a uchar array. * * Copies word_count * 4 bytes from the source u32 array into the * destination byte array starting at the given offset. * * @param dst Destination byte array (uchar*). * @param dst_offset Byte offset in the destination array to begin writing. * @param src Source array of u32 values. * @param word_count Number of u32 words to copy (1 word = 4 bytes). */ inline void copy_u32_array_bytes(uchar *dst, int dst_offset, const u32 *src, const int word_count) { const uchar *src_bytes = (const uchar *)src; #pragma unroll for (int i = 0; i < word_count * 4; i++) { dst[dst_offset + i] = src_bytes[i]; } } inline uchar get_lsb_of_little_endian_coordinate(const u32 *coord) { return as_uchar4(coord[0]).s0; } inline uchar get_lsb_of_big_endian_coordinate(const u32 *coord) { return as_uchar4(coord[ONE_COORDINATE_NUM_WORDS - 1]).s3; } // ======= Swap 32-bit value (safe across OpenCL versions) ======= inline u32 swap_u32(u32 v) { #if defined(__builtin_bswap32) return __builtin_bswap32(v); #else uchar4 bytes = as_uchar4(v); return as_uint((uchar4)(bytes.s3, bytes.s2, bytes.s1, bytes.s0)); #endif } /** * @brief Copies a u32 array to another while reversing word order and byte order (endianness). * * The source is interpreted as little-endian; the result will be big-endian, both in word and byte order. * * @param dst Destination u32 array. * @param dst_offset Starting index in the destination array. * @param src Source u32 array. * @param word_count Number of 32-bit words to copy and reverse. */ inline void copy_and_reverse_endianness_u32_array(u32 *dst, int dst_offset, const u32 *src, const int word_count) { #pragma unroll for (int i = 0; i < word_count; i++) { dst[dst_offset + i] = swap_u32(src[word_count - 1 - i]); } } /** * @brief Converts a byte array into an array of u32 words (big-endian). * * Packs 4 bytes at a time from the input byte array `src` into 32-bit words in `dst`, * assuming the byte order is big-endian (most significant byte first). * * For example, the bytes {0x12, 0x34, 0x56, 0x78} will become the u32 word 0x12345678. * * @param src Input byte array (length must be at least word_count * 4). * @param dst Output array of u32 words. * @param word_count Number of 32-bit words to produce (reads 4 * word_count bytes from src). */ inline void pack_bytes_to_u32_words(const uchar *src, u32 *dst, const int word_count) { #pragma unroll for (int i = 0; i < word_count; i++) { dst[i] = ((u32)src[i * 4 + 0] << 24) | ((u32)src[i * 4 + 1] << 16) | ((u32)src[i * 4 + 2] << 8 ) | ((u32)src[i * 4 + 3]); } } inline void sha256_add_padding(u32 *dst, const int padding_start_index, const u32 final_byte, const int length_index, const u32 bit_len) { // Write the final byte + 0x80 bit dst[padding_start_index] = ((u32)final_byte << 24) | 0x00800000; // Zero-fill from padding_start_index + 1 up to length_index - 1 #pragma unroll for (int i = padding_start_index + 1; i < length_index; i++) { dst[i] = 0; } // Store bit length dst[length_index] = bit_len; } inline void get_sec_bytes_uncompressed(const u32 *x_bigEndian, const u32 *y_bigEndian, uchar *out_sec) { out_sec[0] = SEC_PREFIX_UNCOMPRESSED_ECDSA_POINT; copy_u32_array_bytes(out_sec, 1, x_bigEndian, ONE_COORDINATE_NUM_WORDS); copy_u32_array_bytes(out_sec, 33, y_bigEndian, ONE_COORDINATE_NUM_WORDS); } inline uchar get_compressed_prefix_from_lsb(uchar lsb) { return (lsb & 1) == 0 ? SEC_PREFIX_COMPRESSED_ECDSA_POINT_EVEN_Y : SEC_PREFIX_COMPRESSED_ECDSA_POINT_ODD_Y; } inline void get_sec_bytes_compressed(const u32 *x_bigEndian, const u32 *y_bigEndian, uchar *out_sec) { uchar lsb = get_lsb_of_big_endian_coordinate(y_bigEndian); out_sec[0] = get_compressed_prefix_from_lsb(lsb); copy_u32_array_bytes(out_sec, 1, x_bigEndian, ONE_COORDINATE_NUM_WORDS); } inline void transform_sec_prefix_from_uncompressed_to_compressed(uchar *out_sec) { uchar lsb = out_sec[SEC_PUBLIC_KEY_UNCOMPRESSED_NUM_BYTES - 1]; out_sec[0] = get_compressed_prefix_from_lsb(lsb); } inline void build_sha256_block_from_uncompressed_pubkey(const uchar *sec, u32 *sha256_input) { // Pack 64 bytes from sec[0..63] into sha256_input[0..15] pack_bytes_to_u32_words(sec, sha256_input, TWO_COORDINATE_NUM_WORDS); // Apply SHA-256 padding: write 0x80 bit, zero-fill, append bit length (520 bits) sha256_add_padding(sha256_input, TWO_COORDINATE_NUM_WORDS, sec[TWO_COORDINATES_NUM_BYTES], SHA256_INPUT_TOTAL_WORDS_UNCOMPRESSED - 1, SEC_PUBLIC_KEY_UNCOMPRESSED_NUM_BITS); } inline void build_sha256_block_from_compressed_pubkey(const uchar *sec, u32 *sha256_input) { // Pack 32 bytes from sec[0..31] into sha256_input[0..7] pack_bytes_to_u32_words(sec, sha256_input, ONE_COORDINATE_NUM_WORDS); // Apply SHA-256 padding: write 0x80 bit, zero-fill, append bit length (264 bits) sha256_add_padding(sha256_input, ONE_COORDINATE_NUM_WORDS, sec[ONE_COORDINATE_NUM_BYTES], SHA256_INPUT_TOTAL_WORDS_COMPRESSED - 1, SEC_PUBLIC_KEY_COMPRESSED_NUM_BITS); } inline void build_ripemd160_block_from_sha256(const u32 *sha256_hash, u32 *ripemd_input) { // Copy 8 words (32 bytes) from SHA256 #pragma unroll for (int i = 0; i < SHA256_HASH_NUM_WORDS; i++) { ripemd_input[i] = sha256_hash[i]; } // Add RIPEMD160 padding // write "1" bit right after public key for SHA-256 padding ripemd_input[8] = 0x80000000; #pragma unroll for (int i = 9; i < 14; i++) { ripemd_input[i] = 0; } // begin of 64 length bits: // 0x0000000000010000 // 256 bits = 0x100 in hex // decimal 65536 is 00000000 00000001 00000000 00000000 in binary ripemd_input[14] = 0x00010000; // low word (bits 0–31) ripemd_input[15] = 0x00000000; // high word (bits 32–63) } /** * @define REUSE_UNCOMPRESSED_SEC_FOR_COMPRESSED * * When defined, enables optimization by reusing the buffer that stores the * uncompressed SEC (Standards for Efficient Cryptography) public key representation * to also hold the compressed form. * * Rationale: * - The compressed SEC format shares the same X coordinate as the uncompressed form. * - The only difference is the prefix byte (0x02 or 0x03 instead of 0x04). * - This allows us to avoid allocating a second array for the compressed key. * * Benefits: * - Reduces memory usage. * - Avoids redundant serialization logic. * - Helps GPU kernels minimize register and local memory pressure. * * Safety: * - This optimization is safe as long as the uncompressed SEC buffer is no longer needed * after being overwritten with the compressed prefix. */ #define REUSE_FOR_COMPRESSED /** * @brief * Generates multiple public key candidates from a single private key base by modifying the least significant bits. * * This kernel computes elliptic curve public keys and their corresponding Bitcoin address hashes for a grid * of private key candidates, where each candidate is derived by OR-ing the given base key with `global_id`. * * The output includes: * - X and Y coordinates of the resulting public key (in big-endian) * - RIPEMD-160 hash of the SHA-256 hash of the uncompressed public key * - RIPEMD-160 hash of the SHA-256 hash of the compressed public key * * Computation steps per work item: * 1. Take base private key from global memory and modify it by OR-ing with the thread's global ID. * 2. Multiply the private key with the curve's base point G using a precomputed wNAF table. * 3. Convert the resulting public key coordinates from little-endian to big-endian. * 4. Store X and Y coordinates in output buffer. * 5. Serialize uncompressed SEC format (0x04 + X + Y), hash it (SHA-256 then RIPEMD-160), and store the hash. * 6. Serialize compressed SEC format (0x02/0x03 + X), hash it (SHA-256 then RIPEMD-160), and store the hash. * * Optimization: * - If `REUSE_FOR_COMPRESSED` is defined, the buffer used for the uncompressed SEC format is reused for * the compressed version to reduce memory footprint. * * @param r Output buffer (global u32*). Must be large enough to hold all chunks per thread. * Each thread writes CHUNK_SIZE_NUM_WORDS u32 values. * @param k Input buffer (global const u32*) representing a single base private key (8 words, little-endian). */ __kernel void generateKeysKernel_grid(__global u32 *r, __global const u32 *k, const u32 loopCount) { // Little Endian format u32 k_littleEndian_local[PRIVATE_KEY_LENGTH]; u32 x_littleEndian_local[ONE_COORDINATE_NUM_WORDS]; u32 y_littleEndian_local[ONE_COORDINATE_NUM_WORDS]; // Big Endian format u32 x_bigEndian_local[ONE_COORDINATE_NUM_WORDS]; u32 y_bigEndian_local[ONE_COORDINATE_NUM_WORDS]; u32 x1_local[ONE_COORDINATE_NUM_WORDS]; u32 y1_local[ONE_COORDINATE_NUM_WORDS]; u32 z1_local[ONE_COORDINATE_NUM_WORDS] = { 0 }; z1_local[0] = 1; // Initialize Jacobian Z-coordinate (affine point: z = 1) u32 *sha256_input_uncompressed ; u32 *ripemd160_input_uncompressed ; uchar *sec_uncompressed ; u32 *sha256_input_compressed ; u32 *ripemd160_input_compressed ; uchar *sec_compressed ; u32 sha256_input_uncompressed_alloc[SHA256_INPUT_TOTAL_WORDS_UNCOMPRESSED]; u32 ripemd160_input_uncompressed_alloc[RIPEMD160_INPUT_BLOCK_SIZE_WORDS]; uchar sec_uncompressed_alloc[SEC_PUBLIC_KEY_UNCOMPRESSED_NUM_BYTES]; sha256_input_uncompressed = sha256_input_uncompressed_alloc; ripemd160_input_uncompressed = ripemd160_input_uncompressed_alloc; sec_uncompressed = sec_uncompressed_alloc; #ifdef REUSE_FOR_COMPRESSED // Shared context for both compressed and uncompressed operations sha256_ctx_t sha_ctx_shared; ripemd160_ctx_t ripemd_ctx_shared; // Aliases for readability — both use the shared context #define sha_ctx_uncompressed sha_ctx_shared #define sha_ctx_compressed sha_ctx_shared #define ripemd_ctx_uncompressed ripemd_ctx_shared #define ripemd_ctx_compressed ripemd_ctx_shared // arrays sha256_input_compressed = sha256_input_uncompressed_alloc; ripemd160_input_compressed = ripemd160_input_uncompressed_alloc; sec_compressed = sec_uncompressed_alloc; #else // Separate contexts for uncompressed and compressed operations sha256_ctx_t sha_ctx_uncompressed; sha256_ctx_t sha_ctx_compressed; ripemd160_ctx_t ripemd_ctx_uncompressed; ripemd160_ctx_t ripemd_ctx_compressed; u32 sha256_input_compressed_alloc[SHA256_INPUT_TOTAL_WORDS_COMPRESSED]; u32 ripemd160_input_compressed_alloc[RIPEMD160_INPUT_BLOCK_SIZE_WORDS]; uchar sec_compressed_alloc[SEC_PUBLIC_KEY_COMPRESSED_NUM_BYTES]; sha256_input_compressed = sha256_input_compressed_alloc; ripemd160_input_compressed = ripemd160_input_compressed_alloc; sec_compressed = sec_compressed_alloc; #endif // get_global_id(dim) where dim is the dimension index (0 for first, 1 for second dimension etc.) // The above call is equivalent to get_local_size(dim)*get_group_id(dim) + get_local_id(dim) // size_t global_id = get_global_id(0); u32 global_id = get_global_id(0); u32 base_offset = global_id * loopCount; //int local_id = get_local_id(0); //int local_size = get_local_size(0); // Copy private key to local register copy_global_u32_array_private_u32(k_littleEndian_local, k, PRIVATE_KEY_MAX_NUM_WORDS); u32 baseK0 = k_littleEndian_local[0]; // Copy base point G (in affine coordinates) from constant memory to local registers. // This avoids repeated global memory access during the loop (e.g., for point additions). copy_constant_u32_array_private_u32(x1_local, &g_precomputed.xy[G_OFFSET_X1], ONE_COORDINATE_NUM_WORDS); copy_constant_u32_array_private_u32(y1_local, &g_precomputed.xy[G_OFFSET_Y1], ONE_COORDINATE_NUM_WORDS); for (u32 i = 0; i < loopCount; i++) { u32 loop_index = base_offset + i; u32 r_offset = loop_index * CHUNK_SIZE_NUM_WORDS; // Apply variation (global_id) to LSB part of key (k[0]) // We use bitwise OR (|) instead of addition (+) to modify the key, // because it avoids carry propagation and is typically faster on GPU hardware. // // Rationale: // - Addition introduces data dependencies (carry chain across bits). // - Bitwise OR has no carry and maps directly to a single instruction. // - On most GPU architectures (NVIDIA, AMD), bitwise operations are cheaper // than integer addition in terms of instruction latency and power usage. // - Using OR guarantees deterministic variation without overflow concerns, // assuming loop_index is within expected bit range (e.g. lower N bits). // // Result: // baseK0 | loop_index = key variation with fast, non-carrying logic. k_littleEndian_local[0] = (baseK0 | loop_index); if (i == 0) { point_mul_xy(x_littleEndian_local, y_littleEndian_local, k_littleEndian_local, &g_precomputed); } else { point_add_xy(x_littleEndian_local, y_littleEndian_local, x1_local, y1_local); } // create big endian // x copy_and_reverse_endianness_u32_array(x_bigEndian_local, 0, x_littleEndian_local, ONE_COORDINATE_NUM_WORDS); copy_private_u32_array_global_u32(&r[r_offset + CHUNK_OFFSET_00_NUM_WORDS_BIG_ENDIAN_X], x_bigEndian_local, CHUNK_SIZE_00_NUM_WORDS_BIG_ENDIAN_X); // y copy_and_reverse_endianness_u32_array(y_bigEndian_local, 0, y_littleEndian_local, ONE_COORDINATE_NUM_WORDS); copy_private_u32_array_global_u32(&r[r_offset + CHUNK_OFFSET_01_NUM_WORDS_BIG_ENDIAN_Y], y_bigEndian_local, CHUNK_SIZE_01_NUM_WORDS_BIG_ENDIAN_Y); // === Hash uncompressed key === get_sec_bytes_uncompressed(x_bigEndian_local, y_bigEndian_local, sec_uncompressed); build_sha256_block_from_uncompressed_pubkey(sec_uncompressed, sha256_input_uncompressed); sha256_init(&sha_ctx_uncompressed); sha256_update(&sha_ctx_uncompressed, sha256_input_uncompressed, SHA256_INPUT_TOTAL_BYTES_UNCOMPRESSED); build_ripemd160_block_from_sha256(sha_ctx_uncompressed.h, ripemd160_input_uncompressed); ripemd160_init(&ripemd_ctx_uncompressed); ripemd160_update_swap(&ripemd_ctx_uncompressed, ripemd160_input_uncompressed, RIPEMD160_INPUT_BLOCK_SIZE_BYTES); copy_private_u32_array_global_u32(&r[r_offset + CHUNK_OFFSET_10_NUM_WORDS_RIPEMD160_UNCOMPRESSED], ripemd_ctx_uncompressed.h, RIPEMD160_HASH_NUM_WORDS); // === Hash compressed key === #ifdef REUSE_FOR_COMPRESSED transform_sec_prefix_from_uncompressed_to_compressed(sec_compressed); #else get_sec_bytes_compressed(x_bigEndian_local, y_bigEndian_local, sec_compressed); #endif build_sha256_block_from_compressed_pubkey(sec_compressed, sha256_input_compressed); sha256_init(&sha_ctx_compressed); sha256_update(&sha_ctx_compressed, sha256_input_compressed, SHA256_INPUT_TOTAL_BYTES_COMPRESSED); build_ripemd160_block_from_sha256(sha_ctx_compressed.h, ripemd160_input_compressed); ripemd160_init(&ripemd_ctx_compressed); ripemd160_update_swap(&ripemd_ctx_compressed, ripemd160_input_compressed, RIPEMD160_INPUT_BLOCK_SIZE_BYTES); copy_private_u32_array_global_u32(&r[r_offset + CHUNK_OFFSET_11_NUM_WORDS_RIPEMD160_COMPRESSED], ripemd_ctx_compressed.h, RIPEMD160_HASH_NUM_WORDS); } } ================================================ FILE: src/main/resources/mnemonic/wordlist/chinese_simplified.txt ================================================ 的 一 是 在 不 了 有 和 人 这 中 大 为 上 个 国 我 以 要 他 时 来 用 们 生 到 作 地 于 出 就 分 对 成 会 可 主 发 年 动 同 工 也 能 下 过 子 说 产 种 面 而 方 后 多 定 行 学 法 所 民 得 经 十 三 之 进 着 等 部 度 家 电 力 里 如 水 化 高 自 二 理 起 小 物 现 实 加 量 都 两 体 制 机 当 使 点 从 业 本 去 把 性 好 应 开 它 合 还 因 由 其 些 然 前 外 天 政 四 日 那 社 义 事 平 形 相 全 表 间 样 与 关 各 重 新 线 内 数 正 心 反 你 明 看 原 又 么 利 比 或 但 质 气 第 向 道 命 此 变 条 只 没 结 解 问 意 建 月 公 无 系 军 很 情 者 最 立 代 想 已 通 并 提 直 题 党 程 展 五 果 料 象 员 革 位 入 常 文 总 次 品 式 活 设 及 管 特 件 长 求 老 头 基 资 边 流 路 级 少 图 山 统 接 知 较 将 组 见 计 别 她 手 角 期 根 论 运 农 指 几 九 区 强 放 决 西 被 干 做 必 战 先 回 则 任 取 据 处 队 南 给 色 光 门 即 保 治 北 造 百 规 热 领 七 海 口 东 导 器 压 志 世 金 增 争 济 阶 油 思 术 极 交 受 联 什 认 六 共 权 收 证 改 清 美 再 采 转 更 单 风 切 打 白 教 速 花 带 安 场 身 车 例 真 务 具 万 每 目 至 达 走 积 示 议 声 报 斗 完 类 八 离 华 名 确 才 科 张 信 马 节 话 米 整 空 元 况 今 集 温 传 土 许 步 群 广 石 记 需 段 研 界 拉 林 律 叫 且 究 观 越 织 装 影 算 低 持 音 众 书 布 复 容 儿 须 际 商 非 验 连 断 深 难 近 矿 千 周 委 素 技 备 半 办 青 省 列 习 响 约 支 般 史 感 劳 便 团 往 酸 历 市 克 何 除 消 构 府 称 太 准 精 值 号 率 族 维 划 选 标 写 存 候 毛 亲 快 效 斯 院 查 江 型 眼 王 按 格 养 易 置 派 层 片 始 却 专 状 育 厂 京 识 适 属 圆 包 火 住 调 满 县 局 照 参 红 细 引 听 该 铁 价 严 首 底 液 官 德 随 病 苏 失 尔 死 讲 配 女 黄 推 显 谈 罪 神 艺 呢 席 含 企 望 密 批 营 项 防 举 球 英 氧 势 告 李 台 落 木 帮 轮 破 亚 师 围 注 远 字 材 排 供 河 态 封 另 施 减 树 溶 怎 止 案 言 士 均 武 固 叶 鱼 波 视 仅 费 紧 爱 左 章 早 朝 害 续 轻 服 试 食 充 兵 源 判 护 司 足 某 练 差 致 板 田 降 黑 犯 负 击 范 继 兴 似 余 坚 曲 输 修 故 城 夫 够 送 笔 船 占 右 财 吃 富 春 职 觉 汉 画 功 巴 跟 虽 杂 飞 检 吸 助 升 阳 互 初 创 抗 考 投 坏 策 古 径 换 未 跑 留 钢 曾 端 责 站 简 述 钱 副 尽 帝 射 草 冲 承 独 令 限 阿 宣 环 双 请 超 微 让 控 州 良 轴 找 否 纪 益 依 优 顶 础 载 倒 房 突 坐 粉 敌 略 客 袁 冷 胜 绝 析 块 剂 测 丝 协 诉 念 陈 仍 罗 盐 友 洋 错 苦 夜 刑 移 频 逐 靠 混 母 短 皮 终 聚 汽 村 云 哪 既 距 卫 停 烈 央 察 烧 迅 境 若 印 洲 刻 括 激 孔 搞 甚 室 待 核 校 散 侵 吧 甲 游 久 菜 味 旧 模 湖 货 损 预 阻 毫 普 稳 乙 妈 植 息 扩 银 语 挥 酒 守 拿 序 纸 医 缺 雨 吗 针 刘 啊 急 唱 误 训 愿 审 附 获 茶 鲜 粮 斤 孩 脱 硫 肥 善 龙 演 父 渐 血 欢 械 掌 歌 沙 刚 攻 谓 盾 讨 晚 粒 乱 燃 矛 乎 杀 药 宁 鲁 贵 钟 煤 读 班 伯 香 介 迫 句 丰 培 握 兰 担 弦 蛋 沉 假 穿 执 答 乐 谁 顺 烟 缩 征 脸 喜 松 脚 困 异 免 背 星 福 买 染 井 概 慢 怕 磁 倍 祖 皇 促 静 补 评 翻 肉 践 尼 衣 宽 扬 棉 希 伤 操 垂 秋 宜 氢 套 督 振 架 亮 末 宪 庆 编 牛 触 映 雷 销 诗 座 居 抓 裂 胞 呼 娘 景 威 绿 晶 厚 盟 衡 鸡 孙 延 危 胶 屋 乡 临 陆 顾 掉 呀 灯 岁 措 束 耐 剧 玉 赵 跳 哥 季 课 凯 胡 额 款 绍 卷 齐 伟 蒸 殖 永 宗 苗 川 炉 岩 弱 零 杨 奏 沿 露 杆 探 滑 镇 饭 浓 航 怀 赶 库 夺 伊 灵 税 途 灭 赛 归 召 鼓 播 盘 裁 险 康 唯 录 菌 纯 借 糖 盖 横 符 私 努 堂 域 枪 润 幅 哈 竟 熟 虫 泽 脑 壤 碳 欧 遍 侧 寨 敢 彻 虑 斜 薄 庭 纳 弹 饲 伸 折 麦 湿 暗 荷 瓦 塞 床 筑 恶 户 访 塔 奇 透 梁 刀 旋 迹 卡 氯 遇 份 毒 泥 退 洗 摆 灰 彩 卖 耗 夏 择 忙 铜 献 硬 予 繁 圈 雪 函 亦 抽 篇 阵 阴 丁 尺 追 堆 雄 迎 泛 爸 楼 避 谋 吨 野 猪 旗 累 偏 典 馆 索 秦 脂 潮 爷 豆 忽 托 惊 塑 遗 愈 朱 替 纤 粗 倾 尚 痛 楚 谢 奋 购 磨 君 池 旁 碎 骨 监 捕 弟 暴 割 贯 殊 释 词 亡 壁 顿 宝 午 尘 闻 揭 炮 残 冬 桥 妇 警 综 招 吴 付 浮 遭 徐 您 摇 谷 赞 箱 隔 订 男 吹 园 纷 唐 败 宋 玻 巨 耕 坦 荣 闭 湾 键 凡 驻 锅 救 恩 剥 凝 碱 齿 截 炼 麻 纺 禁 废 盛 版 缓 净 睛 昌 婚 涉 筒 嘴 插 岸 朗 庄 街 藏 姑 贸 腐 奴 啦 惯 乘 伙 恢 匀 纱 扎 辩 耳 彪 臣 亿 璃 抵 脉 秀 萨 俄 网 舞 店 喷 纵 寸 汗 挂 洪 贺 闪 柬 爆 烯 津 稻 墙 软 勇 像 滚 厘 蒙 芳 肯 坡 柱 荡 腿 仪 旅 尾 轧 冰 贡 登 黎 削 钻 勒 逃 障 氨 郭 峰 币 港 伏 轨 亩 毕 擦 莫 刺 浪 秘 援 株 健 售 股 岛 甘 泡 睡 童 铸 汤 阀 休 汇 舍 牧 绕 炸 哲 磷 绩 朋 淡 尖 启 陷 柴 呈 徒 颜 泪 稍 忘 泵 蓝 拖 洞 授 镜 辛 壮 锋 贫 虚 弯 摩 泰 幼 廷 尊 窗 纲 弄 隶 疑 氏 宫 姐 震 瑞 怪 尤 琴 循 描 膜 违 夹 腰 缘 珠 穷 森 枝 竹 沟 催 绳 忆 邦 剩 幸 浆 栏 拥 牙 贮 礼 滤 钠 纹 罢 拍 咱 喊 袖 埃 勤 罚 焦 潜 伍 墨 欲 缝 姓 刊 饱 仿 奖 铝 鬼 丽 跨 默 挖 链 扫 喝 袋 炭 污 幕 诸 弧 励 梅 奶 洁 灾 舟 鉴 苯 讼 抱 毁 懂 寒 智 埔 寄 届 跃 渡 挑 丹 艰 贝 碰 拔 爹 戴 码 梦 芽 熔 赤 渔 哭 敬 颗 奔 铅 仲 虎 稀 妹 乏 珍 申 桌 遵 允 隆 螺 仓 魏 锐 晓 氮 兼 隐 碍 赫 拨 忠 肃 缸 牵 抢 博 巧 壳 兄 杜 讯 诚 碧 祥 柯 页 巡 矩 悲 灌 龄 伦 票 寻 桂 铺 圣 恐 恰 郑 趣 抬 荒 腾 贴 柔 滴 猛 阔 辆 妻 填 撤 储 签 闹 扰 紫 砂 递 戏 吊 陶 伐 喂 疗 瓶 婆 抚 臂 摸 忍 虾 蜡 邻 胸 巩 挤 偶 弃 槽 劲 乳 邓 吉 仁 烂 砖 租 乌 舰 伴 瓜 浅 丙 暂 燥 橡 柳 迷 暖 牌 秧 胆 详 簧 踏 瓷 谱 呆 宾 糊 洛 辉 愤 竞 隙 怒 粘 乃 绪 肩 籍 敏 涂 熙 皆 侦 悬 掘 享 纠 醒 狂 锁 淀 恨 牲 霸 爬 赏 逆 玩 陵 祝 秒 浙 貌 役 彼 悉 鸭 趋 凤 晨 畜 辈 秩 卵 署 梯 炎 滩 棋 驱 筛 峡 冒 啥 寿 译 浸 泉 帽 迟 硅 疆 贷 漏 稿 冠 嫩 胁 芯 牢 叛 蚀 奥 鸣 岭 羊 凭 串 塘 绘 酵 融 盆 锡 庙 筹 冻 辅 摄 袭 筋 拒 僚 旱 钾 鸟 漆 沈 眉 疏 添 棒 穗 硝 韩 逼 扭 侨 凉 挺 碗 栽 炒 杯 患 馏 劝 豪 辽 勃 鸿 旦 吏 拜 狗 埋 辊 掩 饮 搬 骂 辞 勾 扣 估 蒋 绒 雾 丈 朵 姆 拟 宇 辑 陕 雕 偿 蓄 崇 剪 倡 厅 咬 驶 薯 刷 斥 番 赋 奉 佛 浇 漫 曼 扇 钙 桃 扶 仔 返 俗 亏 腔 鞋 棱 覆 框 悄 叔 撞 骗 勘 旺 沸 孤 吐 孟 渠 屈 疾 妙 惜 仰 狠 胀 谐 抛 霉 桑 岗 嘛 衰 盗 渗 脏 赖 涌 甜 曹 阅 肌 哩 厉 烃 纬 毅 昨 伪 症 煮 叹 钉 搭 茎 笼 酷 偷 弓 锥 恒 杰 坑 鼻 翼 纶 叙 狱 逮 罐 络 棚 抑 膨 蔬 寺 骤 穆 冶 枯 册 尸 凸 绅 坯 牺 焰 轰 欣 晋 瘦 御 锭 锦 丧 旬 锻 垄 搜 扑 邀 亭 酯 迈 舒 脆 酶 闲 忧 酚 顽 羽 涨 卸 仗 陪 辟 惩 杭 姚 肚 捉 飘 漂 昆 欺 吾 郎 烷 汁 呵 饰 萧 雅 邮 迁 燕 撒 姻 赴 宴 烦 债 帐 斑 铃 旨 醇 董 饼 雏 姿 拌 傅 腹 妥 揉 贤 拆 歪 葡 胺 丢 浩 徽 昂 垫 挡 览 贪 慰 缴 汪 慌 冯 诺 姜 谊 凶 劣 诬 耀 昏 躺 盈 骑 乔 溪 丛 卢 抹 闷 咨 刮 驾 缆 悟 摘 铒 掷 颇 幻 柄 惠 惨 佳 仇 腊 窝 涤 剑 瞧 堡 泼 葱 罩 霍 捞 胎 苍 滨 俩 捅 湘 砍 霞 邵 萄 疯 淮 遂 熊 粪 烘 宿 档 戈 驳 嫂 裕 徙 箭 捐 肠 撑 晒 辨 殿 莲 摊 搅 酱 屏 疫 哀 蔡 堵 沫 皱 畅 叠 阁 莱 敲 辖 钩 痕 坝 巷 饿 祸 丘 玄 溜 曰 逻 彭 尝 卿 妨 艇 吞 韦 怨 矮 歇 ================================================ FILE: src/main/resources/mnemonic/wordlist/chinese_traditional.txt ================================================ 的 一 是 在 不 了 有 和 人 這 中 大 為 上 個 國 我 以 要 他 時 來 用 們 生 到 作 地 於 出 就 分 對 成 會 可 主 發 年 動 同 工 也 能 下 過 子 說 產 種 面 而 方 後 多 定 行 學 法 所 民 得 經 十 三 之 進 著 等 部 度 家 電 力 裡 如 水 化 高 自 二 理 起 小 物 現 實 加 量 都 兩 體 制 機 當 使 點 從 業 本 去 把 性 好 應 開 它 合 還 因 由 其 些 然 前 外 天 政 四 日 那 社 義 事 平 形 相 全 表 間 樣 與 關 各 重 新 線 內 數 正 心 反 你 明 看 原 又 麼 利 比 或 但 質 氣 第 向 道 命 此 變 條 只 沒 結 解 問 意 建 月 公 無 系 軍 很 情 者 最 立 代 想 已 通 並 提 直 題 黨 程 展 五 果 料 象 員 革 位 入 常 文 總 次 品 式 活 設 及 管 特 件 長 求 老 頭 基 資 邊 流 路 級 少 圖 山 統 接 知 較 將 組 見 計 別 她 手 角 期 根 論 運 農 指 幾 九 區 強 放 決 西 被 幹 做 必 戰 先 回 則 任 取 據 處 隊 南 給 色 光 門 即 保 治 北 造 百 規 熱 領 七 海 口 東 導 器 壓 志 世 金 增 爭 濟 階 油 思 術 極 交 受 聯 什 認 六 共 權 收 證 改 清 美 再 採 轉 更 單 風 切 打 白 教 速 花 帶 安 場 身 車 例 真 務 具 萬 每 目 至 達 走 積 示 議 聲 報 鬥 完 類 八 離 華 名 確 才 科 張 信 馬 節 話 米 整 空 元 況 今 集 溫 傳 土 許 步 群 廣 石 記 需 段 研 界 拉 林 律 叫 且 究 觀 越 織 裝 影 算 低 持 音 眾 書 布 复 容 兒 須 際 商 非 驗 連 斷 深 難 近 礦 千 週 委 素 技 備 半 辦 青 省 列 習 響 約 支 般 史 感 勞 便 團 往 酸 歷 市 克 何 除 消 構 府 稱 太 準 精 值 號 率 族 維 劃 選 標 寫 存 候 毛 親 快 效 斯 院 查 江 型 眼 王 按 格 養 易 置 派 層 片 始 卻 專 狀 育 廠 京 識 適 屬 圓 包 火 住 調 滿 縣 局 照 參 紅 細 引 聽 該 鐵 價 嚴 首 底 液 官 德 隨 病 蘇 失 爾 死 講 配 女 黃 推 顯 談 罪 神 藝 呢 席 含 企 望 密 批 營 項 防 舉 球 英 氧 勢 告 李 台 落 木 幫 輪 破 亞 師 圍 注 遠 字 材 排 供 河 態 封 另 施 減 樹 溶 怎 止 案 言 士 均 武 固 葉 魚 波 視 僅 費 緊 愛 左 章 早 朝 害 續 輕 服 試 食 充 兵 源 判 護 司 足 某 練 差 致 板 田 降 黑 犯 負 擊 范 繼 興 似 餘 堅 曲 輸 修 故 城 夫 夠 送 筆 船 佔 右 財 吃 富 春 職 覺 漢 畫 功 巴 跟 雖 雜 飛 檢 吸 助 昇 陽 互 初 創 抗 考 投 壞 策 古 徑 換 未 跑 留 鋼 曾 端 責 站 簡 述 錢 副 盡 帝 射 草 衝 承 獨 令 限 阿 宣 環 雙 請 超 微 讓 控 州 良 軸 找 否 紀 益 依 優 頂 礎 載 倒 房 突 坐 粉 敵 略 客 袁 冷 勝 絕 析 塊 劑 測 絲 協 訴 念 陳 仍 羅 鹽 友 洋 錯 苦 夜 刑 移 頻 逐 靠 混 母 短 皮 終 聚 汽 村 雲 哪 既 距 衛 停 烈 央 察 燒 迅 境 若 印 洲 刻 括 激 孔 搞 甚 室 待 核 校 散 侵 吧 甲 遊 久 菜 味 舊 模 湖 貨 損 預 阻 毫 普 穩 乙 媽 植 息 擴 銀 語 揮 酒 守 拿 序 紙 醫 缺 雨 嗎 針 劉 啊 急 唱 誤 訓 願 審 附 獲 茶 鮮 糧 斤 孩 脫 硫 肥 善 龍 演 父 漸 血 歡 械 掌 歌 沙 剛 攻 謂 盾 討 晚 粒 亂 燃 矛 乎 殺 藥 寧 魯 貴 鐘 煤 讀 班 伯 香 介 迫 句 豐 培 握 蘭 擔 弦 蛋 沉 假 穿 執 答 樂 誰 順 煙 縮 徵 臉 喜 松 腳 困 異 免 背 星 福 買 染 井 概 慢 怕 磁 倍 祖 皇 促 靜 補 評 翻 肉 踐 尼 衣 寬 揚 棉 希 傷 操 垂 秋 宜 氫 套 督 振 架 亮 末 憲 慶 編 牛 觸 映 雷 銷 詩 座 居 抓 裂 胞 呼 娘 景 威 綠 晶 厚 盟 衡 雞 孫 延 危 膠 屋 鄉 臨 陸 顧 掉 呀 燈 歲 措 束 耐 劇 玉 趙 跳 哥 季 課 凱 胡 額 款 紹 卷 齊 偉 蒸 殖 永 宗 苗 川 爐 岩 弱 零 楊 奏 沿 露 桿 探 滑 鎮 飯 濃 航 懷 趕 庫 奪 伊 靈 稅 途 滅 賽 歸 召 鼓 播 盤 裁 險 康 唯 錄 菌 純 借 糖 蓋 橫 符 私 努 堂 域 槍 潤 幅 哈 竟 熟 蟲 澤 腦 壤 碳 歐 遍 側 寨 敢 徹 慮 斜 薄 庭 納 彈 飼 伸 折 麥 濕 暗 荷 瓦 塞 床 築 惡 戶 訪 塔 奇 透 梁 刀 旋 跡 卡 氯 遇 份 毒 泥 退 洗 擺 灰 彩 賣 耗 夏 擇 忙 銅 獻 硬 予 繁 圈 雪 函 亦 抽 篇 陣 陰 丁 尺 追 堆 雄 迎 泛 爸 樓 避 謀 噸 野 豬 旗 累 偏 典 館 索 秦 脂 潮 爺 豆 忽 托 驚 塑 遺 愈 朱 替 纖 粗 傾 尚 痛 楚 謝 奮 購 磨 君 池 旁 碎 骨 監 捕 弟 暴 割 貫 殊 釋 詞 亡 壁 頓 寶 午 塵 聞 揭 炮 殘 冬 橋 婦 警 綜 招 吳 付 浮 遭 徐 您 搖 谷 贊 箱 隔 訂 男 吹 園 紛 唐 敗 宋 玻 巨 耕 坦 榮 閉 灣 鍵 凡 駐 鍋 救 恩 剝 凝 鹼 齒 截 煉 麻 紡 禁 廢 盛 版 緩 淨 睛 昌 婚 涉 筒 嘴 插 岸 朗 莊 街 藏 姑 貿 腐 奴 啦 慣 乘 夥 恢 勻 紗 扎 辯 耳 彪 臣 億 璃 抵 脈 秀 薩 俄 網 舞 店 噴 縱 寸 汗 掛 洪 賀 閃 柬 爆 烯 津 稻 牆 軟 勇 像 滾 厘 蒙 芳 肯 坡 柱 盪 腿 儀 旅 尾 軋 冰 貢 登 黎 削 鑽 勒 逃 障 氨 郭 峰 幣 港 伏 軌 畝 畢 擦 莫 刺 浪 秘 援 株 健 售 股 島 甘 泡 睡 童 鑄 湯 閥 休 匯 舍 牧 繞 炸 哲 磷 績 朋 淡 尖 啟 陷 柴 呈 徒 顏 淚 稍 忘 泵 藍 拖 洞 授 鏡 辛 壯 鋒 貧 虛 彎 摩 泰 幼 廷 尊 窗 綱 弄 隸 疑 氏 宮 姐 震 瑞 怪 尤 琴 循 描 膜 違 夾 腰 緣 珠 窮 森 枝 竹 溝 催 繩 憶 邦 剩 幸 漿 欄 擁 牙 貯 禮 濾 鈉 紋 罷 拍 咱 喊 袖 埃 勤 罰 焦 潛 伍 墨 欲 縫 姓 刊 飽 仿 獎 鋁 鬼 麗 跨 默 挖 鏈 掃 喝 袋 炭 污 幕 諸 弧 勵 梅 奶 潔 災 舟 鑑 苯 訟 抱 毀 懂 寒 智 埔 寄 屆 躍 渡 挑 丹 艱 貝 碰 拔 爹 戴 碼 夢 芽 熔 赤 漁 哭 敬 顆 奔 鉛 仲 虎 稀 妹 乏 珍 申 桌 遵 允 隆 螺 倉 魏 銳 曉 氮 兼 隱 礙 赫 撥 忠 肅 缸 牽 搶 博 巧 殼 兄 杜 訊 誠 碧 祥 柯 頁 巡 矩 悲 灌 齡 倫 票 尋 桂 鋪 聖 恐 恰 鄭 趣 抬 荒 騰 貼 柔 滴 猛 闊 輛 妻 填 撤 儲 簽 鬧 擾 紫 砂 遞 戲 吊 陶 伐 餵 療 瓶 婆 撫 臂 摸 忍 蝦 蠟 鄰 胸 鞏 擠 偶 棄 槽 勁 乳 鄧 吉 仁 爛 磚 租 烏 艦 伴 瓜 淺 丙 暫 燥 橡 柳 迷 暖 牌 秧 膽 詳 簧 踏 瓷 譜 呆 賓 糊 洛 輝 憤 競 隙 怒 粘 乃 緒 肩 籍 敏 塗 熙 皆 偵 懸 掘 享 糾 醒 狂 鎖 淀 恨 牲 霸 爬 賞 逆 玩 陵 祝 秒 浙 貌 役 彼 悉 鴨 趨 鳳 晨 畜 輩 秩 卵 署 梯 炎 灘 棋 驅 篩 峽 冒 啥 壽 譯 浸 泉 帽 遲 矽 疆 貸 漏 稿 冠 嫩 脅 芯 牢 叛 蝕 奧 鳴 嶺 羊 憑 串 塘 繪 酵 融 盆 錫 廟 籌 凍 輔 攝 襲 筋 拒 僚 旱 鉀 鳥 漆 沈 眉 疏 添 棒 穗 硝 韓 逼 扭 僑 涼 挺 碗 栽 炒 杯 患 餾 勸 豪 遼 勃 鴻 旦 吏 拜 狗 埋 輥 掩 飲 搬 罵 辭 勾 扣 估 蔣 絨 霧 丈 朵 姆 擬 宇 輯 陝 雕 償 蓄 崇 剪 倡 廳 咬 駛 薯 刷 斥 番 賦 奉 佛 澆 漫 曼 扇 鈣 桃 扶 仔 返 俗 虧 腔 鞋 棱 覆 框 悄 叔 撞 騙 勘 旺 沸 孤 吐 孟 渠 屈 疾 妙 惜 仰 狠 脹 諧 拋 黴 桑 崗 嘛 衰 盜 滲 臟 賴 湧 甜 曹 閱 肌 哩 厲 烴 緯 毅 昨 偽 症 煮 嘆 釘 搭 莖 籠 酷 偷 弓 錐 恆 傑 坑 鼻 翼 綸 敘 獄 逮 罐 絡 棚 抑 膨 蔬 寺 驟 穆 冶 枯 冊 屍 凸 紳 坯 犧 焰 轟 欣 晉 瘦 禦 錠 錦 喪 旬 鍛 壟 搜 撲 邀 亭 酯 邁 舒 脆 酶 閒 憂 酚 頑 羽 漲 卸 仗 陪 闢 懲 杭 姚 肚 捉 飄 漂 昆 欺 吾 郎 烷 汁 呵 飾 蕭 雅 郵 遷 燕 撒 姻 赴 宴 煩 債 帳 斑 鈴 旨 醇 董 餅 雛 姿 拌 傅 腹 妥 揉 賢 拆 歪 葡 胺 丟 浩 徽 昂 墊 擋 覽 貪 慰 繳 汪 慌 馮 諾 姜 誼 兇 劣 誣 耀 昏 躺 盈 騎 喬 溪 叢 盧 抹 悶 諮 刮 駕 纜 悟 摘 鉺 擲 頗 幻 柄 惠 慘 佳 仇 臘 窩 滌 劍 瞧 堡 潑 蔥 罩 霍 撈 胎 蒼 濱 倆 捅 湘 砍 霞 邵 萄 瘋 淮 遂 熊 糞 烘 宿 檔 戈 駁 嫂 裕 徙 箭 捐 腸 撐 曬 辨 殿 蓮 攤 攪 醬 屏 疫 哀 蔡 堵 沫 皺 暢 疊 閣 萊 敲 轄 鉤 痕 壩 巷 餓 禍 丘 玄 溜 曰 邏 彭 嘗 卿 妨 艇 吞 韋 怨 矮 歇 ================================================ FILE: src/main/resources/mnemonic/wordlist/czech.txt ================================================ abdikace abeceda adresa agrese akce aktovka alej alkohol amputace ananas andulka anekdota anketa antika anulovat archa arogance asfalt asistent aspirace astma astronom atlas atletika atol autobus azyl babka bachor bacil baculka badatel bageta bagr bahno bakterie balada baletka balkon balonek balvan balza bambus bankomat barbar baret barman baroko barva baterka batoh bavlna bazalka bazilika bazuka bedna beran beseda bestie beton bezinka bezmoc beztak bicykl bidlo biftek bikiny bilance biograf biolog bitva bizon blahobyt blatouch blecha bledule blesk blikat blizna blokovat bloudit blud bobek bobr bodlina bodnout bohatost bojkot bojovat bokorys bolest borec borovice bota boubel bouchat bouda boule bourat boxer bradavka brambora branka bratr brepta briketa brko brloh bronz broskev brunetka brusinka brzda brzy bublina bubnovat buchta buditel budka budova bufet bujarost bukvice buldok bulva bunda bunkr burza butik buvol buzola bydlet bylina bytovka bzukot capart carevna cedr cedule cejch cejn cela celer celkem celnice cenina cennost cenovka centrum cenzor cestopis cetka chalupa chapadlo charita chata chechtat chemie chichot chirurg chlad chleba chlubit chmel chmura chobot chochol chodba cholera chomout chopit choroba chov chrapot chrlit chrt chrup chtivost chudina chutnat chvat chvilka chvost chyba chystat chytit cibule cigareta cihelna cihla cinkot cirkus cisterna citace citrus cizinec cizost clona cokoliv couvat ctitel ctnost cudnost cuketa cukr cupot cvaknout cval cvik cvrkot cyklista daleko dareba datel datum dcera debata dechovka decibel deficit deflace dekl dekret demokrat deprese derby deska detektiv dikobraz diktovat dioda diplom disk displej divadlo divoch dlaha dlouho dluhopis dnes dobro dobytek docent dochutit dodnes dohled dohoda dohra dojem dojnice doklad dokola doktor dokument dolar doleva dolina doma dominant domluvit domov donutit dopad dopis doplnit doposud doprovod dopustit dorazit dorost dort dosah doslov dostatek dosud dosyta dotaz dotek dotknout doufat doutnat dovozce dozadu doznat dozorce drahota drak dramatik dravec draze drdol drobnost drogerie drozd drsnost drtit drzost duben duchovno dudek duha duhovka dusit dusno dutost dvojice dvorec dynamit ekolog ekonomie elektron elipsa email emise emoce empatie epizoda epocha epopej epos esej esence eskorta eskymo etiketa euforie evoluce exekuce exkurze expedice exploze export extrakt facka fajfka fakulta fanatik fantazie farmacie favorit fazole federace fejeton fenka fialka figurant filozof filtr finance finta fixace fjord flanel flirt flotila fond fosfor fotbal fotka foton frakce freska fronta fukar funkce fyzika galeje garant genetika geolog gilotina glazura glejt golem golfista gotika graf gramofon granule grep gril grog groteska guma hadice hadr hala halenka hanba hanopis harfa harpuna havran hebkost hejkal hejno hejtman hektar helma hematom herec herna heslo hezky historik hladovka hlasivky hlava hledat hlen hlodavec hloh hloupost hltat hlubina hluchota hmat hmota hmyz hnis hnojivo hnout hoblina hoboj hoch hodiny hodlat hodnota hodovat hojnost hokej holinka holka holub homole honitba honorace horal horda horizont horko horlivec hormon hornina horoskop horstvo hospoda hostina hotovost houba houf houpat houska hovor hradba hranice hravost hrazda hrbolek hrdina hrdlo hrdost hrnek hrobka hromada hrot hrouda hrozen hrstka hrubost hryzat hubenost hubnout hudba hukot humr husita hustota hvozd hybnost hydrant hygiena hymna hysterik idylka ihned ikona iluze imunita infekce inflace inkaso inovace inspekce internet invalida investor inzerce ironie jablko jachta jahoda jakmile jakost jalovec jantar jarmark jaro jasan jasno jatka javor jazyk jedinec jedle jednatel jehlan jekot jelen jelito jemnost jenom jepice jeseter jevit jezdec jezero jinak jindy jinoch jiskra jistota jitrnice jizva jmenovat jogurt jurta kabaret kabel kabinet kachna kadet kadidlo kahan kajak kajuta kakao kaktus kalamita kalhoty kalibr kalnost kamera kamkoliv kamna kanibal kanoe kantor kapalina kapela kapitola kapka kaple kapota kapr kapusta kapybara karamel karotka karton kasa katalog katedra kauce kauza kavalec kazajka kazeta kazivost kdekoliv kdesi kedluben kemp keramika kino klacek kladivo klam klapot klasika klaun klec klenba klepat klesnout klid klima klisna klobouk klokan klopa kloub klubovna klusat kluzkost kmen kmitat kmotr kniha knot koalice koberec kobka kobliha kobyla kocour kohout kojenec kokos koktejl kolaps koleda kolize kolo komando kometa komik komnata komora kompas komunita konat koncept kondice konec konfese kongres konina konkurs kontakt konzerva kopanec kopie kopnout koprovka korbel korektor kormidlo koroptev korpus koruna koryto korzet kosatec kostka kotel kotleta kotoul koukat koupelna kousek kouzlo kovboj koza kozoroh krabice krach krajina kralovat krasopis kravata kredit krejcar kresba kreveta kriket kritik krize krkavec krmelec krmivo krocan krok kronika kropit kroupa krovka krtek kruhadlo krupice krutost krvinka krychle krypta krystal kryt kudlanka kufr kujnost kukla kulajda kulich kulka kulomet kultura kuna kupodivu kurt kurzor kutil kvalita kvasinka kvestor kynolog kyselina kytara kytice kytka kytovec kyvadlo labrador lachtan ladnost laik lakomec lamela lampa lanovka lasice laso lastura latinka lavina lebka leckdy leden lednice ledovka ledvina legenda legie legrace lehce lehkost lehnout lektvar lenochod lentilka lepenka lepidlo letadlo letec letmo letokruh levhart levitace levobok libra lichotka lidojed lidskost lihovina lijavec lilek limetka linie linka linoleum listopad litina litovat lobista lodivod logika logoped lokalita loket lomcovat lopata lopuch lord losos lotr loudal louh louka louskat lovec lstivost lucerna lucifer lump lusk lustrace lvice lyra lyrika lysina madam madlo magistr mahagon majetek majitel majorita makak makovice makrela malba malina malovat malvice maminka mandle manko marnost masakr maskot masopust matice matrika maturita mazanec mazivo mazlit mazurka mdloba mechanik meditace medovina melasa meloun mentolka metla metoda metr mezera migrace mihnout mihule mikina mikrofon milenec milimetr milost mimika mincovna minibar minomet minulost miska mistr mixovat mladost mlha mlhovina mlok mlsat mluvit mnich mnohem mobil mocnost modelka modlitba mohyla mokro molekula momentka monarcha monokl monstrum montovat monzun mosaz moskyt most motivace motorka motyka moucha moudrost mozaika mozek mozol mramor mravenec mrkev mrtvola mrzet mrzutost mstitel mudrc muflon mulat mumie munice muset mutace muzeum muzikant myslivec mzda nabourat nachytat nadace nadbytek nadhoz nadobro nadpis nahlas nahnat nahodile nahradit naivita najednou najisto najmout naklonit nakonec nakrmit nalevo namazat namluvit nanometr naoko naopak naostro napadat napevno naplnit napnout naposled naprosto narodit naruby narychlo nasadit nasekat naslepo nastat natolik navenek navrch navzdory nazvat nebe nechat necky nedaleko nedbat neduh negace nehet nehoda nejen nejprve neklid nelibost nemilost nemoc neochota neonka nepokoj nerost nerv nesmysl nesoulad netvor neuron nevina nezvykle nicota nijak nikam nikdy nikl nikterak nitro nocleh nohavice nominace nora norek nositel nosnost nouze noviny novota nozdra nuda nudle nuget nutit nutnost nutrie nymfa obal obarvit obava obdiv obec obehnat obejmout obezita obhajoba obilnice objasnit objekt obklopit oblast oblek obliba obloha obluda obnos obohatit obojek obout obrazec obrna obruba obrys obsah obsluha obstarat obuv obvaz obvinit obvod obvykle obyvatel obzor ocas ocel ocenit ochladit ochota ochrana ocitnout odboj odbyt odchod odcizit odebrat odeslat odevzdat odezva odhadce odhodit odjet odjinud odkaz odkoupit odliv odluka odmlka odolnost odpad odpis odplout odpor odpustit odpykat odrazka odsoudit odstup odsun odtok odtud odvaha odveta odvolat odvracet odznak ofina ofsajd ohlas ohnisko ohrada ohrozit ohryzek okap okenice oklika okno okouzlit okovy okrasa okres okrsek okruh okupant okurka okusit olejnina olizovat omak omeleta omezit omladina omlouvat omluva omyl onehdy opakovat opasek operace opice opilost opisovat opora opozice opravdu oproti orbital orchestr orgie orlice orloj ortel osada oschnout osika osivo oslava oslepit oslnit oslovit osnova osoba osolit ospalec osten ostraha ostuda ostych osvojit oteplit otisk otop otrhat otrlost otrok otruby otvor ovanout ovar oves ovlivnit ovoce oxid ozdoba pachatel pacient padouch pahorek pakt palanda palec palivo paluba pamflet pamlsek panenka panika panna panovat panstvo pantofle paprika parketa parodie parta paruka paryba paseka pasivita pastelka patent patrona pavouk pazneht pazourek pecka pedagog pejsek peklo peloton penalta pendrek penze periskop pero pestrost petarda petice petrolej pevnina pexeso pianista piha pijavice pikle piknik pilina pilnost pilulka pinzeta pipeta pisatel pistole pitevna pivnice pivovar placenta plakat plamen planeta plastika platit plavidlo plaz plech plemeno plenta ples pletivo plevel plivat plnit plno plocha plodina plomba plout pluk plyn pobavit pobyt pochod pocit poctivec podat podcenit podepsat podhled podivit podklad podmanit podnik podoba podpora podraz podstata podvod podzim poezie pohanka pohnutka pohovor pohroma pohyb pointa pojistka pojmout pokazit pokles pokoj pokrok pokuta pokyn poledne polibek polknout poloha polynom pomalu pominout pomlka pomoc pomsta pomyslet ponechat ponorka ponurost popadat popel popisek poplach poprosit popsat popud poradce porce porod porucha poryv posadit posed posila poskok poslanec posoudit pospolu postava posudek posyp potah potkan potlesk potomek potrava potupa potvora poukaz pouto pouzdro povaha povidla povlak povoz povrch povstat povyk povzdech pozdrav pozemek poznatek pozor pozvat pracovat prahory praktika prales praotec praporek prase pravda princip prkno probudit procento prodej profese prohra projekt prolomit promile pronikat propad prorok prosba proton proutek provaz prskavka prsten prudkost prut prvek prvohory psanec psovod pstruh ptactvo puberta puch pudl pukavec puklina pukrle pult pumpa punc pupen pusa pusinka pustina putovat putyka pyramida pysk pytel racek rachot radiace radnice radon raft ragby raketa rakovina rameno rampouch rande rarach rarita rasovna rastr ratolest razance razidlo reagovat reakce recept redaktor referent reflex rejnok reklama rekord rekrut rektor reputace revize revma revolver rezerva riskovat riziko robotika rodokmen rohovka rokle rokoko romaneto ropovod ropucha rorejs rosol rostlina rotmistr rotoped rotunda roubenka roucho roup roura rovina rovnice rozbor rozchod rozdat rozeznat rozhodce rozinka rozjezd rozkaz rozloha rozmar rozpad rozruch rozsah roztok rozum rozvod rubrika ruchadlo rukavice rukopis ryba rybolov rychlost rydlo rypadlo rytina ryzost sadista sahat sako samec samizdat samota sanitka sardinka sasanka satelit sazba sazenice sbor schovat sebranka secese sedadlo sediment sedlo sehnat sejmout sekera sekta sekunda sekvoje semeno seno servis sesadit seshora seskok seslat sestra sesuv sesypat setba setina setkat setnout setrvat sever seznam shoda shrnout sifon silnice sirka sirotek sirup situace skafandr skalisko skanzen skaut skeptik skica skladba sklenice sklo skluz skoba skokan skoro skripta skrz skupina skvost skvrna slabika sladidlo slanina slast slavnost sledovat slepec sleva slezina slib slina sliznice slon sloupek slovo sluch sluha slunce slupka slza smaragd smetana smilstvo smlouva smog smrad smrk smrtka smutek smysl snad snaha snob sobota socha sodovka sokol sopka sotva souboj soucit soudce souhlas soulad soumrak souprava soused soutok souviset spalovna spasitel spis splav spodek spojenec spolu sponzor spornost spousta sprcha spustit sranda sraz srdce srna srnec srovnat srpen srst srub stanice starosta statika stavba stehno stezka stodola stolek stopa storno stoupat strach stres strhnout strom struna studna stupnice stvol styk subjekt subtropy suchar sudost sukno sundat sunout surikata surovina svah svalstvo svetr svatba svazek svisle svitek svoboda svodidlo svorka svrab sykavka sykot synek synovec sypat sypkost syrovost sysel sytost tabletka tabule tahoun tajemno tajfun tajga tajit tajnost taktika tamhle tampon tancovat tanec tanker tapeta tavenina tazatel technika tehdy tekutina telefon temnota tendence tenista tenor teplota tepna teprve terapie termoska textil ticho tiskopis titulek tkadlec tkanina tlapka tleskat tlukot tlupa tmel toaleta topinka topol torzo touha toulec tradice traktor tramp trasa traverza trefit trest trezor trhavina trhlina trochu trojice troska trouba trpce trpitel trpkost trubec truchlit truhlice trus trvat tudy tuhnout tuhost tundra turista turnaj tuzemsko tvaroh tvorba tvrdost tvrz tygr tykev ubohost uboze ubrat ubrousek ubrus ubytovna ucho uctivost udivit uhradit ujednat ujistit ujmout ukazatel uklidnit uklonit ukotvit ukrojit ulice ulita ulovit umyvadlo unavit uniforma uniknout upadnout uplatnit uplynout upoutat upravit uran urazit usednout usilovat usmrtit usnadnit usnout usoudit ustlat ustrnout utahovat utkat utlumit utonout utopenec utrousit uvalit uvolnit uvozovka uzdravit uzel uzenina uzlina uznat vagon valcha valoun vana vandal vanilka varan varhany varovat vcelku vchod vdova vedro vegetace vejce velbloud veletrh velitel velmoc velryba venkov veranda verze veselka veskrze vesnice vespodu vesta veterina veverka vibrace vichr videohra vidina vidle vila vinice viset vitalita vize vizitka vjezd vklad vkus vlajka vlak vlasec vlevo vlhkost vliv vlnovka vloupat vnucovat vnuk voda vodivost vodoznak vodstvo vojensky vojna vojsko volant volba volit volno voskovka vozidlo vozovna vpravo vrabec vracet vrah vrata vrba vrcholek vrhat vrstva vrtule vsadit vstoupit vstup vtip vybavit vybrat vychovat vydat vydra vyfotit vyhledat vyhnout vyhodit vyhradit vyhubit vyjasnit vyjet vyjmout vyklopit vykonat vylekat vymazat vymezit vymizet vymyslet vynechat vynikat vynutit vypadat vyplatit vypravit vypustit vyrazit vyrovnat vyrvat vyslovit vysoko vystavit vysunout vysypat vytasit vytesat vytratit vyvinout vyvolat vyvrhel vyzdobit vyznat vzadu vzbudit vzchopit vzdor vzduch vzdychat vzestup vzhledem vzkaz vzlykat vznik vzorek vzpoura vztah vztek xylofon zabrat zabydlet zachovat zadarmo zadusit zafoukat zahltit zahodit zahrada zahynout zajatec zajet zajistit zaklepat zakoupit zalepit zamezit zamotat zamyslet zanechat zanikat zaplatit zapojit zapsat zarazit zastavit zasunout zatajit zatemnit zatknout zaujmout zavalit zavelet zavinit zavolat zavrtat zazvonit zbavit zbrusu zbudovat zbytek zdaleka zdarma zdatnost zdivo zdobit zdroj zdvih zdymadlo zelenina zeman zemina zeptat zezadu zezdola zhatit zhltnout zhluboka zhotovit zhruba zima zimnice zjemnit zklamat zkoumat zkratka zkumavka zlato zlehka zloba zlom zlost zlozvyk zmapovat zmar zmatek zmije zmizet zmocnit zmodrat zmrzlina zmutovat znak znalost znamenat znovu zobrazit zotavit zoubek zoufale zplodit zpomalit zprava zprostit zprudka zprvu zrada zranit zrcadlo zrnitost zrno zrovna zrychlit zrzavost zticha ztratit zubovina zubr zvednout zvenku zvesela zvon zvrat zvukovod zvyk ================================================ FILE: src/main/resources/mnemonic/wordlist/english.txt ================================================ abandon ability able about above absent absorb abstract absurd abuse access accident account accuse achieve acid acoustic acquire across act action actor actress actual adapt add addict address adjust admit adult advance advice aerobic affair afford afraid again age agent agree ahead aim air airport aisle alarm album alcohol alert alien all alley allow almost alone alpha already also alter always amateur amazing among amount amused analyst anchor ancient anger angle angry animal ankle announce annual another answer antenna antique anxiety any apart apology appear apple approve april arch arctic area arena argue arm armed armor army around arrange arrest arrive arrow art artefact artist artwork ask aspect assault asset assist assume asthma athlete atom attack attend attitude attract auction audit august aunt author auto autumn average avocado avoid awake aware away awesome awful awkward axis baby bachelor bacon badge bag balance balcony ball bamboo banana banner bar barely bargain barrel base basic basket battle beach bean beauty because become beef before begin behave behind believe below belt bench benefit best betray better between beyond bicycle bid bike bind biology bird birth bitter black blade blame blanket blast bleak bless blind blood blossom blouse blue blur blush board boat body boil bomb bone bonus book boost border boring borrow boss bottom bounce box boy bracket brain brand brass brave bread breeze brick bridge brief bright bring brisk broccoli broken bronze broom brother brown brush bubble buddy budget buffalo build bulb bulk bullet bundle bunker burden burger burst bus business busy butter buyer buzz cabbage cabin cable cactus cage cake call calm camera camp can canal cancel candy cannon canoe canvas canyon capable capital captain car carbon card cargo carpet carry cart case cash casino castle casual cat catalog catch category cattle caught cause caution cave ceiling celery cement census century cereal certain chair chalk champion change chaos chapter charge chase chat cheap check cheese chef cherry chest chicken chief child chimney choice choose chronic chuckle chunk churn cigar cinnamon circle citizen city civil claim clap clarify claw clay clean clerk clever click client cliff climb clinic clip clock clog close cloth cloud clown club clump cluster clutch coach coast coconut code coffee coil coin collect color column combine come comfort comic common company concert conduct confirm congress connect consider control convince cook cool copper copy coral core corn correct cost cotton couch country couple course cousin cover coyote crack cradle craft cram crane crash crater crawl crazy cream credit creek crew cricket crime crisp critic crop cross crouch crowd crucial cruel cruise crumble crunch crush cry crystal cube culture cup cupboard curious current curtain curve cushion custom cute cycle dad damage damp dance danger daring dash daughter dawn day deal debate debris decade december decide decline decorate decrease deer defense define defy degree delay deliver demand demise denial dentist deny depart depend deposit depth deputy derive describe desert design desk despair destroy detail detect develop device devote diagram dial diamond diary dice diesel diet differ digital dignity dilemma dinner dinosaur direct dirt disagree discover disease dish dismiss disorder display distance divert divide divorce dizzy doctor document dog doll dolphin domain donate donkey donor door dose double dove draft dragon drama drastic draw dream dress drift drill drink drip drive drop drum dry duck dumb dune during dust dutch duty dwarf dynamic eager eagle early earn earth easily east easy echo ecology economy edge edit educate effort egg eight either elbow elder electric elegant element elephant elevator elite else embark embody embrace emerge emotion employ empower empty enable enact end endless endorse enemy energy enforce engage engine enhance enjoy enlist enough enrich enroll ensure enter entire entry envelope episode equal equip era erase erode erosion error erupt escape essay essence estate eternal ethics evidence evil evoke evolve exact example excess exchange excite exclude excuse execute exercise exhaust exhibit exile exist exit exotic expand expect expire explain expose express extend extra eye eyebrow fabric face faculty fade faint faith fall false fame family famous fan fancy fantasy farm fashion fat fatal father fatigue fault favorite feature february federal fee feed feel female fence festival fetch fever few fiber fiction field figure file film filter final find fine finger finish fire firm first fiscal fish fit fitness fix flag flame flash flat flavor flee flight flip float flock floor flower fluid flush fly foam focus fog foil fold follow food foot force forest forget fork fortune forum forward fossil foster found fox fragile frame frequent fresh friend fringe frog front frost frown frozen fruit fuel fun funny furnace fury future gadget gain galaxy gallery game gap garage garbage garden garlic garment gas gasp gate gather gauge gaze general genius genre gentle genuine gesture ghost giant gift giggle ginger giraffe girl give glad glance glare glass glide glimpse globe gloom glory glove glow glue goat goddess gold good goose gorilla gospel gossip govern gown grab grace grain grant grape grass gravity great green grid grief grit grocery group grow grunt guard guess guide guilt guitar gun gym habit hair half hammer hamster hand happy harbor hard harsh harvest hat have hawk hazard head health heart heavy hedgehog height hello helmet help hen hero hidden high hill hint hip hire history hobby hockey hold hole holiday hollow home honey hood hope horn horror horse hospital host hotel hour hover hub huge human humble humor hundred hungry hunt hurdle hurry hurt husband hybrid ice icon idea identify idle ignore ill illegal illness image imitate immense immune impact impose improve impulse inch include income increase index indicate indoor industry infant inflict inform inhale inherit initial inject injury inmate inner innocent input inquiry insane insect inside inspire install intact interest into invest invite involve iron island isolate issue item ivory jacket jaguar jar jazz jealous jeans jelly jewel job join joke journey joy judge juice jump jungle junior junk just kangaroo keen keep ketchup key kick kid kidney kind kingdom kiss kit kitchen kite kitten kiwi knee knife knock know lab label labor ladder lady lake lamp language laptop large later latin laugh laundry lava law lawn lawsuit layer lazy leader leaf learn leave lecture left leg legal legend leisure lemon lend length lens leopard lesson letter level liar liberty library license life lift light like limb limit link lion liquid list little live lizard load loan lobster local lock logic lonely long loop lottery loud lounge love loyal lucky luggage lumber lunar lunch luxury lyrics machine mad magic magnet maid mail main major make mammal man manage mandate mango mansion manual maple marble march margin marine market marriage mask mass master match material math matrix matter maximum maze meadow mean measure meat mechanic medal media melody melt member memory mention menu mercy merge merit merry mesh message metal method middle midnight milk million mimic mind minimum minor minute miracle mirror misery miss mistake mix mixed mixture mobile model modify mom moment monitor monkey monster month moon moral more morning mosquito mother motion motor mountain mouse move movie much muffin mule multiply muscle museum mushroom music must mutual myself mystery myth naive name napkin narrow nasty nation nature near neck need negative neglect neither nephew nerve nest net network neutral never news next nice night noble noise nominee noodle normal north nose notable note nothing notice novel now nuclear number nurse nut oak obey object oblige obscure observe obtain obvious occur ocean october odor off offer office often oil okay old olive olympic omit once one onion online only open opera opinion oppose option orange orbit orchard order ordinary organ orient original orphan ostrich other outdoor outer output outside oval oven over own owner oxygen oyster ozone pact paddle page pair palace palm panda panel panic panther paper parade parent park parrot party pass patch path patient patrol pattern pause pave payment peace peanut pear peasant pelican pen penalty pencil people pepper perfect permit person pet phone photo phrase physical piano picnic picture piece pig pigeon pill pilot pink pioneer pipe pistol pitch pizza place planet plastic plate play please pledge pluck plug plunge poem poet point polar pole police pond pony pool popular portion position possible post potato pottery poverty powder power practice praise predict prefer prepare present pretty prevent price pride primary print priority prison private prize problem process produce profit program project promote proof property prosper protect proud provide public pudding pull pulp pulse pumpkin punch pupil puppy purchase purity purpose purse push put puzzle pyramid quality quantum quarter question quick quit quiz quote rabbit raccoon race rack radar radio rail rain raise rally ramp ranch random range rapid rare rate rather raven raw razor ready real reason rebel rebuild recall receive recipe record recycle reduce reflect reform refuse region regret regular reject relax release relief rely remain remember remind remove render renew rent reopen repair repeat replace report require rescue resemble resist resource response result retire retreat return reunion reveal review reward rhythm rib ribbon rice rich ride ridge rifle right rigid ring riot ripple risk ritual rival river road roast robot robust rocket romance roof rookie room rose rotate rough round route royal rubber rude rug rule run runway rural sad saddle sadness safe sail salad salmon salon salt salute same sample sand satisfy satoshi sauce sausage save say scale scan scare scatter scene scheme school science scissors scorpion scout scrap screen script scrub sea search season seat second secret section security seed seek segment select sell seminar senior sense sentence series service session settle setup seven shadow shaft shallow share shed shell sheriff shield shift shine ship shiver shock shoe shoot shop short shoulder shove shrimp shrug shuffle shy sibling sick side siege sight sign silent silk silly silver similar simple since sing siren sister situate six size skate sketch ski skill skin skirt skull slab slam sleep slender slice slide slight slim slogan slot slow slush small smart smile smoke smooth snack snake snap sniff snow soap soccer social sock soda soft solar soldier solid solution solve someone song soon sorry sort soul sound soup source south space spare spatial spawn speak special speed spell spend sphere spice spider spike spin spirit split spoil sponsor spoon sport spot spray spread spring spy square squeeze squirrel stable stadium staff stage stairs stamp stand start state stay steak steel stem step stereo stick still sting stock stomach stone stool story stove strategy street strike strong struggle student stuff stumble style subject submit subway success such sudden suffer sugar suggest suit summer sun sunny sunset super supply supreme sure surface surge surprise surround survey suspect sustain swallow swamp swap swarm swear sweet swift swim swing switch sword symbol symptom syrup system table tackle tag tail talent talk tank tape target task taste tattoo taxi teach team tell ten tenant tennis tent term test text thank that theme then theory there they thing this thought three thrive throw thumb thunder ticket tide tiger tilt timber time tiny tip tired tissue title toast tobacco today toddler toe together toilet token tomato tomorrow tone tongue tonight tool tooth top topic topple torch tornado tortoise toss total tourist toward tower town toy track trade traffic tragic train transfer trap trash travel tray treat tree trend trial tribe trick trigger trim trip trophy trouble truck true truly trumpet trust truth try tube tuition tumble tuna tunnel turkey turn turtle twelve twenty twice twin twist two type typical ugly umbrella unable unaware uncle uncover under undo unfair unfold unhappy uniform unique unit universe unknown unlock until unusual unveil update upgrade uphold upon upper upset urban urge usage use used useful useless usual utility vacant vacuum vague valid valley valve van vanish vapor various vast vault vehicle velvet vendor venture venue verb verify version very vessel veteran viable vibrant vicious victory video view village vintage violin virtual virus visa visit visual vital vivid vocal voice void volcano volume vote voyage wage wagon wait walk wall walnut want warfare warm warrior wash wasp waste water wave way wealth weapon wear weasel weather web wedding weekend weird welcome west wet whale what wheat wheel when where whip whisper wide width wife wild will win window wine wing wink winner winter wire wisdom wise wish witness wolf woman wonder wood wool word work world worry worth wrap wreck wrestle wrist write wrong yard year yellow you young youth zebra zero zone zoo ================================================ FILE: src/main/resources/mnemonic/wordlist/french.txt ================================================ abaisser abandon abdiquer abeille abolir aborder aboutir aboyer abrasif abreuver abriter abroger abrupt absence absolu absurde abusif abyssal académie acajou acarien accabler accepter acclamer accolade accroche accuser acerbe achat acheter aciduler acier acompte acquérir acronyme acteur actif actuel adepte adéquat adhésif adjectif adjuger admettre admirer adopter adorer adoucir adresse adroit adulte adverbe aérer aéronef affaire affecter affiche affreux affubler agacer agencer agile agiter agrafer agréable agrume aider aiguille ailier aimable aisance ajouter ajuster alarmer alchimie alerte algèbre algue aliéner aliment alléger alliage allouer allumer alourdir alpaga altesse alvéole amateur ambigu ambre aménager amertume amidon amiral amorcer amour amovible amphibie ampleur amusant analyse anaphore anarchie anatomie ancien anéantir angle angoisse anguleux animal annexer annonce annuel anodin anomalie anonyme anormal antenne antidote anxieux apaiser apéritif aplanir apologie appareil appeler apporter appuyer aquarium aqueduc arbitre arbuste ardeur ardoise argent arlequin armature armement armoire armure arpenter arracher arriver arroser arsenic artériel article aspect asphalte aspirer assaut asservir assiette associer assurer asticot astre astuce atelier atome atrium atroce attaque attentif attirer attraper aubaine auberge audace audible augurer aurore automne autruche avaler avancer avarice avenir averse aveugle aviateur avide avion aviser avoine avouer avril axial axiome badge bafouer bagage baguette baignade balancer balcon baleine balisage bambin bancaire bandage banlieue bannière banquier barbier baril baron barque barrage bassin bastion bataille bateau batterie baudrier bavarder belette bélier belote bénéfice berceau berger berline bermuda besace besogne bétail beurre biberon bicycle bidule bijou bilan bilingue billard binaire biologie biopsie biotype biscuit bison bistouri bitume bizarre blafard blague blanchir blessant blinder blond bloquer blouson bobard bobine boire boiser bolide bonbon bondir bonheur bonifier bonus bordure borne botte boucle boueux bougie boulon bouquin bourse boussole boutique boxeur branche brasier brave brebis brèche breuvage bricoler brigade brillant brioche brique brochure broder bronzer brousse broyeur brume brusque brutal bruyant buffle buisson bulletin bureau burin bustier butiner butoir buvable buvette cabanon cabine cachette cadeau cadre caféine caillou caisson calculer calepin calibre calmer calomnie calvaire camarade caméra camion campagne canal caneton canon cantine canular capable caporal caprice capsule capter capuche carabine carbone caresser caribou carnage carotte carreau carton cascade casier casque cassure causer caution cavalier caverne caviar cédille ceinture céleste cellule cendrier censurer central cercle cérébral cerise cerner cerveau cesser chagrin chaise chaleur chambre chance chapitre charbon chasseur chaton chausson chavirer chemise chenille chéquier chercher cheval chien chiffre chignon chimère chiot chlorure chocolat choisir chose chouette chrome chute cigare cigogne cimenter cinéma cintrer circuler cirer cirque citerne citoyen citron civil clairon clameur claquer classe clavier client cligner climat clivage cloche clonage cloporte cobalt cobra cocasse cocotier coder codifier coffre cogner cohésion coiffer coincer colère colibri colline colmater colonel combat comédie commande compact concert conduire confier congeler connoter consonne contact convexe copain copie corail corbeau cordage corniche corpus correct cortège cosmique costume coton coude coupure courage couteau couvrir coyote crabe crainte cravate crayon créature créditer crémeux creuser crevette cribler crier cristal critère croire croquer crotale crucial cruel crypter cubique cueillir cuillère cuisine cuivre culminer cultiver cumuler cupide curatif curseur cyanure cycle cylindre cynique daigner damier danger danseur dauphin débattre débiter déborder débrider débutant décaler décembre déchirer décider déclarer décorer décrire décupler dédale déductif déesse défensif défiler défrayer dégager dégivrer déglutir dégrafer déjeuner délice déloger demander demeurer démolir dénicher dénouer dentelle dénuder départ dépenser déphaser déplacer déposer déranger dérober désastre descente désert désigner désobéir dessiner destrier détacher détester détourer détresse devancer devenir deviner devoir diable dialogue diamant dicter différer digérer digital digne diluer dimanche diminuer dioxyde directif diriger discuter disposer dissiper distance divertir diviser docile docteur dogme doigt domaine domicile dompter donateur donjon donner dopamine dortoir dorure dosage doseur dossier dotation douanier double douceur douter doyen dragon draper dresser dribbler droiture duperie duplexe durable durcir dynastie éblouir écarter écharpe échelle éclairer éclipse éclore écluse école économie écorce écouter écraser écrémer écrivain écrou écume écureuil édifier éduquer effacer effectif effigie effort effrayer effusion égaliser égarer éjecter élaborer élargir électron élégant éléphant élève éligible élitisme éloge élucider éluder emballer embellir embryon émeraude émission emmener émotion émouvoir empereur employer emporter emprise émulsion encadrer enchère enclave encoche endiguer endosser endroit enduire énergie enfance enfermer enfouir engager engin englober énigme enjamber enjeu enlever ennemi ennuyeux enrichir enrobage enseigne entasser entendre entier entourer entraver énumérer envahir enviable envoyer enzyme éolien épaissir épargne épatant épaule épicerie épidémie épier épilogue épine épisode épitaphe époque épreuve éprouver épuisant équerre équipe ériger érosion erreur éruption escalier espadon espèce espiègle espoir esprit esquiver essayer essence essieu essorer estime estomac estrade étagère étaler étanche étatique éteindre étendoir éternel éthanol éthique ethnie étirer étoffer étoile étonnant étourdir étrange étroit étude euphorie évaluer évasion éventail évidence éviter évolutif évoquer exact exagérer exaucer exceller excitant exclusif excuse exécuter exemple exercer exhaler exhorter exigence exiler exister exotique expédier explorer exposer exprimer exquis extensif extraire exulter fable fabuleux facette facile facture faiblir falaise fameux famille farceur farfelu farine farouche fasciner fatal fatigue faucon fautif faveur favori fébrile féconder fédérer félin femme fémur fendoir féodal fermer féroce ferveur festival feuille feutre février fiasco ficeler fictif fidèle figure filature filetage filière filleul filmer filou filtrer financer finir fiole firme fissure fixer flairer flamme flasque flatteur fléau flèche fleur flexion flocon flore fluctuer fluide fluvial folie fonderie fongible fontaine forcer forgeron formuler fortune fossile foudre fougère fouiller foulure fourmi fragile fraise franchir frapper frayeur frégate freiner frelon frémir frénésie frère friable friction frisson frivole froid fromage frontal frotter fruit fugitif fuite fureur furieux furtif fusion futur gagner galaxie galerie gambader garantir gardien garnir garrigue gazelle gazon géant gélatine gélule gendarme général génie genou gentil géologie géomètre géranium germe gestuel geyser gibier gicler girafe givre glace glaive glisser globe gloire glorieux golfeur gomme gonfler gorge gorille goudron gouffre goulot goupille gourmand goutte graduel graffiti graine grand grappin gratuit gravir grenat griffure griller grimper grogner gronder grotte groupe gruger grutier gruyère guépard guerrier guide guimauve guitare gustatif gymnaste gyrostat habitude hachoir halte hameau hangar hanneton haricot harmonie harpon hasard hélium hématome herbe hérisson hermine héron hésiter heureux hiberner hibou hilarant histoire hiver homard hommage homogène honneur honorer honteux horde horizon horloge hormone horrible houleux housse hublot huileux humain humble humide humour hurler hydromel hygiène hymne hypnose idylle ignorer iguane illicite illusion image imbiber imiter immense immobile immuable impact impérial implorer imposer imprimer imputer incarner incendie incident incliner incolore indexer indice inductif inédit ineptie inexact infini infliger informer infusion ingérer inhaler inhiber injecter injure innocent inoculer inonder inscrire insecte insigne insolite inspirer instinct insulter intact intense intime intrigue intuitif inutile invasion inventer inviter invoquer ironique irradier irréel irriter isoler ivoire ivresse jaguar jaillir jambe janvier jardin jauger jaune javelot jetable jeton jeudi jeunesse joindre joncher jongler joueur jouissif journal jovial joyau joyeux jubiler jugement junior jupon juriste justice juteux juvénile kayak kimono kiosque label labial labourer lacérer lactose lagune laine laisser laitier lambeau lamelle lampe lanceur langage lanterne lapin largeur larme laurier lavabo lavoir lecture légal léger légume lessive lettre levier lexique lézard liasse libérer libre licence licorne liège lièvre ligature ligoter ligue limer limite limonade limpide linéaire lingot lionceau liquide lisière lister lithium litige littoral livreur logique lointain loisir lombric loterie louer lourd loutre louve loyal lubie lucide lucratif lueur lugubre luisant lumière lunaire lundi luron lutter luxueux machine magasin magenta magique maigre maillon maintien mairie maison majorer malaxer maléfice malheur malice mallette mammouth mandater maniable manquant manteau manuel marathon marbre marchand mardi maritime marqueur marron marteler mascotte massif matériel matière matraque maudire maussade mauve maximal méchant méconnu médaille médecin méditer méduse meilleur mélange mélodie membre mémoire menacer mener menhir mensonge mentor mercredi mérite merle messager mesure métal météore méthode métier meuble miauler microbe miette mignon migrer milieu million mimique mince minéral minimal minorer minute miracle miroiter missile mixte mobile moderne moelleux mondial moniteur monnaie monotone monstre montagne monument moqueur morceau morsure mortier moteur motif mouche moufle moulin mousson mouton mouvant multiple munition muraille murène murmure muscle muséum musicien mutation muter mutuel myriade myrtille mystère mythique nageur nappe narquois narrer natation nation nature naufrage nautique navire nébuleux nectar néfaste négation négliger négocier neige nerveux nettoyer neurone neutron neveu niche nickel nitrate niveau noble nocif nocturne noirceur noisette nomade nombreux nommer normatif notable notifier notoire nourrir nouveau novateur novembre novice nuage nuancer nuire nuisible numéro nuptial nuque nutritif obéir objectif obliger obscur observer obstacle obtenir obturer occasion occuper océan octobre octroyer octupler oculaire odeur odorant offenser officier offrir ogive oiseau oisillon olfactif olivier ombrage omettre onctueux onduler onéreux onirique opale opaque opérer opinion opportun opprimer opter optique orageux orange orbite ordonner oreille organe orgueil orifice ornement orque ortie osciller osmose ossature otarie ouragan ourson outil outrager ouvrage ovation oxyde oxygène ozone paisible palace palmarès palourde palper panache panda pangolin paniquer panneau panorama pantalon papaye papier papoter papyrus paradoxe parcelle paresse parfumer parler parole parrain parsemer partager parure parvenir passion pastèque paternel patience patron pavillon pavoiser payer paysage peigne peintre pelage pélican pelle pelouse peluche pendule pénétrer pénible pensif pénurie pépite péplum perdrix perforer période permuter perplexe persil perte peser pétale petit pétrir peuple pharaon phobie phoque photon phrase physique piano pictural pièce pierre pieuvre pilote pinceau pipette piquer pirogue piscine piston pivoter pixel pizza placard plafond plaisir planer plaque plastron plateau pleurer plexus pliage plomb plonger pluie plumage pochette poésie poète pointe poirier poisson poivre polaire policier pollen polygone pommade pompier ponctuel pondérer poney portique position posséder posture potager poteau potion pouce poulain poumon pourpre poussin pouvoir prairie pratique précieux prédire préfixe prélude prénom présence prétexte prévoir primitif prince prison priver problème procéder prodige profond progrès proie projeter prologue promener propre prospère protéger prouesse proverbe prudence pruneau psychose public puceron puiser pulpe pulsar punaise punitif pupitre purifier puzzle pyramide quasar querelle question quiétude quitter quotient racine raconter radieux ragondin raideur raisin ralentir rallonge ramasser rapide rasage ratisser ravager ravin rayonner réactif réagir réaliser réanimer recevoir réciter réclamer récolter recruter reculer recycler rédiger redouter refaire réflexe réformer refrain refuge régalien région réglage régulier réitérer rejeter rejouer relatif relever relief remarque remède remise remonter remplir remuer renard renfort renifler renoncer rentrer renvoi replier reporter reprise reptile requin réserve résineux résoudre respect rester résultat rétablir retenir réticule retomber retracer réunion réussir revanche revivre révolte révulsif richesse rideau rieur rigide rigoler rincer riposter risible risque rituel rival rivière rocheux romance rompre ronce rondin roseau rosier rotatif rotor rotule rouge rouille rouleau routine royaume ruban rubis ruche ruelle rugueux ruiner ruisseau ruser rustique rythme sabler saboter sabre sacoche safari sagesse saisir salade salive salon saluer samedi sanction sanglier sarcasme sardine saturer saugrenu saumon sauter sauvage savant savonner scalpel scandale scélérat scénario sceptre schéma science scinder score scrutin sculpter séance sécable sécher secouer sécréter sédatif séduire seigneur séjour sélectif semaine sembler semence séminal sénateur sensible sentence séparer séquence serein sergent sérieux serrure sérum service sésame sévir sevrage sextuple sidéral siècle siéger siffler sigle signal silence silicium simple sincère sinistre siphon sirop sismique situer skier social socle sodium soigneux soldat soleil solitude soluble sombre sommeil somnoler sonde songeur sonnette sonore sorcier sortir sosie sottise soucieux soudure souffle soulever soupape source soutirer souvenir spacieux spatial spécial sphère spiral stable station sternum stimulus stipuler strict studieux stupeur styliste sublime substrat subtil subvenir succès sucre suffixe suggérer suiveur sulfate superbe supplier surface suricate surmener surprise sursaut survie suspect syllabe symbole symétrie synapse syntaxe système tabac tablier tactile tailler talent talisman talonner tambour tamiser tangible tapis taquiner tarder tarif tartine tasse tatami tatouage taupe taureau taxer témoin temporel tenaille tendre teneur tenir tension terminer terne terrible tétine texte thème théorie thérapie thorax tibia tiède timide tirelire tiroir tissu titane titre tituber toboggan tolérant tomate tonique tonneau toponyme torche tordre tornade torpille torrent torse tortue totem toucher tournage tousser toxine traction trafic tragique trahir train trancher travail trèfle tremper trésor treuil triage tribunal tricoter trilogie triomphe tripler triturer trivial trombone tronc tropical troupeau tuile tulipe tumulte tunnel turbine tuteur tutoyer tuyau tympan typhon typique tyran ubuesque ultime ultrason unanime unifier union unique unitaire univers uranium urbain urticant usage usine usuel usure utile utopie vacarme vaccin vagabond vague vaillant vaincre vaisseau valable valise vallon valve vampire vanille vapeur varier vaseux vassal vaste vecteur vedette végétal véhicule veinard véloce vendredi vénérer venger venimeux ventouse verdure vérin vernir verrou verser vertu veston vétéran vétuste vexant vexer viaduc viande victoire vidange vidéo vignette vigueur vilain village vinaigre violon vipère virement virtuose virus visage viseur vision visqueux visuel vital vitesse viticole vitrine vivace vivipare vocation voguer voile voisin voiture volaille volcan voltiger volume vorace vortex voter vouloir voyage voyelle wagon xénon yacht zèbre zénith zeste zoologie ================================================ FILE: src/main/resources/mnemonic/wordlist/italian.txt ================================================ abaco abbaglio abbinato abete abisso abolire abrasivo abrogato accadere accenno accusato acetone achille acido acqua acre acrilico acrobata acuto adagio addebito addome adeguato aderire adipe adottare adulare affabile affetto affisso affranto aforisma afoso africano agave agente agevole aggancio agire agitare agonismo agricolo agrumeto aguzzo alabarda alato albatro alberato albo albume alce alcolico alettone alfa algebra aliante alibi alimento allagato allegro allievo allodola allusivo almeno alogeno alpaca alpestre altalena alterno alticcio altrove alunno alveolo alzare amalgama amanita amarena ambito ambrato ameba america ametista amico ammasso ammenda ammirare ammonito amore ampio ampliare amuleto anacardo anagrafe analista anarchia anatra anca ancella ancora andare andrea anello angelo angolare angusto anima annegare annidato anno annuncio anonimo anticipo anzi apatico apertura apode apparire appetito appoggio approdo appunto aprile arabica arachide aragosta araldica arancio aratura arazzo arbitro archivio ardito arenile argento argine arguto aria armonia arnese arredato arringa arrosto arsenico arso artefice arzillo asciutto ascolto asepsi asettico asfalto asino asola aspirato aspro assaggio asse assoluto assurdo asta astenuto astice astratto atavico ateismo atomico atono attesa attivare attorno attrito attuale ausilio austria autista autonomo autunno avanzato avere avvenire avviso avvolgere azione azoto azzimo azzurro babele baccano bacino baco badessa badilata bagnato baita balcone baldo balena ballata balzano bambino bandire baraonda barbaro barca baritono barlume barocco basilico basso batosta battuto baule bava bavosa becco beffa belgio belva benda benevole benigno benzina bere berlina beta bibita bici bidone bifido biga bilancia bimbo binocolo biologo bipede bipolare birbante birra biscotto bisesto bisnonno bisonte bisturi bizzarro blando blatta bollito bonifico bordo bosco botanico bottino bozzolo braccio bradipo brama branca bravura bretella brevetto brezza briglia brillante brindare broccolo brodo bronzina brullo bruno bubbone buca budino buffone buio bulbo buono burlone burrasca bussola busta cadetto caduco calamaro calcolo calesse calibro calmo caloria cambusa camerata camicia cammino camola campale canapa candela cane canino canotto cantina capace capello capitolo capogiro cappero capra capsula carapace carcassa cardo carisma carovana carretto cartolina casaccio cascata caserma caso cassone castello casuale catasta catena catrame cauto cavillo cedibile cedrata cefalo celebre cellulare cena cenone centesimo ceramica cercare certo cerume cervello cesoia cespo ceto chela chiaro chicca chiedere chimera china chirurgo chitarra ciao ciclismo cifrare cigno cilindro ciottolo circa cirrosi citrico cittadino ciuffo civetta civile classico clinica cloro cocco codardo codice coerente cognome collare colmato colore colposo coltivato colza coma cometa commando comodo computer comune conciso condurre conferma congelare coniuge connesso conoscere consumo continuo convegno coperto copione coppia copricapo corazza cordata coricato cornice corolla corpo corredo corsia cortese cosmico costante cottura covato cratere cravatta creato credere cremoso crescita creta criceto crinale crisi critico croce cronaca crostata cruciale crusca cucire cuculo cugino cullato cupola curatore cursore curvo cuscino custode dado daino dalmata damerino daniela dannoso danzare datato davanti davvero debutto decennio deciso declino decollo decreto dedicato definito deforme degno delegare delfino delirio delta demenza denotato dentro deposito derapata derivare deroga descritto deserto desiderio desumere detersivo devoto diametro dicembre diedro difeso diffuso digerire digitale diluvio dinamico dinnanzi dipinto diploma dipolo diradare dire dirotto dirupo disagio discreto disfare disgelo disposto distanza disumano dito divano divelto dividere divorato doblone docente doganale dogma dolce domato domenica dominare dondolo dono dormire dote dottore dovuto dozzina drago druido dubbio dubitare ducale duna duomo duplice duraturo ebano eccesso ecco eclissi economia edera edicola edile editoria educare egemonia egli egoismo egregio elaborato elargire elegante elencato eletto elevare elfico elica elmo elsa eluso emanato emblema emesso emiro emotivo emozione empirico emulo endemico enduro energia enfasi enoteca entrare enzima epatite epilogo episodio epocale eppure equatore erario erba erboso erede eremita erigere ermetico eroe erosivo errante esagono esame esanime esaudire esca esempio esercito esibito esigente esistere esito esofago esortato esoso espanso espresso essenza esso esteso estimare estonia estroso esultare etilico etnico etrusco etto euclideo europa evaso evidenza evitato evoluto evviva fabbrica faccenda fachiro falco famiglia fanale fanfara fango fantasma fare farfalla farinoso farmaco fascia fastoso fasullo faticare fato favoloso febbre fecola fede fegato felpa feltro femmina fendere fenomeno fermento ferro fertile fessura festivo fetta feudo fiaba fiducia fifa figurato filo finanza finestra finire fiore fiscale fisico fiume flacone flamenco flebo flemma florido fluente fluoro fobico focaccia focoso foderato foglio folata folclore folgore fondente fonetico fonia fontana forbito forchetta foresta formica fornaio foro fortezza forzare fosfato fosso fracasso frana frassino fratello freccetta frenata fresco frigo frollino fronde frugale frutta fucilata fucsia fuggente fulmine fulvo fumante fumetto fumoso fune funzione fuoco furbo furgone furore fuso futile gabbiano gaffe galateo gallina galoppo gambero gamma garanzia garbo garofano garzone gasdotto gasolio gastrico gatto gaudio gazebo gazzella geco gelatina gelso gemello gemmato gene genitore gennaio genotipo gergo ghepardo ghiaccio ghisa giallo gilda ginepro giocare gioiello giorno giove girato girone gittata giudizio giurato giusto globulo glutine gnomo gobba golf gomito gommone gonfio gonna governo gracile grado grafico grammo grande grattare gravoso grazia greca gregge grifone grigio grinza grotta gruppo guadagno guaio guanto guardare gufo guidare ibernato icona identico idillio idolo idra idrico idrogeno igiene ignaro ignorato ilare illeso illogico illudere imballo imbevuto imbocco imbuto immane immerso immolato impacco impeto impiego importo impronta inalare inarcare inattivo incanto incendio inchino incisivo incluso incontro incrocio incubo indagine india indole inedito infatti infilare inflitto ingaggio ingegno inglese ingordo ingrosso innesco inodore inoltrare inondato insano insetto insieme insonnia insulina intasato intero intonaco intuito inumidire invalido invece invito iperbole ipnotico ipotesi ippica iride irlanda ironico irrigato irrorare isolato isotopo isterico istituto istrice italia iterare labbro labirinto lacca lacerato lacrima lacuna laddove lago lampo lancetta lanterna lardoso larga laringe lastra latenza latino lattuga lavagna lavoro legale leggero lembo lentezza lenza leone lepre lesivo lessato lesto letterale leva levigato libero lido lievito lilla limatura limitare limpido lineare lingua liquido lira lirica lisca lite litigio livrea locanda lode logica lombare londra longevo loquace lorenzo loto lotteria luce lucidato lumaca luminoso lungo lupo luppolo lusinga lusso lutto macabro macchina macero macinato madama magico maglia magnete magro maiolica malafede malgrado malinteso malsano malto malumore mana mancia mandorla mangiare manifesto mannaro manovra mansarda mantide manubrio mappa maratona marcire maretta marmo marsupio maschera massaia mastino materasso matricola mattone maturo mazurca meandro meccanico mecenate medesimo meditare mega melassa melis melodia meninge meno mensola mercurio merenda merlo meschino mese messere mestolo metallo metodo mettere miagolare mica micelio michele microbo midollo miele migliore milano milite mimosa minerale mini minore mirino mirtillo miscela missiva misto misurare mitezza mitigare mitra mittente mnemonico modello modifica modulo mogano mogio mole molosso monastero monco mondina monetario monile monotono monsone montato monviso mora mordere morsicato mostro motivato motosega motto movenza movimento mozzo mucca mucosa muffa mughetto mugnaio mulatto mulinello multiplo mummia munto muovere murale musa muscolo musica mutevole muto nababbo nafta nanometro narciso narice narrato nascere nastrare naturale nautica naviglio nebulosa necrosi negativo negozio nemmeno neofita neretto nervo nessuno nettuno neutrale neve nevrotico nicchia ninfa nitido nobile nocivo nodo nome nomina nordico normale norvegese nostrano notare notizia notturno novella nucleo nulla numero nuovo nutrire nuvola nuziale oasi obbedire obbligo obelisco oblio obolo obsoleto occasione occhio occidente occorrere occultare ocra oculato odierno odorare offerta offrire offuscato oggetto oggi ognuno olandese olfatto oliato oliva ologramma oltre omaggio ombelico ombra omega omissione ondoso onere onice onnivoro onorevole onta operato opinione opposto oracolo orafo ordine orecchino orefice orfano organico origine orizzonte orma ormeggio ornativo orologio orrendo orribile ortensia ortica orzata orzo osare oscurare osmosi ospedale ospite ossa ossidare ostacolo oste otite otre ottagono ottimo ottobre ovale ovest ovino oviparo ovocito ovunque ovviare ozio pacchetto pace pacifico padella padrone paese paga pagina palazzina palesare pallido palo palude pandoro pannello paolo paonazzo paprica parabola parcella parere pargolo pari parlato parola partire parvenza parziale passivo pasticca patacca patologia pattume pavone peccato pedalare pedonale peggio peloso penare pendice penisola pennuto penombra pensare pentola pepe pepita perbene percorso perdonato perforare pergamena periodo permesso perno perplesso persuaso pertugio pervaso pesatore pesista peso pestifero petalo pettine petulante pezzo piacere pianta piattino piccino picozza piega pietra piffero pigiama pigolio pigro pila pilifero pillola pilota pimpante pineta pinna pinolo pioggia piombo piramide piretico pirite pirolisi pitone pizzico placebo planare plasma platano plenario pochezza poderoso podismo poesia poggiare polenta poligono pollice polmonite polpetta polso poltrona polvere pomice pomodoro ponte popoloso porfido poroso porpora porre portata posa positivo possesso postulato potassio potere pranzo prassi pratica precluso predica prefisso pregiato prelievo premere prenotare preparato presenza pretesto prevalso prima principe privato problema procura produrre profumo progetto prolunga promessa pronome proposta proroga proteso prova prudente prugna prurito psiche pubblico pudica pugilato pugno pulce pulito pulsante puntare pupazzo pupilla puro quadro qualcosa quasi querela quota raccolto raddoppio radicale radunato raffica ragazzo ragione ragno ramarro ramingo ramo randagio rantolare rapato rapina rappreso rasatura raschiato rasente rassegna rastrello rata ravveduto reale recepire recinto recluta recondito recupero reddito redimere regalato registro regola regresso relazione remare remoto renna replica reprimere reputare resa residente responso restauro rete retina retorica rettifica revocato riassunto ribadire ribelle ribrezzo ricarica ricco ricevere riciclato ricordo ricreduto ridicolo ridurre rifasare riflesso riforma rifugio rigare rigettato righello rilassato rilevato rimanere rimbalzo rimedio rimorchio rinascita rincaro rinforzo rinnovo rinomato rinsavito rintocco rinuncia rinvenire riparato ripetuto ripieno riportare ripresa ripulire risata rischio riserva risibile riso rispetto ristoro risultato risvolto ritardo ritegno ritmico ritrovo riunione riva riverso rivincita rivolto rizoma roba robotico robusto roccia roco rodaggio rodere roditore rogito rollio romantico rompere ronzio rosolare rospo rotante rotondo rotula rovescio rubizzo rubrica ruga rullino rumine rumoroso ruolo rupe russare rustico sabato sabbiare sabotato sagoma salasso saldatura salgemma salivare salmone salone saltare saluto salvo sapere sapido saporito saraceno sarcasmo sarto sassoso satellite satira satollo saturno savana savio saziato sbadiglio sbalzo sbancato sbarra sbattere sbavare sbendare sbirciare sbloccato sbocciato sbrinare sbruffone sbuffare scabroso scadenza scala scambiare scandalo scapola scarso scatenare scavato scelto scenico scettro scheda schiena sciarpa scienza scindere scippo sciroppo scivolo sclerare scodella scolpito scomparto sconforto scoprire scorta scossone scozzese scriba scrollare scrutinio scuderia scultore scuola scuro scusare sdebitare sdoganare seccatura secondo sedano seggiola segnalato segregato seguito selciato selettivo sella selvaggio semaforo sembrare seme seminato sempre senso sentire sepolto sequenza serata serbato sereno serio serpente serraglio servire sestina setola settimana sfacelo sfaldare sfamato sfarzoso sfaticato sfera sfida sfilato sfinge sfocato sfoderare sfogo sfoltire sforzato sfratto sfruttato sfuggito sfumare sfuso sgabello sgarbato sgonfiare sgorbio sgrassato sguardo sibilo siccome sierra sigla signore silenzio sillaba simbolo simpatico simulato sinfonia singolo sinistro sino sintesi sinusoide sipario sisma sistole situato slitta slogatura sloveno smarrito smemorato smentito smeraldo smilzo smontare smottato smussato snellire snervato snodo sobbalzo sobrio soccorso sociale sodale soffitto sogno soldato solenne solido sollazzo solo solubile solvente somatico somma sonda sonetto sonnifero sopire soppeso sopra sorgere sorpasso sorriso sorso sorteggio sorvolato sospiro sosta sottile spada spalla spargere spatola spavento spazzola specie spedire spegnere spelatura speranza spessore spettrale spezzato spia spigoloso spillato spinoso spirale splendido sportivo sposo spranga sprecare spronato spruzzo spuntino squillo sradicare srotolato stabile stacco staffa stagnare stampato stantio starnuto stasera statuto stelo steppa sterzo stiletto stima stirpe stivale stizzoso stonato storico strappo stregato stridulo strozzare strutto stuccare stufo stupendo subentro succoso sudore suggerito sugo sultano suonare superbo supporto surgelato surrogato sussurro sutura svagare svedese sveglio svelare svenuto svezia sviluppo svista svizzera svolta svuotare tabacco tabulato tacciare taciturno tale talismano tampone tannino tara tardivo targato tariffa tarpare tartaruga tasto tattico taverna tavolata tazza teca tecnico telefono temerario tempo temuto tendone tenero tensione tentacolo teorema terme terrazzo terzetto tesi tesserato testato tetro tettoia tifare tigella timbro tinto tipico tipografo tiraggio tiro titanio titolo titubante tizio tizzone toccare tollerare tolto tombola tomo tonfo tonsilla topazio topologia toppa torba tornare torrone tortora toscano tossire tostatura totano trabocco trachea trafila tragedia tralcio tramonto transito trapano trarre trasloco trattato trave treccia tremolio trespolo tributo tricheco trifoglio trillo trincea trio tristezza triturato trivella tromba trono troppo trottola trovare truccato tubatura tuffato tulipano tumulto tunisia turbare turchino tuta tutela ubicato uccello uccisore udire uditivo uffa ufficio uguale ulisse ultimato umano umile umorismo uncinetto ungere ungherese unicorno unificato unisono unitario unte uovo upupa uragano urgenza urlo usanza usato uscito usignolo usuraio utensile utilizzo utopia vacante vaccinato vagabondo vagliato valanga valgo valico valletta valoroso valutare valvola vampata vangare vanitoso vano vantaggio vanvera vapore varano varcato variante vasca vedetta vedova veduto vegetale veicolo velcro velina velluto veloce venato vendemmia vento verace verbale vergogna verifica vero verruca verticale vescica vessillo vestale veterano vetrina vetusto viandante vibrante vicenda vichingo vicinanza vidimare vigilia vigneto vigore vile villano vimini vincitore viola vipera virgola virologo virulento viscoso visione vispo vissuto visura vita vitello vittima vivanda vivido viziare voce voga volatile volere volpe voragine vulcano zampogna zanna zappato zattera zavorra zefiro zelante zelo zenzero zerbino zibetto zinco zircone zitto zolla zotico zucchero zufolo zulu zuppa ================================================ FILE: src/main/resources/mnemonic/wordlist/japanese.txt ================================================ あいこくしん あいさつ あいだ あおぞら あかちゃん あきる あけがた あける あこがれる あさい あさひ あしあと あじわう あずかる あずき あそぶ あたえる あたためる あたりまえ あたる あつい あつかう あっしゅく あつまり あつめる あてな あてはまる あひる あぶら あぶる あふれる あまい あまど あまやかす あまり あみもの あめりか あやまる あゆむ あらいぐま あらし あらすじ あらためる あらゆる あらわす ありがとう あわせる あわてる あんい あんがい あんこ あんぜん あんてい あんない あんまり いいだす いおん いがい いがく いきおい いきなり いきもの いきる いくじ いくぶん いけばな いけん いこう いこく いこつ いさましい いさん いしき いじゅう いじょう いじわる いずみ いずれ いせい いせえび いせかい いせき いぜん いそうろう いそがしい いだい いだく いたずら いたみ いたりあ いちおう いちじ いちど いちば いちぶ いちりゅう いつか いっしゅん いっせい いっそう いったん いっち いってい いっぽう いてざ いてん いどう いとこ いない いなか いねむり いのち いのる いはつ いばる いはん いびき いひん いふく いへん いほう いみん いもうと いもたれ いもり いやがる いやす いよかん いよく いらい いらすと いりぐち いりょう いれい いれもの いれる いろえんぴつ いわい いわう いわかん いわば いわゆる いんげんまめ いんさつ いんしょう いんよう うえき うえる うおざ うがい うかぶ うかべる うきわ うくらいな うくれれ うけたまわる うけつけ うけとる うけもつ うける うごかす うごく うこん うさぎ うしなう うしろがみ うすい うすぎ うすぐらい うすめる うせつ うちあわせ うちがわ うちき うちゅう うっかり うつくしい うったえる うつる うどん うなぎ うなじ うなずく うなる うねる うのう うぶげ うぶごえ うまれる うめる うもう うやまう うよく うらがえす うらぐち うらない うりあげ うりきれ うるさい うれしい うれゆき うれる うろこ うわき うわさ うんこう うんちん うんてん うんどう えいえん えいが えいきょう えいご えいせい えいぶん えいよう えいわ えおり えがお えがく えきたい えくせる えしゃく えすて えつらん えのぐ えほうまき えほん えまき えもじ えもの えらい えらぶ えりあ えんえん えんかい えんぎ えんげき えんしゅう えんぜつ えんそく えんちょう えんとつ おいかける おいこす おいしい おいつく おうえん おうさま おうじ おうせつ おうたい おうふく おうべい おうよう おえる おおい おおう おおどおり おおや おおよそ おかえり おかず おがむ おかわり おぎなう おきる おくさま おくじょう おくりがな おくる おくれる おこす おこなう おこる おさえる おさない おさめる おしいれ おしえる おじぎ おじさん おしゃれ おそらく おそわる おたがい おたく おだやか おちつく おっと おつり おでかけ おとしもの おとなしい おどり おどろかす おばさん おまいり おめでとう おもいで おもう おもたい おもちゃ おやつ おやゆび およぼす おらんだ おろす おんがく おんけい おんしゃ おんせん おんだん おんちゅう おんどけい かあつ かいが がいき がいけん がいこう かいさつ かいしゃ かいすいよく かいぜん かいぞうど かいつう かいてん かいとう かいふく がいへき かいほう かいよう がいらい かいわ かえる かおり かかえる かがく かがし かがみ かくご かくとく かざる がぞう かたい かたち がちょう がっきゅう がっこう がっさん がっしょう かなざわし かのう がはく かぶか かほう かほご かまう かまぼこ かめれおん かゆい かようび からい かるい かろう かわく かわら がんか かんけい かんこう かんしゃ かんそう かんたん かんち がんばる きあい きあつ きいろ ぎいん きうい きうん きえる きおう きおく きおち きおん きかい きかく きかんしゃ ききて きくばり きくらげ きけんせい きこう きこえる きこく きさい きさく きさま きさらぎ ぎじかがく ぎしき ぎじたいけん ぎじにってい ぎじゅつしゃ きすう きせい きせき きせつ きそう きぞく きぞん きたえる きちょう きつえん ぎっちり きつつき きつね きてい きどう きどく きない きなが きなこ きぬごし きねん きのう きのした きはく きびしい きひん きふく きぶん きぼう きほん きまる きみつ きむずかしい きめる きもだめし きもち きもの きゃく きやく ぎゅうにく きよう きょうりゅう きらい きらく きりん きれい きれつ きろく ぎろん きわめる ぎんいろ きんかくじ きんじょ きんようび ぐあい くいず くうかん くうき くうぐん くうこう ぐうせい くうそう ぐうたら くうふく くうぼ くかん くきょう くげん ぐこう くさい くさき くさばな くさる くしゃみ くしょう くすのき くすりゆび くせげ くせん ぐたいてき くださる くたびれる くちこみ くちさき くつした ぐっすり くつろぐ くとうてん くどく くなん くねくね くのう くふう くみあわせ くみたてる くめる くやくしょ くらす くらべる くるま くれる くろう くわしい ぐんかん ぐんしょく ぐんたい ぐんて けあな けいかく けいけん けいこ けいさつ げいじゅつ けいたい げいのうじん けいれき けいろ けおとす けおりもの げきか げきげん げきだん げきちん げきとつ げきは げきやく げこう げこくじょう げざい けさき げざん けしき けしごむ けしょう げすと けたば けちゃっぷ けちらす けつあつ けつい けつえき けっこん けつじょ けっせき けってい けつまつ げつようび げつれい けつろん げどく けとばす けとる けなげ けなす けなみ けぬき げねつ けねん けはい げひん けぶかい げぼく けまり けみかる けむし けむり けもの けらい けろけろ けわしい けんい けんえつ けんお けんか げんき けんげん けんこう けんさく けんしゅう けんすう げんそう けんちく けんてい けんとう けんない けんにん げんぶつ けんま けんみん けんめい けんらん けんり こあくま こいぬ こいびと ごうい こうえん こうおん こうかん ごうきゅう ごうけい こうこう こうさい こうじ こうすい ごうせい こうそく こうたい こうちゃ こうつう こうてい こうどう こうない こうはい ごうほう ごうまん こうもく こうりつ こえる こおり ごかい ごがつ ごかん こくご こくさい こくとう こくない こくはく こぐま こけい こける ここのか こころ こさめ こしつ こすう こせい こせき こぜん こそだて こたい こたえる こたつ こちょう こっか こつこつ こつばん こつぶ こてい こてん ことがら ことし ことば ことり こなごな こねこね このまま このみ このよ ごはん こひつじ こふう こふん こぼれる ごまあぶら こまかい ごますり こまつな こまる こむぎこ こもじ こもち こもの こもん こやく こやま こゆう こゆび こよい こよう こりる これくしょん ころっけ こわもて こわれる こんいん こんかい こんき こんしゅう こんすい こんだて こんとん こんなん こんびに こんぽん こんまけ こんや こんれい こんわく ざいえき さいかい さいきん ざいげん ざいこ さいしょ さいせい ざいたく ざいちゅう さいてき ざいりょう さうな さかいし さがす さかな さかみち さがる さぎょう さくし さくひん さくら さこく さこつ さずかる ざせき さたん さつえい ざつおん ざっか ざつがく さっきょく ざっし さつじん ざっそう さつたば さつまいも さてい さといも さとう さとおや さとし さとる さのう さばく さびしい さべつ さほう さほど さます さみしい さみだれ さむけ さめる さやえんどう さゆう さよう さよく さらだ ざるそば さわやか さわる さんいん さんか さんきゃく さんこう さんさい ざんしょ さんすう さんせい さんそ さんち さんま さんみ さんらん しあい しあげ しあさって しあわせ しいく しいん しうち しえい しおけ しかい しかく じかん しごと しすう じだい したうけ したぎ したて したみ しちょう しちりん しっかり しつじ しつもん してい してき してつ じてん じどう しなぎれ しなもの しなん しねま しねん しのぐ しのぶ しはい しばかり しはつ しはらい しはん しひょう しふく じぶん しへい しほう しほん しまう しまる しみん しむける じむしょ しめい しめる しもん しゃいん しゃうん しゃおん じゃがいも しやくしょ しゃくほう しゃけん しゃこ しゃざい しゃしん しゃせん しゃそう しゃたい しゃちょう しゃっきん じゃま しゃりん しゃれい じゆう じゅうしょ しゅくはく じゅしん しゅっせき しゅみ しゅらば じゅんばん しょうかい しょくたく しょっけん しょどう しょもつ しらせる しらべる しんか しんこう じんじゃ しんせいじ しんちく しんりん すあげ すあし すあな ずあん すいえい すいか すいとう ずいぶん すいようび すうがく すうじつ すうせん すおどり すきま すくう すくない すける すごい すこし ずさん すずしい すすむ すすめる すっかり ずっしり ずっと すてき すてる すねる すのこ すはだ すばらしい ずひょう ずぶぬれ すぶり すふれ すべて すべる ずほう すぼん すまい すめし すもう すやき すらすら するめ すれちがう すろっと すわる すんぜん すんぽう せあぶら せいかつ せいげん せいじ せいよう せおう せかいかん せきにん せきむ せきゆ せきらんうん せけん せこう せすじ せたい せたけ せっかく せっきゃく ぜっく せっけん せっこつ せっさたくま せつぞく せつだん せつでん せっぱん せつび せつぶん せつめい せつりつ せなか せのび せはば せびろ せぼね せまい せまる せめる せもたれ せりふ ぜんあく せんい せんえい せんか せんきょ せんく せんげん ぜんご せんさい せんしゅ せんすい せんせい せんぞ せんたく せんちょう せんてい せんとう せんぬき せんねん せんぱい ぜんぶ ぜんぽう せんむ せんめんじょ せんもん せんやく せんゆう せんよう ぜんら ぜんりゃく せんれい せんろ そあく そいとげる そいね そうがんきょう そうき そうご そうしん そうだん そうなん そうび そうめん そうり そえもの そえん そがい そげき そこう そこそこ そざい そしな そせい そせん そそぐ そだてる そつう そつえん そっかん そつぎょう そっけつ そっこう そっせん そっと そとがわ そとづら そなえる そなた そふぼ そぼく そぼろ そまつ そまる そむく そむりえ そめる そもそも そよかぜ そらまめ そろう そんかい そんけい そんざい そんしつ そんぞく そんちょう ぞんび ぞんぶん そんみん たあい たいいん たいうん たいえき たいおう だいがく たいき たいぐう たいけん たいこ たいざい だいじょうぶ だいすき たいせつ たいそう だいたい たいちょう たいてい だいどころ たいない たいねつ たいのう たいはん だいひょう たいふう たいへん たいほ たいまつばな たいみんぐ たいむ たいめん たいやき たいよう たいら たいりょく たいる たいわん たうえ たえる たおす たおる たおれる たかい たかね たきび たくさん たこく たこやき たさい たしざん だじゃれ たすける たずさわる たそがれ たたかう たたく ただしい たたみ たちばな だっかい だっきゃく だっこ だっしゅつ だったい たてる たとえる たなばた たにん たぬき たのしみ たはつ たぶん たべる たぼう たまご たまる だむる ためいき ためす ためる たもつ たやすい たよる たらす たりきほんがん たりょう たりる たると たれる たれんと たろっと たわむれる だんあつ たんい たんおん たんか たんき たんけん たんご たんさん たんじょうび だんせい たんそく たんたい だんち たんてい たんとう だんな たんにん だんねつ たんのう たんぴん だんぼう たんまつ たんめい だんれつ だんろ だんわ ちあい ちあん ちいき ちいさい ちえん ちかい ちから ちきゅう ちきん ちけいず ちけん ちこく ちさい ちしき ちしりょう ちせい ちそう ちたい ちたん ちちおや ちつじょ ちてき ちてん ちぬき ちぬり ちのう ちひょう ちへいせん ちほう ちまた ちみつ ちみどろ ちめいど ちゃんこなべ ちゅうい ちゆりょく ちょうし ちょさくけん ちらし ちらみ ちりがみ ちりょう ちるど ちわわ ちんたい ちんもく ついか ついたち つうか つうじょう つうはん つうわ つかう つかれる つくね つくる つけね つける つごう つたえる つづく つつじ つつむ つとめる つながる つなみ つねづね つのる つぶす つまらない つまる つみき つめたい つもり つもる つよい つるぼ つるみく つわもの つわり てあし てあて てあみ ていおん ていか ていき ていけい ていこく ていさつ ていし ていせい ていたい ていど ていねい ていひょう ていへん ていぼう てうち ておくれ てきとう てくび でこぼこ てさぎょう てさげ てすり てそう てちがい てちょう てつがく てつづき でっぱ てつぼう てつや でぬかえ てぬき てぬぐい てのひら てはい てぶくろ てふだ てほどき てほん てまえ てまきずし てみじか てみやげ てらす てれび てわけ てわたし でんあつ てんいん てんかい てんき てんぐ てんけん てんごく てんさい てんし てんすう でんち てんてき てんとう てんない てんぷら てんぼうだい てんめつ てんらんかい でんりょく でんわ どあい といれ どうかん とうきゅう どうぐ とうし とうむぎ とおい とおか とおく とおす とおる とかい とかす ときおり ときどき とくい とくしゅう とくてん とくに とくべつ とけい とける とこや とさか としょかん とそう とたん とちゅう とっきゅう とっくん とつぜん とつにゅう とどける ととのえる とない となえる となり とのさま とばす どぶがわ とほう とまる とめる ともだち ともる どようび とらえる とんかつ どんぶり ないかく ないこう ないしょ ないす ないせん ないそう なおす ながい なくす なげる なこうど なさけ なたでここ なっとう なつやすみ ななおし なにごと なにもの なにわ なのか なふだ なまいき なまえ なまみ なみだ なめらか なめる なやむ ならう ならび ならぶ なれる なわとび なわばり にあう にいがた にうけ におい にかい にがて にきび にくしみ にくまん にげる にさんかたんそ にしき にせもの にちじょう にちようび にっか にっき にっけい にっこう にっさん にっしょく にっすう にっせき にってい になう にほん にまめ にもつ にやり にゅういん にりんしゃ にわとり にんい にんか にんき にんげん にんしき にんずう にんそう にんたい にんち にんてい にんにく にんぷ にんまり にんむ にんめい にんよう ぬいくぎ ぬかす ぬぐいとる ぬぐう ぬくもり ぬすむ ぬまえび ぬめり ぬらす ぬんちゃく ねあげ ねいき ねいる ねいろ ねぐせ ねくたい ねくら ねこぜ ねこむ ねさげ ねすごす ねそべる ねだん ねつい ねっしん ねつぞう ねったいぎょ ねぶそく ねふだ ねぼう ねほりはほり ねまき ねまわし ねみみ ねむい ねむたい ねもと ねらう ねわざ ねんいり ねんおし ねんかん ねんきん ねんぐ ねんざ ねんし ねんちゃく ねんど ねんぴ ねんぶつ ねんまつ ねんりょう ねんれい のいず のおづま のがす のきなみ のこぎり のこす のこる のせる のぞく のぞむ のたまう のちほど のっく のばす のはら のべる のぼる のみもの のやま のらいぬ のらねこ のりもの のりゆき のれん のんき ばあい はあく ばあさん ばいか ばいく はいけん はいご はいしん はいすい はいせん はいそう はいち ばいばい はいれつ はえる はおる はかい ばかり はかる はくしゅ はけん はこぶ はさみ はさん はしご ばしょ はしる はせる ぱそこん はそん はたん はちみつ はつおん はっかく はづき はっきり はっくつ はっけん はっこう はっさん はっしん はったつ はっちゅう はってん はっぴょう はっぽう はなす はなび はにかむ はぶらし はみがき はむかう はめつ はやい はやし はらう はろうぃん はわい はんい はんえい はんおん はんかく はんきょう ばんぐみ はんこ はんしゃ はんすう はんだん ぱんち ぱんつ はんてい はんとし はんのう はんぱ はんぶん はんぺん はんぼうき はんめい はんらん はんろん ひいき ひうん ひえる ひかく ひかり ひかる ひかん ひくい ひけつ ひこうき ひこく ひさい ひさしぶり ひさん びじゅつかん ひしょ ひそか ひそむ ひたむき ひだり ひたる ひつぎ ひっこし ひっし ひつじゅひん ひっす ひつぜん ぴったり ぴっちり ひつよう ひてい ひとごみ ひなまつり ひなん ひねる ひはん ひびく ひひょう ひほう ひまわり ひまん ひみつ ひめい ひめじし ひやけ ひやす ひよう びょうき ひらがな ひらく ひりつ ひりょう ひるま ひるやすみ ひれい ひろい ひろう ひろき ひろゆき ひんかく ひんけつ ひんこん ひんしゅ ひんそう ぴんち ひんぱん びんぼう ふあん ふいうち ふうけい ふうせん ぷうたろう ふうとう ふうふ ふえる ふおん ふかい ふきん ふくざつ ふくぶくろ ふこう ふさい ふしぎ ふじみ ふすま ふせい ふせぐ ふそく ぶたにく ふたん ふちょう ふつう ふつか ふっかつ ふっき ふっこく ぶどう ふとる ふとん ふのう ふはい ふひょう ふへん ふまん ふみん ふめつ ふめん ふよう ふりこ ふりる ふるい ふんいき ぶんがく ぶんぐ ふんしつ ぶんせき ふんそう ぶんぽう へいあん へいおん へいがい へいき へいげん へいこう へいさ へいしゃ へいせつ へいそ へいたく へいてん へいねつ へいわ へきが へこむ べにいろ べにしょうが へらす へんかん べんきょう べんごし へんさい へんたい べんり ほあん ほいく ぼうぎょ ほうこく ほうそう ほうほう ほうもん ほうりつ ほえる ほおん ほかん ほきょう ぼきん ほくろ ほけつ ほけん ほこう ほこる ほしい ほしつ ほしゅ ほしょう ほせい ほそい ほそく ほたて ほたる ぽちぶくろ ほっきょく ほっさ ほったん ほとんど ほめる ほんい ほんき ほんけ ほんしつ ほんやく まいにち まかい まかせる まがる まける まこと まさつ まじめ ますく まぜる まつり まとめ まなぶ まぬけ まねく まほう まもる まゆげ まよう まろやか まわす まわり まわる まんが まんきつ まんぞく まんなか みいら みうち みえる みがく みかた みかん みけん みこん みじかい みすい みすえる みせる みっか みつかる みつける みてい みとめる みなと みなみかさい みねらる みのう みのがす みほん みもと みやげ みらい みりょく みわく みんか みんぞく むいか むえき むえん むかい むかう むかえ むかし むぎちゃ むける むげん むさぼる むしあつい むしば むじゅん むしろ むすう むすこ むすぶ むすめ むせる むせん むちゅう むなしい むのう むやみ むよう むらさき むりょう むろん めいあん めいうん めいえん めいかく めいきょく めいさい めいし めいそう めいぶつ めいれい めいわく めぐまれる めざす めした めずらしい めだつ めまい めやす めんきょ めんせき めんどう もうしあげる もうどうけん もえる もくし もくてき もくようび もちろん もどる もらう もんく もんだい やおや やける やさい やさしい やすい やすたろう やすみ やせる やそう やたい やちん やっと やっぱり やぶる やめる ややこしい やよい やわらかい ゆうき ゆうびんきょく ゆうべ ゆうめい ゆけつ ゆしゅつ ゆせん ゆそう ゆたか ゆちゃく ゆでる ゆにゅう ゆびわ ゆらい ゆれる ようい ようか ようきゅう ようじ ようす ようちえん よかぜ よかん よきん よくせい よくぼう よけい よごれる よさん よしゅう よそう よそく よっか よてい よどがわく よねつ よやく よゆう よろこぶ よろしい らいう らくがき らくご らくさつ らくだ らしんばん らせん らぞく らたい らっか られつ りえき りかい りきさく りきせつ りくぐん りくつ りけん りこう りせい りそう りそく りてん りねん りゆう りゅうがく りよう りょうり りょかん りょくちゃ りょこう りりく りれき りろん りんご るいけい るいさい るいじ るいせき るすばん るりがわら れいかん れいぎ れいせい れいぞうこ れいとう れいぼう れきし れきだい れんあい れんけい れんこん れんさい れんしゅう れんぞく れんらく ろうか ろうご ろうじん ろうそく ろくが ろこつ ろじうら ろしゅつ ろせん ろてん ろめん ろれつ ろんぎ ろんぱ ろんぶん ろんり わかす わかめ わかやま わかれる わしつ わじまし わすれもの わらう われる ================================================ FILE: src/main/resources/mnemonic/wordlist/korean.txt ================================================ 가격 가끔 가난 가능 가득 가르침 가뭄 가방 가상 가슴 가운데 가을 가이드 가입 가장 가정 가족 가죽 각오 각자 간격 간부 간섭 간장 간접 간판 갈등 갈비 갈색 갈증 감각 감기 감소 감수성 감자 감정 갑자기 강남 강당 강도 강력히 강변 강북 강사 강수량 강아지 강원도 강의 강제 강조 같이 개구리 개나리 개방 개별 개선 개성 개인 객관적 거실 거액 거울 거짓 거품 걱정 건강 건물 건설 건조 건축 걸음 검사 검토 게시판 게임 겨울 견해 결과 결국 결론 결석 결승 결심 결정 결혼 경계 경고 경기 경력 경복궁 경비 경상도 경영 경우 경쟁 경제 경주 경찰 경치 경향 경험 계곡 계단 계란 계산 계속 계약 계절 계층 계획 고객 고구려 고궁 고급 고등학생 고무신 고민 고양이 고장 고전 고집 고춧가루 고통 고향 곡식 골목 골짜기 골프 공간 공개 공격 공군 공급 공기 공동 공무원 공부 공사 공식 공업 공연 공원 공장 공짜 공책 공통 공포 공항 공휴일 과목 과일 과장 과정 과학 관객 관계 관광 관념 관람 관련 관리 관습 관심 관점 관찰 광경 광고 광장 광주 괴로움 굉장히 교과서 교문 교복 교실 교양 교육 교장 교직 교통 교환 교훈 구경 구름 구멍 구별 구분 구석 구성 구속 구역 구입 구청 구체적 국가 국기 국내 국립 국물 국민 국수 국어 국왕 국적 국제 국회 군대 군사 군인 궁극적 권리 권위 권투 귀국 귀신 규정 규칙 균형 그날 그냥 그늘 그러나 그룹 그릇 그림 그제서야 그토록 극복 극히 근거 근교 근래 근로 근무 근본 근원 근육 근처 글씨 글자 금강산 금고 금년 금메달 금액 금연 금요일 금지 긍정적 기간 기관 기념 기능 기독교 기둥 기록 기름 기법 기본 기분 기쁨 기숙사 기술 기억 기업 기온 기운 기원 기적 기준 기침 기혼 기획 긴급 긴장 길이 김밥 김치 김포공항 깍두기 깜빡 깨달음 깨소금 껍질 꼭대기 꽃잎 나들이 나란히 나머지 나물 나침반 나흘 낙엽 난방 날개 날씨 날짜 남녀 남대문 남매 남산 남자 남편 남학생 낭비 낱말 내년 내용 내일 냄비 냄새 냇물 냉동 냉면 냉방 냉장고 넥타이 넷째 노동 노란색 노력 노인 녹음 녹차 녹화 논리 논문 논쟁 놀이 농구 농담 농민 농부 농업 농장 농촌 높이 눈동자 눈물 눈썹 뉴욕 느낌 늑대 능동적 능력 다방 다양성 다음 다이어트 다행 단계 단골 단독 단맛 단순 단어 단위 단점 단체 단추 단편 단풍 달걀 달러 달력 달리 닭고기 담당 담배 담요 담임 답변 답장 당근 당분간 당연히 당장 대규모 대낮 대단히 대답 대도시 대략 대량 대륙 대문 대부분 대신 대응 대장 대전 대접 대중 대책 대출 대충 대통령 대학 대한민국 대합실 대형 덩어리 데이트 도대체 도덕 도둑 도망 도서관 도심 도움 도입 도자기 도저히 도전 도중 도착 독감 독립 독서 독일 독창적 동화책 뒷모습 뒷산 딸아이 마누라 마늘 마당 마라톤 마련 마무리 마사지 마약 마요네즈 마을 마음 마이크 마중 마지막 마찬가지 마찰 마흔 막걸리 막내 막상 만남 만두 만세 만약 만일 만점 만족 만화 많이 말기 말씀 말투 맘대로 망원경 매년 매달 매력 매번 매스컴 매일 매장 맥주 먹이 먼저 먼지 멀리 메일 며느리 며칠 면담 멸치 명단 명령 명예 명의 명절 명칭 명함 모금 모니터 모델 모든 모범 모습 모양 모임 모조리 모집 모퉁이 목걸이 목록 목사 목소리 목숨 목적 목표 몰래 몸매 몸무게 몸살 몸속 몸짓 몸통 몹시 무관심 무궁화 무더위 무덤 무릎 무슨 무엇 무역 무용 무조건 무지개 무척 문구 문득 문법 문서 문제 문학 문화 물가 물건 물결 물고기 물론 물리학 물음 물질 물체 미국 미디어 미사일 미술 미역 미용실 미움 미인 미팅 미혼 민간 민족 민주 믿음 밀가루 밀리미터 밑바닥 바가지 바구니 바나나 바늘 바닥 바닷가 바람 바이러스 바탕 박물관 박사 박수 반대 반드시 반말 반발 반성 반응 반장 반죽 반지 반찬 받침 발가락 발걸음 발견 발달 발레 발목 발바닥 발생 발음 발자국 발전 발톱 발표 밤하늘 밥그릇 밥맛 밥상 밥솥 방금 방면 방문 방바닥 방법 방송 방식 방안 방울 방지 방학 방해 방향 배경 배꼽 배달 배드민턴 백두산 백색 백성 백인 백제 백화점 버릇 버섯 버튼 번개 번역 번지 번호 벌금 벌레 벌써 범위 범인 범죄 법률 법원 법적 법칙 베이징 벨트 변경 변동 변명 변신 변호사 변화 별도 별명 별일 병실 병아리 병원 보관 보너스 보라색 보람 보름 보상 보안 보자기 보장 보전 보존 보통 보편적 보험 복도 복사 복숭아 복습 볶음 본격적 본래 본부 본사 본성 본인 본질 볼펜 봉사 봉지 봉투 부근 부끄러움 부담 부동산 부문 부분 부산 부상 부엌 부인 부작용 부장 부정 부족 부지런히 부친 부탁 부품 부회장 북부 북한 분노 분량 분리 분명 분석 분야 분위기 분필 분홍색 불고기 불과 불교 불꽃 불만 불법 불빛 불안 불이익 불행 브랜드 비극 비난 비닐 비둘기 비디오 비로소 비만 비명 비밀 비바람 비빔밥 비상 비용 비율 비중 비타민 비판 빌딩 빗물 빗방울 빗줄기 빛깔 빨간색 빨래 빨리 사건 사계절 사나이 사냥 사람 사랑 사립 사모님 사물 사방 사상 사생활 사설 사슴 사실 사업 사용 사월 사장 사전 사진 사촌 사춘기 사탕 사투리 사흘 산길 산부인과 산업 산책 살림 살인 살짝 삼계탕 삼국 삼십 삼월 삼촌 상관 상금 상대 상류 상반기 상상 상식 상업 상인 상자 상점 상처 상추 상태 상표 상품 상황 새벽 색깔 색연필 생각 생명 생물 생방송 생산 생선 생신 생일 생활 서랍 서른 서명 서민 서비스 서양 서울 서적 서점 서쪽 서클 석사 석유 선거 선물 선배 선생 선수 선원 선장 선전 선택 선풍기 설거지 설날 설렁탕 설명 설문 설사 설악산 설치 설탕 섭씨 성공 성당 성명 성별 성인 성장 성적 성질 성함 세금 세미나 세상 세월 세종대왕 세탁 센터 센티미터 셋째 소규모 소극적 소금 소나기 소년 소득 소망 소문 소설 소속 소아과 소용 소원 소음 소중히 소지품 소질 소풍 소형 속담 속도 속옷 손가락 손길 손녀 손님 손등 손목 손뼉 손실 손질 손톱 손해 솔직히 솜씨 송아지 송이 송편 쇠고기 쇼핑 수건 수년 수단 수돗물 수동적 수면 수명 수박 수상 수석 수술 수시로 수업 수염 수영 수입 수준 수집 수출 수컷 수필 수학 수험생 수화기 숙녀 숙소 숙제 순간 순서 순수 순식간 순위 숟가락 술병 술집 숫자 스님 스물 스스로 스승 스웨터 스위치 스케이트 스튜디오 스트레스 스포츠 슬쩍 슬픔 습관 습기 승객 승리 승부 승용차 승진 시각 시간 시골 시금치 시나리오 시댁 시리즈 시멘트 시민 시부모 시선 시설 시스템 시아버지 시어머니 시월 시인 시일 시작 시장 시절 시점 시중 시즌 시집 시청 시합 시험 식구 식기 식당 식량 식료품 식물 식빵 식사 식생활 식초 식탁 식품 신고 신규 신념 신문 신발 신비 신사 신세 신용 신제품 신청 신체 신화 실감 실내 실력 실례 실망 실수 실습 실시 실장 실정 실질적 실천 실체 실컷 실태 실패 실험 실현 심리 심부름 심사 심장 심정 심판 쌍둥이 씨름 씨앗 아가씨 아나운서 아드님 아들 아쉬움 아스팔트 아시아 아울러 아저씨 아줌마 아직 아침 아파트 아프리카 아픔 아홉 아흔 악기 악몽 악수 안개 안경 안과 안내 안녕 안동 안방 안부 안주 알루미늄 알코올 암시 암컷 압력 앞날 앞문 애인 애정 액수 앨범 야간 야단 야옹 약간 약국 약속 약수 약점 약품 약혼녀 양념 양력 양말 양배추 양주 양파 어둠 어려움 어른 어젯밤 어쨌든 어쩌다가 어쩐지 언니 언덕 언론 언어 얼굴 얼른 얼음 얼핏 엄마 업무 업종 업체 엉덩이 엉망 엉터리 엊그제 에너지 에어컨 엔진 여건 여고생 여관 여군 여권 여대생 여덟 여동생 여든 여론 여름 여섯 여성 여왕 여인 여전히 여직원 여학생 여행 역사 역시 역할 연결 연구 연극 연기 연락 연설 연세 연속 연습 연애 연예인 연인 연장 연주 연출 연필 연합 연휴 열기 열매 열쇠 열심히 열정 열차 열흘 염려 엽서 영국 영남 영상 영양 영역 영웅 영원히 영하 영향 영혼 영화 옆구리 옆방 옆집 예감 예금 예방 예산 예상 예선 예술 예습 예식장 예약 예전 예절 예정 예컨대 옛날 오늘 오락 오랫동안 오렌지 오로지 오른발 오븐 오십 오염 오월 오전 오직 오징어 오페라 오피스텔 오히려 옥상 옥수수 온갖 온라인 온몸 온종일 온통 올가을 올림픽 올해 옷차림 와이셔츠 와인 완성 완전 왕비 왕자 왜냐하면 왠지 외갓집 외국 외로움 외삼촌 외출 외침 외할머니 왼발 왼손 왼쪽 요금 요일 요즘 요청 용기 용서 용어 우산 우선 우승 우연히 우정 우체국 우편 운동 운명 운반 운전 운행 울산 울음 움직임 웃어른 웃음 워낙 원고 원래 원서 원숭이 원인 원장 원피스 월급 월드컵 월세 월요일 웨이터 위반 위법 위성 위원 위험 위협 윗사람 유난히 유럽 유명 유물 유산 유적 유치원 유학 유행 유형 육군 육상 육십 육체 은행 음력 음료 음반 음성 음식 음악 음주 의견 의논 의문 의복 의식 의심 의외로 의욕 의원 의학 이것 이곳 이념 이놈 이달 이대로 이동 이렇게 이력서 이론적 이름 이민 이발소 이별 이불 이빨 이상 이성 이슬 이야기 이용 이웃 이월 이윽고 이익 이전 이중 이튿날 이틀 이혼 인간 인격 인공 인구 인근 인기 인도 인류 인물 인생 인쇄 인연 인원 인재 인종 인천 인체 인터넷 인하 인형 일곱 일기 일단 일대 일등 일반 일본 일부 일상 일생 일손 일요일 일월 일정 일종 일주일 일찍 일체 일치 일행 일회용 임금 임무 입대 입력 입맛 입사 입술 입시 입원 입장 입학 자가용 자격 자극 자동 자랑 자부심 자식 자신 자연 자원 자율 자전거 자정 자존심 자판 작가 작년 작성 작업 작용 작은딸 작품 잔디 잔뜩 잔치 잘못 잠깐 잠수함 잠시 잠옷 잠자리 잡지 장관 장군 장기간 장래 장례 장르 장마 장면 장모 장미 장비 장사 장소 장식 장애인 장인 장점 장차 장학금 재능 재빨리 재산 재생 재작년 재정 재채기 재판 재학 재활용 저것 저고리 저곳 저녁 저런 저렇게 저번 저울 저절로 저축 적극 적당히 적성 적용 적응 전개 전공 전기 전달 전라도 전망 전문 전반 전부 전세 전시 전용 전자 전쟁 전주 전철 전체 전통 전혀 전후 절대 절망 절반 절약 절차 점검 점수 점심 점원 점점 점차 접근 접시 접촉 젓가락 정거장 정도 정류장 정리 정말 정면 정문 정반대 정보 정부 정비 정상 정성 정오 정원 정장 정지 정치 정확히 제공 제과점 제대로 제목 제발 제법 제삿날 제안 제일 제작 제주도 제출 제품 제한 조각 조건 조금 조깅 조명 조미료 조상 조선 조용히 조절 조정 조직 존댓말 존재 졸업 졸음 종교 종로 종류 종소리 종업원 종종 종합 좌석 죄인 주관적 주름 주말 주머니 주먹 주문 주민 주방 주변 주식 주인 주일 주장 주전자 주택 준비 줄거리 줄기 줄무늬 중간 중계방송 중국 중년 중단 중독 중반 중부 중세 중소기업 중순 중앙 중요 중학교 즉석 즉시 즐거움 증가 증거 증권 증상 증세 지각 지갑 지경 지극히 지금 지급 지능 지름길 지리산 지방 지붕 지식 지역 지우개 지원 지적 지점 지진 지출 직선 직업 직원 직장 진급 진동 진로 진료 진리 진짜 진찰 진출 진통 진행 질문 질병 질서 짐작 집단 집안 집중 짜증 찌꺼기 차남 차라리 차량 차림 차별 차선 차츰 착각 찬물 찬성 참가 참기름 참새 참석 참여 참외 참조 찻잔 창가 창고 창구 창문 창밖 창작 창조 채널 채점 책가방 책방 책상 책임 챔피언 처벌 처음 천국 천둥 천장 천재 천천히 철도 철저히 철학 첫날 첫째 청년 청바지 청소 청춘 체계 체력 체온 체육 체중 체험 초등학생 초반 초밥 초상화 초순 초여름 초원 초저녁 초점 초청 초콜릿 촛불 총각 총리 총장 촬영 최근 최상 최선 최신 최악 최종 추석 추억 추진 추천 추측 축구 축소 축제 축하 출근 출발 출산 출신 출연 출입 출장 출판 충격 충고 충돌 충분히 충청도 취업 취직 취향 치약 친구 친척 칠십 칠월 칠판 침대 침묵 침실 칫솔 칭찬 카메라 카운터 칼국수 캐릭터 캠퍼스 캠페인 커튼 컨디션 컬러 컴퓨터 코끼리 코미디 콘서트 콜라 콤플렉스 콩나물 쾌감 쿠데타 크림 큰길 큰딸 큰소리 큰아들 큰어머니 큰일 큰절 클래식 클럽 킬로 타입 타자기 탁구 탁자 탄생 태권도 태양 태풍 택시 탤런트 터널 터미널 테니스 테스트 테이블 텔레비전 토론 토마토 토요일 통계 통과 통로 통신 통역 통일 통장 통제 통증 통합 통화 퇴근 퇴원 퇴직금 튀김 트럭 특급 특별 특성 특수 특징 특히 튼튼히 티셔츠 파란색 파일 파출소 판결 판단 판매 판사 팔십 팔월 팝송 패션 팩스 팩시밀리 팬티 퍼센트 페인트 편견 편의 편지 편히 평가 평균 평생 평소 평양 평일 평화 포스터 포인트 포장 포함 표면 표정 표준 표현 품목 품질 풍경 풍속 풍습 프랑스 프린터 플라스틱 피곤 피망 피아노 필름 필수 필요 필자 필통 핑계 하느님 하늘 하드웨어 하룻밤 하반기 하숙집 하순 하여튼 하지만 하천 하품 하필 학과 학교 학급 학기 학년 학력 학번 학부모 학비 학생 학술 학습 학용품 학원 학위 학자 학점 한계 한글 한꺼번에 한낮 한눈 한동안 한때 한라산 한마디 한문 한번 한복 한식 한여름 한쪽 할머니 할아버지 할인 함께 함부로 합격 합리적 항공 항구 항상 항의 해결 해군 해답 해당 해물 해석 해설 해수욕장 해안 핵심 핸드백 햄버거 햇볕 햇살 행동 행복 행사 행운 행위 향기 향상 향수 허락 허용 헬기 현관 현금 현대 현상 현실 현장 현재 현지 혈액 협력 형부 형사 형수 형식 형제 형태 형편 혜택 호기심 호남 호랑이 호박 호텔 호흡 혹시 홀로 홈페이지 홍보 홍수 홍차 화면 화분 화살 화요일 화장 화학 확보 확인 확장 확정 환갑 환경 환영 환율 환자 활기 활동 활발히 활용 활짝 회견 회관 회복 회색 회원 회장 회전 횟수 횡단보도 효율적 후반 후춧가루 훈련 훨씬 휴식 휴일 흉내 흐름 흑백 흑인 흔적 흔히 흥미 흥분 희곡 희망 희생 흰색 힘껏 ================================================ FILE: src/main/resources/mnemonic/wordlist/portuguese.txt ================================================ abacate abaixo abalar abater abduzir abelha aberto abismo abotoar abranger abreviar abrigar abrupto absinto absoluto absurdo abutre acabado acalmar acampar acanhar acaso aceitar acelerar acenar acervo acessar acetona achatar acidez acima acionado acirrar aclamar aclive acolhida acomodar acoplar acordar acumular acusador adaptar adega adentro adepto adequar aderente adesivo adeus adiante aditivo adjetivo adjunto admirar adorar adquirir adubo adverso advogado aeronave afastar aferir afetivo afinador afivelar aflito afluente afrontar agachar agarrar agasalho agenciar agilizar agiota agitado agora agradar agreste agrupar aguardar agulha ajoelhar ajudar ajustar alameda alarme alastrar alavanca albergue albino alcatra aldeia alecrim alegria alertar alface alfinete algum alheio aliar alicate alienar alinhar aliviar almofada alocar alpiste alterar altitude alucinar alugar aluno alusivo alvo amaciar amador amarelo amassar ambas ambiente ameixa amenizar amido amistoso amizade amolador amontoar amoroso amostra amparar ampliar ampola anagrama analisar anarquia anatomia andaime anel anexo angular animar anjo anomalia anotado ansioso anterior anuidade anunciar anzol apagador apalpar apanhado apego apelido apertada apesar apetite apito aplauso aplicada apoio apontar aposta aprendiz aprovar aquecer arame aranha arara arcada ardente areia arejar arenito aresta argiloso argola arma arquivo arraial arrebate arriscar arroba arrumar arsenal arterial artigo arvoredo asfaltar asilado aspirar assador assinar assoalho assunto astral atacado atadura atalho atarefar atear atender aterro ateu atingir atirador ativo atoleiro atracar atrevido atriz atual atum auditor aumentar aura aurora autismo autoria autuar avaliar avante avaria avental avesso aviador avisar avulso axila azarar azedo azeite azulejo babar babosa bacalhau bacharel bacia bagagem baiano bailar baioneta bairro baixista bajular baleia baliza balsa banal bandeira banho banir banquete barato barbado baronesa barraca barulho baseado bastante batata batedor batida batom batucar baunilha beber beijo beirada beisebol beldade beleza belga beliscar bendito bengala benzer berimbau berlinda berro besouro bexiga bezerro bico bicudo bienal bifocal bifurcar bigorna bilhete bimestre bimotor biologia biombo biosfera bipolar birrento biscoito bisneto bispo bissexto bitola bizarro blindado bloco bloquear boato bobagem bocado bocejo bochecha boicotar bolada boletim bolha bolo bombeiro bonde boneco bonita borbulha borda boreal borracha bovino boxeador branco brasa braveza breu briga brilho brincar broa brochura bronzear broto bruxo bucha budismo bufar bule buraco busca busto buzina cabana cabelo cabide cabo cabrito cacau cacetada cachorro cacique cadastro cadeado cafezal caiaque caipira caixote cajado caju calafrio calcular caldeira calibrar calmante calota camada cambista camisa camomila campanha camuflar canavial cancelar caneta canguru canhoto canivete canoa cansado cantar canudo capacho capela capinar capotar capricho captador capuz caracol carbono cardeal careca carimbar carneiro carpete carreira cartaz carvalho casaco casca casebre castelo casulo catarata cativar caule causador cautelar cavalo caverna cebola cedilha cegonha celebrar celular cenoura censo centeio cercar cerrado certeiro cerveja cetim cevada chacota chaleira chamado chapada charme chatice chave chefe chegada cheiro cheque chicote chifre chinelo chocalho chover chumbo chutar chuva cicatriz ciclone cidade cidreira ciente cigana cimento cinto cinza ciranda circuito cirurgia citar clareza clero clicar clone clube coado coagir cobaia cobertor cobrar cocada coelho coentro coeso cogumelo coibir coifa coiote colar coleira colher colidir colmeia colono coluna comando combinar comentar comitiva comover complexo comum concha condor conectar confuso congelar conhecer conjugar consumir contrato convite cooperar copeiro copiador copo coquetel coragem cordial corneta coronha corporal correio cortejo coruja corvo cosseno costela cotonete couro couve covil cozinha cratera cravo creche credor creme crer crespo criada criminal crioulo crise criticar crosta crua cruzeiro cubano cueca cuidado cujo culatra culminar culpar cultura cumprir cunhado cupido curativo curral cursar curto cuspir custear cutelo damasco datar debater debitar deboche debulhar decalque decimal declive decote decretar dedal dedicado deduzir defesa defumar degelo degrau degustar deitado deixar delator delegado delinear delonga demanda demitir demolido dentista depenado depilar depois depressa depurar deriva derramar desafio desbotar descanso desenho desfiado desgaste desigual deslize desmamar desova despesa destaque desviar detalhar detentor detonar detrito deusa dever devido devotado dezena diagrama dialeto didata difuso digitar dilatado diluente diminuir dinastia dinheiro diocese direto discreta disfarce disparo disquete dissipar distante ditador diurno diverso divisor divulgar dizer dobrador dolorido domador dominado donativo donzela dormente dorsal dosagem dourado doutor drenagem drible drogaria duelar duende dueto duplo duquesa durante duvidoso eclodir ecoar ecologia edificar edital educado efeito efetivar ejetar elaborar eleger eleitor elenco elevador eliminar elogiar embargo embolado embrulho embutido emenda emergir emissor empatia empenho empinado empolgar emprego empurrar emulador encaixe encenado enchente encontro endeusar endossar enfaixar enfeite enfim engajado engenho englobar engomado engraxar enguia enjoar enlatar enquanto enraizar enrolado enrugar ensaio enseada ensino ensopado entanto enteado entidade entortar entrada entulho envergar enviado envolver enxame enxerto enxofre enxuto epiderme equipar ereto erguido errata erva ervilha esbanjar esbelto escama escola escrita escuta esfinge esfolar esfregar esfumado esgrima esmalte espanto espelho espiga esponja espreita espumar esquerda estaca esteira esticar estofado estrela estudo esvaziar etanol etiqueta euforia europeu evacuar evaporar evasivo eventual evidente evoluir exagero exalar examinar exato exausto excesso excitar exclamar executar exemplo exibir exigente exonerar expandir expelir expirar explanar exposto expresso expulsar externo extinto extrato fabricar fabuloso faceta facial fada fadiga faixa falar falta familiar fandango fanfarra fantoche fardado farelo farinha farofa farpa fartura fatia fator favorita faxina fazenda fechado feijoada feirante felino feminino fenda feno fera feriado ferrugem ferver festejar fetal feudal fiapo fibrose ficar ficheiro figurado fileira filho filme filtrar firmeza fisgada fissura fita fivela fixador fixo flacidez flamingo flanela flechada flora flutuar fluxo focal focinho fofocar fogo foguete foice folgado folheto forjar formiga forno forte fosco fossa fragata fralda frango frasco fraterno freira frente fretar frieza friso fritura fronha frustrar fruteira fugir fulano fuligem fundar fungo funil furador furioso futebol gabarito gabinete gado gaiato gaiola gaivota galega galho galinha galocha ganhar garagem garfo gargalo garimpo garoupa garrafa gasoduto gasto gata gatilho gaveta gazela gelado geleia gelo gemada gemer gemido generoso gengiva genial genoma genro geologia gerador germinar gesso gestor ginasta gincana gingado girafa girino glacial glicose global glorioso goela goiaba golfe golpear gordura gorjeta gorro gostoso goteira governar gracejo gradual grafite gralha grampo granada gratuito graveto graxa grego grelhar greve grilo grisalho gritaria grosso grotesco grudado grunhido gruta guache guarani guaxinim guerrear guiar guincho guisado gula guloso guru habitar harmonia haste haver hectare herdar heresia hesitar hiato hibernar hidratar hiena hino hipismo hipnose hipoteca hoje holofote homem honesto honrado hormonal hospedar humorado iate ideia idoso ignorado igreja iguana ileso ilha iludido iluminar ilustrar imagem imediato imenso imersivo iminente imitador imortal impacto impedir implante impor imprensa impune imunizar inalador inapto inativo incenso inchar incidir incluir incolor indeciso indireto indutor ineficaz inerente infantil infestar infinito inflamar informal infrator ingerir inibido inicial inimigo injetar inocente inodoro inovador inox inquieto inscrito inseto insistir inspetor instalar insulto intacto integral intimar intocado intriga invasor inverno invicto invocar iogurte iraniano ironizar irreal irritado isca isento isolado isqueiro italiano janeiro jangada janta jararaca jardim jarro jasmim jato javali jazida jejum joaninha joelhada jogador joia jornal jorrar jovem juba judeu judoca juiz julgador julho jurado jurista juro justa labareda laboral lacre lactante ladrilho lagarta lagoa laje lamber lamentar laminar lampejo lanche lapidar lapso laranja lareira largura lasanha lastro lateral latido lavanda lavoura lavrador laxante lazer lealdade lebre legado legendar legista leigo leiloar leitura lembrete leme lenhador lentilha leoa lesma leste letivo letreiro levar leveza levitar liberal libido liderar ligar ligeiro limitar limoeiro limpador linda linear linhagem liquidez listagem lisura litoral livro lixa lixeira locador locutor lojista lombo lona longe lontra lorde lotado loteria loucura lousa louvar luar lucidez lucro luneta lustre lutador luva macaco macete machado macio madeira madrinha magnata magreza maior mais malandro malha malote maluco mamilo mamoeiro mamute manada mancha mandato manequim manhoso manivela manobrar mansa manter manusear mapeado maquinar marcador maresia marfim margem marinho marmita maroto marquise marreco martelo marujo mascote masmorra massagem mastigar matagal materno matinal matutar maxilar medalha medida medusa megafone meiga melancia melhor membro memorial menino menos mensagem mental merecer mergulho mesada mesclar mesmo mesquita mestre metade meteoro metragem mexer mexicano micro migalha migrar milagre milenar milhar mimado minerar minhoca ministro minoria miolo mirante mirtilo misturar mocidade moderno modular moeda moer moinho moita moldura moleza molho molinete molusco montanha moqueca morango morcego mordomo morena mosaico mosquete mostarda motel motim moto motriz muda muito mulata mulher multar mundial munido muralha murcho muscular museu musical nacional nadador naja namoro narina narrado nascer nativa natureza navalha navegar navio neblina nebuloso negativa negociar negrito nervoso neta neural nevasca nevoeiro ninar ninho nitidez nivelar nobreza noite noiva nomear nominal nordeste nortear notar noticiar noturno novelo novilho novo nublado nudez numeral nupcial nutrir nuvem obcecado obedecer objetivo obrigado obscuro obstetra obter obturar ocidente ocioso ocorrer oculista ocupado ofegante ofensiva oferenda oficina ofuscado ogiva olaria oleoso olhar oliveira ombro omelete omisso omitir ondulado oneroso ontem opcional operador oponente oportuno oposto orar orbitar ordem ordinal orfanato orgasmo orgulho oriental origem oriundo orla ortodoxo orvalho oscilar ossada osso ostentar otimismo ousadia outono outubro ouvido ovelha ovular oxidar oxigenar pacato paciente pacote pactuar padaria padrinho pagar pagode painel pairar paisagem palavra palestra palheta palito palmada palpitar pancada panela panfleto panqueca pantanal papagaio papelada papiro parafina parcial pardal parede partida pasmo passado pastel patamar patente patinar patrono paulada pausar peculiar pedalar pedestre pediatra pedra pegada peitoral peixe pele pelicano penca pendurar peneira penhasco pensador pente perceber perfeito pergunta perito permitir perna perplexo persiana pertence peruca pescado pesquisa pessoa petiscar piada picado piedade pigmento pilastra pilhado pilotar pimenta pincel pinguim pinha pinote pintar pioneiro pipoca piquete piranha pires pirueta piscar pistola pitanga pivete planta plaqueta platina plebeu plumagem pluvial pneu poda poeira poetisa polegada policiar poluente polvilho pomar pomba ponderar pontaria populoso porta possuir postal pote poupar pouso povoar praia prancha prato praxe prece predador prefeito premiar prensar preparar presilha pretexto prevenir prezar primata princesa prisma privado processo produto profeta proibido projeto prometer propagar prosa protetor provador publicar pudim pular pulmonar pulseira punhal punir pupilo pureza puxador quadra quantia quarto quase quebrar queda queijo quente querido quimono quina quiosque rabanada rabisco rachar racionar radial raiar rainha raio raiva rajada ralado ramal ranger ranhura rapadura rapel rapidez raposa raquete raridade rasante rascunho rasgar raspador rasteira rasurar ratazana ratoeira realeza reanimar reaver rebaixar rebelde rebolar recado recente recheio recibo recordar recrutar recuar rede redimir redonda reduzida reenvio refinar refletir refogar refresco refugiar regalia regime regra reinado reitor rejeitar relativo remador remendo remorso renovado reparo repelir repleto repolho represa repudiar requerer resenha resfriar resgatar residir resolver respeito ressaca restante resumir retalho reter retirar retomada retratar revelar revisor revolta riacho rica rigidez rigoroso rimar ringue risada risco risonho robalo rochedo rodada rodeio rodovia roedor roleta romano roncar rosado roseira rosto rota roteiro rotina rotular rouco roupa roxo rubro rugido rugoso ruivo rumo rupestre russo sabor saciar sacola sacudir sadio safira saga sagrada saibro salada saleiro salgado saliva salpicar salsicha saltar salvador sambar samurai sanar sanfona sangue sanidade sapato sarda sargento sarjeta saturar saudade saxofone sazonal secar secular seda sedento sediado sedoso sedutor segmento segredo segundo seiva seleto selvagem semanal semente senador senhor sensual sentado separado sereia seringa serra servo setembro setor sigilo silhueta silicone simetria simpatia simular sinal sincero singular sinopse sintonia sirene siri situado soberano sobra socorro sogro soja solda soletrar solteiro sombrio sonata sondar sonegar sonhador sono soprano soquete sorrir sorteio sossego sotaque soterrar sovado sozinho suavizar subida submerso subsolo subtrair sucata sucesso suco sudeste sufixo sugador sugerir sujeito sulfato sumir suor superior suplicar suposto suprimir surdina surfista surpresa surreal surtir suspiro sustento tabela tablete tabuada tacho tagarela talher talo talvez tamanho tamborim tampa tangente tanto tapar tapioca tardio tarefa tarja tarraxa tatuagem taurino taxativo taxista teatral tecer tecido teclado tedioso teia teimar telefone telhado tempero tenente tensor tentar termal terno terreno tese tesoura testado teto textura texugo tiara tigela tijolo timbrar timidez tingido tinteiro tiragem titular toalha tocha tolerar tolice tomada tomilho tonel tontura topete tora torcido torneio torque torrada torto tostar touca toupeira toxina trabalho tracejar tradutor trafegar trajeto trama trancar trapo traseiro tratador travar treino tremer trepidar trevo triagem tribo triciclo tridente trilogia trindade triplo triturar triunfal trocar trombeta trova trunfo truque tubular tucano tudo tulipa tupi turbo turma turquesa tutelar tutorial uivar umbigo unha unidade uniforme urologia urso urtiga urubu usado usina usufruir vacina vadiar vagaroso vaidoso vala valente validade valores vantagem vaqueiro varanda vareta varrer vascular vasilha vassoura vazar vazio veado vedar vegetar veicular veleiro velhice veludo vencedor vendaval venerar ventre verbal verdade vereador vergonha vermelho verniz versar vertente vespa vestido vetorial viaduto viagem viajar viatura vibrador videira vidraria viela viga vigente vigiar vigorar vilarejo vinco vinheta vinil violeta virada virtude visitar visto vitral viveiro vizinho voador voar vogal volante voleibol voltagem volumoso vontade vulto vuvuzela xadrez xarope xeque xeretar xerife xingar zangado zarpar zebu zelador zombar zoologia zumbido ================================================ FILE: src/main/resources/mnemonic/wordlist/russian.txt ================================================ абзац абонент абсурд авангард авария август авиация автор агент агитация агрегат адвокат адмирал адрес азарт азот академия аквариум аксиома акула акцент акция аллея алмаз алтарь альбом альянс амбиция анализ анекдот анкета ансамбль антенна апельсин аппарат аппетит апрель аптека арбуз аргумент аренда арест армия аромат арсенал артерия артист архив аспирант асфальт атака атомный атрибут аукцион афиша аэропорт бабочка бабушка багаж база бактерия баланс балерина балкон бандит банк барабан барон барышня барьер бассейн батарея башмак башня бедный беженец бездна белка белый бензин берег беседа бешеный билет бинокль биржа битва благо блеск близкий блин блок блюдо богатый бодрый боец бокал боковой бокс более болото болтать большой бомба борт борьба босой ботинок бояться брак брать бревно бред бригада бродяга броня бросить брызги брюки брюхо бугор будка будни будущее буква букет бульвар бумага бунт бурный буря бутылка бухта бывший быстро бытовой быть бюджет бюро бюст вагон важный вакцина валенок вальс валюта ванная варенье вариант вблизи вверх вводить вдали вдвое вдова вдоль вдруг ведро ведущий ведьма вежливо везде веко вексель велеть великий венец веник веранда верблюд верить верный версия вертеть верхний вершина весело весна весомый вести весь ветеран ветхий вечер вечно вешалка вещество взамен взгляд вздох взнос взойти взор взрыв взять видеть видимо визг визит вилка вина вирус висок витамин витрина вихрь вишня вкус влага владелец власть влево влияние вложить вместе внешний вникать внимание вновь внук внутри внучка внушать вовлечь вовремя вовсю вода водород водяной воевать возврат возглас воздух возить возле возня возраст война войско вокзал волос волчий вольный воля вообще вопль вопрос ворота восемь восток вплоть вполне вправе впредь впрочем врач вредный время вручить всадник всегда вскоре вскрыть всплеск вспышка встреча всюду всякий второй вход вчера выбор вывод выгнать выдать выехать вызов выйти выкуп вылезти вымыть выпасть выпить выплата выпуск вырасти выручка выслать высокий выставка вышка вязать вялый газета газовый галерея галстук гамма гарантия гармония гарнизон гастроли гвардия гвоздь гектар генерал гений геном геолог герб герой гибкий гигант гимн гипотеза гитара главный глагол гладить глаз глина глоток глубокий глупый глухой глыба глядеть гнев гнездо гнилой годовой голова голубой голый гонорар гордость горизонт горло горный город горшок горький горючее горячий готовый градус грамм граница граф гребень гриб гримаса грозить грохот грош грубый грудь груз грунт группа груша грязный губа гудок гулкий гулять гусеница густо гусь давление давно даже дальний данный дарить датчик дать дача двадцать дважды дверь двигать движение двойной двор дебют девятый дежурный действие декабрь деление дело дельфин день дерево держать дерзкий десять деталь детский дефект дефицит деятель джаз джинсы джунгли диагноз диалог диапазон диван дивизия дивный диета дизайн дикарь дилер динамика диплом директор дитя длинный дневник добрый добыча доверие догадка догнать дождь доклад доктор документ долго должен долина донос дорога досада доска достать досуг доход доцент дощатый драка древний дремать дробный дрова дрожать другой дружба дубовый дуга думать дурной духи душный дуэль дуэт дыра дыхание дюжина дядя едва единый ерунда если ехать жадный жажда жалеть жалоба жанр жареный жаркий жгучий жевать желание желудок жена женщина жертва жест жидкость житель жить жрец жулик журнал жуткий забрать забыть завести завод завтра загадка загнать заговор задача задеть задний задолго заехать заказ закон закрыть закуска залезть залить залп замок замуж замысел занавес заново занять заодно запись запрос запуск запястье заранее заросль зарплата заря засада заслуга заснуть застать затвор затеять затрата затылок захват зачем защита заявить заяц звезда звено звонить здесь зелень земля зеркало зерно зима злой змея знамя знание значит золотой зона зонтик зоопарк зрачок зрение зритель зубной зубр игла идеал идеолог идея идол идти изба избить избрать избыток извлечь извне изгиб изгнать издание изделие изнутри изобилие изоляция изредка изрядно изучение изъять изящный икона икра иллюзия именно иметь имидж империя импульс иначе инвалид индекс индивид инерция инженер иногда иной институт интерес интрига интуиция инфаркт инцидент ирония искать испуг история итог июнь кабель кабинет каблук кавалер кадр каждый кажется казино калитка камень камин канал кандидат каникулы канон капитан капля капот капуста карандаш карета каркас карман картина карьера каска кассета кастрюля каталог катер каток катушка кафедра качество каша кашлять каюта квадрат квартира квота кепка кивнуть километр кино киоск кипяток кирпич кислота кисть клавиша клапан класс клей клетка клиент климат клиника кличка клоун клочок клуб клумба ключ книга кнопка кнут княгиня князь кобура когда кодекс кожа коктейль колено коллега колонна колпак кольцо колючий коляска команда комедия комиссия коммуна комната комок компания комфорт конвейер конгресс конечно конкурс контроль концерт конь конюшня копать копейка копыто корабль корень корзина коридор кормить корпус космос костюм косяк котел котлета который коттедж кофе кофта кошка кража край красный краткий кредит крем крепкий кресло кривой кризис кристалл критерий кричать кровь крокодил кролик кроме крона круг кружка крупный крутой крушение крыло крыша крючок кстати кубик куда кузов кукла кулак кулиса культура кумир купе купить купол купюра курица курорт курс куртка кусок куст кухня кушать лабиринт лавка лагерь ладно ладонь лапа лауреат лгать лебедь левый легенда легкий ледяной лежать лезвие лезть лекция ленивый лента лепесток лесной лестница лететь лето лечить лига лидер лиловый лимон линия липкий лист литр лихой лицо лишить лишний ловить логика лодка ложь лозунг локоть лопата лошадь лукавый луна лучший лысый льгота любить любой людской люстра лютый лягушка магазин магия майор майский максимум макушка мало мальчик мама манера марка март маршрут масса мастер масштаб материал матч махать машина маяк мебель медаль медведь медицина медь между мелкий мелочь мемуары меньше меню менять мера мерцать место месяц металл метод метр механизм меховой мечтать мешать мешок миграция микрофон милиция миллион милость миля мимо минерал министр минута мирный миска миссия митинг мишень младший мнение мнимый много могучий модель может мозг мокрый молекула молния молодой молчать момент монета монитор монолог монстр монтаж мораль море морковь мороз морщина мостовая мотать мотив мотор мохнатый мрамор мрачный мстить мудрый мужество мужчина музей музыка мундир муравей мусор муха мчаться мысль мыться мышца мышь мюзикл мягкий мясо набор навык наглый нагрузка надежда надзор надо наедине назад название назло наивный найти наконец налево наличие налог намерен нанести напасть например народ наследие натура наука наутро начать небо неважно невеста негодяй недавно неделя недолго недра недуг нежный незачем некто нелепый неловко нельзя немало немой неплохо нервный нередко нестись неудача неужели нефть неясный нигде низкий никакой никогда никуда ничто ничуть ниша нищий новость новый нога ноготь ножницы ноздря номер носить носок ночь ноябрь нрав нуль нынче нырять нюанс няня обаяние обед обезьяна обещать обжечь обзор обилие обитать область облик обложка обмен обморок обожать обои оболочка оборона обочина образ обрести обрыв обувь обучение обход общество общий объект обыск обычно обязать овощи овраг овца оговорка ограда огурец одежда одеяло один однако одолеть ожидать озеро океан окно около окоп окраина октябрь опасный опека операция описание оплата опора оппонент оптимизм оптовый опухоль опыт оратор орбита орган орден орел оригинал ориентир оркестр оружие осенний осколок осмотр остров отбор отбыть отвлечь отдать отдел отдых отель отец отзыв отказ отклик открыть откуда отличие отныне отойти отпуск отрасль отросток отрывок отряд отсек отставка отсюда оттенок оттого отчего отъезд офис офицер охота охрана оценка очаг очень очередь очищать ошибка ощущение павильон падать пазуха пакет палата палец палуба пальто память панель паника пара парень пароход партия парус паспорт пассажир пастух патент патрон пауза паук паутина пафос пахнуть пациент пачка певец педагог пейзаж пенсия пепел первый перед период перо перрон персонаж перчатка песня песок петля петрушка петух пехота печать печень пешком пещера пианист пиджак пилот пионер пирамида пирожок письмо пища плавание плакать пламя план пласт платить пленный плечо плита плод плоский плотный плохой площадь плыть плюс пляж плясать победа повар повод повсюду повязка погода погреб подбор подвиг подделка поджать поднос подпись подруга подход подчас подъезд поединок поезд поесть поехать пожалуй пожилой позади позвать поздний позиция позор поиск поймать пойти поклон покой покрыть полдень полезный ползти полк полный половина полтора польза поляна помидор помнить помощь попасть поперек поплыть пополам поправка попугай попытка порог портрет порция порыв порядок после посол посреди постель посуда потом похвала похожий поцелуй почва почему пошлина поэма поэтому право праздник практика прах преграда предмет прежде прелесть премия препарат пресса прибыть прижать прийти приказ прилавок пример принять природа притом прихожая прицел причина приют прогноз продукт проект прожить прокат промысел пропуск просто против профиль процесс прочий прошлый прощать пружина прут прыжок прямой птица публика пугать пуговица пузырь пульт пуля пункт пускать пустой путь пухлый пучок пушистый пушка пчела пшеница пылать пыль пышный пьеса пятка пятно пятый пятьсот работа равнина ради радость радуга разбить развитие разговор раздел различие размер разный разрыв разум район ракета раковина рамка рано рапорт распад рассказ расти расход расцвет рация рвануть рваться реакция ребро реветь редактор редкий реестр режим резать резерв резина резко резной рейс реклама рекорд религия рельс ремень ремонт реплика репортаж ресница ресторан реформа рецепт речь решение ржавый риск рисунок ритуал рифма робко робот ровесник ровно родной рождение роза розовый розыск роль роман роскошь роспись рост рубашка рубеж рубить рубрика рудник рука рукопись румяный русло рухнуть ручей ручной рыба рыжий рынок рыхлый рыцарь рычаг рюкзак рядом садовый сажать салон салфетка салют самец самовар самый сани санкция сапог сарай сатира сахар сбить сбоку сборная сбыт свадьба свалка сварить свежий сверху свет свеча свинья свист свитер свобода сводка свой свыше связь сдаться сделать сегмент сегодня седло седой седьмой сезон сейф сейчас секрет сектор секунда семинар семья сенатор сено сенсация сентябрь сервис сердце середина сержант серия серый сессия сесть сетевой сжатый сжечь сзади сигнал сиденье сила силуэт сильный символ симпатия симфония синий синтез синяк сирень система ситуация сияние сказать скала скамейка скандал скатерть скачок скважина сквер сквозь скелет скидка склад сколько скорый скосить скот скрипка скудный скука слабый слава сладкий слегка след слеза слепой слесарь слишком слово слог сложный сломать служба слух случай слышать слюна смежный смелый сменить смесь сметана смех смола смуглый смутный смущать смысл снайпер снаряд сначала снег снизу сниться сно��а снять собака соблазн собрание событие совесть совсем согласие создать сознание созреть сойтись сокол солдат соленый солнце солома сомнение сонный соперник соратник сорвать сосед сосиска состав сотня соус союз спад спальня спасти спектр сперва спешить спина спирт список спичка сплав спонсор спор способ справка спустя спутник сразу средство срок срыв ссора ссылка ставить стадия стакан станция старый стая стебель стекло стена степень стереть стиль стимул стирать стихи стоить стойка стол стонать стопа сторона стоянка страна стричь строгий струя студент стук ступня стыдно суббота субъект сувенир сугроб сугубо судить судно судьба суета суметь сумма сумрак сундук супруг суровый сутки сухой суша существо сфера схема схожий сценарий счастье считать съезд сыграть сырой сытый сыщик сюда сюжет сюрприз тайна также такой такси тактика талия таможня танец таракан тарелка тариф тащить таять тварь театр тезис текст текущий телефон тема темнота теневой теннис теория теперь тепло терапия терзать термин терпеть терраса терять тесный тетрадь техника течение тигр типовой тираж титул тихий ткань товарищ тоже толпа толстый толчок толщина только тонкий тонна топить топор торговля тормоз торчать тотчас точка точно тощий трава традиция трактор трамвай траншея трасса тревога трезвый тренер трепет треск третий трещина трибуна тридцать триста триумф трогать тройка тронуть тропа тротуар трубка труд трюк тряпка туго туловище туман тумбочка тундра тупик турист турнир тусклый туфля туча тысяча тяга тяжело убежать убогий уборка уважение увезти уволить угадать угол угощать угроза угрюмый удар удачный уделять удивить удобный удочка уезжать ужин узел узкий уйти указание уклон украсть укусить улетать улица улыбка умело умение умный умолять унести унижать унылый упаковка упасть упорно упрек урна уровень урожай уронить усадьба усатый усвоить усилие условие услуга усмешка успеть устав устоять утечка утешать утро уцелеть участие ученик учесть ущелье ущерб уютный фабрика фаворит факел факт фамилия фантазия фасад февраль феномен фермер фигура физика филиал философ фильм финал флаг флот фойе фокус фонарь фонд фонтан форма форум фото фрагмент фраза фракция фронт фрукт функция фуражка футбол футляр халат хаос характер хата хвалить хватать хвойный хвост химия хирург хитрый хищник хлеб хлынуть хмурый ходить хозяин хоккей холм холст хорошо хотеть храбрый храм хранить хребет хрен хрипло хроника хрупкий художник худший хулиган хутор царь цветок целевой целиком целое цель цензура ценить центр цепной цикл цилиндр цирк цитата цифра чайник часы чашка человек челюсть чемодан чемпион чепуха червь чердак через чернила черта чеснок честно четверть четыре число чистый читатель чтение чтобы чувство чудак чудный чудо чужой чулок чума чушь чуять шагать шанс шапка шарик шарф шахматы шашлык шедевр шептать шерсть шестой шинель ширина шишка шкаф школа шкура шланг шлем шнур шоколад шорох шоссе шпион шприц штаб штамм штаны штатный штора штраф штурм штык шумно шуршать шутить шутка щедрый щека щенок экзамен экипаж экономия экран эксперт элемент элитный эмоция энергия эпизод эпоха эскиз эстрада этап этика этот эфир эффект эшелон юбилей юбка южный юмор юность юрист юстиция яблоко явление ягода ядро язык яйцо якобы якорь январь яркий ярмарка ярость ясный яхта ячейка ящик ================================================ FILE: src/main/resources/mnemonic/wordlist/spanish.txt ================================================ ábaco abdomen abeja abierto abogado abono aborto abrazo abrir abuelo abuso acabar academia acceso acción aceite acelga acento aceptar ácido aclarar acné acoger acoso activo acto actriz actuar acudir acuerdo acusar adicto admitir adoptar adorno aduana adulto aéreo afectar afición afinar afirmar ágil agitar agonía agosto agotar agregar agrio agua agudo águila aguja ahogo ahorro aire aislar ajedrez ajeno ajuste alacrán alambre alarma alba álbum alcalde aldea alegre alejar alerta aleta alfiler alga algodón aliado aliento alivio alma almeja almíbar altar alteza altivo alto altura alumno alzar amable amante amapola amargo amasar ámbar ámbito ameno amigo amistad amor amparo amplio ancho anciano ancla andar andén anemia ángulo anillo ánimo anís anotar antena antiguo antojo anual anular anuncio añadir añejo año apagar aparato apetito apio aplicar apodo aporte apoyo aprender aprobar apuesta apuro arado araña arar árbitro árbol arbusto archivo arco arder ardilla arduo área árido aries armonía arnés aroma arpa arpón arreglo arroz arruga arte artista asa asado asalto ascenso asegurar aseo asesor asiento asilo asistir asno asombro áspero astilla astro astuto asumir asunto atajo ataque atar atento ateo ático atleta átomo atraer atroz atún audaz audio auge aula aumento ausente autor aval avance avaro ave avellana avena avestruz avión aviso ayer ayuda ayuno azafrán azar azote azúcar azufre azul baba babor bache bahía baile bajar balanza balcón balde bambú banco banda baño barba barco barniz barro báscula bastón basura batalla batería batir batuta baúl bazar bebé bebida bello besar beso bestia bicho bien bingo blanco bloque blusa boa bobina bobo boca bocina boda bodega boina bola bolero bolsa bomba bondad bonito bono bonsái borde borrar bosque bote botín bóveda bozal bravo brazo brecha breve brillo brinco brisa broca broma bronce brote bruja brusco bruto buceo bucle bueno buey bufanda bufón búho buitre bulto burbuja burla burro buscar butaca buzón caballo cabeza cabina cabra cacao cadáver cadena caer café caída caimán caja cajón cal calamar calcio caldo calidad calle calma calor calvo cama cambio camello camino campo cáncer candil canela canguro canica canto caña cañón caoba caos capaz capitán capote captar capucha cara carbón cárcel careta carga cariño carne carpeta carro carta casa casco casero caspa castor catorce catre caudal causa cazo cebolla ceder cedro celda célebre celoso célula cemento ceniza centro cerca cerdo cereza cero cerrar certeza césped cetro chacal chaleco champú chancla chapa charla chico chiste chivo choque choza chuleta chupar ciclón ciego cielo cien cierto cifra cigarro cima cinco cine cinta ciprés circo ciruela cisne cita ciudad clamor clan claro clase clave cliente clima clínica cobre cocción cochino cocina coco código codo cofre coger cohete cojín cojo cola colcha colegio colgar colina collar colmo columna combate comer comida cómodo compra conde conejo conga conocer consejo contar copa copia corazón corbata corcho cordón corona correr coser cosmos costa cráneo cráter crear crecer creído crema cría crimen cripta crisis cromo crónica croqueta crudo cruz cuadro cuarto cuatro cubo cubrir cuchara cuello cuento cuerda cuesta cueva cuidar culebra culpa culto cumbre cumplir cuna cuneta cuota cupón cúpula curar curioso curso curva cutis dama danza dar dardo dátil deber débil década decir dedo defensa definir dejar delfín delgado delito demora denso dental deporte derecho derrota desayuno deseo desfile desnudo destino desvío detalle detener deuda día diablo diadema diamante diana diario dibujo dictar diente dieta diez difícil digno dilema diluir dinero directo dirigir disco diseño disfraz diva divino doble doce dolor domingo don donar dorado dormir dorso dos dosis dragón droga ducha duda duelo dueño dulce dúo duque durar dureza duro ébano ebrio echar eco ecuador edad edición edificio editor educar efecto eficaz eje ejemplo elefante elegir elemento elevar elipse élite elixir elogio eludir embudo emitir emoción empate empeño empleo empresa enano encargo enchufe encía enemigo enero enfado enfermo engaño enigma enlace enorme enredo ensayo enseñar entero entrar envase envío época equipo erizo escala escena escolar escribir escudo esencia esfera esfuerzo espada espejo espía esposa espuma esquí estar este estilo estufa etapa eterno ética etnia evadir evaluar evento evitar exacto examen exceso excusa exento exigir exilio existir éxito experto explicar exponer extremo fábrica fábula fachada fácil factor faena faja falda fallo falso faltar fama familia famoso faraón farmacia farol farsa fase fatiga fauna favor fax febrero fecha feliz feo feria feroz fértil fervor festín fiable fianza fiar fibra ficción ficha fideo fiebre fiel fiera fiesta figura fijar fijo fila filete filial filtro fin finca fingir finito firma flaco flauta flecha flor flota fluir flujo flúor fobia foca fogata fogón folio folleto fondo forma forro fortuna forzar fosa foto fracaso frágil franja frase fraude freír freno fresa frío frito fruta fuego fuente fuerza fuga fumar función funda furgón furia fusil fútbol futuro gacela gafas gaita gajo gala galería gallo gamba ganar gancho ganga ganso garaje garza gasolina gastar gato gavilán gemelo gemir gen género genio gente geranio gerente germen gesto gigante gimnasio girar giro glaciar globo gloria gol golfo goloso golpe goma gordo gorila gorra gota goteo gozar grada gráfico grano grasa gratis grave grieta grillo gripe gris grito grosor grúa grueso grumo grupo guante guapo guardia guerra guía guiño guion guiso guitarra gusano gustar haber hábil hablar hacer hacha hada hallar hamaca harina haz hazaña hebilla hebra hecho helado helio hembra herir hermano héroe hervir hielo hierro hígado higiene hijo himno historia hocico hogar hoguera hoja hombre hongo honor honra hora hormiga horno hostil hoyo hueco huelga huerta hueso huevo huida huir humano húmedo humilde humo hundir huracán hurto icono ideal idioma ídolo iglesia iglú igual ilegal ilusión imagen imán imitar impar imperio imponer impulso incapaz índice inerte infiel informe ingenio inicio inmenso inmune innato insecto instante interés íntimo intuir inútil invierno ira iris ironía isla islote jabalí jabón jamón jarabe jardín jarra jaula jazmín jefe jeringa jinete jornada joroba joven joya juerga jueves juez jugador jugo juguete juicio junco jungla junio juntar júpiter jurar justo juvenil juzgar kilo koala labio lacio lacra lado ladrón lagarto lágrima laguna laico lamer lámina lámpara lana lancha langosta lanza lápiz largo larva lástima lata látex latir laurel lavar lazo leal lección leche lector leer legión legumbre lejano lengua lento leña león leopardo lesión letal letra leve leyenda libertad libro licor líder lidiar lienzo liga ligero lima límite limón limpio lince lindo línea lingote lino linterna líquido liso lista litera litio litro llaga llama llanto llave llegar llenar llevar llorar llover lluvia lobo loción loco locura lógica logro lombriz lomo lonja lote lucha lucir lugar lujo luna lunes lupa lustro luto luz maceta macho madera madre maduro maestro mafia magia mago maíz maldad maleta malla malo mamá mambo mamut manco mando manejar manga maniquí manjar mano manso manta mañana mapa máquina mar marco marea marfil margen marido mármol marrón martes marzo masa máscara masivo matar materia matiz matriz máximo mayor mazorca mecha medalla medio médula mejilla mejor melena melón memoria menor mensaje mente menú mercado merengue mérito mes mesón meta meter método metro mezcla miedo miel miembro miga mil milagro militar millón mimo mina minero mínimo minuto miope mirar misa miseria misil mismo mitad mito mochila moción moda modelo moho mojar molde moler molino momento momia monarca moneda monja monto moño morada morder moreno morir morro morsa mortal mosca mostrar motivo mover móvil mozo mucho mudar mueble muela muerte muestra mugre mujer mula muleta multa mundo muñeca mural muro músculo museo musgo música muslo nácar nación nadar naipe naranja nariz narrar nasal natal nativo natural náusea naval nave navidad necio néctar negar negocio negro neón nervio neto neutro nevar nevera nicho nido niebla nieto niñez niño nítido nivel nobleza noche nómina noria norma norte nota noticia novato novela novio nube nuca núcleo nudillo nudo nuera nueve nuez nulo número nutria oasis obeso obispo objeto obra obrero observar obtener obvio oca ocaso océano ochenta ocho ocio ocre octavo octubre oculto ocupar ocurrir odiar odio odisea oeste ofensa oferta oficio ofrecer ogro oído oír ojo ola oleada olfato olivo olla olmo olor olvido ombligo onda onza opaco opción ópera opinar oponer optar óptica opuesto oración orador oral órbita orca orden oreja órgano orgía orgullo oriente origen orilla oro orquesta oruga osadía oscuro osezno oso ostra otoño otro oveja óvulo óxido oxígeno oyente ozono pacto padre paella página pago país pájaro palabra palco paleta pálido palma paloma palpar pan panal pánico pantera pañuelo papá papel papilla paquete parar parcela pared parir paro párpado parque párrafo parte pasar paseo pasión paso pasta pata patio patria pausa pauta pavo payaso peatón pecado pecera pecho pedal pedir pegar peine pelar peldaño pelea peligro pellejo pelo peluca pena pensar peñón peón peor pepino pequeño pera percha perder pereza perfil perico perla permiso perro persona pesa pesca pésimo pestaña pétalo petróleo pez pezuña picar pichón pie piedra pierna pieza pijama pilar piloto pimienta pino pintor pinza piña piojo pipa pirata pisar piscina piso pista pitón pizca placa plan plata playa plaza pleito pleno plomo pluma plural pobre poco poder podio poema poesía poeta polen policía pollo polvo pomada pomelo pomo pompa poner porción portal posada poseer posible poste potencia potro pozo prado precoz pregunta premio prensa preso previo primo príncipe prisión privar proa probar proceso producto proeza profesor programa prole promesa pronto propio próximo prueba público puchero pudor pueblo puerta puesto pulga pulir pulmón pulpo pulso puma punto puñal puño pupa pupila puré quedar queja quemar querer queso quieto química quince quitar rábano rabia rabo ración radical raíz rama rampa rancho rango rapaz rápido rapto rasgo raspa rato rayo raza razón reacción realidad rebaño rebote recaer receta rechazo recoger recreo recto recurso red redondo reducir reflejo reforma refrán refugio regalo regir regla regreso rehén reino reír reja relato relevo relieve relleno reloj remar remedio remo rencor rendir renta reparto repetir reposo reptil res rescate resina respeto resto resumen retiro retorno retrato reunir revés revista rey rezar rico riego rienda riesgo rifa rígido rigor rincón riñón río riqueza risa ritmo rito rizo roble roce rociar rodar rodeo rodilla roer rojizo rojo romero romper ron ronco ronda ropa ropero rosa rosca rostro rotar rubí rubor rudo rueda rugir ruido ruina ruleta rulo rumbo rumor ruptura ruta rutina sábado saber sabio sable sacar sagaz sagrado sala saldo salero salir salmón salón salsa salto salud salvar samba sanción sandía sanear sangre sanidad sano santo sapo saque sardina sartén sastre satán sauna saxofón sección seco secreto secta sed seguir seis sello selva semana semilla senda sensor señal señor separar sepia sequía ser serie sermón servir sesenta sesión seta setenta severo sexo sexto sidra siesta siete siglo signo sílaba silbar silencio silla símbolo simio sirena sistema sitio situar sobre socio sodio sol solapa soldado soledad sólido soltar solución sombra sondeo sonido sonoro sonrisa sopa soplar soporte sordo sorpresa sorteo sostén sótano suave subir suceso sudor suegra suelo sueño suerte sufrir sujeto sultán sumar superar suplir suponer supremo sur surco sureño surgir susto sutil tabaco tabique tabla tabú taco tacto tajo talar talco talento talla talón tamaño tambor tango tanque tapa tapete tapia tapón taquilla tarde tarea tarifa tarjeta tarot tarro tarta tatuaje tauro taza tazón teatro techo tecla técnica tejado tejer tejido tela teléfono tema temor templo tenaz tender tener tenis tenso teoría terapia terco término ternura terror tesis tesoro testigo tetera texto tez tibio tiburón tiempo tienda tierra tieso tigre tijera tilde timbre tímido timo tinta tío típico tipo tira tirón titán títere título tiza toalla tobillo tocar tocino todo toga toldo tomar tono tonto topar tope toque tórax torero tormenta torneo toro torpedo torre torso tortuga tos tosco toser tóxico trabajo tractor traer tráfico trago traje tramo trance trato trauma trazar trébol tregua treinta tren trepar tres tribu trigo tripa triste triunfo trofeo trompa tronco tropa trote trozo truco trueno trufa tubería tubo tuerto tumba tumor túnel túnica turbina turismo turno tutor ubicar úlcera umbral unidad unir universo uno untar uña urbano urbe urgente urna usar usuario útil utopía uva vaca vacío vacuna vagar vago vaina vajilla vale válido valle valor válvula vampiro vara variar varón vaso vecino vector vehículo veinte vejez vela velero veloz vena vencer venda veneno vengar venir venta venus ver verano verbo verde vereda verja verso verter vía viaje vibrar vicio víctima vida vídeo vidrio viejo viernes vigor vil villa vinagre vino viñedo violín viral virgo virtud visor víspera vista vitamina viudo vivaz vivero vivir vivo volcán volumen volver voraz votar voto voz vuelo vulgar yacer yate yegua yema yerno yeso yodo yoga yogur zafiro zanja zapato zarza zona zorro zumo zurdo ================================================ FILE: src/main/resources/mnemonic/wordlist/turkish.txt ================================================ abajur abaküs abartı abdal abdest abiye abluka abone absorbe absürt acayip acele acemi açıkgöz adalet adam adezyon adisyon adliye adres afacan afili afiş afiyet aforizm afra ağaç ağır ahbap ahkam ahlak ahtapot aidat aile ajan akademi akarsu akbaş akciğer akdeniz akıbet akıl akıntı akide akrep akrobasi aksiyon akşam aktif aktör aktris akustik alaca albüm alçak aldanma aleni alet alfabe algılama alıngan alkış alkol alpay alperen altın altüst altyapı alyuvar amade amatör amazon ambalaj amblem ambulans amca amel amigo amir amiyane amorti ampul anadolu anahtar anakonda anaokul anapara anarşi anatomi anayasa anekdot anestezi angaje anka anket anlamlı anne anomali anonim anten antlaşma apse araba aracı araf arbede arda arefe arena argo argüman arkadaş armoni aroma arsa arsız artı artist aruz asansör asayiş asfalt asgari asil asker askı aslan asosyal astsubay asya aşçı aşırı aşure atabey ataman ateş atmaca atmosfer atom atölye avcı avdet avize avlu avokado avrupa avukat ayaz ayçiçeği aydın aygıt ayna ayran ayrıntı azim baca bagaj bağlantı bahadır bahçe baki bakkal baklava bakteri balçık balina balo balta bant banyo bardak barış başbuğ başıboş başkan başlık bavul bayındır baykuş bazlama bedel begüm bekçi bekle belge belki bencil benek bengi benzer berjer berk bermuda berrak beşik beton beyin beyoğlu bıçak biberiye bidon biftek bihaber bikini bilezik bilinç bilye bina binbaşı binyıl bisiklet bisküvi bitki bizzat bodrum boğaz bohça bolero boncuk bonfile borsa boru bostan boşboğaz botanik boya boykot boynuz bozgun bozkır bölüm börek buçuk bugün buğday buhar buhran bulvar buram burçak burs burun butik buzdağı buzkıran bücür büfe bülten bütçe bütün büyük cacık cadı cahil cambaz canhıraş casus cazibe cehalet cehennem ceket cemre cenin cennet cepken cerrah cesur cetvel cevher ceylan cılız cıva cilt cisim ciyak coğrafya cömert cumba cüzdan çabucak çadır çağdaş çağlayan çağrı çakmak çalışkan çamaşır çapa çaput çarık çarpan çarşaf çayhane çekirdek çelebi çember çenet çengel çerçeve çerez çeşit çeşme çete çevre çeyiz çeyrek çığır çılgın çıngırak çift çiğdem çikolata çilek çimen çivi çoban çocuk çokgen çomak çorba çözelti çubuk çukur çuval çürük dağbaşı dağılım daktilo daldırış dalga dalkavuk damak damıtma damla dana dandik danışman daniska dantel dargeçit darphane davet dayı defter değer değirmen dehşet delgeç demir deneyim denge depo deprem derdest dere derhal derman dernek derviş desen destan dışarı dışbükey dijital dikbaşlı dilekçe dimağ dinamik dindar dinleme dinozor dipçik dipnot direniş dirsek disiplin disk divriği dizüstü dobra dodurga doğalgaz doktor doküman dolap donanım dondurma donör doruk dosdoğru dost dosya dozer döküm dönence dörtyol dövme dram dublaj durum duvak duyarga duyma duyuru düğme düğüm dükkan dünür düpedüz dürbün düşünür düzayak düzeltme ebeveyn ebru ecel ecnebi ecza edat edilgen efendi efor efsane egemen egzersiz eğrelti ekarte ekip eklem ekmek ekol ekonomi ekose ekran ekvator elaman elastik elbet elbise elçi eldiven elebaşı eleştiri elma eloğlu elveda emare emekçi emisyon emniyet empati emsal emzik endüstri enerji engebe engin enişte enkaz entari entegre entrika enzim erdem ergen erguvan erkek erozyon ertesi erzak esaret esenlik eser eski esnek eşarp eşofman eşraf eşya eşzaman etik etken etkinlik etüt evet evire evrak evrim eyalet eyvah ezber fabrika fanatik fanus fason fasulye fatih fatura fauna favori fayans fayton fazıl fazilet federal felsefe fener feribot fersah fesih festival feveran feza fıçı fıldır fındık fırça fırsat fırtına fıtık fidan fidye figür fihrist fikir fildişi filo filtre fincan firuze fitil fiyaka fizik flaş flüt fosil fren fukara futbol garabet gariban garnitür gazi gece gedik gelenek gelin gemi genç geniş geometri gerçek gevrek gezegen gezgin geziyolu gıcık gıda gıybet girdap girişim gitar giyecek giysi gizem gofret goril göbek göçebe göğüs gökdelen gökmen gökyüzü gölge gömlek gönül görenek görkemli görsel gösteri gövde gözaltı gözcü gözdağı gözleme gözyaşı grup gurbet gusül gübre güfte gümüş günaydın güncel gündüz güneş günyüzü gürbüz güvercin güzel haber hacamat hacim hademe hafız hafriyat hafta hakan hakem hakikat haksever halı hançer hane hangar hapis hapşırık harf haseki hasret hatun havuç haylaz haysiyet hayvan hedef hektar hemen hemfikir hendek hepsi hergele herhangi hesap heyecan heykel hezimet hıçkırık hızölçer hicviye hikaye hikmet hile hisse hobi hoca horlama hormon hoşbeş hoşgörü hoyrat hörgüç höyük hudut hukuk hunhar hurda huysuz huzur hücum hükümet hünkar hüviyet ırmak ısıölçer ısıtıcı ıspanak ısrar ışıldak ızdırap ızgara ibadet icat içbükey içecek içgüdü içsel idman iftihar iğne ihanet ihbar ihdas ihmal ihracat ihsan ikilem ikindi ikircik iklim iksir iktibas ilaç ilçe ileri iletişim ilgi ilhak ilkbahar ilkokul ilmek imkan imleç imsak imtihan imza ince inkar inşa ipek ipucu irade irfan irmik isabet iskele israf isyan işçi işgal işgüzar işlem itibar itiraf ivedi ivme iyileşme iyimser izbandut izci izdiham izin jakoben jandarma jargon kabadayı kablo kabus kaçamak kadeh kadın kadraj kafa kafkas kağıt kağnı kahkaha kahraman kahvaltı kakül kaldırım kale kalibre kalkan kalpak kamış kamyon kanat kandaş kanepe kanser kanun kaos kapı kaplıca kaptan karanlık kardeş karga karınca karmaşa karşıt kasırga kask kasvet katkı katman kavram kaygan kaynakça kayyum kedi kehanet kekik kelebek kenar kerkenez kerpiç kesirli kesmece kestane keşkek ketçap keyfiyet kıble kıdemli kılavuz kılçık kılıf kıraç kırmızı kırsal kısayol kısım kıskanç kısmet kışla kıvanç kıvılcım kıvrık kıyafet kıymetli kızak kızılcık kibar kinaye kira kiremit kirli kirpik kişisel kitap koçbaşı kodaman koğuş kokteyl kolaycı kolbastı kolonya koltuk kolye kombine komedyen komiser komposto komşu komuta konak konfor koni konsül kopya korkusuz korna korse korunak korvet kostüm koşul koyu kozmik köfte kökensel köprücük köpük kördüğüm körfez köstebek köşegen kötü kravat kriter kuantum kudurma kuluçka kulübe kumanya kumbara kumlu kumpir kumral kundura kupa kupkuru kuramsal kurbağa kurdele kurgu kurmay kurşun kurtuluş kurultay kurye kusursuz kuşak kuşbaşı kuşkulu kutlama kutsal kutup kuver kuyruk kuzey kuzgun küçük külçe külfet külliye kültürel kümes künefe küresel kütle lahana lahmacun lamba lansman lavaş layık leğen levent leziz lezzet lider likide liman liste litre liyakat lodos lokanta lokman lokum lunapark lütfen lüzum nokta mabet macera macun madalya madde madem mağara mağdur mağfiret mağlup mahalle mahcup mahir mahkeme mahlas mahrum mahsul makas makbuz makine makro maksat makul maliye manav mangal manidar manken mantık manzara mareşal margarin marifet market marmelat masaüstü masmavi masraf masum matah materyal matrak maval mavra maydanoz mayhoş maytap mazbata mazeret mazlum mazot mazur meblağ mebus mecaz mecbur meclis mecmua mecnun meçhul medeni mehtap mekanik melodi meltem memur mendil menekşe menteşe meraklı mercek merdiven merhaba merinos merkez mermi mert mesafe mesele mesken meslek meşale meşgul meşhur metafor metin metre mevcut mevkidaş meydan meyil meyve meziyet mezun mıknatıs mısra mızıka miğfer mihrak mikrofon miktar milat milli mimar minare mineral minik minyon mirliva misafir miskin miting miyop mizah mobilya model monitör morötesi motive motor mozaik muavin mucize muhafız muhteşem mukayese mumya musluk muşamba mutabık mutfak mutlu muzaffer muzdarip mübarek mücadele müdür müfredat müftü mühendis mühim mühlet mükemmel mülk mümkün mümtaz müsrif müstesna müşahit müşteri mütercim müthiş müze müzik nabız nadas nadir nahoş nakarat nakış nalbur namlu namus nankör nargile narkoz nasıl nasip naylon nazar nazım nazik neden nefes negatif neon neptün nerede nesil nesnel neşeli netice nevresim neyse neyzen nezaket nezih nezle nicel nilüfer nimet nisan nispet nitekim nizam nohut noksan normal nostalji noter nöbet numara numune nutuk nüfus obabaşı obez obje ocak odun ofansif ofis oğlak oğuz okçu oklava oksijen okul okumuş okutman okuyucu okyanus olağan olanak olası olay olgun olimpik olumlu omlet omurga onarım onursal opera optik oral orantı ordu organik orijin orkide orman orta oruç otağ otantik otel otoban otogar otomobil otonom otopark otorite otoyol oturum oyuk oyuncak ozan ödeme ödenek ödev ödül ödünç öfke öğlen öğrenci öğün öğütücü öksürük ölçme ölçü ölümsüz ömür önayak öncü önder önem önerge öngörü önlük önsezi öpücük ördek örgü örtbas örtme örtü örümcek örüntü öteberi öteki övünç öykü öyleyse özçekim özdeyiş özel özenti özerk özgürlük özlem özlü özne özsever özümseme özür özveri pabuç padişah palamut palmiye palto palyaço pamuk panayır pancar panda panel panik panjur pankart pano pansuman pantolon panzehir papatya papyon paraşüt parça pardösü parfüm parıltı parkur parmak parodi parsel partner pasaport pasif paskalya pastırma paşa patates paten patika patlıcan patolog patron payanda paydaş payidar paylaşma paytak peçete pedal peder pehlivan pekala pekmez pelerin pelikan pelüş pembe pena pencere pense perçin perde pergel perişan peron personel perşembe peruk pervane pespaye pestil peşin petek petrol petunya peynir peyzaj pınar pırasa pırlanta pide pikap piknik pilav piliç pilot pipet pipo piramit pirinç pirzola pist pişik pişman piyasa piyes plaj plaket planlama platform plazma podyum poğaça polat polen politika pompa popüler porselen portakal posa poster poşet poyraz pozitif pranga pratik prenses prim problem profil program proje protokol prova puan pudra pusula püre pürüz püstül püsür racon radar radikal radyo rafadan rafine rağbet rahat rahle rakam raket rakip rakun ralli rampa randevu ranza rapor rastgele rasyonel razı realite reçine refah referans refik reform rehber rehin reis rekabet reklam rekor rektör renk resim resmen restoran retorik revaç revize reyon rezalet rezerv rezil rıhtım rıza ritim ritüel rivayet robot roman rota rozet röportaj rötar ruble ruhban ruhsat rulet rulo runik rutin rutubet rüşvet rütbe rüya rüzgar sabah sabıka sabit sabun saçma sade sadık safahat safdil safkan sağanak sağduyu sağlam saha sahiden sahne sakal sakız sakin saklama saksağan salamura salça salgı salınım salkım salon saltanat sanatçı sancak sandalye saniye saplantı sapsız saray sarışın sarkık sarmaşık satır savaşım savunma saydam sayfa saygın sayısal sebep seçenek seçim seçkin seçmen seda sedir sedye sefer sehpa sekizgen selektör selvi semavi sembol seminer senaryo sendika senkron sensör sentez sepet seramik serbest serdar seremoni sergi serhat serin sermaye serpuş sersem serüven servis sesli sesteş sevap seviye seyahat seyirci sezon sıcak sıfat sıhhi sınanma sınır sıradan sırdaş sırma sırtüstü sızgıt siftah sigorta sihirbaz silah silecek silindir simetri simge simit sincap sindirim sinema sinirli sipariş sirke siroz sistem sivilce siyasi slogan soba sofra soğuk sohbet sokak solfej solunum somut sonbahar sonraki sonsuz sorunsuz sosyete soyağacı soydaş soygun soytarı söğüş sömürge sönük söylem sözcük sözde spatula spektrum spiker spiral sponsor sporcu sprey stabil statü stok stopaj strateji subay sucuk suçüstü suhulet sulama sungur sunucu surat susam suskun sükse sükut sülale sünger süpürge sürahi süreç sürgün sürüm süsleme sütanne sütlaç sütun süvari şahane şahbaz şahit şahsiyet şakıma şaklaban şakrak şamar şampiyon şanslı şantiye şapka şarkıcı şartname şaşırma şaşkın şatafat şayet şebeke şefkat şeftali şehir şehvet şeker şekil şelale şema şemsiye şerbet şeref şerit şımarık şıpıdık şifre şimdi şimşek şipşak şirin şişe şişirme şofben şöhret şölen şüphe tabaka tabela tabure tadilat taharet tahıl tahkim tahlil tahmin tahrifat tahsilat tahta taklit takoz taksici taktik takvim talebe talip tamamen tamirci tampon tamtakır tandır tanecik tanıtım tanrı tansiyon tapan tapınak taptaze tapu tarafgir tarhana tarım tarih tarla tartak tarumar tasarım tasdik taslak tastamam taşeron taşınmaz taşra tatava tatbikat tatil tatlı tavsiye tavşan tavuk taze taziye tazminat tebeşir tebrik tecrübe teçhizat tedarik tedbir teftiş teğet teğmen tehdit tehlike tekdüze tekerlek tekme teknik tekrar telef telsiz telve temas tembel temiz temkin tempo temsilci tendon teneke tenha tenkit tepegöz tepki terazi terbiye tercih tereyağı terfi terim terminal tersane tertip tesadüf tescil tesir teslimat tespit testere teşekkür teşhir teşrif teşvik teyze tezahür tezgah tıbbi tıkaç tıkışık tıknaz tılsım tıpkı tıraş tırışka tırmanış tırnak tırpan tıslama ticaret tilki tiryaki titreşim tohum tokat tolere tomar tombak tomurcuk topaç toplum toprak toptan toraman torpido tortu tosbağa toynak tören trafik trajedi tramvay transfer tribün triko tugay tuğla tuğrul tuhaf tulumba tunç turan turkuaz turnusol turşu turuncu tutanak tutkal tutsak tutum tuyuğ tuzlu tüccar tüfek tükenmez tülbent tümleç tünel türbin türev türk tüzük ucube ucuz uçak uçurtma ufuk uğrak uğur ukala ulaşım ulema ulus ulvi umursama umut unutkan uslu ustabaşı ustura usul utangaç uyanık uyarı uydu uygar uygulama uykusuz uysal uyuşma uzantı uzay uzgören uzlaşma uzman uzun ücra ücret üçbudak üçgen üçkağıt üçleme üfürük ülke ümit üniforma ünite ünlem üretken ürün üslup üstel üstün üşengeç üşüme ütopya üvey üzengi üzgün üzüm vagon vaka vakfiye vakıf vakit vakum vapur varil varlık varsayım varyemez vasıta vasiyet vatandaş vazife vazo veciz vefa vehim veliaht veresiye verimli verkaç vernik vertigo vesait vesika vestiyer veznedar vicdan vilayet virane virgül vişne vites vokal volkan vurma vurucu vücut yabancı yabgu yağış yağlı yağmur yakamoz yakın yaklaşık yalçın yalıtım yaman yanardağ yangın yanıt yankı yanlış yansıma yapay yapboz yapımcı yaprak yaratık yarbay yardım yargıç yarıçap yasemin yastık yaşam yatak yatırım yavru yaygara yayıncı yayla yazılım yekpare yekvücut yelkovan yelpaze yemek yemiş yengeç yeniçeri yeraltı yerküre yerleşke yeryüzü yeşil yetenek yetkili yığınak yıkama yılbaşı yıldırım yılkı yılmaz yırtıcı yiğit yoğurt yokuş yolcu yoldaş yolgeçen yolkesen yolüstü yordam yorgan yorumcu yosun yöndeş yönetim yönlü yöntem yöresel yörünge yufka yukarı yumruk yumurta yuvarlak yücelme yükçeker yüklem yüksek yürek yürütme yüzde yüzeysel yüzgeç yüzüstü yüzyıl zabıta zafer zahmet zambak zaptiye zarafet zaruret zeka zekice zemberek zemin zencefil zeplin zeytin zıbın zılgıt zımbırtı zımpara zıpkın zigon zihinsel zihniyet zincir zindan zirzop ziyaret ziynet zoraki zorlu zorunlu züğürt zümre ================================================ FILE: src/main/resources/simplelogger.properties ================================================ # SLF4J's SimpleLogger configuration file # Simple implementation of Logger that sends all enabled log messages, for all defined loggers, to System.err. # Default logging detail level for all instances of SimpleLogger. # Must be one of ("trace", "debug", "info", "warn", or "error"). # If not specified, defaults to "info". org.slf4j.simpleLogger.defaultLogLevel=trace # Logging detail level for a SimpleLogger instance named "xxxxx". # Must be one of ("trace", "debug", "info", "warn", or "error"). # If not specified, the default logging detail level is used. #org.slf4j.simpleLogger.log.xxxxx= # Set to true if you want the current date and time to be included in output messages. # Default is false, and will output the number of milliseconds elapsed since startup. #org.slf4j.simpleLogger.showDateTime=false # The date and time format to be used in the output messages. # The pattern describing the date and time format is the same that is used in java.text.SimpleDateFormat. # If the format is not specified or is invalid, the default format is used. # The default format is yyyy-MM-dd HH:mm:ss:SSS Z. #org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss:SSS Z # Set to true if you want to output the current thread name. # Defaults to true. #org.slf4j.simpleLogger.showThreadName=true # Set to true if you want the Logger instance name to be included in output messages. # Defaults to true. #org.slf4j.simpleLogger.showLogName=true # Set to true if you want the last component of the name to be included in output messages. # Defaults to false. #org.slf4j.simpleLogger.showShortLogName=false ================================================ FILE: src/main/resources/unused/calc_addrs.cl ================================================ /* * Vanitygen, vanity bitcoin address generator * Copyright (C) 2011 * * Vanitygen is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * Vanitygen is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Vanitygen. If not, see . */ /* * This file contains an OpenCL kernel for performing certain parts of * the bitcoin address calculation process. * * Kernel: ec_add_grid * * Inputs: * - Row: Array of (sequential) EC points * - Column: Array of column increment EC points (= rowsize * Pgenerator) * * Steps: * - Compute P = Row[x] + Column[y] * P is computed as numerator/denominator components Pxj, Pyj, Pz * Final values are: Px = Pxj / (Pz^2), Py = Pyj / (Pz^3) * * The modular inverse of Pz is required to compute Px and Py, and * can be computed more efficiently in large batches. This is done in * the next kernel heap_invert. * * - Store Pxj, Pyj to intermediate point buffer * - Store Pz to z_heap * * Outputs: * - Intermediate point buffer * - Denominator buffer (z_heap) * * ------------------------------- * Kernel: heap_invert * * Inputs: * - Denominator buffer (z_heap) * - N = Batch size (power of 2) * * Steps: * - Compute the product tree for N values in the denominator buffer * - Compute the modular inverse of the root of the product tree * - Multiply down the tree to compute the modular inverse of each leaf * * Outputs: * - Modular inverse denominator buffer (z_heap) * * ------------------------------- * Kernel: hash_ec_point_get * * Inputs: * - Intermediate point buffer * - Modular inverse denominator buffer (z_heap) * * Steps: * - Compute Px = Pxj * (1/Pz)^2 * - Compute Py = Pyj * (1/Pz)^3 * - Compute H = RIPEMD160(SHA256(0x04 | Px | Py)) * * Output: * - Array of 20-byte address hash values * * ------------------------------- * Kernel: hash_ec_point_search_prefix * * Like hash_ec_point_get, but instead of storing the complete hash * value to an output buffer, it searches a sorted list of ranges, * and if a match is found, writes a flag to an output buffer. */ /* Byte-swapping and endianness */ #define bswap32(v) \ (((v) >> 24) | (((v) >> 8) & 0xff00) | \ (((v) << 8) & 0xff0000) | ((v) << 24)) #if __ENDIAN_LITTLE__ != 1 #define load_le32(v) bswap32(v) #define load_be32(v) (v) #else #define load_le32(v) (v) #define load_be32(v) bswap32(v) #endif /* * Loop unrolling macros * * In most cases, preprocessor unrolling works best. * The exception is NVIDIA's compiler, which seems to take unreasonably * long to compile a loop with a larger iteration count, or a loop with * a body of >50 PTX instructions, with preprocessor unrolling. * However, it does not seem to take as long with pragma unroll, and * produces good output. */ /* Explicit loop unrolling */ #define unroll_5(a) do { a(0) a(1) a(2) a(3) a(4) } while (0) #define unroll_8(a) do { a(0) a(1) a(2) a(3) a(4) a(5) a(6) a(7) } while (0) #define unroll_1_7(a) do { a(1) a(2) a(3) a(4) a(5) a(6) a(7) } while (0) #define unroll_7(a) do { a(0) a(1) a(2) a(3) a(4) a(5) a(6) } while (0) #define unroll_7_0(a) do { a(7) a(6) a(5) a(4) a(3) a(2) a(1) a(0) } while (0) #define unroll_7_1(a) do { a(7) a(6) a(5) a(4) a(3) a(2) a(1) } while (0) #define unroll_16(a) do { \ a(0) a(1) a(2) a(3) a(4) a(5) a(6) a(7) \ a(8) a(9) a(10) a(11) a(12) a(13) a(14) a(15) \ } while (0) #define unroll_64(a) do { \ a(0) a(1) a(2) a(3) a(4) a(5) a(6) a(7) \ a(8) a(9) a(10) a(11) a(12) a(13) a(14) a(15) \ a(16) a(17) a(18) a(19) a(20) a(21) a(22) a(23) \ a(24) a(25) a(26) a(27) a(28) a(29) a(30) a(31) \ a(32) a(33) a(34) a(35) a(36) a(37) a(38) a(39) \ a(40) a(41) a(42) a(43) a(44) a(45) a(46) a(47) \ a(48) a(49) a(50) a(51) a(52) a(53) a(54) a(55) \ a(56) a(57) a(58) a(59) a(60) a(61) a(62) a(63) \ } while (0) /* Conditional loop unrolling */ #if defined(DEEP_PREPROC_UNROLL) #define iter_5(a) unroll_5(a) #define iter_8(a) unroll_8(a) #define iter_16(a) unroll_16(a) #define iter_64(a) unroll_64(a) #else #define iter_5(a) do {int _i; for (_i = 0; _i < 5; _i++) { a(_i) }} while (0) #define iter_8(a) do {int _i; for (_i = 0; _i < 8; _i++) { a(_i) }} while (0) #define iter_16(a) do {int _i; for (_i = 0; _i < 16; _i++) { a(_i) }} while (0) #define iter_64(a) do {int _i; for (_i = 0; _i < 64; _i++) { a(_i) }} while (0) #endif /* * BIGNUM mini-library * This module deals with fixed-size 256-bit bignums. * Where modular arithmetic is performed, the SECP256k1 prime * modulus (below) is assumed. * * Methods include: * - bn_is_zero/bn_is_one/bn_is_odd/bn_is_even/bn_is_bit_set * - bn_rshift[1]/bn_lshift[1] * - bn_neg * - bn_uadd/bn_uadd_p * - bn_usub/bn_usub_p */ typedef uint bn_word; #define BN_NBITS 256 #define BN_WSHIFT 5 #define BN_WBITS (1 << BN_WSHIFT) #define BN_NWORDS ((BN_NBITS/8) / sizeof(bn_word)) #define BN_WORDMAX 0xffffffff #define MODULUS_BYTES \ 0xfffffc2f, 0xfffffffe, 0xffffffff, 0xffffffff, \ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff typedef struct { bn_word d[BN_NWORDS]; } bignum; __constant bn_word modulus[] = { MODULUS_BYTES }; __constant bignum bn_zero; __constant bn_word mont_rr[BN_NWORDS] = { 0xe90a1, 0x7a2, 0x1, 0, }; __constant bn_word mont_n0[2] = { 0xd2253531, 0xd838091d }; #define bn_is_odd(bn) (bn.d[0] & 1) #define bn_is_even(bn) (!bn_is_odd(bn)) #define bn_is_zero(bn) (!bn.d[0] && !bn.d[1] && !bn.d[2] && \ !bn.d[3] && !bn.d[4] && !bn.d[5] && \ !bn.d[6] && !bn.d[7]) #define bn_is_one(bn) ((bn.d[0] == 1) && !bn.d[1] && !bn.d[2] && \ !bn.d[3] && !bn.d[4] && !bn.d[5] && \ !bn.d[6] && !bn.d[7]) #define bn_is_bit_set(bn, n) \ ((((bn_word*)&bn)[n >> BN_WSHIFT]) & (1 << (n & (BN_WBITS-1)))) #define bn_unroll(e) unroll_8(e) #define bn_unroll_sf(e) unroll_1_7(e) #define bn_unroll_sl(e) unroll_7(e) #define bn_unroll_reverse(e) unroll_7_0(e) #define bn_unroll_reverse_sl(e) unroll_7_1(e) #define bn_unroll_arg(e, arg) \ e(arg, 0) e(arg, 1) e(arg, 2) e(arg, 3) \ e(arg, 4) e(arg, 5) e(arg, 6) e(arg, 7) #define bn_unroll_arg_sf(e, arg) \ e(arg, 1) e(arg, 2) e(arg, 3) \ e(arg, 4) e(arg, 5) e(arg, 6) e(arg, 7) #define bn_iter(e) iter_8(e) /* * Bitwise shift */ void bn_lshift1(bignum *bn) { #define bn_lshift1_inner1(i) \ bn->d[i] = (bn->d[i] << 1) | (bn->d[i-1] >> 31); bn_unroll_reverse_sl(bn_lshift1_inner1); bn->d[0] <<= 1; } void bn_rshift(bignum *bn, int shift) { int wd, iws, iwr; bn_word ihw, ilw; iws = (shift & (BN_WBITS-1)); iwr = BN_WBITS - iws; wd = (shift >> BN_WSHIFT); ihw = (wd < BN_WBITS) ? bn->d[wd] : 0; #define bn_rshift_inner1(i) \ wd++; \ ilw = ihw; \ ihw = (wd < BN_WBITS) ? bn->d[wd] : 0; \ bn->d[i] = (ilw >> iws) | (ihw << iwr); bn_unroll_sl(bn_rshift_inner1); bn->d[BN_NWORDS-1] = (ihw >> iws); } void bn_rshift1(bignum *bn) { #define bn_rshift1_inner1(i) \ bn->d[i] = (bn->d[i+1] << 31) | (bn->d[i] >> 1); bn_unroll_sl(bn_rshift1_inner1); bn->d[BN_NWORDS-1] >>= 1; } void bn_rshift1_2(bignum *bna, bignum *bnb) { #define bn_rshift1_2_inner1(i) \ bna->d[i] = (bna->d[i+1] << 31) | (bna->d[i] >> 1); \ bnb->d[i] = (bnb->d[i+1] << 31) | (bnb->d[i] >> 1); bn_unroll_sl(bn_rshift1_2_inner1); bna->d[BN_NWORDS-1] >>= 1; bnb->d[BN_NWORDS-1] >>= 1; } /* * Unsigned comparison */ int bn_ucmp_ge(bignum *a, bignum *b) { int l = 0, g = 0; #define bn_ucmp_ge_inner1(i) \ if (a->d[i] < b->d[i]) l |= (1 << i); \ if (a->d[i] > b->d[i]) g |= (1 << i); bn_unroll_reverse(bn_ucmp_ge_inner1); return (l > g) ? 0 : 1; } int bn_ucmp_ge_c(bignum *a, __constant bn_word *b) { int l = 0, g = 0; #define bn_ucmp_ge_c_inner1(i) \ if (a->d[i] < b[i]) l |= (1 << i); \ if (a->d[i] > b[i]) g |= (1 << i); bn_unroll_reverse(bn_ucmp_ge_c_inner1); return (l > g) ? 0 : 1; } /* * Negate */ void bn_neg(bignum *n) { int c = 1; #define bn_neg_inner1(i) \ c = (n->d[i] = (~n->d[i]) + c) ? 0 : c; bn_unroll(bn_neg_inner1); } /* * Add/subtract */ #define bn_add_word(r, a, b, t, c) do { \ t = a + b; \ c = (t < a) ? 1 : 0; \ r = t; \ } while (0) #define bn_addc_word(r, a, b, t, c) do { \ t = a + b + c; \ c = (t < a) ? 1 : ((c & (t == a)) ? 1 : 0); \ r = t; \ } while (0) bn_word bn_uadd_words_seq(bn_word *r, bn_word *a, bn_word *b) { bn_word t, c = 0; #define bn_uadd_words_seq_inner1(i) \ bn_addc_word(r[i], a[i], b[i], t, c); bn_add_word(r[0], a[0], b[0], t, c); bn_unroll_sf(bn_uadd_words_seq_inner1); return c; } bn_word bn_uadd_words_c_seq(bn_word *r, bn_word *a, __constant bn_word *b) { bn_word t, c = 0; bn_add_word(r[0], a[0], b[0], t, c); bn_unroll_sf(bn_uadd_words_seq_inner1); return c; } #define bn_sub_word(r, a, b, t, c) do { \ t = a - b; \ c = (a < b) ? 1 : 0; \ r = t; \ } while (0) #define bn_subb_word(r, a, b, t, c) do { \ t = a - (b + c); \ c = (!(a) && c) ? 1 : 0; \ c |= (a < b) ? 1 : 0; \ r = t; \ } while (0) bn_word bn_usub_words_seq(bn_word *r, bn_word *a, bn_word *b) { bn_word t, c = 0; #define bn_usub_words_seq_inner1(i) \ bn_subb_word(r[i], a[i], b[i], t, c); bn_sub_word(r[0], a[0], b[0], t, c); bn_unroll_sf(bn_usub_words_seq_inner1); return c; } bn_word bn_usub_words_c_seq(bn_word *r, bn_word *a, __constant bn_word *b) { bn_word t, c = 0; bn_sub_word(r[0], a[0], b[0], t, c); bn_unroll_sf(bn_usub_words_seq_inner1); return c; } /* * Add/subtract better suited for AMD's VLIW architecture */ bn_word bn_uadd_words_vliw(bn_word *r, bn_word *a, bn_word *b) { bignum x; bn_word c = 0, cp = 0; #define bn_uadd_words_vliw_inner1(i) \ x.d[i] = a[i] + b[i]; #define bn_uadd_words_vliw_inner2(i) \ c |= (a[i] > x.d[i]) ? (1 << i) : 0; \ cp |= (!~x.d[i]) ? (1 << i) : 0; #define bn_uadd_words_vliw_inner3(i) \ r[i] = x.d[i] + ((c >> i) & 1); bn_unroll(bn_uadd_words_vliw_inner1); bn_unroll(bn_uadd_words_vliw_inner2); c = ((cp + (c << 1)) ^ cp); r[0] = x.d[0]; bn_unroll_sf(bn_uadd_words_vliw_inner3); return c >> BN_NWORDS; } bn_word bn_uadd_words_c_vliw(bn_word *r, bn_word *a, __constant bn_word *b) { bignum x; bn_word c = 0, cp = 0; bn_unroll(bn_uadd_words_vliw_inner1); bn_unroll(bn_uadd_words_vliw_inner2); c = ((cp + (c << 1)) ^ cp); r[0] = x.d[0]; bn_unroll_sf(bn_uadd_words_vliw_inner3); return c >> BN_NWORDS; } bn_word bn_usub_words_vliw(bn_word *r, bn_word *a, bn_word *b) { bignum x; bn_word c = 0, cp = 0; #define bn_usub_words_vliw_inner1(i) \ x.d[i] = a[i] - b[i]; #define bn_usub_words_vliw_inner2(i) \ c |= (a[i] < b[i]) ? (1 << i) : 0; \ cp |= (!x.d[i]) ? (1 << i) : 0; #define bn_usub_words_vliw_inner3(i) \ r[i] = x.d[i] - ((c >> i) & 1); bn_unroll(bn_usub_words_vliw_inner1); bn_unroll(bn_usub_words_vliw_inner2); c = ((cp + (c << 1)) ^ cp); r[0] = x.d[0]; bn_unroll_sf(bn_usub_words_vliw_inner3); return c >> BN_NWORDS; } bn_word bn_usub_words_c_vliw(bn_word *r, bn_word *a, __constant bn_word *b) { bignum x; bn_word c = 0, cp = 0; bn_unroll(bn_usub_words_vliw_inner1); bn_unroll(bn_usub_words_vliw_inner2); c = ((cp + (c << 1)) ^ cp); r[0] = x.d[0]; bn_unroll_sf(bn_usub_words_vliw_inner3); return c >> BN_NWORDS; } #if defined(DEEP_VLIW) #define bn_uadd_words bn_uadd_words_vliw #define bn_uadd_words_c bn_uadd_words_c_vliw #define bn_usub_words bn_usub_words_vliw #define bn_usub_words_c bn_usub_words_c_vliw #else #define bn_uadd_words bn_uadd_words_seq #define bn_uadd_words_c bn_uadd_words_c_seq #define bn_usub_words bn_usub_words_seq #define bn_usub_words_c bn_usub_words_c_seq #endif #define bn_uadd(r, a, b) bn_uadd_words((r)->d, (a)->d, (b)->d) #define bn_uadd_c(r, a, b) bn_uadd_words_c((r)->d, (a)->d, b) #define bn_usub(r, a, b) bn_usub_words((r)->d, (a)->d, (b)->d) #define bn_usub_c(r, a, b) bn_usub_words_c((r)->d, (a)->d, b) /* * Modular add/sub */ void bn_mod_add(bignum *r, bignum *a, bignum *b) { if (bn_uadd(r, a, b) || (bn_ucmp_ge_c(r, modulus))) bn_usub_c(r, r, modulus); } void bn_mod_sub(bignum *r, bignum *a, bignum *b) { if (bn_usub(r, a, b)) bn_uadd_c(r, r, modulus); } void bn_mod_lshift1(bignum *bn) { bn_word c = (bn->d[BN_NWORDS-1] & 0x80000000); bn_lshift1(bn); if (c || (bn_ucmp_ge_c(bn, modulus))) bn_usub_c(bn, bn, modulus); } /* * Montgomery multiplication * * This includes normal multiplication of two "Montgomeryized" * bignums, and bn_from_mont for de-Montgomeryizing a bignum. */ #define bn_mul_word(r, a, w, c, p, s) do { \ r = (a * w) + c; \ p = mul_hi(a, w); \ c = (r < c) ? p + 1 : p; \ } while (0) #define bn_mul_add_word(r, a, w, c, p, s) do { \ s = r + c; \ p = mul_hi(a, w); \ r = (a * w) + s; \ c = (s < c) ? p + 1 : p; \ if (r < s) c++; \ } while (0) void bn_mul_mont(bignum *r, bignum *a, bignum *b) { bignum t; bn_word tea, teb, c, p, s, m; #if !defined(VERY_EXPENSIVE_BRANCHES) int q; #endif c = 0; #define bn_mul_mont_inner1(j) \ bn_mul_word(t.d[j], a->d[j], b->d[0], c, p, s); bn_unroll(bn_mul_mont_inner1); tea = c; teb = 0; c = 0; m = t.d[0] * mont_n0[0]; bn_mul_add_word(t.d[0], modulus[0], m, c, p, s); #define bn_mul_mont_inner2(j) \ bn_mul_add_word(t.d[j], modulus[j], m, c, p, s); \ t.d[j-1] = t.d[j]; bn_unroll_sf(bn_mul_mont_inner2); t.d[BN_NWORDS-1] = tea + c; tea = teb + ((t.d[BN_NWORDS-1] < c) ? 1 : 0); #define bn_mul_mont_inner3_1(i, j) \ bn_mul_add_word(t.d[j], a->d[j], b->d[i], c, p, s); #define bn_mul_mont_inner3_2(i, j) \ bn_mul_add_word(t.d[j], modulus[j], m, c, p, s); \ t.d[j-1] = t.d[j]; #define bn_mul_mont_inner3(i) \ c = 0; \ bn_unroll_arg(bn_mul_mont_inner3_1, i); \ tea += c; \ teb = ((tea < c) ? 1 : 0); \ c = 0; \ m = t.d[0] * mont_n0[0]; \ bn_mul_add_word(t.d[0], modulus[0], m, c, p, s); \ bn_unroll_arg_sf(bn_mul_mont_inner3_2, i); \ t.d[BN_NWORDS-1] = tea + c; \ tea = teb + ((t.d[BN_NWORDS-1] < c) ? 1 : 0); /* * The outer loop here is quite long, and we won't unroll it * unless VERY_EXPENSIVE_BRANCHES is set. */ #if defined(VERY_EXPENSIVE_BRANCHES) bn_unroll_sf(bn_mul_mont_inner3); c = tea | !bn_usub_c(r, &t, modulus); if (!c) *r = t; #else for (q = 1; q < BN_NWORDS; q++) { bn_mul_mont_inner3(q); } c = tea || (t.d[BN_NWORDS-1] >= modulus[BN_NWORDS-1]); if (c) { c = tea | !bn_usub_c(r, &t, modulus); if (c) return; } *r = t; #endif } void bn_from_mont(bignum *rb, bignum *b) { #define WORKSIZE ((2*BN_NWORDS) + 1) bn_word r[WORKSIZE]; bn_word m, c, p, s; #if defined(PRAGMA_UNROLL) int i; #endif /* Copy the input to the working area */ /* Zero the upper words */ #define bn_from_mont_inner1(i) \ r[i] = b->d[i]; #define bn_from_mont_inner2(i) \ r[BN_NWORDS+i] = 0; bn_unroll(bn_from_mont_inner1); bn_unroll(bn_from_mont_inner2); r[WORKSIZE-1] = 0; /* Multiply (long) by modulus */ #define bn_from_mont_inner3_1(i, j) \ bn_mul_add_word(r[i+j], modulus[j], m, c, p, s); #if !defined(VERY_EXPENSIVE_BRANCHES) #define bn_from_mont_inner3_2(i) \ if (r[BN_NWORDS + i] < c) \ r[BN_NWORDS + i + 1] += 1; #else #define bn_from_mont_inner3_2(i) \ r[BN_NWORDS + i + 1] += (r[BN_NWORDS + i] < c) ? 1 : 0; #endif #define bn_from_mont_inner3(i) \ m = r[i] * mont_n0[0]; \ c = 0; \ bn_unroll_arg(bn_from_mont_inner3_1, i); \ r[BN_NWORDS + i] += c; \ bn_from_mont_inner3_2(i) /* * The outer loop here is not very long, so we will unroll * it by default. However, it's just complicated enough to * cause NVIDIA's compiler to take unreasonably long to compile * it, unless we use pragma unroll. */ #if !defined(PRAGMA_UNROLL) bn_iter(bn_from_mont_inner3); #else #pragma unroll 8 for (i = 0; i < BN_NWORDS; i++) { bn_from_mont_inner3(i) } #endif /* * Make sure the result is less than the modulus. * Subtracting is not much more expensive than compare, so * subtract always and assign based on the carry out value. */ c = bn_usub_words_c(rb->d, &r[BN_NWORDS], modulus); if (c) { #define bn_from_mont_inner4(i) \ rb->d[i] = r[BN_NWORDS + i]; bn_unroll(bn_from_mont_inner4); } } /* * Modular inversion */ void bn_mod_inverse(bignum *r, bignum *n) { bignum a, b, x, y; int shift; bn_word xc, yc; for (shift = 0; shift < BN_NWORDS; shift++) { a.d[shift] = modulus[shift]; x.d[shift] = 0; y.d[shift] = 0; } b = *n; x.d[0] = 1; xc = 0; yc = 0; while (!bn_is_zero(b)) { shift = 0; while (!bn_is_odd(b)) { if (bn_is_odd(x)) xc += bn_uadd_c(&x, &x, modulus); bn_rshift1_2(&x, &b); x.d[7] |= (xc << 31); xc >>= 1; } while (!bn_is_odd(a)) { if (bn_is_odd(y)) yc += bn_uadd_c(&y, &y, modulus); bn_rshift1_2(&y, &a); y.d[7] |= (yc << 31); yc >>= 1; } if (bn_ucmp_ge(&b, &a)) { xc += yc + bn_uadd(&x, &x, &y); bn_usub(&b, &b, &a); } else { yc += xc + bn_uadd(&y, &y, &x); bn_usub(&a, &a, &b); } } if (!bn_is_one(a)) { /* no modular inverse */ *r = bn_zero; } else { /* Compute y % m as cheaply as possible */ while (yc < 0x80000000) yc -= bn_usub_c(&y, &y, modulus); bn_neg(&y); *r = y; } } /* * HASH FUNCTIONS * * BYTE ORDER NOTE: None of the hash functions below deal with byte * order. The caller is expected to be aware of this when it stuffs * data into in the native integer. * * NOTE #2: Endianness of the OpenCL device makes no difference here. */ #define hash256_unroll(a) unroll_8(a) #define hash160_unroll(a) unroll_5(a) #define hash256_iter(a) iter_8(a) #define hash160_iter(a) iter_5(a) /* * SHA-2 256 * * CAUTION: Input buffer will be overwritten/mangled. * Data expected in big-endian format. * This implementation is designed for space efficiency more than * raw speed. */ __constant uint sha2_init[8] = { 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 }; __constant uint sha2_k[64] = { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 }; void sha2_256_init(uint *out) { #define sha2_256_init_inner_1(i) \ out[i] = sha2_init[i]; hash256_unroll(sha2_256_init_inner_1); } /* The state variable remapping is really contorted */ #define sha2_stvar(vals, i, v) vals[(64+v-i) % 8] #define sha2_s0(a) (rotate(a, 30U) ^ rotate(a, 19U) ^ rotate(a, 10U)) #define sha2_s1(a) (rotate(a, 26U) ^ rotate(a, 21U) ^ rotate(a, 7U)) #if defined(AMD_BFI_INT) #pragma OPENCL EXTENSION cl_amd_media_ops : enable #define sha2_ch(a, b, c) amd_bytealign(a, b, c) #define sha2_ma(a, b, c) amd_bytealign((a^c), b, a) #else #define sha2_ch(a, b, c) (c ^ (a & (b ^ c))) #define sha2_ma(a, b, c) ((a & c) | (b & (a | c))) #endif void sha2_256_block(uint *out, uint *in) { uint state[8], t1, t2; #if defined(PRAGMA_UNROLL) int i; #endif #define sha2_256_block_inner_1(i) \ state[i] = out[i]; hash256_unroll(sha2_256_block_inner_1); #define sha2_256_block_inner_2(i) \ if (i >= 16) { \ t1 = in[(i + 1) % 16]; \ t2 = in[(i + 14) % 16]; \ in[i % 16] += (in[(i + 9) % 16] + \ (rotate(t1, 25U) ^ rotate(t1, 14U) ^ (t1 >> 3)) + \ (rotate(t2, 15U) ^ rotate(t2, 13U) ^ (t2 >> 10))); \ } \ t1 = (sha2_stvar(state, i, 7) + \ sha2_s1(sha2_stvar(state, i, 4)) + \ sha2_ch(sha2_stvar(state, i, 4), \ sha2_stvar(state, i, 5), \ sha2_stvar(state, i, 6)) + \ sha2_k[i] + \ in[i % 16]); \ t2 = (sha2_s0(sha2_stvar(state, i, 0)) + \ sha2_ma(sha2_stvar(state, i, 0), \ sha2_stvar(state, i, 1), \ sha2_stvar(state, i, 2))); \ sha2_stvar(state, i, 3) += t1; \ sha2_stvar(state, i, 7) = t1 + t2; \ #if !defined(PRAGMA_UNROLL) iter_64(sha2_256_block_inner_2); #else #pragma unroll 64 for (i = 0; i < 64; i++) { sha2_256_block_inner_2(i) } #endif #define sha2_256_block_inner_3(i) \ out[i] += state[i]; hash256_unroll(sha2_256_block_inner_3); } /* * RIPEMD160 * * Data expected in little-endian format. */ __constant uint ripemd160_iv[] = { 0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0 }; __constant uint ripemd160_k[] = { 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E }; __constant uint ripemd160_kp[] = { 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000 }; __constant uchar ripemd160_ws[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13, }; __constant uchar ripemd160_wsp[] = { 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11 }; __constant uchar ripemd160_rl[] = { 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6, }; __constant uchar ripemd160_rlp[] = { 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 }; #define ripemd160_val(v, i, n) (v)[(80+(n)-(i)) % 5] #define ripemd160_valp(v, i, n) (v)[5 + ((80+(n)-(i)) % 5)] #if defined(AMD_BFI_INT) #define ripemd160_f0(x, y, z) (x ^ y ^ z) #define ripemd160_f1(x, y, z) amd_bytealign(x, y, z) #define ripemd160_f2(x, y, z) (z ^ (x | ~y)) #define ripemd160_f3(x, y, z) amd_bytealign(z, x, y) #define ripemd160_f4(x, y, z) (x ^ (y | ~z)) #else #define ripemd160_f0(x, y, z) (x ^ y ^ z) #define ripemd160_f1(x, y, z) ((x & y) | (~x & z)) #define ripemd160_f2(x, y, z) (z ^ (x | ~y)) #define ripemd160_f3(x, y, z) ((x & z) | (y & ~z)) #define ripemd160_f4(x, y, z) (x ^ (y | ~z)) #endif #define ripemd160_round(i, in, vals, f, fp, t) do { \ ripemd160_val(vals, i, 0) = \ rotate(ripemd160_val(vals, i, 0) + \ f(ripemd160_val(vals, i, 1), \ ripemd160_val(vals, i, 2), \ ripemd160_val(vals, i, 3)) + \ in[ripemd160_ws[i]] + \ ripemd160_k[i / 16], \ (uint)ripemd160_rl[i]) + \ ripemd160_val(vals, i, 4); \ ripemd160_val(vals, i, 2) = \ rotate(ripemd160_val(vals, i, 2), 10U); \ ripemd160_valp(vals, i, 0) = \ rotate(ripemd160_valp(vals, i, 0) + \ fp(ripemd160_valp(vals, i, 1), \ ripemd160_valp(vals, i, 2), \ ripemd160_valp(vals, i, 3)) + \ in[ripemd160_wsp[i]] + \ ripemd160_kp[i / 16], \ (uint)ripemd160_rlp[i]) + \ ripemd160_valp(vals, i, 4); \ ripemd160_valp(vals, i, 2) = \ rotate(ripemd160_valp(vals, i, 2), 10U); \ } while (0) void ripemd160_init(uint *out) { #define ripemd160_init_inner_1(i) \ out[i] = ripemd160_iv[i]; hash160_unroll(ripemd160_init_inner_1); } void ripemd160_block(uint *out, uint *in) { uint vals[10], t; #if defined(PRAGMA_UNROLL) int i; #endif #define ripemd160_block_inner_1(i) \ vals[i] = vals[i + 5] = out[i]; hash160_unroll(ripemd160_block_inner_1); #define ripemd160_block_inner_p0(i) \ ripemd160_round(i, in, vals, \ ripemd160_f0, ripemd160_f4, t); #define ripemd160_block_inner_p1(i) \ ripemd160_round((16 + i), in, vals, \ ripemd160_f1, ripemd160_f3, t); #define ripemd160_block_inner_p2(i) \ ripemd160_round((32 + i), in, vals, \ ripemd160_f2, ripemd160_f2, t); #define ripemd160_block_inner_p3(i) \ ripemd160_round((48 + i), in, vals, \ ripemd160_f3, ripemd160_f1, t); #define ripemd160_block_inner_p4(i) \ ripemd160_round((64 + i), in, vals, \ ripemd160_f4, ripemd160_f0, t); #if !defined(PRAGMA_UNROLL) iter_16(ripemd160_block_inner_p0); iter_16(ripemd160_block_inner_p1); iter_16(ripemd160_block_inner_p2); iter_16(ripemd160_block_inner_p3); iter_16(ripemd160_block_inner_p4); #else #pragma unroll 16 for (i = 0; i < 16; i++) { ripemd160_block_inner_p0(i); } #pragma unroll 16 for (i = 0; i < 16; i++) { ripemd160_block_inner_p1(i); } #pragma unroll 16 for (i = 0; i < 16; i++) { ripemd160_block_inner_p2(i); } #pragma unroll 16 for (i = 0; i < 16; i++) { ripemd160_block_inner_p3(i); } #pragma unroll 16 for (i = 0; i < 16; i++) { ripemd160_block_inner_p4(i); } #endif t = out[1] + vals[2] + vals[8]; out[1] = out[2] + vals[3] + vals[9]; out[2] = out[3] + vals[4] + vals[5]; out[3] = out[4] + vals[0] + vals[6]; out[4] = out[0] + vals[1] + vals[7]; out[0] = t; } #ifdef TEST_KERNELS /* * Test kernels */ /* Montgomery multiplication test kernel */ __kernel void test_mul_mont(__global bignum *products_out, __global bignum *nums_in) { bignum a, b, c; int o; o = get_global_id(0); nums_in += (2*o); a = nums_in[0]; b = nums_in[1]; bn_mul_mont(&c, &a, &b); products_out[o] = c; } /* modular inversion test kernel */ __kernel void test_mod_inverse(__global bignum *inv_out, __global bignum *nums_in, int count) { bignum x, xp; int i, o; o = get_global_id(0) * count; for (i = 0; i < count; i++) { x = nums_in[o]; bn_mod_inverse(&xp, &x); inv_out[o++] = xp; } } #endif /* TEST_KERNELS */ #define ACCESS_BUNDLE 1024 #define ACCESS_STRIDE (ACCESS_BUNDLE/BN_NWORDS) __kernel void ec_add_grid(__global bn_word *points_out, __global bn_word *z_heap, __global bn_word *row_in, __global bignum *col_in) { bignum rx, ry; bignum x1, y1, a, b, c, d, e, z; bn_word cy; int i, cell, start; /* Load the row increment point */ i = 2 * get_global_id(1); rx = col_in[i]; ry = col_in[i+1]; cell = get_global_id(0); start = ((((2 * cell) / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % (ACCESS_STRIDE/2))); #define ec_add_grid_inner_1(i) \ x1.d[i] = row_in[start + (i*ACCESS_STRIDE)]; bn_unroll(ec_add_grid_inner_1); start += (ACCESS_STRIDE/2); #define ec_add_grid_inner_2(i) \ y1.d[i] = row_in[start + (i*ACCESS_STRIDE)]; bn_unroll(ec_add_grid_inner_2); bn_mod_sub(&z, &x1, &rx); cell += (get_global_id(1) * get_global_size(0)); start = (((cell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % ACCESS_STRIDE)); #define ec_add_grid_inner_3(i) \ z_heap[start + (i*ACCESS_STRIDE)] = z.d[i]; bn_unroll(ec_add_grid_inner_3); bn_mod_sub(&b, &y1, &ry); bn_mod_add(&c, &x1, &rx); bn_mod_add(&d, &y1, &ry); bn_mul_mont(&y1, &b, &b); bn_mul_mont(&x1, &z, &z); bn_mul_mont(&e, &c, &x1); bn_mod_sub(&y1, &y1, &e); /* * This disgusting code caters to the global memory unit on * various GPUs, by giving it a nice contiguous patch to write * per warp/wavefront. */ start = ((((2 * cell) / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % (ACCESS_STRIDE/2))); #define ec_add_grid_inner_4(i) \ points_out[start + (i*ACCESS_STRIDE)] = y1.d[i]; bn_unroll(ec_add_grid_inner_4); bn_mod_lshift1(&y1); bn_mod_sub(&y1, &e, &y1); bn_mul_mont(&y1, &y1, &b); bn_mul_mont(&a, &x1, &z); bn_mul_mont(&c, &d, &a); bn_mod_sub(&y1, &y1, &c); cy = 0; if (bn_is_odd(y1)) cy = bn_uadd_c(&y1, &y1, modulus); bn_rshift1(&y1); y1.d[BN_NWORDS-1] |= (cy ? 0x80000000 : 0); start += (ACCESS_STRIDE/2); bn_unroll(ec_add_grid_inner_4); } __kernel void heap_invert(__global bn_word *z_heap, int batch) { bignum a, b, c, z; int i, off, lcell, hcell, start; #define heap_invert_inner_load_a(j) \ a.d[j] = z_heap[start + j*ACCESS_STRIDE]; #define heap_invert_inner_load_b(j) \ b.d[j] = z_heap[start + j*ACCESS_STRIDE]; #define heap_invert_inner_load_z(j) \ z.d[j] = z_heap[start + j*ACCESS_STRIDE]; #define heap_invert_inner_store_z(j) \ z_heap[start + j*ACCESS_STRIDE] = z.d[j]; #define heap_invert_inner_store_c(j) \ z_heap[start + j*ACCESS_STRIDE] = c.d[j]; off = get_global_size(0); lcell = get_global_id(0); hcell = (off * batch) + lcell; for (i = 0; i < (batch-1); i++) { start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_a); lcell += off; start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_b); bn_mul_mont(&z, &a, &b); start = (((hcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (hcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_store_z); lcell += off; hcell += off; } /* Invert the root, fix up 1/ZR -> R/Z */ bn_mod_inverse(&z, &z); #define heap_invert_inner_1(i) \ a.d[i] = mont_rr[i]; bn_unroll(heap_invert_inner_1); bn_mul_mont(&z, &z, &a); bn_mul_mont(&z, &z, &a); /* Unroll the first iteration to avoid a load/store on the root */ lcell -= (off << 1); hcell -= (off << 1); start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_a); lcell += off; start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_b); bn_mul_mont(&c, &a, &z); bn_unroll(heap_invert_inner_store_c); bn_mul_mont(&c, &b, &z); lcell -= off; start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_store_c); lcell -= (off << 1); for (i = 0; i < (batch-2); i++) { start = (((hcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (hcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_z); start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_a); lcell += off; start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_b); bn_mul_mont(&c, &a, &z); bn_unroll(heap_invert_inner_store_c); bn_mul_mont(&c, &b, &z); lcell -= off; start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_store_c); lcell -= (off << 1); hcell -= off; } } void hash_ec_point(uint *hash_out, __global bn_word *xy, __global bn_word *zip) { uint hash1[16], hash2[16]; bignum c, zi, zzi; bn_word wh, wl; /* * Multiply the coordinates by the inverted Z values. * Stash the coordinates in the hash buffer. * SHA-2 requires big endian, and our intended hash input * is big-endian, so swapping is unnecessary, but * inserting the format byte in front causes a headache. */ #define hash_ec_point_inner_1(i) \ zi.d[i] = zip[i*ACCESS_STRIDE]; bn_unroll(hash_ec_point_inner_1); bn_mul_mont(&zzi, &zi, &zi); /* 1 / Z^2 */ #define hash_ec_point_inner_2(i) \ c.d[i] = xy[i*ACCESS_STRIDE]; bn_unroll(hash_ec_point_inner_2); bn_mul_mont(&c, &c, &zzi); /* X / Z^2 */ bn_from_mont(&c, &c); wh = 0x00000004; /* POINT_CONVERSION_UNCOMPRESSED */ #define hash_ec_point_inner_3(i) \ wl = wh; \ wh = c.d[(BN_NWORDS - 1) - i]; \ hash1[i] = (wl << 24) | (wh >> 8); bn_unroll(hash_ec_point_inner_3); bn_mul_mont(&zzi, &zzi, &zi); /* 1 / Z^3 */ #define hash_ec_point_inner_4(i) \ c.d[i] = xy[(ACCESS_STRIDE/2) + i*ACCESS_STRIDE]; bn_unroll(hash_ec_point_inner_4); bn_mul_mont(&c, &c, &zzi); /* Y / Z^3 */ bn_from_mont(&c, &c); #define hash_ec_point_inner_5(i) \ wl = wh; \ wh = c.d[(BN_NWORDS - 1) - i]; \ hash1[BN_NWORDS + i] = (wl << 24) | (wh >> 8); bn_unroll(hash_ec_point_inner_5); /* * Hash the first 64 bytes of the buffer */ sha2_256_init(hash2); sha2_256_block(hash2, hash1); /* * Hash the last byte of the buffer + SHA-2 padding */ hash1[0] = wh << 24 | 0x800000; hash1[1] = 0; hash1[2] = 0; hash1[3] = 0; hash1[4] = 0; hash1[5] = 0; hash1[6] = 0; hash1[7] = 0; hash1[8] = 0; hash1[9] = 0; hash1[10] = 0; hash1[11] = 0; hash1[12] = 0; hash1[13] = 0; hash1[14] = 0; hash1[15] = 65 * 8; sha2_256_block(hash2, hash1); /* * Hash the SHA-2 result with RIPEMD160 * Unfortunately, SHA-2 outputs big-endian, but * RIPEMD160 expects little-endian. Need to swap! */ #define hash_ec_point_inner_6(i) \ hash2[i] = bswap32(hash2[i]); hash256_unroll(hash_ec_point_inner_6); hash2[8] = bswap32(0x80000000); hash2[9] = 0; hash2[10] = 0; hash2[11] = 0; hash2[12] = 0; hash2[13] = 0; hash2[14] = 32 * 8; hash2[15] = 0; ripemd160_init(hash_out); ripemd160_block(hash_out, hash2); } __kernel void hash_ec_point_get(__global uint *hashes_out, __global bn_word *points_in, __global bn_word *z_heap) { uint hash[5]; int i, p, cell, start; cell = ((get_global_id(1) * get_global_size(0)) + get_global_id(0)); start = (((cell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % ACCESS_STRIDE)); z_heap += start; start = ((((2 * cell) / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % (ACCESS_STRIDE/2))); points_in += start; /* Complete the coordinates and hash */ hash_ec_point(hash, points_in, z_heap); p = get_global_size(0); i = p * get_global_id(1); hashes_out += 5 * (i + get_global_id(0)); /* Output the hash in proper byte-order */ #define hash_ec_point_get_inner_1(i) \ hashes_out[i] = load_le32(hash[i]); hash160_unroll(hash_ec_point_get_inner_1); } /* * Normally this would be one function that compared two hash160s. * This one compares a hash160 with an upper and lower bound in one * function to work around a problem with AMD's OpenCL compiler. */ int hash160_ucmp_g(uint *a, __global uint *bound) { uint gv; #define hash160_ucmp_g_inner_1(i) \ gv = load_be32(bound[i]); \ if (a[i] < gv) return -1; \ if (a[i] > gv) break; hash160_iter(hash160_ucmp_g_inner_1); #define hash160_ucmp_g_inner_2(i) \ gv = load_be32(bound[5+i]); \ if (a[i] < gv) return 0; \ if (a[i] > gv) return 1; hash160_iter(hash160_ucmp_g_inner_2); return 0; } __kernel void hash_ec_point_search_prefix(__global uint *found, __global bn_word *points_in, __global bn_word *z_heap, __global uint *target_table, int ntargets) { uint hash[5]; int i, high, low, p, cell, start; cell = ((get_global_id(1) * get_global_size(0)) + get_global_id(0)); start = (((cell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % ACCESS_STRIDE)); z_heap += start; start = ((((2 * cell) / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % (ACCESS_STRIDE/2))); points_in += start; /* Complete the coordinates and hash */ hash_ec_point(hash, points_in, z_heap); /* * Unconditionally byteswap the hash result, because: * - The byte-level convention of RIPEMD160 is little-endian * - We are comparing it in big-endian order */ #define hash_ec_point_search_prefix_inner_1(i) \ hash[i] = bswap32(hash[i]); hash160_unroll(hash_ec_point_search_prefix_inner_1); /* Binary-search the target table for the hash we just computed */ for (high = ntargets - 1, low = 0, i = high >> 1; high >= low; i = low + ((high - low) >> 1)) { p = hash160_ucmp_g(hash, &target_table[10*i]); low = (p > 0) ? (i + 1) : low; high = (p < 0) ? (i - 1) : high; if (p == 0) { /* For debugging purposes, write the hash value */ found[0] = ((get_global_id(1) * get_global_size(0)) + get_global_id(0)); found[1] = i; #define hash_ec_point_search_prefix_inner_2(i) \ found[i+2] = load_be32(hash[i]); hash160_unroll(hash_ec_point_search_prefix_inner_2); high = -1; } } } ================================================ FILE: src/main/resources/unused/calc_addrs_fix_zero.cl ================================================ /* * Vanitygen, vanity bitcoin address generator * Copyright (C) 2011 * * Vanitygen is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * Vanitygen is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Vanitygen. If not, see . */ /* * This file contains an OpenCL kernel for performing certain parts of * the bitcoin address calculation process. * * Kernel: ec_add_grid * * Inputs: * - Row: Array of (sequential) EC points * - Column: Array of column increment EC points (= rowsize * Pgenerator) * * Steps: * - Compute P = Row[x] + Column[y] * P is computed as numerator/denominator components Pxj, Pyj, Pz * Final values are: Px = Pxj / (Pz^2), Py = Pyj / (Pz^3) * * The modular inverse of Pz is required to compute Px and Py, and * can be computed more efficiently in large batches. This is done in * the next kernel heap_invert. * * - Store Pxj, Pyj to intermediate point buffer * - Store Pz to z_heap * * Outputs: * - Intermediate point buffer * - Denominator buffer (z_heap) * * ------------------------------- * Kernel: heap_invert * * Inputs: * - Denominator buffer (z_heap) * - N = Batch size (power of 2) * * Steps: * - Compute the product tree for N values in the denominator buffer * - Compute the modular inverse of the root of the product tree * - Multiply down the tree to compute the modular inverse of each leaf * * Outputs: * - Modular inverse denominator buffer (z_heap) * * ------------------------------- * Kernel: hash_ec_point_get * * Inputs: * - Intermediate point buffer * - Modular inverse denominator buffer (z_heap) * * Steps: * - Compute Px = Pxj * (1/Pz)^2 * - Compute Py = Pyj * (1/Pz)^3 * - Compute H = RIPEMD160(SHA256(0x04 | Px | Py)) * * Output: * - Array of 20-byte address hash values * * ------------------------------- * Kernel: hash_ec_point_search_prefix * * Like hash_ec_point_get, but instead of storing the complete hash * value to an output buffer, it searches a sorted list of ranges, * and if a match is found, writes a flag to an output buffer. */ /* Byte-swapping and endianness */ #define bswap32(v) \ (((v) >> 24) | (((v) >> 8) & 0xff00) | \ (((v) << 8) & 0xff0000) | ((v) << 24)) #if __ENDIAN_LITTLE__ != 1 #define load_le32(v) bswap32(v) #define load_be32(v) (v) #else #define load_le32(v) (v) #define load_be32(v) bswap32(v) #endif /* * Loop unrolling macros * * In most cases, preprocessor unrolling works best. * The exception is NVIDIA's compiler, which seems to take unreasonably * long to compile a loop with a larger iteration count, or a loop with * a body of >50 PTX instructions, with preprocessor unrolling. * However, it does not seem to take as long with pragma unroll, and * produces good output. */ /* Explicit loop unrolling */ #define unroll_5(a) do { a(0) a(1) a(2) a(3) a(4) } while (0) #define unroll_8(a) do { a(0) a(1) a(2) a(3) a(4) a(5) a(6) a(7) } while (0) #define unroll_1_7(a) do { a(1) a(2) a(3) a(4) a(5) a(6) a(7) } while (0) #define unroll_7(a) do { a(0) a(1) a(2) a(3) a(4) a(5) a(6) } while (0) #define unroll_7_0(a) do { a(7) a(6) a(5) a(4) a(3) a(2) a(1) a(0) } while (0) #define unroll_7_1(a) do { a(7) a(6) a(5) a(4) a(3) a(2) a(1) } while (0) #define unroll_16(a) do { \ a(0) a(1) a(2) a(3) a(4) a(5) a(6) a(7) \ a(8) a(9) a(10) a(11) a(12) a(13) a(14) a(15) \ } while (0) #define unroll_64(a) do { \ a(0) a(1) a(2) a(3) a(4) a(5) a(6) a(7) \ a(8) a(9) a(10) a(11) a(12) a(13) a(14) a(15) \ a(16) a(17) a(18) a(19) a(20) a(21) a(22) a(23) \ a(24) a(25) a(26) a(27) a(28) a(29) a(30) a(31) \ a(32) a(33) a(34) a(35) a(36) a(37) a(38) a(39) \ a(40) a(41) a(42) a(43) a(44) a(45) a(46) a(47) \ a(48) a(49) a(50) a(51) a(52) a(53) a(54) a(55) \ a(56) a(57) a(58) a(59) a(60) a(61) a(62) a(63) \ } while (0) /* Conditional loop unrolling */ #if defined(DEEP_PREPROC_UNROLL) #define iter_5(a) unroll_5(a) #define iter_8(a) unroll_8(a) #define iter_16(a) unroll_16(a) #define iter_64(a) unroll_64(a) #else #define iter_5(a) do {int _i; for (_i = 0; _i < 5; _i++) { a(_i) }} while (0) #define iter_8(a) do {int _i; for (_i = 0; _i < 8; _i++) { a(_i) }} while (0) #define iter_16(a) do {int _i; for (_i = 0; _i < 16; _i++) { a(_i) }} while (0) #define iter_64(a) do {int _i; for (_i = 0; _i < 64; _i++) { a(_i) }} while (0) #endif /* * BIGNUM mini-library * This module deals with fixed-size 256-bit bignums. * Where modular arithmetic is performed, the SECP256k1 prime * modulus (below) is assumed. * * Methods include: * - bn_is_zero/bn_is_one/bn_is_odd/bn_is_even/bn_is_bit_set * - bn_rshift[1]/bn_lshift[1] * - bn_neg * - bn_uadd/bn_uadd_p * - bn_usub/bn_usub_p */ typedef uint bn_word; #define BN_NBITS 256 #define BN_WSHIFT 5 #define BN_WBITS (1 << BN_WSHIFT) #define BN_NWORDS ((BN_NBITS/8) / sizeof(bn_word)) #define BN_WORDMAX 0xffffffff #define MODULUS_BYTES \ 0xfffffc2f, 0xfffffffe, 0xffffffff, 0xffffffff, \ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff typedef struct { bn_word d[BN_NWORDS]; } bignum; __constant bn_word modulus[] = { MODULUS_BYTES }; __constant bignum bn_zero = {{0}}; __constant bn_word mont_rr[BN_NWORDS] = { 0xe90a1, 0x7a2, 0x1, 0, }; __constant bn_word mont_n0[2] = { 0xd2253531, 0xd838091d }; #define bn_is_odd(bn) (bn.d[0] & 1) #define bn_is_even(bn) (!bn_is_odd(bn)) #define bn_is_zero(bn) (!bn.d[0] && !bn.d[1] && !bn.d[2] && \ !bn.d[3] && !bn.d[4] && !bn.d[5] && \ !bn.d[6] && !bn.d[7]) #define bn_is_one(bn) ((bn.d[0] == 1) && !bn.d[1] && !bn.d[2] && \ !bn.d[3] && !bn.d[4] && !bn.d[5] && \ !bn.d[6] && !bn.d[7]) #define bn_is_bit_set(bn, n) \ ((((bn_word*)&bn)[n >> BN_WSHIFT]) & (1 << (n & (BN_WBITS-1)))) #define bn_unroll(e) unroll_8(e) #define bn_unroll_sf(e) unroll_1_7(e) #define bn_unroll_sl(e) unroll_7(e) #define bn_unroll_reverse(e) unroll_7_0(e) #define bn_unroll_reverse_sl(e) unroll_7_1(e) #define bn_unroll_arg(e, arg) \ e(arg, 0) e(arg, 1) e(arg, 2) e(arg, 3) \ e(arg, 4) e(arg, 5) e(arg, 6) e(arg, 7) #define bn_unroll_arg_sf(e, arg) \ e(arg, 1) e(arg, 2) e(arg, 3) \ e(arg, 4) e(arg, 5) e(arg, 6) e(arg, 7) #define bn_iter(e) iter_8(e) /* * Bitwise shift */ void bn_lshift1(bignum *bn) { #define bn_lshift1_inner1(i) \ bn->d[i] = (bn->d[i] << 1) | (bn->d[i-1] >> 31); bn_unroll_reverse_sl(bn_lshift1_inner1); bn->d[0] <<= 1; } void bn_rshift(bignum *bn, int shift) { int wd, iws, iwr; bn_word ihw, ilw; iws = (shift & (BN_WBITS-1)); iwr = BN_WBITS - iws; wd = (shift >> BN_WSHIFT); ihw = (wd < BN_WBITS) ? bn->d[wd] : 0; #define bn_rshift_inner1(i) \ wd++; \ ilw = ihw; \ ihw = (wd < BN_WBITS) ? bn->d[wd] : 0; \ bn->d[i] = (ilw >> iws) | (ihw << iwr); bn_unroll_sl(bn_rshift_inner1); bn->d[BN_NWORDS-1] = (ihw >> iws); } void bn_rshift1(bignum *bn) { #define bn_rshift1_inner1(i) \ bn->d[i] = (bn->d[i+1] << 31) | (bn->d[i] >> 1); bn_unroll_sl(bn_rshift1_inner1); bn->d[BN_NWORDS-1] >>= 1; } void bn_rshift1_2(bignum *bna, bignum *bnb) { #define bn_rshift1_2_inner1(i) \ bna->d[i] = (bna->d[i+1] << 31) | (bna->d[i] >> 1); \ bnb->d[i] = (bnb->d[i+1] << 31) | (bnb->d[i] >> 1); bn_unroll_sl(bn_rshift1_2_inner1); bna->d[BN_NWORDS-1] >>= 1; bnb->d[BN_NWORDS-1] >>= 1; } /* * Unsigned comparison */ int bn_ucmp_ge(bignum *a, bignum *b) { int l = 0, g = 0; #define bn_ucmp_ge_inner1(i) \ if (a->d[i] < b->d[i]) l |= (1 << i); \ if (a->d[i] > b->d[i]) g |= (1 << i); bn_unroll_reverse(bn_ucmp_ge_inner1); return (l > g) ? 0 : 1; } int bn_ucmp_ge_c(bignum *a, __constant bn_word *b) { int l = 0, g = 0; #define bn_ucmp_ge_c_inner1(i) \ if (a->d[i] < b[i]) l |= (1 << i); \ if (a->d[i] > b[i]) g |= (1 << i); bn_unroll_reverse(bn_ucmp_ge_c_inner1); return (l > g) ? 0 : 1; } /* * Negate */ void bn_neg(bignum *n) { int c = 1; #define bn_neg_inner1(i) \ c = (n->d[i] = (~n->d[i]) + c) ? 0 : c; bn_unroll(bn_neg_inner1); } /* * Add/subtract */ #define bn_add_word(r, a, b, t, c) do { \ t = a + b; \ c = (t < a) ? 1 : 0; \ r = t; \ } while (0) #define bn_addc_word(r, a, b, t, c) do { \ t = a + b + c; \ c = (t < a) ? 1 : ((c & (t == a)) ? 1 : 0); \ r = t; \ } while (0) bn_word bn_uadd_words_seq(bn_word *r, bn_word *a, bn_word *b) { bn_word t, c = 0; #define bn_uadd_words_seq_inner1(i) \ bn_addc_word(r[i], a[i], b[i], t, c); bn_add_word(r[0], a[0], b[0], t, c); bn_unroll_sf(bn_uadd_words_seq_inner1); return c; } bn_word bn_uadd_words_c_seq(bn_word *r, bn_word *a, __constant bn_word *b) { bn_word t, c = 0; bn_add_word(r[0], a[0], b[0], t, c); bn_unroll_sf(bn_uadd_words_seq_inner1); return c; } #define bn_sub_word(r, a, b, t, c) do { \ t = a - b; \ c = (a < b) ? 1 : 0; \ r = t; \ } while (0) #define bn_subb_word(r, a, b, t, c) do { \ t = a - (b + c); \ c = (!(a) && c) ? 1 : 0; \ c |= (a < b) ? 1 : 0; \ r = t; \ } while (0) bn_word bn_usub_words_seq(bn_word *r, bn_word *a, bn_word *b) { bn_word t, c = 0; #define bn_usub_words_seq_inner1(i) \ bn_subb_word(r[i], a[i], b[i], t, c); bn_sub_word(r[0], a[0], b[0], t, c); bn_unroll_sf(bn_usub_words_seq_inner1); return c; } bn_word bn_usub_words_c_seq(bn_word *r, bn_word *a, __constant bn_word *b) { bn_word t, c = 0; bn_sub_word(r[0], a[0], b[0], t, c); bn_unroll_sf(bn_usub_words_seq_inner1); return c; } /* * Add/subtract better suited for AMD's VLIW architecture */ bn_word bn_uadd_words_vliw(bn_word *r, bn_word *a, bn_word *b) { bignum x; bn_word c = 0, cp = 0; #define bn_uadd_words_vliw_inner1(i) \ x.d[i] = a[i] + b[i]; #define bn_uadd_words_vliw_inner2(i) \ c |= (a[i] > x.d[i]) ? (1 << i) : 0; \ cp |= (!~x.d[i]) ? (1 << i) : 0; #define bn_uadd_words_vliw_inner3(i) \ r[i] = x.d[i] + ((c >> i) & 1); bn_unroll(bn_uadd_words_vliw_inner1); bn_unroll(bn_uadd_words_vliw_inner2); c = ((cp + (c << 1)) ^ cp); r[0] = x.d[0]; bn_unroll_sf(bn_uadd_words_vliw_inner3); return c >> BN_NWORDS; } bn_word bn_uadd_words_c_vliw(bn_word *r, bn_word *a, __constant bn_word *b) { bignum x; bn_word c = 0, cp = 0; bn_unroll(bn_uadd_words_vliw_inner1); bn_unroll(bn_uadd_words_vliw_inner2); c = ((cp + (c << 1)) ^ cp); r[0] = x.d[0]; bn_unroll_sf(bn_uadd_words_vliw_inner3); return c >> BN_NWORDS; } bn_word bn_usub_words_vliw(bn_word *r, bn_word *a, bn_word *b) { bignum x; bn_word c = 0, cp = 0; #define bn_usub_words_vliw_inner1(i) \ x.d[i] = a[i] - b[i]; #define bn_usub_words_vliw_inner2(i) \ c |= (a[i] < b[i]) ? (1 << i) : 0; \ cp |= (!x.d[i]) ? (1 << i) : 0; #define bn_usub_words_vliw_inner3(i) \ r[i] = x.d[i] - ((c >> i) & 1); bn_unroll(bn_usub_words_vliw_inner1); bn_unroll(bn_usub_words_vliw_inner2); c = ((cp + (c << 1)) ^ cp); r[0] = x.d[0]; bn_unroll_sf(bn_usub_words_vliw_inner3); return c >> BN_NWORDS; } bn_word bn_usub_words_c_vliw(bn_word *r, bn_word *a, __constant bn_word *b) { bignum x; bn_word c = 0, cp = 0; bn_unroll(bn_usub_words_vliw_inner1); bn_unroll(bn_usub_words_vliw_inner2); c = ((cp + (c << 1)) ^ cp); r[0] = x.d[0]; bn_unroll_sf(bn_usub_words_vliw_inner3); return c >> BN_NWORDS; } #if defined(DEEP_VLIW) #define bn_uadd_words bn_uadd_words_vliw #define bn_uadd_words_c bn_uadd_words_c_vliw #define bn_usub_words bn_usub_words_vliw #define bn_usub_words_c bn_usub_words_c_vliw #else #define bn_uadd_words bn_uadd_words_seq #define bn_uadd_words_c bn_uadd_words_c_seq #define bn_usub_words bn_usub_words_seq #define bn_usub_words_c bn_usub_words_c_seq #endif #define bn_uadd(r, a, b) bn_uadd_words((r)->d, (a)->d, (b)->d) #define bn_uadd_c(r, a, b) bn_uadd_words_c((r)->d, (a)->d, b) #define bn_usub(r, a, b) bn_usub_words((r)->d, (a)->d, (b)->d) #define bn_usub_c(r, a, b) bn_usub_words_c((r)->d, (a)->d, b) /* * Modular add/sub */ void bn_mod_add(bignum *r, bignum *a, bignum *b) { if (bn_uadd(r, a, b) || (bn_ucmp_ge_c(r, modulus))) bn_usub_c(r, r, modulus); } void bn_mod_sub(bignum *r, bignum *a, bignum *b) { if (bn_usub(r, a, b)) bn_uadd_c(r, r, modulus); } void bn_mod_lshift1(bignum *bn) { bn_word c = (bn->d[BN_NWORDS-1] & 0x80000000); bn_lshift1(bn); if (c || (bn_ucmp_ge_c(bn, modulus))) bn_usub_c(bn, bn, modulus); } /* * Montgomery multiplication * * This includes normal multiplication of two "Montgomeryized" * bignums, and bn_from_mont for de-Montgomeryizing a bignum. */ #define bn_mul_word(r, a, w, c, p, s) do { \ r = (a * w) + c; \ p = mul_hi(a, w); \ c = (r < c) ? p + 1 : p; \ } while (0) #define bn_mul_add_word(r, a, w, c, p, s) do { \ s = r + c; \ p = mul_hi(a, w); \ r = (a * w) + s; \ c = (s < c) ? p + 1 : p; \ if (r < s) c++; \ } while (0) void bn_mul_mont(bignum *r, bignum *a, bignum *b) { bignum t; bn_word tea, teb, c, p, s, m; #if !defined(VERY_EXPENSIVE_BRANCHES) int q; #endif c = 0; #define bn_mul_mont_inner1(j) \ bn_mul_word(t.d[j], a->d[j], b->d[0], c, p, s); bn_unroll(bn_mul_mont_inner1); tea = c; teb = 0; c = 0; m = t.d[0] * mont_n0[0]; bn_mul_add_word(t.d[0], modulus[0], m, c, p, s); #define bn_mul_mont_inner2(j) \ bn_mul_add_word(t.d[j], modulus[j], m, c, p, s); \ t.d[j-1] = t.d[j]; bn_unroll_sf(bn_mul_mont_inner2); t.d[BN_NWORDS-1] = tea + c; tea = teb + ((t.d[BN_NWORDS-1] < c) ? 1 : 0); #define bn_mul_mont_inner3_1(i, j) \ bn_mul_add_word(t.d[j], a->d[j], b->d[i], c, p, s); #define bn_mul_mont_inner3_2(i, j) \ bn_mul_add_word(t.d[j], modulus[j], m, c, p, s); \ t.d[j-1] = t.d[j]; #define bn_mul_mont_inner3(i) \ c = 0; \ bn_unroll_arg(bn_mul_mont_inner3_1, i); \ tea += c; \ teb = ((tea < c) ? 1 : 0); \ c = 0; \ m = t.d[0] * mont_n0[0]; \ bn_mul_add_word(t.d[0], modulus[0], m, c, p, s); \ bn_unroll_arg_sf(bn_mul_mont_inner3_2, i); \ t.d[BN_NWORDS-1] = tea + c; \ tea = teb + ((t.d[BN_NWORDS-1] < c) ? 1 : 0); /* * The outer loop here is quite long, and we won't unroll it * unless VERY_EXPENSIVE_BRANCHES is set. */ #if defined(VERY_EXPENSIVE_BRANCHES) bn_unroll_sf(bn_mul_mont_inner3); c = tea | !bn_usub_c(r, &t, modulus); if (!c) *r = t; #else for (q = 1; q < BN_NWORDS; q++) { bn_mul_mont_inner3(q); } c = tea || (t.d[BN_NWORDS-1] >= modulus[BN_NWORDS-1]); if (c) { c = tea | !bn_usub_c(r, &t, modulus); if (c) return; } *r = t; #endif } void bn_from_mont(bignum *rb, bignum *b) { #define WORKSIZE ((2*BN_NWORDS) + 1) bn_word r[WORKSIZE]; bn_word m, c, p, s; #if defined(PRAGMA_UNROLL) int i; #endif /* Copy the input to the working area */ /* Zero the upper words */ #define bn_from_mont_inner1(i) \ r[i] = b->d[i]; #define bn_from_mont_inner2(i) \ r[BN_NWORDS+i] = 0; bn_unroll(bn_from_mont_inner1); bn_unroll(bn_from_mont_inner2); r[WORKSIZE-1] = 0; /* Multiply (long) by modulus */ #define bn_from_mont_inner3_1(i, j) \ bn_mul_add_word(r[i+j], modulus[j], m, c, p, s); #if !defined(VERY_EXPENSIVE_BRANCHES) #define bn_from_mont_inner3_2(i) \ if (r[BN_NWORDS + i] < c) \ r[BN_NWORDS + i + 1] += 1; #else #define bn_from_mont_inner3_2(i) \ r[BN_NWORDS + i + 1] += (r[BN_NWORDS + i] < c) ? 1 : 0; #endif #define bn_from_mont_inner3(i) \ m = r[i] * mont_n0[0]; \ c = 0; \ bn_unroll_arg(bn_from_mont_inner3_1, i); \ r[BN_NWORDS + i] += c; \ bn_from_mont_inner3_2(i) /* * The outer loop here is not very long, so we will unroll * it by default. However, it's just complicated enough to * cause NVIDIA's compiler to take unreasonably long to compile * it, unless we use pragma unroll. */ #if !defined(PRAGMA_UNROLL) bn_iter(bn_from_mont_inner3); #else #pragma unroll 8 for (i = 0; i < BN_NWORDS; i++) { bn_from_mont_inner3(i) } #endif /* * Make sure the result is less than the modulus. * Subtracting is not much more expensive than compare, so * subtract always and assign based on the carry out value. */ c = bn_usub_words_c(rb->d, &r[BN_NWORDS], modulus); if (c) { #define bn_from_mont_inner4(i) \ rb->d[i] = r[BN_NWORDS + i]; bn_unroll(bn_from_mont_inner4); } } /* * Modular inversion */ void bn_mod_inverse(bignum *r, bignum *n) { bignum a, b, x, y; int shift; bn_word xc, yc; for (shift = 0; shift < BN_NWORDS; shift++) { a.d[shift] = modulus[shift]; x.d[shift] = 0; y.d[shift] = 0; } b = *n; x.d[0] = 1; xc = 0; yc = 0; while (!bn_is_zero(b)) { shift = 0; while (!bn_is_odd(b)) { if (bn_is_odd(x)) xc += bn_uadd_c(&x, &x, modulus); bn_rshift1_2(&x, &b); x.d[7] |= (xc << 31); xc >>= 1; } while (!bn_is_odd(a)) { if (bn_is_odd(y)) yc += bn_uadd_c(&y, &y, modulus); bn_rshift1_2(&y, &a); y.d[7] |= (yc << 31); yc >>= 1; } if (bn_ucmp_ge(&b, &a)) { xc += yc + bn_uadd(&x, &x, &y); bn_usub(&b, &b, &a); } else { yc += xc + bn_uadd(&y, &y, &x); bn_usub(&a, &a, &b); } } if (!bn_is_one(a)) { /* no modular inverse */ *r = bn_zero; } else { /* Compute y % m as cheaply as possible */ while (yc < 0x80000000) yc -= bn_usub_c(&y, &y, modulus); bn_neg(&y); *r = y; } } /* * HASH FUNCTIONS * * BYTE ORDER NOTE: None of the hash functions below deal with byte * order. The caller is expected to be aware of this when it stuffs * data into in the native integer. * * NOTE #2: Endianness of the OpenCL device makes no difference here. */ #define hash256_unroll(a) unroll_8(a) #define hash160_unroll(a) unroll_5(a) #define hash256_iter(a) iter_8(a) #define hash160_iter(a) iter_5(a) /* * SHA-2 256 * * CAUTION: Input buffer will be overwritten/mangled. * Data expected in big-endian format. * This implementation is designed for space efficiency more than * raw speed. */ __constant uint sha2_init[8] = { 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 }; __constant uint sha2_k[64] = { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 }; void sha2_256_init(uint *out) { #define sha2_256_init_inner_1(i) \ out[i] = sha2_init[i]; hash256_unroll(sha2_256_init_inner_1); } /* The state variable remapping is really contorted */ #define sha2_stvar(vals, i, v) vals[(64+v-i) % 8] #define sha2_s0(a) (rotate(a, 30U) ^ rotate(a, 19U) ^ rotate(a, 10U)) #define sha2_s1(a) (rotate(a, 26U) ^ rotate(a, 21U) ^ rotate(a, 7U)) #if defined(AMD_BFI_INT) #pragma OPENCL EXTENSION cl_amd_media_ops : enable #define sha2_ch(a, b, c) amd_bytealign(a, b, c) #define sha2_ma(a, b, c) amd_bytealign((a^c), b, a) #else #define sha2_ch(a, b, c) (c ^ (a & (b ^ c))) #define sha2_ma(a, b, c) ((a & c) | (b & (a | c))) #endif void sha2_256_block(uint *out, uint *in) { uint state[8], t1, t2; #if defined(PRAGMA_UNROLL) int i; #endif #define sha2_256_block_inner_1(i) \ state[i] = out[i]; hash256_unroll(sha2_256_block_inner_1); #define sha2_256_block_inner_2(i) \ if (i >= 16) { \ t1 = in[(i + 1) % 16]; \ t2 = in[(i + 14) % 16]; \ in[i % 16] += (in[(i + 9) % 16] + \ (rotate(t1, 25U) ^ rotate(t1, 14U) ^ (t1 >> 3)) + \ (rotate(t2, 15U) ^ rotate(t2, 13U) ^ (t2 >> 10))); \ } \ t1 = (sha2_stvar(state, i, 7) + \ sha2_s1(sha2_stvar(state, i, 4)) + \ sha2_ch(sha2_stvar(state, i, 4), \ sha2_stvar(state, i, 5), \ sha2_stvar(state, i, 6)) + \ sha2_k[i] + \ in[i % 16]); \ t2 = (sha2_s0(sha2_stvar(state, i, 0)) + \ sha2_ma(sha2_stvar(state, i, 0), \ sha2_stvar(state, i, 1), \ sha2_stvar(state, i, 2))); \ sha2_stvar(state, i, 3) += t1; \ sha2_stvar(state, i, 7) = t1 + t2; \ #if !defined(PRAGMA_UNROLL) iter_64(sha2_256_block_inner_2); #else #pragma unroll 64 for (i = 0; i < 64; i++) { sha2_256_block_inner_2(i) } #endif #define sha2_256_block_inner_3(i) \ out[i] += state[i]; hash256_unroll(sha2_256_block_inner_3); } /* * RIPEMD160 * * Data expected in little-endian format. */ __constant uint ripemd160_iv[] = { 0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0 }; __constant uint ripemd160_k[] = { 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E }; __constant uint ripemd160_kp[] = { 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000 }; __constant uchar ripemd160_ws[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13, }; __constant uchar ripemd160_wsp[] = { 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11 }; __constant uchar ripemd160_rl[] = { 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6, }; __constant uchar ripemd160_rlp[] = { 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 }; #define ripemd160_val(v, i, n) (v)[(80+(n)-(i)) % 5] #define ripemd160_valp(v, i, n) (v)[5 + ((80+(n)-(i)) % 5)] #if defined(AMD_BFI_INT) #define ripemd160_f0(x, y, z) (x ^ y ^ z) #define ripemd160_f1(x, y, z) amd_bytealign(x, y, z) #define ripemd160_f2(x, y, z) (z ^ (x | ~y)) #define ripemd160_f3(x, y, z) amd_bytealign(z, x, y) #define ripemd160_f4(x, y, z) (x ^ (y | ~z)) #else #define ripemd160_f0(x, y, z) (x ^ y ^ z) #define ripemd160_f1(x, y, z) ((x & y) | (~x & z)) #define ripemd160_f2(x, y, z) (z ^ (x | ~y)) #define ripemd160_f3(x, y, z) ((x & z) | (y & ~z)) #define ripemd160_f4(x, y, z) (x ^ (y | ~z)) #endif #define ripemd160_round(i, in, vals, f, fp, t) do { \ ripemd160_val(vals, i, 0) = \ rotate(ripemd160_val(vals, i, 0) + \ f(ripemd160_val(vals, i, 1), \ ripemd160_val(vals, i, 2), \ ripemd160_val(vals, i, 3)) + \ in[ripemd160_ws[i]] + \ ripemd160_k[i / 16], \ (uint)ripemd160_rl[i]) + \ ripemd160_val(vals, i, 4); \ ripemd160_val(vals, i, 2) = \ rotate(ripemd160_val(vals, i, 2), 10U); \ ripemd160_valp(vals, i, 0) = \ rotate(ripemd160_valp(vals, i, 0) + \ fp(ripemd160_valp(vals, i, 1), \ ripemd160_valp(vals, i, 2), \ ripemd160_valp(vals, i, 3)) + \ in[ripemd160_wsp[i]] + \ ripemd160_kp[i / 16], \ (uint)ripemd160_rlp[i]) + \ ripemd160_valp(vals, i, 4); \ ripemd160_valp(vals, i, 2) = \ rotate(ripemd160_valp(vals, i, 2), 10U); \ } while (0) void ripemd160_init(uint *out) { #define ripemd160_init_inner_1(i) \ out[i] = ripemd160_iv[i]; hash160_unroll(ripemd160_init_inner_1); } void ripemd160_block(uint *out, uint *in) { uint vals[10], t; #if defined(PRAGMA_UNROLL) int i; #endif #define ripemd160_block_inner_1(i) \ vals[i] = vals[i + 5] = out[i]; hash160_unroll(ripemd160_block_inner_1); #define ripemd160_block_inner_p0(i) \ ripemd160_round(i, in, vals, \ ripemd160_f0, ripemd160_f4, t); #define ripemd160_block_inner_p1(i) \ ripemd160_round((16 + i), in, vals, \ ripemd160_f1, ripemd160_f3, t); #define ripemd160_block_inner_p2(i) \ ripemd160_round((32 + i), in, vals, \ ripemd160_f2, ripemd160_f2, t); #define ripemd160_block_inner_p3(i) \ ripemd160_round((48 + i), in, vals, \ ripemd160_f3, ripemd160_f1, t); #define ripemd160_block_inner_p4(i) \ ripemd160_round((64 + i), in, vals, \ ripemd160_f4, ripemd160_f0, t); #if !defined(PRAGMA_UNROLL) iter_16(ripemd160_block_inner_p0); iter_16(ripemd160_block_inner_p1); iter_16(ripemd160_block_inner_p2); iter_16(ripemd160_block_inner_p3); iter_16(ripemd160_block_inner_p4); #else #pragma unroll 16 for (i = 0; i < 16; i++) { ripemd160_block_inner_p0(i); } #pragma unroll 16 for (i = 0; i < 16; i++) { ripemd160_block_inner_p1(i); } #pragma unroll 16 for (i = 0; i < 16; i++) { ripemd160_block_inner_p2(i); } #pragma unroll 16 for (i = 0; i < 16; i++) { ripemd160_block_inner_p3(i); } #pragma unroll 16 for (i = 0; i < 16; i++) { ripemd160_block_inner_p4(i); } #endif t = out[1] + vals[2] + vals[8]; out[1] = out[2] + vals[3] + vals[9]; out[2] = out[3] + vals[4] + vals[5]; out[3] = out[4] + vals[0] + vals[6]; out[4] = out[0] + vals[1] + vals[7]; out[0] = t; } #ifdef TEST_KERNELS /* * Test kernels */ /* Montgomery multiplication test kernel */ __kernel void test_mul_mont(__global bignum *products_out, __global bignum *nums_in) { bignum a, b, c; int o; o = get_global_id(0); nums_in += (2*o); a = nums_in[0]; b = nums_in[1]; bn_mul_mont(&c, &a, &b); products_out[o] = c; } /* modular inversion test kernel */ __kernel void test_mod_inverse(__global bignum *inv_out, __global bignum *nums_in, int count) { bignum x, xp; int i, o; o = get_global_id(0) * count; for (i = 0; i < count; i++) { x = nums_in[o]; bn_mod_inverse(&xp, &x); inv_out[o++] = xp; } } #endif /* TEST_KERNELS */ #define ACCESS_BUNDLE 1024 #define ACCESS_STRIDE (ACCESS_BUNDLE/BN_NWORDS) __kernel void ec_add_grid(__global bn_word *points_out, __global bn_word *z_heap, __global bn_word *row_in, __global bignum *col_in) { bignum rx, ry; bignum x1, y1, a, b, c, d, e, z; bn_word cy; int i, cell, start; /* Load the row increment point */ i = 2 * get_global_id(1); rx = col_in[i]; ry = col_in[i+1]; cell = get_global_id(0); start = ((((2 * cell) / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % (ACCESS_STRIDE/2))); #define ec_add_grid_inner_1(i) \ x1.d[i] = row_in[start + (i*ACCESS_STRIDE)]; bn_unroll(ec_add_grid_inner_1); start += (ACCESS_STRIDE/2); #define ec_add_grid_inner_2(i) \ y1.d[i] = row_in[start + (i*ACCESS_STRIDE)]; bn_unroll(ec_add_grid_inner_2); bn_mod_sub(&z, &x1, &rx); cell += (get_global_id(1) * get_global_size(0)); start = (((cell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % ACCESS_STRIDE)); #define ec_add_grid_inner_3(i) \ z_heap[start + (i*ACCESS_STRIDE)] = z.d[i]; bn_unroll(ec_add_grid_inner_3); bn_mod_sub(&b, &y1, &ry); bn_mod_add(&c, &x1, &rx); bn_mod_add(&d, &y1, &ry); bn_mul_mont(&y1, &b, &b); bn_mul_mont(&x1, &z, &z); bn_mul_mont(&e, &c, &x1); bn_mod_sub(&y1, &y1, &e); /* * This disgusting code caters to the global memory unit on * various GPUs, by giving it a nice contiguous patch to write * per warp/wavefront. */ start = ((((2 * cell) / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % (ACCESS_STRIDE/2))); #define ec_add_grid_inner_4(i) \ points_out[start + (i*ACCESS_STRIDE)] = y1.d[i]; bn_unroll(ec_add_grid_inner_4); bn_mod_lshift1(&y1); bn_mod_sub(&y1, &e, &y1); bn_mul_mont(&y1, &y1, &b); bn_mul_mont(&a, &x1, &z); bn_mul_mont(&c, &d, &a); bn_mod_sub(&y1, &y1, &c); cy = 0; if (bn_is_odd(y1)) cy = bn_uadd_c(&y1, &y1, modulus); bn_rshift1(&y1); y1.d[BN_NWORDS-1] |= (cy ? 0x80000000 : 0); start += (ACCESS_STRIDE/2); bn_unroll(ec_add_grid_inner_4); } __kernel void heap_invert(__global bn_word *z_heap, int batch) { bignum a, b, c, z; int i, off, lcell, hcell, start; #define heap_invert_inner_load_a(j) \ a.d[j] = z_heap[start + j*ACCESS_STRIDE]; #define heap_invert_inner_load_b(j) \ b.d[j] = z_heap[start + j*ACCESS_STRIDE]; #define heap_invert_inner_load_z(j) \ z.d[j] = z_heap[start + j*ACCESS_STRIDE]; #define heap_invert_inner_store_z(j) \ z_heap[start + j*ACCESS_STRIDE] = z.d[j]; #define heap_invert_inner_store_c(j) \ z_heap[start + j*ACCESS_STRIDE] = c.d[j]; off = get_global_size(0); lcell = get_global_id(0); hcell = (off * batch) + lcell; for (i = 0; i < (batch-1); i++) { start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_a); lcell += off; start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_b); bn_mul_mont(&z, &a, &b); start = (((hcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (hcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_store_z); lcell += off; hcell += off; } /* Invert the root, fix up 1/ZR -> R/Z */ bn_mod_inverse(&z, &z); #define heap_invert_inner_1(i) \ a.d[i] = mont_rr[i]; bn_unroll(heap_invert_inner_1); bn_mul_mont(&z, &z, &a); bn_mul_mont(&z, &z, &a); /* Unroll the first iteration to avoid a load/store on the root */ lcell -= (off << 1); hcell -= (off << 1); start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_a); lcell += off; start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_b); bn_mul_mont(&c, &a, &z); bn_unroll(heap_invert_inner_store_c); bn_mul_mont(&c, &b, &z); lcell -= off; start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_store_c); lcell -= (off << 1); for (i = 0; i < (batch-2); i++) { start = (((hcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (hcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_z); start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_a); lcell += off; start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_b); bn_mul_mont(&c, &a, &z); bn_unroll(heap_invert_inner_store_c); bn_mul_mont(&c, &b, &z); lcell -= off; start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_store_c); lcell -= (off << 1); hcell -= off; } } void hash_ec_point(uint *hash_out, __global bn_word *xy, __global bn_word *zip) { uint hash1[16], hash2[16]; bignum c, zi, zzi; bn_word wh, wl; /* * Multiply the coordinates by the inverted Z values. * Stash the coordinates in the hash buffer. * SHA-2 requires big endian, and our intended hash input * is big-endian, so swapping is unnecessary, but * inserting the format byte in front causes a headache. */ #define hash_ec_point_inner_1(i) \ zi.d[i] = zip[i*ACCESS_STRIDE]; bn_unroll(hash_ec_point_inner_1); bn_mul_mont(&zzi, &zi, &zi); /* 1 / Z^2 */ #define hash_ec_point_inner_2(i) \ c.d[i] = xy[i*ACCESS_STRIDE]; bn_unroll(hash_ec_point_inner_2); bn_mul_mont(&c, &c, &zzi); /* X / Z^2 */ bn_from_mont(&c, &c); wh = 0x00000004; /* POINT_CONVERSION_UNCOMPRESSED */ #define hash_ec_point_inner_3(i) \ wl = wh; \ wh = c.d[(BN_NWORDS - 1) - i]; \ hash1[i] = (wl << 24) | (wh >> 8); bn_unroll(hash_ec_point_inner_3); bn_mul_mont(&zzi, &zzi, &zi); /* 1 / Z^3 */ #define hash_ec_point_inner_4(i) \ c.d[i] = xy[(ACCESS_STRIDE/2) + i*ACCESS_STRIDE]; bn_unroll(hash_ec_point_inner_4); bn_mul_mont(&c, &c, &zzi); /* Y / Z^3 */ bn_from_mont(&c, &c); #define hash_ec_point_inner_5(i) \ wl = wh; \ wh = c.d[(BN_NWORDS - 1) - i]; \ hash1[BN_NWORDS + i] = (wl << 24) | (wh >> 8); bn_unroll(hash_ec_point_inner_5); /* * Hash the first 64 bytes of the buffer */ sha2_256_init(hash2); sha2_256_block(hash2, hash1); /* * Hash the last byte of the buffer + SHA-2 padding */ hash1[0] = wh << 24 | 0x800000; hash1[1] = 0; hash1[2] = 0; hash1[3] = 0; hash1[4] = 0; hash1[5] = 0; hash1[6] = 0; hash1[7] = 0; hash1[8] = 0; hash1[9] = 0; hash1[10] = 0; hash1[11] = 0; hash1[12] = 0; hash1[13] = 0; hash1[14] = 0; hash1[15] = 65 * 8; sha2_256_block(hash2, hash1); /* * Hash the SHA-2 result with RIPEMD160 * Unfortunately, SHA-2 outputs big-endian, but * RIPEMD160 expects little-endian. Need to swap! */ #define hash_ec_point_inner_6(i) \ hash2[i] = bswap32(hash2[i]); hash256_unroll(hash_ec_point_inner_6); hash2[8] = bswap32(0x80000000); hash2[9] = 0; hash2[10] = 0; hash2[11] = 0; hash2[12] = 0; hash2[13] = 0; hash2[14] = 32 * 8; hash2[15] = 0; ripemd160_init(hash_out); ripemd160_block(hash_out, hash2); } __kernel void hash_ec_point_get(__global uint *hashes_out, __global bn_word *points_in, __global bn_word *z_heap) { uint hash[5]; int i, p, cell, start; cell = ((get_global_id(1) * get_global_size(0)) + get_global_id(0)); start = (((cell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % ACCESS_STRIDE)); z_heap += start; start = ((((2 * cell) / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % (ACCESS_STRIDE/2))); points_in += start; /* Complete the coordinates and hash */ hash_ec_point(hash, points_in, z_heap); p = get_global_size(0); i = p * get_global_id(1); hashes_out += 5 * (i + get_global_id(0)); /* Output the hash in proper byte-order */ #define hash_ec_point_get_inner_1(i) \ hashes_out[i] = load_le32(hash[i]); hash160_unroll(hash_ec_point_get_inner_1); } /* * Normally this would be one function that compared two hash160s. * This one compares a hash160 with an upper and lower bound in one * function to work around a problem with AMD's OpenCL compiler. */ int hash160_ucmp_g(uint *a, __global uint *bound) { uint gv; #define hash160_ucmp_g_inner_1(i) \ gv = load_be32(bound[i]); \ if (a[i] < gv) return -1; \ if (a[i] > gv) break; hash160_iter(hash160_ucmp_g_inner_1); #define hash160_ucmp_g_inner_2(i) \ gv = load_be32(bound[5+i]); \ if (a[i] < gv) return 0; \ if (a[i] > gv) return 1; hash160_iter(hash160_ucmp_g_inner_2); return 0; } __kernel void hash_ec_point_search_prefix(__global uint *found, __global bn_word *points_in, __global bn_word *z_heap, __global uint *target_table, int ntargets) { uint hash[5]; int i, high, low, p, cell, start; cell = ((get_global_id(1) * get_global_size(0)) + get_global_id(0)); start = (((cell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % ACCESS_STRIDE)); z_heap += start; start = ((((2 * cell) / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % (ACCESS_STRIDE/2))); points_in += start; /* Complete the coordinates and hash */ hash_ec_point(hash, points_in, z_heap); /* * Unconditionally byteswap the hash result, because: * - The byte-level convention of RIPEMD160 is little-endian * - We are comparing it in big-endian order */ #define hash_ec_point_search_prefix_inner_1(i) \ hash[i] = bswap32(hash[i]); hash160_unroll(hash_ec_point_search_prefix_inner_1); /* Binary-search the target table for the hash we just computed */ for (high = ntargets - 1, low = 0, i = high >> 1; high >= low; i = low + ((high - low) >> 1)) { p = hash160_ucmp_g(hash, &target_table[10*i]); low = (p > 0) ? (i + 1) : low; high = (p < 0) ? (i - 1) : high; if (p == 0) { /* For debugging purposes, write the hash value */ found[0] = ((get_global_id(1) * get_global_size(0)) + get_global_id(0)); found[1] = i; #define hash_ec_point_search_prefix_inner_2(i) \ found[i+2] = load_be32(hash[i]); hash160_unroll(hash_ec_point_search_prefix_inner_2); high = -1; } } } ================================================ FILE: src/main/resources/unused/gpu.cl ================================================ /* * OCLExplorer bitcoin addresses brute-force tool * Copyright (C) 2017 Stanislav V. Tretyakov * * Based on OpenCL script: * Vanitygen, vanity bitcoin address generator * Copyright (C) 2011 * * This file contains an OpenCL kernel for performing certain parts of * the bitcoin address calculation process. */ /* Byte-swapping and endianness */ #define bswap32(v) \ (((v) >> 24) | (((v) >> 8) & 0xff00) | \ (((v) << 8) & 0xff0000) | ((v) << 24)) #if __ENDIAN_LITTLE__ != 1 #define load_le32(v) bswap32(v) #define load_be32(v) (v) #else #define load_le32(v) (v) #define load_be32(v) bswap32(v) #endif /* * Loop unrolling macros * * In most cases, preprocessor unrolling works best. * The exception is NVIDIA's compiler, which seems to take unreasonably * long to compile a loop with a larger iteration count, or a loop with * a body of >50 PTX instructions, with preprocessor unrolling. * However, it does not seem to take as long with pragma unroll, and * produces good output. */ /* Explicit loop unrolling */ #define unroll_5(a) do { a(0) a(1) a(2) a(3) a(4) } while (0) #define unroll_8(a) do { a(0) a(1) a(2) a(3) a(4) a(5) a(6) a(7) } while (0) #define unroll_1_7(a) do { a(1) a(2) a(3) a(4) a(5) a(6) a(7) } while (0) #define unroll_7(a) do { a(0) a(1) a(2) a(3) a(4) a(5) a(6) } while (0) #define unroll_7_0(a) do { a(7) a(6) a(5) a(4) a(3) a(2) a(1) a(0) } while (0) #define unroll_7_1(a) do { a(7) a(6) a(5) a(4) a(3) a(2) a(1) } while (0) #define unroll_16(a) do { \ a(0) a(1) a(2) a(3) a(4) a(5) a(6) a(7) \ a(8) a(9) a(10) a(11) a(12) a(13) a(14) a(15) \ } while (0) #define unroll_64(a) do { \ a(0) a(1) a(2) a(3) a(4) a(5) a(6) a(7) \ a(8) a(9) a(10) a(11) a(12) a(13) a(14) a(15) \ a(16) a(17) a(18) a(19) a(20) a(21) a(22) a(23) \ a(24) a(25) a(26) a(27) a(28) a(29) a(30) a(31) \ a(32) a(33) a(34) a(35) a(36) a(37) a(38) a(39) \ a(40) a(41) a(42) a(43) a(44) a(45) a(46) a(47) \ a(48) a(49) a(50) a(51) a(52) a(53) a(54) a(55) \ a(56) a(57) a(58) a(59) a(60) a(61) a(62) a(63) \ } while (0) /* Conditional loop unrolling */ #if defined(DEEP_PREPROC_UNROLL) #define iter_5(a) unroll_5(a) #define iter_8(a) unroll_8(a) #define iter_16(a) unroll_16(a) #define iter_64(a) unroll_64(a) #else #define iter_5(a) do {int _i; for (_i = 0; _i < 5; _i++) { a(_i) }} while (0) #define iter_8(a) do {int _i; for (_i = 0; _i < 8; _i++) { a(_i) }} while (0) #define iter_16(a) do {int _i; for (_i = 0; _i < 16; _i++) { a(_i) }} while (0) #define iter_64(a) do {int _i; for (_i = 0; _i < 64; _i++) { a(_i) }} while (0) #endif /* * BIGNUM mini-library * This module deals with fixed-size 256-bit bignums. * Where modular arithmetic is performed, the SECP256k1 prime * modulus (below) is assumed. * * Methods include: * - bn_is_zero/bn_is_one/bn_is_odd/bn_is_even/bn_is_bit_set * - bn_rshift[1]/bn_lshift[1] * - bn_neg * - bn_uadd/bn_uadd_p * - bn_usub/bn_usub_p */ typedef uint bn_word; #define BN_NBITS 256 #define BN_WSHIFT 5 #define BN_WBITS (1 << BN_WSHIFT) #define BN_NWORDS ((BN_NBITS/8) / sizeof(bn_word)) #define BN_WORDMAX 0xffffffff #define MODULUS_BYTES \ 0xfffffc2f, 0xfffffffe, 0xffffffff, 0xffffffff, \ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff typedef struct { bn_word d[BN_NWORDS]; } bignum; __constant bn_word modulus[] = { MODULUS_BYTES }; __constant bignum bn_zero = {{0}}; __constant bn_word mont_rr[BN_NWORDS] = { 0xe90a1, 0x7a2, 0x1, 0, }; __constant bn_word mont_n0[2] = { 0xd2253531, 0xd838091d }; #define bn_is_odd(bn) (bn.d[0] & 1) #define bn_is_even(bn) (!bn_is_odd(bn)) #define bn_is_zero(bn) (!bn.d[0] && !bn.d[1] && !bn.d[2] && \ !bn.d[3] && !bn.d[4] && !bn.d[5] && \ !bn.d[6] && !bn.d[7]) #define bn_is_one(bn) ((bn.d[0] == 1) && !bn.d[1] && !bn.d[2] && \ !bn.d[3] && !bn.d[4] && !bn.d[5] && \ !bn.d[6] && !bn.d[7]) #define bn_is_bit_set(bn, n) \ ((((bn_word*)&bn)[n >> BN_WSHIFT]) & (1 << (n & (BN_WBITS-1)))) #define bn_unroll(e) unroll_8(e) #define bn_unroll_sf(e) unroll_1_7(e) #define bn_unroll_sl(e) unroll_7(e) #define bn_unroll_reverse(e) unroll_7_0(e) #define bn_unroll_reverse_sl(e) unroll_7_1(e) #define bn_unroll_arg(e, arg) \ e(arg, 0) e(arg, 1) e(arg, 2) e(arg, 3) \ e(arg, 4) e(arg, 5) e(arg, 6) e(arg, 7) #define bn_unroll_arg_sf(e, arg) \ e(arg, 1) e(arg, 2) e(arg, 3) \ e(arg, 4) e(arg, 5) e(arg, 6) e(arg, 7) #define bn_iter(e) iter_8(e) /* * Bitwise shift */ void bn_lshift1(bignum *bn) { #define bn_lshift1_inner1(i) \ bn->d[i] = (bn->d[i] << 1) | (bn->d[i-1] >> 31); bn_unroll_reverse_sl(bn_lshift1_inner1); bn->d[0] <<= 1; } void bn_rshift(bignum *bn, int shift) { int wd, iws, iwr; bn_word ihw, ilw; iws = (shift & (BN_WBITS-1)); iwr = BN_WBITS - iws; wd = (shift >> BN_WSHIFT); ihw = (wd < BN_WBITS) ? bn->d[wd] : 0; #define bn_rshift_inner1(i) \ wd++; \ ilw = ihw; \ ihw = (wd < BN_WBITS) ? bn->d[wd] : 0; \ bn->d[i] = (ilw >> iws) | (ihw << iwr); bn_unroll_sl(bn_rshift_inner1); bn->d[BN_NWORDS-1] = (ihw >> iws); } void bn_rshift1(bignum *bn) { #define bn_rshift1_inner1(i) \ bn->d[i] = (bn->d[i+1] << 31) | (bn->d[i] >> 1); bn_unroll_sl(bn_rshift1_inner1); bn->d[BN_NWORDS-1] >>= 1; } void bn_rshift1_2(bignum *bna, bignum *bnb) { #define bn_rshift1_2_inner1(i) \ bna->d[i] = (bna->d[i+1] << 31) | (bna->d[i] >> 1); \ bnb->d[i] = (bnb->d[i+1] << 31) | (bnb->d[i] >> 1); bn_unroll_sl(bn_rshift1_2_inner1); bna->d[BN_NWORDS-1] >>= 1; bnb->d[BN_NWORDS-1] >>= 1; } /* * Unsigned comparison */ int bn_ucmp_ge(bignum *a, bignum *b) { int l = 0, g = 0; #define bn_ucmp_ge_inner1(i) \ if (a->d[i] < b->d[i]) l |= (1 << i); \ if (a->d[i] > b->d[i]) g |= (1 << i); bn_unroll_reverse(bn_ucmp_ge_inner1); return (l > g) ? 0 : 1; } int bn_ucmp_ge_c(bignum *a, __constant bn_word *b) { int l = 0, g = 0; #define bn_ucmp_ge_c_inner1(i) \ if (a->d[i] < b[i]) l |= (1 << i); \ if (a->d[i] > b[i]) g |= (1 << i); bn_unroll_reverse(bn_ucmp_ge_c_inner1); return (l > g) ? 0 : 1; } /* * Negate */ void bn_neg(bignum *n) { int c = 1; #define bn_neg_inner1(i) \ c = (n->d[i] = (~n->d[i]) + c) ? 0 : c; bn_unroll(bn_neg_inner1); } /* * Add/subtract */ #define bn_add_word(r, a, b, t, c) do { \ t = a + b; \ c = (t < a) ? 1 : 0; \ r = t; \ } while (0) #define bn_addc_word(r, a, b, t, c) do { \ t = a + b + c; \ c = (t < a) ? 1 : ((c & (t == a)) ? 1 : 0); \ r = t; \ } while (0) bn_word bn_uadd_words_seq(bn_word *r, bn_word *a, bn_word *b) { bn_word t, c = 0; #define bn_uadd_words_seq_inner1(i) \ bn_addc_word(r[i], a[i], b[i], t, c); bn_add_word(r[0], a[0], b[0], t, c); bn_unroll_sf(bn_uadd_words_seq_inner1); return c; } bn_word bn_uadd_words_c_seq(bn_word *r, bn_word *a, __constant bn_word *b) { bn_word t, c = 0; bn_add_word(r[0], a[0], b[0], t, c); bn_unroll_sf(bn_uadd_words_seq_inner1); return c; } #define bn_sub_word(r, a, b, t, c) do { \ t = a - b; \ c = (a < b) ? 1 : 0; \ r = t; \ } while (0) #define bn_subb_word(r, a, b, t, c) do { \ t = a - (b + c); \ c = (!(a) && c) ? 1 : 0; \ c |= (a < b) ? 1 : 0; \ r = t; \ } while (0) bn_word bn_usub_words_seq(bn_word *r, bn_word *a, bn_word *b) { bn_word t, c = 0; #define bn_usub_words_seq_inner1(i) \ bn_subb_word(r[i], a[i], b[i], t, c); bn_sub_word(r[0], a[0], b[0], t, c); bn_unroll_sf(bn_usub_words_seq_inner1); return c; } bn_word bn_usub_words_c_seq(bn_word *r, bn_word *a, __constant bn_word *b) { bn_word t, c = 0; bn_sub_word(r[0], a[0], b[0], t, c); bn_unroll_sf(bn_usub_words_seq_inner1); return c; } /* * Add/subtract better suited for AMD's VLIW architecture */ bn_word bn_uadd_words_vliw(bn_word *r, bn_word *a, bn_word *b) { bignum x; bn_word c = 0, cp = 0; #define bn_uadd_words_vliw_inner1(i) \ x.d[i] = a[i] + b[i]; #define bn_uadd_words_vliw_inner2(i) \ c |= (a[i] > x.d[i]) ? (1 << i) : 0; \ cp |= (!~x.d[i]) ? (1 << i) : 0; #define bn_uadd_words_vliw_inner3(i) \ r[i] = x.d[i] + ((c >> i) & 1); bn_unroll(bn_uadd_words_vliw_inner1); bn_unroll(bn_uadd_words_vliw_inner2); c = ((cp + (c << 1)) ^ cp); r[0] = x.d[0]; bn_unroll_sf(bn_uadd_words_vliw_inner3); return c >> BN_NWORDS; } bn_word bn_uadd_words_c_vliw(bn_word *r, bn_word *a, __constant bn_word *b) { bignum x; bn_word c = 0, cp = 0; bn_unroll(bn_uadd_words_vliw_inner1); bn_unroll(bn_uadd_words_vliw_inner2); c = ((cp + (c << 1)) ^ cp); r[0] = x.d[0]; bn_unroll_sf(bn_uadd_words_vliw_inner3); return c >> BN_NWORDS; } bn_word bn_usub_words_vliw(bn_word *r, bn_word *a, bn_word *b) { bignum x; bn_word c = 0, cp = 0; #define bn_usub_words_vliw_inner1(i) \ x.d[i] = a[i] - b[i]; #define bn_usub_words_vliw_inner2(i) \ c |= (a[i] < b[i]) ? (1 << i) : 0; \ cp |= (!x.d[i]) ? (1 << i) : 0; #define bn_usub_words_vliw_inner3(i) \ r[i] = x.d[i] - ((c >> i) & 1); bn_unroll(bn_usub_words_vliw_inner1); bn_unroll(bn_usub_words_vliw_inner2); c = ((cp + (c << 1)) ^ cp); r[0] = x.d[0]; bn_unroll_sf(bn_usub_words_vliw_inner3); return c >> BN_NWORDS; } bn_word bn_usub_words_c_vliw(bn_word *r, bn_word *a, __constant bn_word *b) { bignum x; bn_word c = 0, cp = 0; bn_unroll(bn_usub_words_vliw_inner1); bn_unroll(bn_usub_words_vliw_inner2); c = ((cp + (c << 1)) ^ cp); r[0] = x.d[0]; bn_unroll_sf(bn_usub_words_vliw_inner3); return c >> BN_NWORDS; } #if defined(DEEP_VLIW) #define bn_uadd_words bn_uadd_words_vliw #define bn_uadd_words_c bn_uadd_words_c_vliw #define bn_usub_words bn_usub_words_vliw #define bn_usub_words_c bn_usub_words_c_vliw #else #define bn_uadd_words bn_uadd_words_seq #define bn_uadd_words_c bn_uadd_words_c_seq #define bn_usub_words bn_usub_words_seq #define bn_usub_words_c bn_usub_words_c_seq #endif #define bn_uadd(r, a, b) bn_uadd_words((r)->d, (a)->d, (b)->d) #define bn_uadd_c(r, a, b) bn_uadd_words_c((r)->d, (a)->d, b) #define bn_usub(r, a, b) bn_usub_words((r)->d, (a)->d, (b)->d) #define bn_usub_c(r, a, b) bn_usub_words_c((r)->d, (a)->d, b) /* * Modular add/sub */ void bn_mod_add(bignum *r, bignum *a, bignum *b) { if (bn_uadd(r, a, b) || (bn_ucmp_ge_c(r, modulus))) bn_usub_c(r, r, modulus); } void bn_mod_sub(bignum *r, bignum *a, bignum *b) { if (bn_usub(r, a, b)) bn_uadd_c(r, r, modulus); } void bn_mod_lshift1(bignum *bn) { bn_word c = (bn->d[BN_NWORDS-1] & 0x80000000); bn_lshift1(bn); if (c || (bn_ucmp_ge_c(bn, modulus))) bn_usub_c(bn, bn, modulus); } /* * Montgomery multiplication * * This includes normal multiplication of two "Montgomeryized" * bignums, and bn_from_mont for de-Montgomeryizing a bignum. */ #define bn_mul_word(r, a, w, c, p, s) do { \ r = (a * w) + c; \ p = mul_hi(a, w); \ c = (r < c) ? p + 1 : p; \ } while (0) #define bn_mul_add_word(r, a, w, c, p, s) do { \ s = r + c; \ p = mul_hi(a, w); \ r = (a * w) + s; \ c = (s < c) ? p + 1 : p; \ if (r < s) c++; \ } while (0) void bn_mul_mont(bignum *r, bignum *a, bignum *b) { bignum t; bn_word tea, teb, c, p, s, m; #if !defined(VERY_EXPENSIVE_BRANCHES) int q; #endif c = 0; #define bn_mul_mont_inner1(j) \ bn_mul_word(t.d[j], a->d[j], b->d[0], c, p, s); bn_unroll(bn_mul_mont_inner1); tea = c; teb = 0; c = 0; m = t.d[0] * mont_n0[0]; bn_mul_add_word(t.d[0], modulus[0], m, c, p, s); #define bn_mul_mont_inner2(j) \ bn_mul_add_word(t.d[j], modulus[j], m, c, p, s); \ t.d[j-1] = t.d[j]; bn_unroll_sf(bn_mul_mont_inner2); t.d[BN_NWORDS-1] = tea + c; tea = teb + ((t.d[BN_NWORDS-1] < c) ? 1 : 0); #define bn_mul_mont_inner3_1(i, j) \ bn_mul_add_word(t.d[j], a->d[j], b->d[i], c, p, s); #define bn_mul_mont_inner3_2(i, j) \ bn_mul_add_word(t.d[j], modulus[j], m, c, p, s); \ t.d[j-1] = t.d[j]; #define bn_mul_mont_inner3(i) \ c = 0; \ bn_unroll_arg(bn_mul_mont_inner3_1, i); \ tea += c; \ teb = ((tea < c) ? 1 : 0); \ c = 0; \ m = t.d[0] * mont_n0[0]; \ bn_mul_add_word(t.d[0], modulus[0], m, c, p, s); \ bn_unroll_arg_sf(bn_mul_mont_inner3_2, i); \ t.d[BN_NWORDS-1] = tea + c; \ tea = teb + ((t.d[BN_NWORDS-1] < c) ? 1 : 0); /* * The outer loop here is quite long, and we won't unroll it * unless VERY_EXPENSIVE_BRANCHES is set. */ #if defined(VERY_EXPENSIVE_BRANCHES) bn_unroll_sf(bn_mul_mont_inner3); c = tea | !bn_usub_c(r, &t, modulus); if (!c) *r = t; #else for (q = 1; q < BN_NWORDS; q++) { bn_mul_mont_inner3(q); } c = tea || (t.d[BN_NWORDS-1] >= modulus[BN_NWORDS-1]); if (c) { c = tea | !bn_usub_c(r, &t, modulus); if (c) return; } *r = t; #endif } void bn_from_mont(bignum *rb, bignum *b) { #define WORKSIZE ((2*BN_NWORDS) + 1) bn_word r[WORKSIZE]; bn_word m, c, p, s; #if defined(PRAGMA_UNROLL) int i; #endif /* Copy the input to the working area */ /* Zero the upper words */ #define bn_from_mont_inner1(i) \ r[i] = b->d[i]; #define bn_from_mont_inner2(i) \ r[BN_NWORDS+i] = 0; bn_unroll(bn_from_mont_inner1); bn_unroll(bn_from_mont_inner2); r[WORKSIZE-1] = 0; /* Multiply (long) by modulus */ #define bn_from_mont_inner3_1(i, j) \ bn_mul_add_word(r[i+j], modulus[j], m, c, p, s); #if !defined(VERY_EXPENSIVE_BRANCHES) #define bn_from_mont_inner3_2(i) \ if (r[BN_NWORDS + i] < c) \ r[BN_NWORDS + i + 1] += 1; #else #define bn_from_mont_inner3_2(i) \ r[BN_NWORDS + i + 1] += (r[BN_NWORDS + i] < c) ? 1 : 0; #endif #define bn_from_mont_inner3(i) \ m = r[i] * mont_n0[0]; \ c = 0; \ bn_unroll_arg(bn_from_mont_inner3_1, i); \ r[BN_NWORDS + i] += c; \ bn_from_mont_inner3_2(i) /* * The outer loop here is not very long, so we will unroll * it by default. However, it's just complicated enough to * cause NVIDIA's compiler to take unreasonably long to compile * it, unless we use pragma unroll. */ #if !defined(PRAGMA_UNROLL) bn_iter(bn_from_mont_inner3); #else #pragma unroll 8 for (i = 0; i < BN_NWORDS; i++) { bn_from_mont_inner3(i) } #endif /* * Make sure the result is less than the modulus. * Subtracting is not much more expensive than compare, so * subtract always and assign based on the carry out value. */ c = bn_usub_words_c(rb->d, &r[BN_NWORDS], modulus); if (c) { #define bn_from_mont_inner4(i) \ rb->d[i] = r[BN_NWORDS + i]; bn_unroll(bn_from_mont_inner4); } } /* * Modular inversion */ void bn_mod_inverse(bignum *r, bignum *n) { bignum a, b, x, y; int shift; bn_word xc, yc; for (shift = 0; shift < BN_NWORDS; shift++) { a.d[shift] = modulus[shift]; x.d[shift] = 0; y.d[shift] = 0; } b = *n; x.d[0] = 1; xc = 0; yc = 0; while (!bn_is_zero(b)) { shift = 0; while (!bn_is_odd(b)) { if (bn_is_odd(x)) xc += bn_uadd_c(&x, &x, modulus); bn_rshift1_2(&x, &b); x.d[7] |= (xc << 31); xc >>= 1; } while (!bn_is_odd(a)) { if (bn_is_odd(y)) yc += bn_uadd_c(&y, &y, modulus); bn_rshift1_2(&y, &a); y.d[7] |= (yc << 31); yc >>= 1; } if (bn_ucmp_ge(&b, &a)) { xc += yc + bn_uadd(&x, &x, &y); bn_usub(&b, &b, &a); } else { yc += xc + bn_uadd(&y, &y, &x); bn_usub(&a, &a, &b); } } if (!bn_is_one(a)) { /* no modular inverse */ *r = bn_zero; } else { /* Compute y % m as cheaply as possible */ while (yc < 0x80000000) yc -= bn_usub_c(&y, &y, modulus); bn_neg(&y); *r = y; } } /* * HASH FUNCTIONS * * BYTE ORDER NOTE: None of the hash functions below deal with byte * order. The caller is expected to be aware of this when it stuffs * data into in the native integer. * * NOTE #2: Endianness of the OpenCL device makes no difference here. */ #define hash256_unroll(a) unroll_8(a) #define hash160_unroll(a) unroll_5(a) #define hash256_iter(a) iter_8(a) #define hash160_iter(a) iter_5(a) /* * SHA-2 256 * * CAUTION: Input buffer will be overwritten/mangled. * Data expected in big-endian format. * This implementation is designed for space efficiency more than * raw speed. */ __constant uint sha2_init[8] = { 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 }; __constant uint sha2_k[64] = { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 }; void sha2_256_init(uint *out) { #define sha2_256_init_inner_1(i) \ out[i] = sha2_init[i]; hash256_unroll(sha2_256_init_inner_1); } /* The state variable remapping is really contorted */ #define sha2_stvar(vals, i, v) vals[(64+v-i) % 8] #define sha2_s0(a) (rotate(a, 30U) ^ rotate(a, 19U) ^ rotate(a, 10U)) #define sha2_s1(a) (rotate(a, 26U) ^ rotate(a, 21U) ^ rotate(a, 7U)) #if defined(AMD_BFI_INT) #pragma OPENCL EXTENSION cl_amd_media_ops : enable #define sha2_ch(a, b, c) amd_bytealign(a, b, c) #define sha2_ma(a, b, c) amd_bytealign((a^c), b, a) #else #define sha2_ch(a, b, c) (c ^ (a & (b ^ c))) #define sha2_ma(a, b, c) ((a & c) | (b & (a | c))) #endif void sha2_256_block(uint *out, uint *in) { uint state[8], t1, t2; #if defined(PRAGMA_UNROLL) int i; #endif #define sha2_256_block_inner_1(i) \ state[i] = out[i]; hash256_unroll(sha2_256_block_inner_1); #define sha2_256_block_inner_2(i) \ if (i >= 16) { \ t1 = in[(i + 1) % 16]; \ t2 = in[(i + 14) % 16]; \ in[i % 16] += (in[(i + 9) % 16] + \ (rotate(t1, 25U) ^ rotate(t1, 14U) ^ (t1 >> 3)) + \ (rotate(t2, 15U) ^ rotate(t2, 13U) ^ (t2 >> 10))); \ } \ t1 = (sha2_stvar(state, i, 7) + \ sha2_s1(sha2_stvar(state, i, 4)) + \ sha2_ch(sha2_stvar(state, i, 4), \ sha2_stvar(state, i, 5), \ sha2_stvar(state, i, 6)) + \ sha2_k[i] + \ in[i % 16]); \ t2 = (sha2_s0(sha2_stvar(state, i, 0)) + \ sha2_ma(sha2_stvar(state, i, 0), \ sha2_stvar(state, i, 1), \ sha2_stvar(state, i, 2))); \ sha2_stvar(state, i, 3) += t1; \ sha2_stvar(state, i, 7) = t1 + t2; \ #if !defined(PRAGMA_UNROLL) iter_64(sha2_256_block_inner_2); #else #pragma unroll 64 for (i = 0; i < 64; i++) { sha2_256_block_inner_2(i) } #endif #define sha2_256_block_inner_3(i) \ out[i] += state[i]; hash256_unroll(sha2_256_block_inner_3); } /* * RIPEMD160 * * Data expected in little-endian format. */ __constant uint ripemd160_iv[] = { 0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0 }; __constant uint ripemd160_k[] = { 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E }; __constant uint ripemd160_kp[] = { 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000 }; __constant uchar ripemd160_ws[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13, }; __constant uchar ripemd160_wsp[] = { 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11 }; __constant uchar ripemd160_rl[] = { 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6, }; __constant uchar ripemd160_rlp[] = { 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 }; #define ripemd160_val(v, i, n) (v)[(80+(n)-(i)) % 5] #define ripemd160_valp(v, i, n) (v)[5 + ((80+(n)-(i)) % 5)] #if defined(AMD_BFI_INT) #define ripemd160_f0(x, y, z) (x ^ y ^ z) #define ripemd160_f1(x, y, z) amd_bytealign(x, y, z) #define ripemd160_f2(x, y, z) (z ^ (x | ~y)) #define ripemd160_f3(x, y, z) amd_bytealign(z, x, y) #define ripemd160_f4(x, y, z) (x ^ (y | ~z)) #else #define ripemd160_f0(x, y, z) (x ^ y ^ z) #define ripemd160_f1(x, y, z) ((x & y) | (~x & z)) #define ripemd160_f2(x, y, z) (z ^ (x | ~y)) #define ripemd160_f3(x, y, z) ((x & z) | (y & ~z)) #define ripemd160_f4(x, y, z) (x ^ (y | ~z)) #endif #define ripemd160_round(i, in, vals, f, fp, t) do { \ ripemd160_val(vals, i, 0) = \ rotate(ripemd160_val(vals, i, 0) + \ f(ripemd160_val(vals, i, 1), \ ripemd160_val(vals, i, 2), \ ripemd160_val(vals, i, 3)) + \ in[ripemd160_ws[i]] + \ ripemd160_k[i / 16], \ (uint)ripemd160_rl[i]) + \ ripemd160_val(vals, i, 4); \ ripemd160_val(vals, i, 2) = \ rotate(ripemd160_val(vals, i, 2), 10U); \ ripemd160_valp(vals, i, 0) = \ rotate(ripemd160_valp(vals, i, 0) + \ fp(ripemd160_valp(vals, i, 1), \ ripemd160_valp(vals, i, 2), \ ripemd160_valp(vals, i, 3)) + \ in[ripemd160_wsp[i]] + \ ripemd160_kp[i / 16], \ (uint)ripemd160_rlp[i]) + \ ripemd160_valp(vals, i, 4); \ ripemd160_valp(vals, i, 2) = \ rotate(ripemd160_valp(vals, i, 2), 10U); \ } while (0) void ripemd160_init(uint *out) { #define ripemd160_init_inner_1(i) \ out[i] = ripemd160_iv[i]; hash160_unroll(ripemd160_init_inner_1); } void ripemd160_block(uint *out, uint *in) { uint vals[10], t; #if defined(PRAGMA_UNROLL) int i; #endif #define ripemd160_block_inner_1(i) \ vals[i] = vals[i + 5] = out[i]; hash160_unroll(ripemd160_block_inner_1); #define ripemd160_block_inner_p0(i) \ ripemd160_round(i, in, vals, \ ripemd160_f0, ripemd160_f4, t); #define ripemd160_block_inner_p1(i) \ ripemd160_round((16 + i), in, vals, \ ripemd160_f1, ripemd160_f3, t); #define ripemd160_block_inner_p2(i) \ ripemd160_round((32 + i), in, vals, \ ripemd160_f2, ripemd160_f2, t); #define ripemd160_block_inner_p3(i) \ ripemd160_round((48 + i), in, vals, \ ripemd160_f3, ripemd160_f1, t); #define ripemd160_block_inner_p4(i) \ ripemd160_round((64 + i), in, vals, \ ripemd160_f4, ripemd160_f0, t); #if !defined(PRAGMA_UNROLL) iter_16(ripemd160_block_inner_p0); iter_16(ripemd160_block_inner_p1); iter_16(ripemd160_block_inner_p2); iter_16(ripemd160_block_inner_p3); iter_16(ripemd160_block_inner_p4); #else #pragma unroll 16 for (i = 0; i < 16; i++) { ripemd160_block_inner_p0(i); } #pragma unroll 16 for (i = 0; i < 16; i++) { ripemd160_block_inner_p1(i); } #pragma unroll 16 for (i = 0; i < 16; i++) { ripemd160_block_inner_p2(i); } #pragma unroll 16 for (i = 0; i < 16; i++) { ripemd160_block_inner_p3(i); } #pragma unroll 16 for (i = 0; i < 16; i++) { ripemd160_block_inner_p4(i); } #endif t = out[1] + vals[2] + vals[8]; out[1] = out[2] + vals[3] + vals[9]; out[2] = out[3] + vals[4] + vals[5]; out[3] = out[4] + vals[0] + vals[6]; out[4] = out[0] + vals[1] + vals[7]; out[0] = t; } #define ACCESS_BUNDLE 1024 #define ACCESS_STRIDE (ACCESS_BUNDLE/BN_NWORDS) __kernel void ec_add_grid(__global bn_word *points_out, __global bn_word *z_heap, __global bn_word *row_in, __global bignum *col_in) { bignum rx, ry; bignum x1, y1, a, b, c, d, e, z; bn_word cy; int i, cell, start; /* Load the row increment point */ i = 2 * get_global_id(1); rx = col_in[i]; ry = col_in[i+1]; cell = get_global_id(0); start = ((((2 * cell) / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % (ACCESS_STRIDE/2))); #define ec_add_grid_inner_1(i) \ x1.d[i] = row_in[start + (i*ACCESS_STRIDE)]; bn_unroll(ec_add_grid_inner_1); start += (ACCESS_STRIDE/2); #define ec_add_grid_inner_2(i) \ y1.d[i] = row_in[start + (i*ACCESS_STRIDE)]; bn_unroll(ec_add_grid_inner_2); bn_mod_sub(&z, &x1, &rx); cell += (get_global_id(1) * get_global_size(0)); start = (((cell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % ACCESS_STRIDE)); #define ec_add_grid_inner_3(i) \ z_heap[start + (i*ACCESS_STRIDE)] = z.d[i]; bn_unroll(ec_add_grid_inner_3); bn_mod_sub(&b, &y1, &ry); bn_mod_add(&c, &x1, &rx); bn_mod_add(&d, &y1, &ry); bn_mul_mont(&y1, &b, &b); bn_mul_mont(&x1, &z, &z); bn_mul_mont(&e, &c, &x1); bn_mod_sub(&y1, &y1, &e); /* * This disgusting code caters to the global memory unit on * various GPUs, by giving it a nice contiguous patch to write * per warp/wavefront. */ start = ((((2 * cell) / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % (ACCESS_STRIDE/2))); #define ec_add_grid_inner_4(i) \ points_out[start + (i*ACCESS_STRIDE)] = y1.d[i]; bn_unroll(ec_add_grid_inner_4); bn_mod_lshift1(&y1); bn_mod_sub(&y1, &e, &y1); bn_mul_mont(&y1, &y1, &b); bn_mul_mont(&a, &x1, &z); bn_mul_mont(&c, &d, &a); bn_mod_sub(&y1, &y1, &c); cy = 0; if (bn_is_odd(y1)) cy = bn_uadd_c(&y1, &y1, modulus); bn_rshift1(&y1); y1.d[BN_NWORDS-1] |= (cy ? 0x80000000 : 0); start += (ACCESS_STRIDE/2); bn_unroll(ec_add_grid_inner_4); } __kernel void heap_invert(__global bn_word *z_heap, int batch) { bignum a, b, c, z; int i, off, lcell, hcell, start; #define heap_invert_inner_load_a(j) \ a.d[j] = z_heap[start + j*ACCESS_STRIDE]; #define heap_invert_inner_load_b(j) \ b.d[j] = z_heap[start + j*ACCESS_STRIDE]; #define heap_invert_inner_load_z(j) \ z.d[j] = z_heap[start + j*ACCESS_STRIDE]; #define heap_invert_inner_store_z(j) \ z_heap[start + j*ACCESS_STRIDE] = z.d[j]; #define heap_invert_inner_store_c(j) \ z_heap[start + j*ACCESS_STRIDE] = c.d[j]; off = get_global_size(0); lcell = get_global_id(0); hcell = (off * batch) + lcell; for (i = 0; i < (batch-1); i++) { start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_a); lcell += off; start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_b); bn_mul_mont(&z, &a, &b); start = (((hcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (hcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_store_z); lcell += off; hcell += off; } /* Invert the root, fix up 1/ZR -> R/Z */ bn_mod_inverse(&z, &z); #define heap_invert_inner_1(i) \ a.d[i] = mont_rr[i]; bn_unroll(heap_invert_inner_1); bn_mul_mont(&z, &z, &a); bn_mul_mont(&z, &z, &a); /* Unroll the first iteration to avoid a load/store on the root */ lcell -= (off << 1); hcell -= (off << 1); start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_a); lcell += off; start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_b); bn_mul_mont(&c, &a, &z); bn_unroll(heap_invert_inner_store_c); bn_mul_mont(&c, &b, &z); lcell -= off; start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_store_c); lcell -= (off << 1); for (i = 0; i < (batch-2); i++) { start = (((hcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (hcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_z); start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_a); lcell += off; start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_load_b); bn_mul_mont(&c, &a, &z); bn_unroll(heap_invert_inner_store_c); bn_mul_mont(&c, &b, &z); lcell -= off; start = (((lcell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (lcell % ACCESS_STRIDE)); bn_unroll(heap_invert_inner_store_c); lcell -= (off << 1); hcell -= off; } } void hash_ec_point2(uint *hash_out, bignum *hx, bignum * hy, bn_word wh) { uint hash1[16], hash2[16]; #define hash_ec_point2_inner_1(i) \ hash1[i] = hx->d[i]; \ hash1[BN_NWORDS+i]=hy->d[i]; bn_unroll(hash_ec_point2_inner_1); /* * Hash the first 64 bytes of the buffer */ sha2_256_init(hash2); sha2_256_block(hash2, hash1); /* * Hash the last byte of the buffer + SHA-2 padding */ hash1[0] = wh << 24 | 0x800000; hash1[1] = 0; hash1[2] = 0; hash1[3] = 0; hash1[4] = 0; hash1[5] = 0; hash1[6] = 0; hash1[7] = 0; hash1[8] = 0; hash1[9] = 0; hash1[10] = 0; hash1[11] = 0; hash1[12] = 0; hash1[13] = 0; hash1[14] = 0; hash1[15] = 65 * 8; sha2_256_block(hash2, hash1); /* * Hash the SHA-2 result with RIPEMD160 * Unfortunately, SHA-2 outputs big-endian, but * RIPEMD160 expects little-endian. Need to swap! */ #define hash_ec_point2_inner_2(i) \ hash2[i] = bswap32(hash2[i]); hash256_unroll(hash_ec_point2_inner_2); hash2[8] = bswap32(0x80000000); hash2[9] = 0; hash2[10] = 0; hash2[11] = 0; hash2[12] = 0; hash2[13] = 0; hash2[14] = 32 * 8; hash2[15] = 0; ripemd160_init(hash_out); ripemd160_block(hash_out, hash2); } void hash_ec_point(uint *hash_out, bignum *x, bignum * y){ bignum hx, hy, yn; bn_word wh, wl; wh = 0x00000004; /* POINT_CONVERSION_UNCOMPRESSED */ #define hash_ec_point_inner_x(i) \ wl = wh; \ wh = x->d[(BN_NWORDS - 1) - i]; \ hx.d[i] = (wl << 24) | (wh >> 8); bn_unroll(hash_ec_point_inner_x); #define hash_ec_point_inner_y(i) \ wl = wh; \ wh = y->d[(BN_NWORDS - 1) - i]; \ hy.d[i] = (wl << 24) | (wh >> 8); bn_unroll(hash_ec_point_inner_y); hash_ec_point2(hash_out, &hx, &hy, wh); } void check_hash(__global uint *found, __global uint *tree, uint * hash, uint cell){ hash[0] = load_be32(bswap32(hash[0])); hash[1] = load_be32(bswap32(hash[1])); hash[2] = load_be32(bswap32(hash[2])); hash[3] = load_be32(bswap32(hash[3])); hash[4] = load_be32(bswap32(hash[4])); uint hpos, pos, pos_next; uchar a, b, c; uchar * h = hash; a = h[0]; b = h[1]; c = h[2]; hpos = 1 + (a + b*256 + c*256*256); pos = tree[hpos]; pos_next = pos; while(pos_next>0){ pos = pos_next; pos_next = (tree[pos + 5]); if((hash[0] == tree[pos] && hash[1] == tree[pos+1] && hash[2] == tree[pos+2] && hash[3] == tree[pos+3] && hash[4] == tree[pos+4])){ found[0] = cell; found[1] = pos; found[2] = hpos; found[3] = hash[0]; found[4] = hash[1]; found[5] = hash[2]; found[6] = hash[3]; found[7] = hash[4]; break; } } } __kernel void hash_and_check(__global uint *found, __global bn_word *xy, __global bn_word *z, __global uint *tree) { uint h[5]; int i, cell, start; bignum x,y, zi, zzi; cell = ((get_global_id(1) * get_global_size(0)) + get_global_id(0)); start = (((cell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % ACCESS_STRIDE)); z += start; start = ((((2 * cell) / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % (ACCESS_STRIDE/2))); xy += start; #define processing_inner_z(i) \ zi.d[i] = z[i*ACCESS_STRIDE]; bn_unroll(processing_inner_z); bn_mul_mont(&zzi, &zi, &zi); /* 1 / Z^2 */ #define processing_inner_x(i) \ x.d[i] = xy[i*ACCESS_STRIDE]; bn_unroll(processing_inner_x); bn_mul_mont(&x, &x, &zzi); /* X / Z^2 */ bn_from_mont(&x, &x); bn_mul_mont(&zzi, &zzi, &zi); /* 1 / Z^3 */ #define processing_inner_y(i) \ y.d[i] = xy[(ACCESS_STRIDE/2) + i*ACCESS_STRIDE]; bn_unroll(processing_inner_y); bn_mul_mont(&y, &y, &zzi); /* Y / Z^3 */ bn_from_mont(&y, &y); /* Complete the coordinates and check hash */ hash_ec_point(h, &x, &y); check_hash(found, tree, h, cell); } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/AbstractPlaintextFileTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.ArrayList; import java.util.List; import org.jspecify.annotations.NonNull; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.lmdbjava.LmdbException; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; import static org.mockito.Mockito.mock; public class AbstractPlaintextFileTest { @Rule public TemporaryFolder folder = new TemporaryFolder(); // @Test public void readFile_emptyFile_processLineNeverCalled() throws IOException { // arrange File emptyFile = folder.newFile("empty.txt"); ReadStatistic readStatistic = new ReadStatistic(); RecordingPlaintextFile sut = new RecordingPlaintextFile(emptyFile, readStatistic); // act sut.readFile(); // assert assertThat(sut.processedLines, is(empty())); } @Test public void readFile_singleLine_processLineCalledOnceWithCorrectContent() throws IOException { // arrange File file = folder.newFile("single.txt"); Files.writeString(file.toPath(), "hello world"); ReadStatistic readStatistic = new ReadStatistic(); RecordingPlaintextFile sut = new RecordingPlaintextFile(file, readStatistic); // act sut.readFile(); // assert assertThat(sut.processedLines, hasSize(1)); assertThat(sut.processedLines.get(0), is(equalTo("hello world"))); } @Test public void readFile_multipleLines_processLineCalledForEachLine() throws IOException { // arrange File file = folder.newFile("multi.txt"); Files.writeString(file.toPath(), "line1\nline2\nline3"); ReadStatistic readStatistic = new ReadStatistic(); RecordingPlaintextFile sut = new RecordingPlaintextFile(file, readStatistic); // act sut.readFile(); // assert assertThat(sut.processedLines, hasSize(3)); assertThat(sut.processedLines.get(0), is(equalTo("line1"))); assertThat(sut.processedLines.get(1), is(equalTo("line2"))); assertThat(sut.processedLines.get(2), is(equalTo("line3"))); } @Test public void readFile_processLineThrowsRuntimeException_errorAddedToReadStatistic() throws IOException { // arrange File file = folder.newFile("error.txt"); Files.writeString(file.toPath(), "bad line"); ReadStatistic readStatistic = new ReadStatistic(); ThrowingPlaintextFile sut = new ThrowingPlaintextFile(file, readStatistic, new RuntimeException("parse error")); // act sut.readFile(); // assert assertThat(readStatistic.errors, hasSize(1)); assertThat(readStatistic.errors.get(0), is(equalTo("bad line"))); } @Test(expected = LmdbException.class) public void readFile_processLineThrowsLmdbException_exceptionPropagated() throws IOException { // arrange File file = folder.newFile("lmdb.txt"); Files.writeString(file.toPath(), "some line"); ReadStatistic readStatistic = new ReadStatistic(); LmdbException mockLmdbException = mock(LmdbException.class); ThrowingPlaintextFile sut = new ThrowingPlaintextFile(file, readStatistic, mockLmdbException); // act sut.readFile(); } @Test public void readFile_multipleExceptionLines_allErrorsAddedToReadStatistic() throws IOException { // arrange File file = folder.newFile("multierror.txt"); Files.writeString(file.toPath(), "bad1\nbad2\nbad3"); ReadStatistic readStatistic = new ReadStatistic(); ThrowingPlaintextFile sut = new ThrowingPlaintextFile(file, readStatistic, new RuntimeException("error")); // act sut.readFile(); // assert assertThat(readStatistic.errors, hasSize(3)); } // // @Test public void interrupt_calledBeforeReadFile_readFileProcessesNoLines() throws IOException { // arrange File file = folder.newFile("lines.txt"); Files.writeString(file.toPath(), "line1\nline2\nline3"); ReadStatistic readStatistic = new ReadStatistic(); RecordingPlaintextFile sut = new RecordingPlaintextFile(file, readStatistic); // act sut.interrupt(); sut.readFile(); // assert assertThat(sut.processedLines, is(empty())); } // // @Test public void readFile_singleLineFile_fileProgressIsSetToNonZero() throws IOException { // arrange File file = folder.newFile("progress.txt"); Files.writeString(file.toPath(), "content"); ReadStatistic readStatistic = new ReadStatistic(); RecordingPlaintextFile sut = new RecordingPlaintextFile(file, readStatistic); // act sut.readFile(); // assert assertThat(readStatistic.currentFileProgress > 0.0, is(true)); } @Test public void readFile_fileWithContent_fileProgressReachesHundredPercent() throws IOException { // arrange File file = folder.newFile("full.txt"); Files.writeString(file.toPath(), "line1\nline2"); ReadStatistic readStatistic = new ReadStatistic(); RecordingPlaintextFile sut = new RecordingPlaintextFile(file, readStatistic); // act sut.readFile(); // assert assertThat(readStatistic.currentFileProgress, is(equalTo(100.0))); } // // @Test public void readFile_asciiContent_contentPreserved() throws IOException { // arrange File file = folder.newFile("ascii.txt"); Files.write(file.toPath(), "simple ascii".getBytes(StandardCharsets.ISO_8859_1)); ReadStatistic readStatistic = new ReadStatistic(); RecordingPlaintextFile sut = new RecordingPlaintextFile(file, readStatistic); // act sut.readFile(); // assert assertThat(sut.processedLines, hasSize(1)); assertThat(sut.processedLines.get(0), containsString("simple ascii")); } // /** * Concrete implementation of {@link AbstractPlaintextFile} for testing. Records all processed lines. */ private static class RecordingPlaintextFile extends AbstractPlaintextFile { final List processedLines = new ArrayList<>(); RecordingPlaintextFile(@NonNull File file, @NonNull ReadStatistic readStatistic) { super(file, readStatistic); } @Override protected void processLine(String line) { processedLines.add(line); } } /** * Concrete implementation of {@link AbstractPlaintextFile} for testing. Always throws the provided exception * from {@link #processLine(String)}. */ private static class ThrowingPlaintextFile extends AbstractPlaintextFile { private final RuntimeException exceptionToThrow; ThrowingPlaintextFile(@NonNull File file, @NonNull ReadStatistic readStatistic, RuntimeException exceptionToThrow) { super(file, readStatistic); this.exceptionToThrow = exceptionToThrow; } @Override protected void processLine(String line) { throw exceptionToThrow; } } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/AbstractProducerTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import java.io.IOException; import java.math.BigInteger; import java.util.List; import java.util.Random; import net.ladenthin.bitcoinaddressfinder.configuration.CProducer; import org.apache.commons.codec.DecoderException; import org.apache.commons.codec.binary.Hex; import org.bitcoinj.base.Network; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import org.slf4j.Logger; @RunWith(DataProviderRunner.class) public class AbstractProducerTest { @Rule public TemporaryFolder folder = new TemporaryFolder(); private final Network network = new NetworkParameterFactory().getNetwork(); private final KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); private final BitHelper bitHelper = new BitHelper(); // @Test public void initProducer_configurationGiven_stateInitializedAndLogged() throws IOException, InterruptedException { CProducer cProducer = new CProducer(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); AbstractProducerTestImpl abstractProducerTestImpl = new AbstractProducerTestImpl(cProducer, mockConsumer, keyUtility, mockKeyProducer, bitHelper); verifyInitProducer(abstractProducerTestImpl); } // // @Test public void releaseProducer_configurationGiven_stateInitializedAndLogged() throws IOException, InterruptedException { CProducer cProducer = new CProducer(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); AbstractProducerTestImpl abstractProducerTestImpl = new AbstractProducerTestImpl(cProducer, mockConsumer, keyUtility, mockKeyProducer, bitHelper); verifyReleaseProducer(abstractProducerTestImpl); } // // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_CREATE_SECRET_BASE_LOGGED, location = CommonDataProvider.class) public void createSecretBase_secretGiven_bitsKilledAndLogged(String givenSecret, int batchSizeInBits, String expectedSecretBase, String logInfo0, String logTrace0, String logTrace1, String logTrace2, String logTrace3, String logTrace4) throws IOException, InterruptedException, DecoderException { // arrange CProducer cProducer = new CProducer(); cProducer.batchSizeInBits = batchSizeInBits; MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); AbstractProducerTestImpl abstractProducerTestImpl = new AbstractProducerTestImpl(cProducer, mockConsumer, keyUtility, mockKeyProducer, bitHelper); Logger logger = mock(Logger.class); when(logger.isTraceEnabled()).thenReturn(true); abstractProducerTestImpl.setLogger(logger); BigInteger secret = new BigInteger(1, Hex.decodeHex(givenSecret)); boolean logSecretBase = true; // act BigInteger secretBase = abstractProducerTestImpl.createSecretBase(secret, logSecretBase); // assert assertThat(keyUtility.bigIntegerToFixedLengthHex(secretBase), is(equalTo(expectedSecretBase))); ArgumentCaptor logCaptor = ArgumentCaptor.forClass(String.class); verify(logger, times(1)).info(logCaptor.capture()); verify(logger, times(5)).trace(logCaptor.capture()); List arguments = logCaptor.getAllValues(); // assert log secret base { assertThat(arguments.get(0), is(equalTo(logInfo0))); } // assert log trace { assertThat(arguments.get(1), is(equalTo(logTrace0))); assertThat(arguments.get(2), is(equalTo(logTrace1))); assertThat(arguments.get(3), is(equalTo(logTrace2))); assertThat(arguments.get(4), is(equalTo(logTrace3))); assertThat(arguments.get(5), is(equalTo(logTrace4))); } } @Test public void createSecretBase_secretGivenAndLogSecretBaseDisabledTraceEnabled_bitsKilledAndLogged() throws IOException, InterruptedException, DecoderException { // arrange CProducer cProducer = new CProducer(); cProducer.batchSizeInBits = 2; MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); AbstractProducerTestImpl abstractProducerTestImpl = new AbstractProducerTestImpl(cProducer, mockConsumer, keyUtility, mockKeyProducer, bitHelper); Logger logger = mock(Logger.class); when(logger.isTraceEnabled()).thenReturn(true); abstractProducerTestImpl.setLogger(logger); BigInteger secret = new BigInteger(Hex.decodeHex("ABCDEF")); boolean logSecretBase = false; // act abstractProducerTestImpl.createSecretBase(secret, logSecretBase); ArgumentCaptor logCaptor = ArgumentCaptor.forClass(String.class); // assert // assert log secret base { verify(logger, times(0)).info(logCaptor.capture()); } // assert log trace { verify(logger, times(5)).trace(logCaptor.capture()); } } @Test public void createSecretBase_secretGivenAndLogSecretBaseEnabledTraceDisabled_bitsKilledAndLogged() throws IOException, InterruptedException, DecoderException { // arrange CProducer cProducer = new CProducer(); cProducer.batchSizeInBits = 2; MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); AbstractProducerTestImpl abstractProducerTestImpl = new AbstractProducerTestImpl(cProducer, mockConsumer, keyUtility, mockKeyProducer, bitHelper); Logger logger = mock(Logger.class); when(logger.isTraceEnabled()).thenReturn(false); abstractProducerTestImpl.setLogger(logger); BigInteger secret = new BigInteger(Hex.decodeHex("ABCDEF")); boolean logSecretBase = true; // act abstractProducerTestImpl.createSecretBase(secret, logSecretBase); ArgumentCaptor logCaptor = ArgumentCaptor.forClass(String.class); // assert // assert log secret base { verify(logger, times(1)).info(logCaptor.capture()); } // assert log trace { verify(logger, times(0)).trace(logCaptor.capture()); } } // static void verifyReleaseProducer(AbstractProducer abstractProducer) { Logger logger = mock(Logger.class); when(logger.isTraceEnabled()).thenReturn(true); abstractProducer.setLogger(logger); abstractProducer.initProducer(); // act abstractProducer.releaseProducer(); // assert assertThat(abstractProducer.state, is(equalTo(ProducerState.INITIALIZED))); ArgumentCaptor logCaptor = ArgumentCaptor.forClass(String.class); verify(logger, times(2)).info(logCaptor.capture()); List arguments = logCaptor.getAllValues(); // assert log initProducer { assertThat(arguments.get(1), is(equalTo("Release producer."))); } } static void verifyInitProducer(AbstractProducer abstractProducer) { Logger logger = mock(Logger.class); when(logger.isTraceEnabled()).thenReturn(true); abstractProducer.setLogger(logger); // pre-assert assertThat(abstractProducer.state, is(equalTo(ProducerState.UNINITIALIZED))); // act abstractProducer.initProducer(); // assert assertThat(abstractProducer.state, is(equalTo(ProducerState.INITIALIZED))); ArgumentCaptor logCaptor = ArgumentCaptor.forClass(String.class); verify(logger, times(1)).info(logCaptor.capture()); List arguments = logCaptor.getAllValues(); // assert log initProducer { assertThat(arguments.get(0), is(equalTo("Init producer."))); } } // @Test(expected = IllegalStateException.class) public void run_notInitialized_illegalStateExceptionThrown() throws IOException, InterruptedException { // arrange CProducer cProducer = new CProducer(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); AbstractProducerTestImpl abstractProducerTestImpl = new AbstractProducerTestImpl(cProducer, mockConsumer, keyUtility, mockKeyProducer, bitHelper); // act abstractProducerTestImpl.run(); } @Test public void run_interruptedBeforeStarted_stateSetToNotRunning() throws IOException, InterruptedException { // arrange CProducer cProducer = new CProducer(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); AbstractProducerTestImpl abstractProducerTestImpl = new AbstractProducerTestImpl(cProducer, mockConsumer, keyUtility, mockKeyProducer, bitHelper); Logger logger = mock(Logger.class); abstractProducerTestImpl.setLogger(logger); abstractProducerTestImpl.initProducer(); abstractProducerTestImpl.interrupt(); // act abstractProducerTestImpl.run(); // assert assertThat(abstractProducerTestImpl.state, is(equalTo(ProducerState.NOT_RUNNING))); ArgumentCaptor logCaptor = ArgumentCaptor.forClass(String.class); verify(logger, times(2)).info(logCaptor.capture()); List arguments = logCaptor.getAllValues(); assertThat(arguments.get(1), is(equalTo("Producer was interrupted before it started running."))); } @Test public void run_exceptionInProduceKeys_exceptionCaughtAndLoggedToError() throws IOException, InterruptedException { // arrange CProducer cProducer = new CProducer(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); AbstractProducerTestImpl abstractProducerTestImpl = new AbstractProducerTestImpl(cProducer, mockConsumer, keyUtility, mockKeyProducer, bitHelper) { @Override public void produceKeys() { throw new RuntimeException("Test exception"); } }; Logger logger = mock(Logger.class); abstractProducerTestImpl.setLogger(logger); abstractProducerTestImpl.initProducer(); // act abstractProducerTestImpl.run(); // assert assertThat(abstractProducerTestImpl.state, is(equalTo(ProducerState.NOT_RUNNING))); ArgumentCaptor logCaptorMessage = ArgumentCaptor.forClass(String.class); ArgumentCaptor logCaptorException = ArgumentCaptor.forClass(Exception.class); verify(logger, times(1)).error(logCaptorMessage.capture(), logCaptorException.capture()); List arguments = logCaptorMessage.getAllValues(); List exceptions = logCaptorException.getAllValues(); assertThat(arguments.get(0), is(equalTo("Error in produceKeys"))); assertThat(exceptions.get(0).getMessage(), is(equalTo("Test exception"))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/AbstractProducerTestImpl.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.math.BigInteger; import net.ladenthin.bitcoinaddressfinder.configuration.CProducer; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducer; public class AbstractProducerTestImpl extends AbstractProducer { public AbstractProducerTestImpl(CProducer cProducer, Consumer consumer, KeyUtility keyUtility, KeyProducer keyProducer, BitHelper bitHelper) { super(cProducer, consumer, keyUtility, keyProducer, bitHelper); } @Override public void produceKeys() { } @Override public void processSecretBase(BigInteger secretBase) { } @Override public void processSecrets(BigInteger[] secret) { } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/AddressFileTest.java ================================================ // @formatter:off /** * Copyright 2026 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import net.ladenthin.bitcoinaddressfinder.staticaddresses.enums.P2PKH; import net.ladenthin.bitcoinaddressfinder.staticaddresses.enums.P2WPKH; import org.apache.commons.io.FileUtils; import org.bitcoinj.base.Network; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; /** * Unit tests for {@link AddressFile}. */ public class AddressFileTest { private final Network network = new NetworkParameterFactory().getNetwork(); @Rule public TemporaryFolder folder = new TemporaryFolder(); // @Test public void processLine_validBitcoinAddress_addressConsumerCalledOnce() throws IOException { // arrange File file = folder.newFile("addresses.txt"); ReadStatistic readStatistic = new ReadStatistic(); List addressCapture = new ArrayList<>(); AddressFile addressFile = new AddressFile(file, readStatistic, network, addressCapture::add, line -> {}); // act addressFile.processLine(P2PKH.Bitcoin.getPublicAddress()); // assert assertThat(addressCapture.size(), is(equalTo(1))); assertThat(addressCapture.get(0).type(), is(equalTo(AddressType.P2PKH_OR_P2SH))); } @Test public void processLine_validBitcoinAddress_readStatisticSuccessfulIncrements() throws IOException { // arrange File file = folder.newFile("addresses.txt"); ReadStatistic readStatistic = new ReadStatistic(); AddressFile addressFile = new AddressFile(file, readStatistic, network, addressToCoin -> {}, line -> {}); // act addressFile.processLine(P2PKH.Bitcoin.getPublicAddress()); // assert assertThat(readStatistic.successful, is(equalTo(1L))); } @Test public void processLine_validSegwitAddress_addressConsumerCalledOnce() throws IOException { // arrange File file = folder.newFile("addresses.txt"); ReadStatistic readStatistic = new ReadStatistic(); List addressCapture = new ArrayList<>(); AddressFile addressFile = new AddressFile(file, readStatistic, network, addressCapture::add, line -> {}); // act addressFile.processLine(P2WPKH.Bitcoin.getPublicAddress()); // assert assertThat(addressCapture.size(), is(equalTo(1))); assertThat(addressCapture.get(0).type(), is(equalTo(AddressType.P2WPKH))); } @Test public void processLine_emptyLine_unsupportedConsumerReceivesEmptyString() throws IOException { // arrange File file = folder.newFile("addresses.txt"); ReadStatistic readStatistic = new ReadStatistic(); List unsupportedCapture = new ArrayList<>(); AddressFile addressFile = new AddressFile(file, readStatistic, network, addressToCoin -> {}, unsupportedCapture::add); // act addressFile.processLine(""); // assert assertThat(unsupportedCapture.size(), is(equalTo(1))); assertThat(unsupportedCapture.get(0), is(equalTo(""))); } @Test public void processLine_emptyLine_readStatisticUnsupportedIncrements() throws IOException { // arrange File file = folder.newFile("addresses.txt"); ReadStatistic readStatistic = new ReadStatistic(); AddressFile addressFile = new AddressFile(file, readStatistic, network, addressToCoin -> {}, line -> {}); // act addressFile.processLine(""); // assert assertThat(readStatistic.getUnsupportedTotal(), is(equalTo(1L))); } @Test public void processLine_commentLine_unsupportedConsumerReceivesCommentString() throws IOException { // arrange File file = folder.newFile("addresses.txt"); ReadStatistic readStatistic = new ReadStatistic(); List unsupportedCapture = new ArrayList<>(); AddressFile addressFile = new AddressFile(file, readStatistic, network, addressToCoin -> {}, unsupportedCapture::add); // act addressFile.processLine("# this is a comment"); // assert assertThat(unsupportedCapture.size(), is(equalTo(1))); assertThat(unsupportedCapture.get(0), is(equalTo("# this is a comment"))); } @Test public void processLine_addressHeaderLine_unsupportedConsumerReceivesHeaderString() throws IOException { // arrange File file = folder.newFile("addresses.txt"); ReadStatistic readStatistic = new ReadStatistic(); List unsupportedCapture = new ArrayList<>(); AddressFile addressFile = new AddressFile(file, readStatistic, network, addressToCoin -> {}, unsupportedCapture::add); // act addressFile.processLine(AddressTxtLine.ADDRESS_HEADER); // assert assertThat(unsupportedCapture.size(), is(equalTo(1))); assertThat(unsupportedCapture.get(0), is(equalTo(AddressTxtLine.ADDRESS_HEADER))); } @Test public void processLine_calledTwiceWithValidAddresses_successfulCountIsTwo() throws IOException { // arrange File file = folder.newFile("addresses.txt"); ReadStatistic readStatistic = new ReadStatistic(); List addressCapture = new ArrayList<>(); AddressFile addressFile = new AddressFile(file, readStatistic, network, addressCapture::add, line -> {}); // act addressFile.processLine(P2PKH.Bitcoin.getPublicAddress()); addressFile.processLine(P2PKH.Litecoin.getPublicAddress()); // assert assertThat(readStatistic.successful, is(equalTo(2L))); assertThat(addressCapture.size(), is(equalTo(2))); assertThat(addressCapture.get(0).type(), is(equalTo(AddressType.P2PKH_OR_P2SH))); assertThat(addressCapture.get(1).type(), is(equalTo(AddressType.P2PKH_OR_P2SH))); } // // @Test public void readFile_fileWithOneBitcoinAddress_addressConsumerCalledOnce() throws IOException { // arrange File file = folder.newFile("addresses.txt"); FileUtils.writeStringToFile(file, P2PKH.Bitcoin.getPublicAddress() + "\n", StandardCharsets.UTF_8.name()); ReadStatistic readStatistic = new ReadStatistic(); List addressCapture = new ArrayList<>(); AddressFile addressFile = new AddressFile(file, readStatistic, network, addressCapture::add, line -> {}); // act addressFile.readFile(); // assert assertThat(addressCapture.size(), is(equalTo(1))); assertThat(addressCapture.get(0).type(), is(equalTo(AddressType.P2PKH_OR_P2SH))); assertThat(readStatistic.successful, is(equalTo(1L))); } @Test public void readFile_emptyFile_consumersNeverCalled() throws IOException { // arrange File file = folder.newFile("addresses.txt"); ReadStatistic readStatistic = new ReadStatistic(); AddressFile addressFile = new AddressFile(file, readStatistic, network, addressToCoin -> {}, line -> {}); // act addressFile.readFile(); // assert assertThat(readStatistic.successful, is(equalTo(0L))); assertThat(readStatistic.getUnsupportedTotal(), is(equalTo(0L))); } @Test public void readFile_mixedValidAndCommentLines_correctCountsUpdated() throws IOException { // arrange File file = folder.newFile("addresses.txt"); String content = P2PKH.Bitcoin.getPublicAddress() + "\n" + "# comment line\n" + P2PKH.Litecoin.getPublicAddress() + "\n"; FileUtils.writeStringToFile(file, content, StandardCharsets.UTF_8.name()); ReadStatistic readStatistic = new ReadStatistic(); List addressCapture = new ArrayList<>(); List unsupportedCapture = new ArrayList<>(); AddressFile addressFile = new AddressFile(file, readStatistic, network, addressCapture::add, unsupportedCapture::add); // act addressFile.readFile(); // assert assertThat(addressCapture.size(), is(equalTo(2))); assertThat(addressCapture.get(0).type(), is(equalTo(AddressType.P2PKH_OR_P2SH))); assertThat(addressCapture.get(1).type(), is(equalTo(AddressType.P2PKH_OR_P2SH))); assertThat(readStatistic.successful, is(equalTo(2L))); assertThat(unsupportedCapture.size(), is(equalTo(1))); assertThat(unsupportedCapture.get(0), is(equalTo("# comment line"))); assertThat(readStatistic.getUnsupportedTotal(), is(equalTo(1L))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/AddressFilesToLMDBTest.java ================================================ // @formatter:off /** * Copyright 2026 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; import net.ladenthin.bitcoinaddressfinder.configuration.CAddressFilesToLMDB; import net.ladenthin.bitcoinaddressfinder.configuration.CLMDBConfigurationWrite; import net.ladenthin.bitcoinaddressfinder.persistence.Persistence; import net.ladenthin.bitcoinaddressfinder.staticaddresses.StaticAddressesFiles; import net.ladenthin.bitcoinaddressfinder.staticaddresses.*; import net.ladenthin.bitcoinaddressfinder.staticaddresses.TestAddressesFiles; import net.ladenthin.bitcoinaddressfinder.staticaddresses.enums.P2PKH; import org.bitcoinj.base.Coin; import org.bitcoinj.base.LegacyAddress; import org.junit.Before; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.*; import org.junit.Test; import org.junit.runner.RunWith; /** * Direct unit tests for {@link AddressFilesToLMDB}. * * Tests the run() and interrupt() methods with parameterized test data from existing test providers. */ @RunWith(DataProviderRunner.class) public class AddressFilesToLMDBTest extends LMDBBase { @Before public void init() throws IOException { } @Test(expected = IllegalArgumentException.class) public void addressFilesToLMDB_addressFileDoesNotExists_throwsIllegalArgumentException() throws IOException { // arrange, act CAddressFilesToLMDB addressFilesToLMDBConfigurationWrite = new CAddressFilesToLMDB(); addressFilesToLMDBConfigurationWrite.addressesFiles.add("thisFileDoesNotExists.txt"); addressFilesToLMDBConfigurationWrite.lmdbConfigurationWrite = new CLMDBConfigurationWrite(); File lmdbFolder = folder.newFolder("lmdb"); String lmdbFolderPath = lmdbFolder.getAbsolutePath(); addressFilesToLMDBConfigurationWrite.lmdbConfigurationWrite.lmdbDirectory = lmdbFolderPath; AddressFilesToLMDB addressFilesToLMDB = new AddressFilesToLMDB(addressFilesToLMDBConfigurationWrite); addressFilesToLMDB.run(); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_COMPRESSED_AND_STATIC_AMOUNT, location = CommonDataProvider.class) public void addressFilesToLMDB_createLMDB_containingTestAddressesHashesWithCorrectAmount(boolean compressed, boolean useStaticAmount) throws Exception { // arrange, act AddressesFiles addressesFiles = new TestAddressesFiles(compressed); try (Persistence persistence = createAndFillAndOpenLMDB(useStaticAmount, addressesFiles, false, false)) { // assert assertThat(persistence.count(), is(equalTo(6L))); Coin[] amounts = new Coin[TestAddressesFiles.NUMBER_OF_ADRESSES]; String[] base58Adresses = addressesFiles.getTestAddresses().getAsBase58StringList().toArray(new String[0]); for (int i = 0; i < amounts.length; i++) { String base58Adresse = base58Adresses[i]; LegacyAddress fromBase58 = LegacyAddress.fromBase58(base58Adresse, network); ByteBuffer hash160 = keyUtility.addressToByteBuffer(fromBase58); amounts[i] = persistence.getAmount(hash160); if (useStaticAmount) { assertThat(amounts[i], is(equalTo(Coin.ZERO))); } else { assertThat(amounts[i], is(equalTo(TestAddressesFiles.AMOUNTS[i]))); } } } } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_STATIC_AMOUNT, location = CommonDataProvider.class) public void addressFilesToLMDB_createLMDBWithStaticAddresses_containingStaticHashes(boolean useStaticAmount) throws Exception { // arrange, act StaticAddressesFiles staticAddressesFiles = new StaticAddressesFiles(); // assert try (Persistence persistence = createAndFillAndOpenLMDB(useStaticAmount, staticAddressesFiles, false, false)) { assertThat(persistence.count(), is(equalTo((long)staticAddressesFiles.getSupportedAddresses().size()))); for (P2PKH staticTestAddress : P2PKH.values()) { ByteBuffer hash160AsByteBuffer = staticTestAddress.getPublicKeyHashAsByteBuffer(); boolean contains = persistence.containsAddress(hash160AsByteBuffer); assertThat(contains, is(equalTo(Boolean.TRUE))); } } } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_BLOOM_FILTER_ENABLED, location = CommonDataProvider.class) public void containsAddress_behavesCorrectly_withOrWithoutBloomFilter(boolean useBloomFilter) throws Exception { AddressesFiles addressesFiles = new TestAddressesFiles(true); try (Persistence persistence = createAndFillAndOpenLMDB(false, addressesFiles, false, useBloomFilter)) { TestAddresses testAddresses = addressesFiles.getTestAddresses(); ByteBuffer hash160 = testAddresses.getIndexAsHash160ByteBuffer(0); boolean contains = persistence.containsAddress(hash160); assertThat("Should find known address", contains, is(true)); } } /** * I got in the past the exception: * {@link java.nio.BufferUnderflowException} because zero values are stored with {@code byteBuffer.capacity() == 0}. */ @Test public void addressFilesToLMDB_addressWithAmountOfZero_noExceptionThrown() throws Exception { // arrange, act AddressesFileSpecialUsecases addressesFileSpecialUsecases = new AddressesFileSpecialUsecases(); //TestAddressesFiles testAddressesFiles = new TestAddressesFiles(true); // assert try (Persistence persistence = createAndFillAndOpenLMDB(false, addressesFileSpecialUsecases, false, false)) { assertThat(persistence.count(), is(equalTo((long)addressesFileSpecialUsecases.getAllAddresses().size()))); TestAddresses testAddresses = addressesFileSpecialUsecases.getTestAddresses(); for (int i = 0; i < testAddresses.getNumberOfAddresses(); i++) { ByteBuffer hash160 = testAddresses.getIndexAsHash160ByteBuffer(i); Coin amount = persistence.getAmount(hash160); assertThat(amount, is(equalTo(Coin.ZERO))); boolean contains = persistence.containsAddress(hash160); assertThat(contains, is(equalTo(Boolean.TRUE))); } } } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_BLOOM_FILTER_ENABLED, location = CommonDataProvider.class) public void containsAddress_returnsFalseForUnknownAddress(boolean useBloomFilter) throws Exception { AddressesFiles addressesFiles = new TestAddressesFiles(true); try (Persistence persistence = createAndFillAndOpenLMDB(false, addressesFiles, false, useBloomFilter)) { ByteBuffer hash160 = keyUtility.byteBufferUtility().byteArrayToByteBuffer(TestAddressesFiles.NON_EXISTING_ADDRESS); boolean contains = persistence.containsAddress(hash160); assertThat("containsAddress() must return false for a known non-existing address used for negative testing.", contains, is(false)); } } // @Test public void interrupt_withNoCurrentFile_doesNotThrow() { // arrange CAddressFilesToLMDB config = new CAddressFilesToLMDB(); AddressFilesToLMDB importer = new AddressFilesToLMDB(config); // act - should not throw exception importer.interrupt(); // assert - method completed without exception } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/AddressFormatNotAcceptedExceptionTest.java ================================================ // @formatter:off /** * Copyright 2026 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; import org.junit.Test; /** * Unit tests for {@link AddressFormatNotAcceptedException}. */ public class AddressFormatNotAcceptedExceptionTest { // @Test public void constructor_withReason_messageContainsReason() { // arrange String reason = "address is empty"; // act AddressFormatNotAcceptedException exception = new AddressFormatNotAcceptedException(reason); // assert assertThat(exception.getMessage(), containsString(reason)); } @Test public void constructor_withReason_messageContainsExpectedPrefix() { // arrange String reason = "unsupported format"; // act AddressFormatNotAcceptedException exception = new AddressFormatNotAcceptedException(reason); // assert assertThat(exception.getMessage(), containsString("Address format not accepted:")); } @Test public void constructor_withReason_messageEqualsExpected() { // arrange String reason = "P2TR is not supported"; // act AddressFormatNotAcceptedException exception = new AddressFormatNotAcceptedException(reason); // assert assertThat(exception.getMessage(), is(equalTo("Address format not accepted: " + reason))); } @Test public void constructor_withReason_isInstanceOfException() { // arrange String reason = "address is empty"; // act AddressFormatNotAcceptedException exception = new AddressFormatNotAcceptedException(reason); // assert assertThat(exception, is(instanceOf(Exception.class))); } @Test public void constructor_withReason_noCause() { // arrange String reason = "address is empty"; // act AddressFormatNotAcceptedException exception = new AddressFormatNotAcceptedException(reason); // assert assertThat(exception.getCause(), is(nullValue())); } // // @Test public void getReason_withReason_returnsReason() { // arrange String reason = "address is null"; // act AddressFormatNotAcceptedException exception = new AddressFormatNotAcceptedException(reason); String actual = exception.getReason(); // assert assertThat(actual, is(equalTo(reason))); } @Test public void getReason_withEmptyReason_returnsEmptyString() { // arrange String reason = ""; // act AddressFormatNotAcceptedException exception = new AddressFormatNotAcceptedException(reason); String actual = exception.getReason(); // assert assertThat(actual, is(equalTo(""))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/AddressToCoinTest.java ================================================ // @formatter:off /** * Copyright 2021 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import org.junit.Test; import java.io.IOException; import java.nio.ByteBuffer; import net.ladenthin.bitcoinaddressfinder.staticaddresses.TestAddresses42; import org.bitcoinj.base.Coin; import org.bitcoinj.base.Network; import org.bitcoinj.crypto.ECKey; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; public class AddressToCoinTest { private final Network network = new NetworkParameterFactory().getNetwork(); private final KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(true)); @Test public void createAddressToCoin_publicKeyGiven_ToStringAndEqualsAndHashCode() throws IOException, InterruptedException { // arrange ECKey keyUncompressed = new TestAddresses42(1, false).getECKeys().get(0); ECKey keyCompressed = new TestAddresses42(1, true).getECKeys().get(0); AddressToCoin addressToCoinUncompressed = new AddressToCoin(keyUtility.byteBufferUtility().byteArrayToByteBuffer(keyUncompressed.getPubKeyHash()), Coin.COIN, AddressType.P2PKH_OR_P2SH); AddressToCoin addressToCoinUncompressed2 = new AddressToCoin(keyUtility.byteBufferUtility().byteArrayToByteBuffer(keyUncompressed.getPubKeyHash()), Coin.COIN, AddressType.P2PKH_OR_P2SH); AddressToCoin addressToCoinCompressed = new AddressToCoin(keyUtility.byteBufferUtility().byteArrayToByteBuffer(keyCompressed.getPubKeyHash()), Coin.COIN, AddressType.P2PKH_OR_P2SH); AddressToCoin addressToCoinCompressed2 = new AddressToCoin(keyUtility.byteBufferUtility().byteArrayToByteBuffer(keyCompressed.getPubKeyHash()), Coin.COIN, AddressType.P2PKH_OR_P2SH); // assert EqualHashCodeToStringTestHelper equalHashCodeToStringTestHelper = new EqualHashCodeToStringTestHelper(addressToCoinUncompressed, addressToCoinUncompressed2, addressToCoinCompressed, addressToCoinCompressed2); equalHashCodeToStringTestHelper.assertEqualsHashCodeToStringAIsDifferentToB(); assertThat(addressToCoinUncompressed.toString(), is(equalTo("AddressToCoin{hash160=73d6a3b07f488e12f9175716f95c5e18c265693f, coin=100000000, type=P2PKH_OR_P2SH}"))); assertThat(addressToCoinCompressed.toString(), is(equalTo("AddressToCoin{hash160=6970dea35c48e1c78e931117fab833354cddf9b4, coin=100000000, type=P2PKH_OR_P2SH}"))); } @Test(expected = IllegalArgumentException.class) public void createAddressToCoin_invalidAddressSizeGiven_ToStringAndEqualsAndHashCode() throws IOException, InterruptedException { // arrange ByteBuffer byteBuffer32bytes = keyUtility.byteBufferUtility().getByteBufferFromHex("0000000000000000000000000000000000000000000000000000000000000000"); // act new AddressToCoin(byteBuffer32bytes, Coin.COIN, AddressType.P2PKH_OR_P2SH); // assert } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/AddressTxtLineTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import org.apache.commons.codec.DecoderException; import org.bitcoinj.base.Base58; import org.bitcoinj.base.Coin; import org.bouncycastle.util.encoders.Hex; import org.junit.Test; import org.junit.runner.RunWith; import net.ladenthin.bitcoinaddressfinder.staticaddresses.StaticKey; import net.ladenthin.bitcoinaddressfinder.staticaddresses.TestAddresses42; import net.ladenthin.bitcoinaddressfinder.staticaddresses.enums.P2PKH; import net.ladenthin.bitcoinaddressfinder.staticaddresses.enums.P2SH; import net.ladenthin.bitcoinaddressfinder.staticaddresses.enums.P2WPKH; import net.ladenthin.bitcoinaddressfinder.staticaddresses.enums.StaticUnsupportedAddress; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; import static org.junit.Assert.fail; @RunWith(DataProviderRunner.class) public class AddressTxtLineTest { private final TestAddresses42 testAddresses = new TestAddresses42(0, false); private final StaticKey staticKey = new StaticKey(); private final KeyUtility keyUtility = new KeyUtility(testAddresses.network, new ByteBufferUtility(false)); private void assertThatDefaultCoinIsSet(AddressToCoin addressToCoin) { assertThat(addressToCoin.coin(), is(equalTo(AddressTxtLine.DEFAULT_COIN))); } // @Test public void fromLine_addressLineIsEmpty_throwsAddressFormatNotAcceptedException() { // act try { new AddressTxtLine().fromLine("", keyUtility); fail("Expected AddressFormatNotAcceptedException"); } catch (AddressFormatNotAcceptedException e) { // assert assertThat(e.getMessage(), containsString(AddressTxtLine.REASON_EMPTY)); } } @Test public void fromLine_addressLineStartsWithIgnoreLineSign_throwsAddressFormatNotAcceptedException() { // act try { new AddressTxtLine().fromLine(AddressTxtLine.IGNORE_LINE_PREFIX + " test", keyUtility); fail("Expected AddressFormatNotAcceptedException"); } catch (AddressFormatNotAcceptedException e) { // assert assertThat(e.getMessage(), containsString(AddressTxtLine.REASON_IGNORE_PREFIX)); } } @Test public void fromLine_addressLineIsOnlyIgnoreLineSign_throwsAddressFormatNotAcceptedException() { // act try { new AddressTxtLine().fromLine(AddressTxtLine.IGNORE_LINE_PREFIX, keyUtility); fail("Expected AddressFormatNotAcceptedException"); } catch (AddressFormatNotAcceptedException e) { // assert assertThat(e.getMessage(), containsString(AddressTxtLine.REASON_IGNORE_PREFIX)); } } @Test public void fromLine_uncompressedBitcoinAddressGiven_returnHash160AndDefaultCoin() throws AddressFormatNotAcceptedException { // act AddressToCoin addressToCoin = new AddressTxtLine().fromLine(staticKey.publicKeyUncompressed, keyUtility); // pre-assert assertThat(addressToCoin, is(notNullValue())); // assert assertThat(addressToCoin.hash160(), is(equalTo(staticKey.byteBufferPublicKeyUncompressed))); assertThatDefaultCoinIsSet(addressToCoin); } @Test public void fromLine_compressedBitcoinAddressGiven_returnHash160AndDefaultCoin() throws AddressFormatNotAcceptedException { // act AddressToCoin addressToCoin = new AddressTxtLine().fromLine(staticKey.publicKeyCompressed, keyUtility); // pre-assert assertThat(addressToCoin, is(notNullValue())); // assert assertThat(addressToCoin.hash160(), is(equalTo(staticKey.byteBufferPublicKeyCompressed))); assertThatDefaultCoinIsSet(addressToCoin); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_ADDRESS_SEPARATOR, location = CommonDataProvider.class) public void fromLine_uncompressedBitcoinAddressGivenWithValidAmount_returnHash160AndSpecifiedCoin(String addressSeparator) throws AddressFormatNotAcceptedException { // arrange long coin = 123987L; // act AddressToCoin addressToCoin = new AddressTxtLine().fromLine(staticKey.publicKeyUncompressed + addressSeparator + coin, keyUtility); // pre-assert assertThat(addressToCoin, is(notNullValue())); // assert assertThat(addressToCoin.hash160(), is(equalTo(staticKey.byteBufferPublicKeyUncompressed))); assertThat(addressToCoin.coin(), is(equalTo(Coin.valueOf(coin)))); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_ADDRESS_SEPARATOR, location = CommonDataProvider.class) public void fromLine_uncompressedBitcoinAddressGivenWithInvalidAmount_returnHash160AndDefaultCoin(String addressSeparator) throws AddressFormatNotAcceptedException { // act AddressToCoin addressToCoin = new AddressTxtLine().fromLine(staticKey.publicKeyUncompressed + addressSeparator + "XYZ", keyUtility); // pre-assert assertThat(addressToCoin, is(notNullValue())); // assert assertThat(addressToCoin.hash160(), is(equalTo(staticKey.byteBufferPublicKeyUncompressed))); assertThatDefaultCoinIsSet(addressToCoin); } @Test public void fromLine_addressLineStartsWithAddressHeader_throwsAddressFormatNotAcceptedException() { // act try { new AddressTxtLine().fromLine(AddressTxtLine.ADDRESS_HEADER, keyUtility); fail("Expected AddressFormatNotAcceptedException"); } catch (AddressFormatNotAcceptedException e) { // assert assertThat(e.getMessage(), containsString(AddressTxtLine.REASON_ADDRESS_HEADER)); } } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_STATIC_UNSUPPORTED_ADDRESSES, location = CommonDataProvider.class) public void fromLine_staticUnsupportedAddress_throwsAddressFormatNotAcceptedException(StaticUnsupportedAddress address) { // act try { new AddressTxtLine().fromLine(address.getPublicAddress(), keyUtility); fail("Expected AddressFormatNotAcceptedException"); } catch (AddressFormatNotAcceptedException e) { // assert assertThat(e.getMessage(), not(emptyOrNullString())); } } // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_STATIC_P2PKH_ADDRESSES, location = CommonDataProvider.class) public void fromLine_staticP2PKHAddress_returnPublicKeyHash(P2PKH address) throws AddressFormatNotAcceptedException { // act AddressToCoin addressToCoin = new AddressTxtLine().fromLine(address.getPublicAddress(), keyUtility); // pre-assert assertThat(addressToCoin, is(notNullValue())); // assert assertThat(new ByteBufferUtility(true).getHexFromByteBuffer(addressToCoin.hash160()), is(equalTo(address.getPublicKeyHashAsHex()))); assertThat(addressToCoin.hash160(), is(equalTo(address.getPublicKeyHashAsByteBuffer()))); assertThat(addressToCoin.type(), is(AddressType.P2PKH_OR_P2SH)); assertThatDefaultCoinIsSet(addressToCoin); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_STATIC_P2SH_ADDRESSES, location = CommonDataProvider.class) public void fromLine_staticP2SHAddress_returnScriptHash(P2SH address) throws AddressFormatNotAcceptedException { // act AddressToCoin addressToCoin = new AddressTxtLine().fromLine(address.getPublicAddress(), keyUtility); // pre-assert assertThat(addressToCoin, is(notNullValue())); // assert assertThat(new ByteBufferUtility(true).getHexFromByteBuffer(addressToCoin.hash160()), is(equalTo(address.getScriptHashAsHex()))); assertThat(addressToCoin.hash160(), is(equalTo(address.getScriptHashAsByteBuffer()))); assertThat(addressToCoin.type(), is(AddressType.P2PKH_OR_P2SH)); assertThatDefaultCoinIsSet(addressToCoin); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_STATIC_P2WPKH_ADDRESSES, location = CommonDataProvider.class) public void fromLine_staticP2WPKHAddress_returnWitnessProgram(P2WPKH address) throws AddressFormatNotAcceptedException { // act AddressToCoin addressToCoin = new AddressTxtLine().fromLine(address.getPublicAddress(), keyUtility); // pre-assert assertThat(addressToCoin, is(notNullValue())); // assert assertThat(new ByteBufferUtility(true).getHexFromByteBuffer(addressToCoin.hash160()), is(equalTo(address.getWitnessProgramAsHex()))); assertThat(addressToCoin.hash160(), is(equalTo(address.getWitnessProgramAsByteBuffer()))); assertThat(addressToCoin.type(), is(AddressType.P2WPKH)); assertThatDefaultCoinIsSet(addressToCoin); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_INVALID_P2WPKH_ADDRESSES_VALID_BASE58, location = CommonDataProvider.class) public void fromLine_invalidP2WPKHAddressWithValidBase58Given_parseAnyway(String base58, String hash) throws AddressFormatNotAcceptedException { // act AddressToCoin addressToCoin = new AddressTxtLine().fromLine(base58, keyUtility); // pre-assert assertThat(addressToCoin, is(notNullValue())); // assert assertThat(new ByteBufferUtility(true).getHexFromByteBuffer(addressToCoin.hash160()), is(equalTo(hash))); assertThatDefaultCoinIsSet(addressToCoin); } // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_INVALID_BECH32_WITNESS_VERSION_2, location = CommonDataProvider.class) public void fromLine_invalidBech32WitnessVersion2_throwsAddressFormatNotAcceptedException(String base58) { // act try { new AddressTxtLine().fromLine(base58, keyUtility); fail("Expected AddressFormatNotAcceptedException"); } catch (AddressFormatNotAcceptedException e) { // assert assertThat(e.getMessage(), containsString(AddressTxtLine.REASON_UNSUPPORTED_WITNESS_VERSION)); } } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_INVALID_BASE58, location = CommonDataProvider.class) public void fromLine_invalidP2WPKHAddressWithInvalidBase58Given_throwsAddressFormatNotAcceptedException(String base58) { // act try { new AddressTxtLine().fromLine(base58, keyUtility); fail("Expected AddressFormatNotAcceptedException"); } catch (AddressFormatNotAcceptedException e) { // assert assertThat(e.getMessage(), containsString(AddressTxtLine.REASON_INVALID_BASE58)); } } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_BITCOIN_CASH_ADDRESSES_CHECKSUM_INVALID, location = CommonDataProvider.class) public void fromLine_bitcoinCashAddressChecksumInvalid_parseAnyway(String base58, String expectedHash160) throws AddressFormatNotAcceptedException { // act AddressToCoin addressToCoin = new AddressTxtLine().fromLine(base58, keyUtility); // pre-assert assertThat(addressToCoin, is(notNullValue())); // assert String hash160AsHex = keyUtility.byteBufferUtility().getHexFromByteBuffer(addressToCoin.hash160()); assertThat(hash160AsHex, is(equalTo(expectedHash160))); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_BITCOIN_CASH_ADDRESSES_INTERNAL_PURPOSE, location = CommonDataProvider.class) public void fromLine_bitcoinCashAddressInternalPurpose_throwsAddressFormatNotAcceptedException(String base58) { // act try { new AddressTxtLine().fromLine(base58, keyUtility); fail("Expected AddressFormatNotAcceptedException"); } catch (AddressFormatNotAcceptedException e) { // assert assertThat(e.getMessage(), containsString(AddressTxtLine.REASON_P2MS_NOT_SUPPORTED)); } } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_BITCOIN_ADDRESSES_CORRECT_BASE_58, location = CommonDataProvider.class) public void fromLine_bitcoinAddressChecksumInvalid_parseAnyway(String base58, String expectedHash160) throws AddressFormatNotAcceptedException { // act AddressToCoin addressToCoin = new AddressTxtLine().fromLine(base58, keyUtility); // pre-assert assertThat(addressToCoin, is(notNullValue())); // assert String hash160AsHex = keyUtility.byteBufferUtility().getHexFromByteBuffer(addressToCoin.hash160()); assertThat(hash160AsHex, is(equalTo(expectedHash160))); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_CORRECT_BASE_58, location = CommonDataProvider.class) public void fromLine_correctBase58_hash160equals(String base58, String expectedHash160) throws AddressFormatNotAcceptedException, DecoderException { // act AddressToCoin addressToCoin = new AddressTxtLine().fromLine(base58, keyUtility); // pre-assert assertThat(addressToCoin, is(notNullValue())); // assert String hash160AsHex = keyUtility.byteBufferUtility().getHexFromByteBuffer(addressToCoin.hash160()); assertThat(hash160AsHex, is(equalTo(expectedHash160))); } // // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_SRC_POS, location = CommonDataProvider.class) public void parseBase58Address_correctBase58UseHigherSrcPos_copiedPartial(int versionBytes) throws DecoderException { // arrange String encoded = Base58.encode(Hex.decode("1f" + "ffffffffffffffffffffffffffffffffffffffff")); // act AddressToCoin addressToCoin = new AddressTxtLine().parseBase58Address(encoded, versionBytes, AddressTxtLine.CHECKSUM_BYTES_REGULAR, keyUtility); // assert byte[] hash160 = keyUtility.byteBufferUtility().byteBufferToBytes(addressToCoin.hash160()); String hash160AsHex = Hex.toHexString(hash160); int expectedLastIndex = 40 - 1 - 2 * versionBytes + 2; assertThat(hash160AsHex.lastIndexOf("f"), is(equalTo(expectedLastIndex))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/AddressTypeTest.java ================================================ // @formatter:off /** * Copyright 2026 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; import org.junit.Test; /** * Unit tests for {@link AddressType}. */ public class AddressTypeTest { // @Test public void values_allConstants_countIsTwo() { // act int actual = AddressType.values().length; // assert assertThat(actual, is(equalTo(2))); } @Test public void values_p2pkhOrP2sh_nameIsExpected() { // act String actual = AddressType.P2PKH_OR_P2SH.name(); // assert assertThat(actual, is(equalTo("P2PKH_OR_P2SH"))); } @Test public void values_p2wpkh_nameIsExpected() { // act String actual = AddressType.P2WPKH.name(); // assert assertThat(actual, is(equalTo("P2WPKH"))); } @Test public void values_eachConstant_isNotNull() { for (AddressType type : AddressType.values()) { // assert assertThat(type, is(notNullValue())); } } // // @Test public void valueOf_p2pkhOrP2sh_returnsExpectedConstant() { // act AddressType actual = AddressType.valueOf("P2PKH_OR_P2SH"); // assert assertThat(actual, is(equalTo(AddressType.P2PKH_OR_P2SH))); } @Test public void valueOf_p2wpkh_returnsExpectedConstant() { // act AddressType actual = AddressType.valueOf("P2WPKH"); // assert assertThat(actual, is(equalTo(AddressType.P2WPKH))); } @Test(expected = IllegalArgumentException.class) public void valueOf_unknownConstantName_throwsIllegalArgumentException() { // act AddressType.valueOf("UNKNOWN_TYPE"); } // // @Test public void ordinal_p2pkhOrP2sh_isZero() { // act int actual = AddressType.P2PKH_OR_P2SH.ordinal(); // assert assertThat(actual, is(equalTo(0))); } @Test public void ordinal_p2wpkh_isOne() { // act int actual = AddressType.P2WPKH.ordinal(); // assert assertThat(actual, is(equalTo(1))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/AwaitTimeTest.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.METHOD) /** * It is an await time test. This tests changes timing durations. Especially for {@link java.util.concurrent.ExecutorService#awaitTermination}. */ public @interface AwaitTimeTest { } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/AwaitTimeTests.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.time.Duration; public class AwaitTimeTests { final static Duration AWAIT_DURATION = Duration.ofSeconds(20); final static Duration IMPRECISION = Duration.ofSeconds(2); } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/BIP39DataProvider.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.tngtech.java.junit.dataprovider.DataProvider; import java.io.InputStream; import java.util.Iterator; import java.util.Map; public class BIP39DataProvider { /** * For {@link net.ladenthin.bitcoinaddressfinder.BIP39KeyProducerTest}. */ public final static String DATA_PROVIDER_BIP39_TEST_VECTORS = "bip39TestVectors"; public final static String FILENAME = "vectors.json"; public final static String PASSPHRASE = "TREZOR"; @DataProvider /** * from https://github.com/trezor/python-mnemonic/blob/master/vectors.json */ public static Object[][] bip39TestVectors() throws Exception { InputStream inputStream = BIP39DataProvider.class.getResourceAsStream("/" + FILENAME); if (inputStream == null) { throw new IllegalStateException(FILENAME + " not found in classpath"); } ObjectMapper mapper = new ObjectMapper(); JsonNode root = mapper.readTree(inputStream); int totalVectors = 0; for (Iterator> fields = root.fields(); fields.hasNext();) { Map.Entry entry = fields.next(); totalVectors += entry.getValue().size(); } Object[][] result = new Object[totalVectors][]; int index = 0; for (Iterator> fields = root.fields(); fields.hasNext();) { Map.Entry entry = fields.next(); String language = entry.getKey(); JsonNode vectors = entry.getValue(); for (JsonNode vectorElement : vectors) { String entropy = vectorElement.get(0).asText(); String mnemonic = vectorElement.get(1).asText(); String seed = vectorElement.get(2).asText(); String xprv = vectorElement.get(3).asText(); result[index++] = new Object[]{language, entropy, mnemonic, PASSPHRASE, seed, xprv}; } } return result; } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/BIP39KeyProducerTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import net.ladenthin.bitcoinaddressfinder.keyproducer.NoMoreSecretsAvailableException; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.time.Instant; import java.util.List; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import java.text.Normalizer; import java.text.Normalizer.Form; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaBip39; import static org.hamcrest.Matchers.*; import org.apache.commons.codec.binary.Hex; import org.junit.Test; import org.bitcoinj.crypto.DeterministicKey; import org.bitcoinj.crypto.HDKeyDerivation; import org.bitcoinj.crypto.MnemonicCode; import org.bitcoinj.params.MainNetParams; import org.bitcoinj.wallet.DeterministicSeed; import static org.junit.Assert.fail; import org.junit.runner.RunWith; @RunWith(DataProviderRunner.class) public class BIP39KeyProducerTest { @Test public void nextKey_givenKnownMnemonic_returnsExpectedPrivateKey() { // arrange String mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"; String passphrase = ""; String bip32Path = CKeyProducerJavaBip39.DEFAULT_BIP32_PATH; Instant creationTime = Instant.ofEpochSecond(0); boolean hardened = false; BIP39KeyProducer producer = new BIP39KeyProducer(mnemonic, passphrase, bip32Path, creationTime, hardened); // act DeterministicKey key = producer.nextKey(); // M/44H/0H/0H/0/0 // assert assertThat(key.getPrivateKeyAsHex(), is("e284129cc0922579a535bbf4d1a3b25773090d28c909bc0fed73b5e0222cc372")); assertThat(key.getPathAsString(), endsWith("/0")); } @Test public void nextBytes_calledTwice_returnsDeterministicByteArrays() { // arrange String mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"; String passphrase = ""; String bip32Path = CKeyProducerJavaBip39.DEFAULT_BIP32_PATH; Instant creationTime = Instant.ofEpochSecond(0); boolean hardened = false; BIP39KeyProducer producer = new BIP39KeyProducer(mnemonic, passphrase, bip32Path, creationTime, hardened); byte[] bytes1 = new byte[16]; byte[] bytes2 = new byte[16]; // act producer.nextBytes(bytes1); // from /0 producer.nextBytes(bytes2); // from /1 // assert assertThat(bytes1, is(not(equalTo(bytes2)))); assertThat(bytes1.length, is(16)); assertThat(bytes2.length, is(16)); } @Test public void appendPath_givenBasePathAndIndex_returnsExtendedHDPath() { // arrange String path = CKeyProducerJavaBip39.DEFAULT_BIP32_PATH; int index = 5; // act var extended = BIP39KeyProducer.append( org.bitcoinj.crypto.HDPath.parsePath(path), new org.bitcoinj.crypto.ChildNumber(index, false) ); // assert assertThat(extended.size(), is(5)); assertThat(extended.get(4).num(), is(index)); } @Test public void bip39Vector_givenEnglishMnemonic_returnsExpectedSeedAndXprv() throws Exception { // Arrange String passphrase = "TREZOR"; String entropyHex = "00000000000000000000000000000000"; String expectedMnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"; String expectedSeedHex = "c55257c360c07c72029aebc1b53c05ed0362ada38ead3e3e9efa3708e53495531f09a6987599d18264c1e1c92f2cf141630c7a3c4ab7c81b2f001698e7463b04"; String expectedXprv = "xprv9s21ZrQH143K3h3fDYiay8mocZ3afhfULfb5GX8kCBdno77K4HiA15Tg23wpbeF1pLfs1c5SPmYHrEpTuuRhxMwvKDwqdKiGJS9XFKzUsAF"; byte[] entropy = Hex.decodeHex(entropyHex); List mnemonic = MnemonicCode.INSTANCE.toMnemonic(entropy); assertThat(String.join(" ", mnemonic), is(expectedMnemonic)); DeterministicSeed seed = DeterministicSeed.ofMnemonic(expectedMnemonic, passphrase); assertThat(Hex.encodeHexString(seed.getSeedBytes()), is(expectedSeedHex)); // Act DeterministicKey masterKey = HDKeyDerivation.createMasterPrivateKey(seed.getSeedBytes()); // Assert assertThat(masterKey.serializePrivB58(MainNetParams.get().network()), is(expectedXprv)); } @Test @UseDataProvider(value = BIP39DataProvider.DATA_PROVIDER_BIP39_TEST_VECTORS, location = BIP39DataProvider.class) public void bip39Vector_givenTestVector_returnsExpectedSeedAndXprvForLanguage(String language, String entropyHex, String mnemonicStr, String passphrase, String expectedSeedHex, String expectedXprv) throws Exception { // Arrange byte[] entropy = Hex.decodeHex(entropyHex); final BIP39Wordlist wordList = BIP39Wordlist.fromLanguageName(language); MnemonicCode mnemonicCode = new MnemonicCode( wordList.getWordListStream(), null ); List mnemonic = mnemonicCode.toMnemonic(entropy); String normalizedMnemonic = Normalizer.normalize(mnemonicStr, Form.NFKD); String normalizedPassphrase = Normalizer.normalize(passphrase, Form.NFKD); // Assert mnemonic assertThat("Language: " + language, String.join(wordList.getSeparator(), mnemonic), is(mnemonicStr)); // Generate seed DeterministicSeed seed = DeterministicSeed.ofMnemonic(normalizedMnemonic, normalizedPassphrase); // Assert seed bytes assertThat("Language: " + language, Hex.encodeHexString(seed.getSeedBytes()), is(expectedSeedHex)); // Generate master key from seed DeterministicKey masterKey = HDKeyDerivation.createMasterPrivateKey(seed.getSeedBytes()); // Assert xprv assertThat("Language: " + language, masterKey.serializePrivB58(MainNetParams.get().network()), is(expectedXprv)); } @Test(expected = NoMoreSecretsAvailableException.class) public void nextKey_counterOverflow_throwsException() { // arrange String mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"; String passphrase = ""; String bip32Path = "M/44H/0H/0H/0"; boolean hardened = false; BIP39KeyProducer producer = new BIP39KeyProducer(mnemonic, passphrase, bip32Path, Instant.ofEpochSecond(0), hardened); producer.counter.set(Integer.MAX_VALUE); try { // act producer.nextKey(); } catch (NoMoreSecretsAvailableException e) { fail("Exception thrown too early: " + e.getMessage()); } // This call should overflow and throw NoMoreSecretsAvailableException producer.nextKey(); } @Test public void testDefaultBip32PathConstant() { assertThat(CKeyProducerJavaBip39.DEFAULT_BIP32_PATH, is("M/44H/0H/0H/0")); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/BIP39WordlistTest.java ================================================ // @formatter:off /** * Copyright 2026 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.io.InputStream; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; import org.junit.Test; /** * Unit tests for {@link BIP39Wordlist}. */ public class BIP39WordlistTest { // @Test public void ideographicSpace_constant_hasCorrectUnicodeValue() { // arrange String expected = "\u3000"; // act String actual = BIP39Wordlist.IDEOGRAPHIC_SPACE; // assert assertThat(actual, is(equalTo(expected))); } @Test public void normalSpace_constant_hasCorrectValue() { // arrange String expected = " "; // act String actual = BIP39Wordlist.NORMAL_SPACE; // assert assertThat(actual, is(equalTo(expected))); } @Test public void ideographicSpace_constant_isOneCharacter() { // act String space = BIP39Wordlist.IDEOGRAPHIC_SPACE; // assert assertThat(space.length(), is(equalTo(1))); } @Test public void normalSpace_constant_isOneCharacter() { // act String space = BIP39Wordlist.NORMAL_SPACE; // assert assertThat(space.length(), is(equalTo(1))); } // // @Test public void getWordListStream_englishWordlist_returnsNonNullStream() { // act InputStream stream = BIP39Wordlist.ENGLISH.getWordListStream(); // assert assertThat(stream, is(notNullValue())); } @Test public void getWordListStream_chineseSimplifiedWordlist_returnsNonNullStream() { // act InputStream stream = BIP39Wordlist.CHINESE_SIMPLIFIED.getWordListStream(); // assert assertThat(stream, is(notNullValue())); } @Test public void getWordListStream_chineseTraditionalWordlist_returnsNonNullStream() { // act InputStream stream = BIP39Wordlist.CHINESE_TRADITIONAL.getWordListStream(); // assert assertThat(stream, is(notNullValue())); } @Test public void getWordListStream_czechWordlist_returnsNonNullStream() { // act InputStream stream = BIP39Wordlist.CZECH.getWordListStream(); // assert assertThat(stream, is(notNullValue())); } @Test public void getWordListStream_frenchWordlist_returnsNonNullStream() { // act InputStream stream = BIP39Wordlist.FRENCH.getWordListStream(); // assert assertThat(stream, is(notNullValue())); } @Test public void getWordListStream_italianWordlist_returnsNonNullStream() { // act InputStream stream = BIP39Wordlist.ITALIAN.getWordListStream(); // assert assertThat(stream, is(notNullValue())); } @Test public void getWordListStream_japaneseWordlist_returnsNonNullStream() { // act InputStream stream = BIP39Wordlist.JAPANESE.getWordListStream(); // assert assertThat(stream, is(notNullValue())); } @Test public void getWordListStream_koreanWordlist_returnsNonNullStream() { // act InputStream stream = BIP39Wordlist.KOREAN.getWordListStream(); // assert assertThat(stream, is(notNullValue())); } @Test public void getWordListStream_portugueseWordlist_returnsNonNullStream() { // act InputStream stream = BIP39Wordlist.PORTUGUESE.getWordListStream(); // assert assertThat(stream, is(notNullValue())); } @Test public void getWordListStream_russianWordlist_returnsNonNullStream() { // act InputStream stream = BIP39Wordlist.RUSSIAN.getWordListStream(); // assert assertThat(stream, is(notNullValue())); } @Test public void getWordListStream_spanishWordlist_returnsNonNullStream() { // act InputStream stream = BIP39Wordlist.SPANISH.getWordListStream(); // assert assertThat(stream, is(notNullValue())); } @Test public void getWordListStream_turkishWordlist_returnsNonNullStream() { // act InputStream stream = BIP39Wordlist.TURKISH.getWordListStream(); // assert assertThat(stream, is(notNullValue())); } @Test public void getWordListStream_allWordlists_returnNonNullStream() { // assert for (BIP39Wordlist wordlist : BIP39Wordlist.values()) { // act InputStream stream = wordlist.getWordListStream(); // assert assertThat("Expected non-null stream for wordlist: " + wordlist.name(), stream, is(notNullValue())); } } // // @Test public void fromLanguageName_lowercaseEnglish_returnsEnglishEnum() { // arrange String name = "english"; // act BIP39Wordlist result = BIP39Wordlist.fromLanguageName(name); // assert assertThat(result, is(equalTo(BIP39Wordlist.ENGLISH))); } @Test public void fromLanguageName_lowercaseJapanese_returnsJapaneseEnum() { // arrange String name = "japanese"; // act BIP39Wordlist result = BIP39Wordlist.fromLanguageName(name); // assert assertThat(result, is(equalTo(BIP39Wordlist.JAPANESE))); } @Test public void fromLanguageName_underscoredChineseSimplified_returnsChineseSimplifiedEnum() { // arrange String name = "chinese_simplified"; // act BIP39Wordlist result = BIP39Wordlist.fromLanguageName(name); // assert assertThat(result, is(equalTo(BIP39Wordlist.CHINESE_SIMPLIFIED))); } @Test public void fromLanguageName_uppercaseEnglish_returnsEnglishEnum() { // arrange String name = "ENGLISH"; // act BIP39Wordlist result = BIP39Wordlist.fromLanguageName(name); // assert assertThat(result, is(equalTo(BIP39Wordlist.ENGLISH))); } @Test public void fromLanguageName_mixedCaseFrench_returnsFrenchEnum() { // arrange String name = "French"; // act BIP39Wordlist result = BIP39Wordlist.fromLanguageName(name); // assert assertThat(result, is(equalTo(BIP39Wordlist.FRENCH))); } @Test public void fromLanguageName_hyphenatedChineseSimplified_returnsChineseSimplifiedEnum() { // arrange // hyphens are converted to underscores by fromLanguageName String name = "chinese-simplified"; // act BIP39Wordlist result = BIP39Wordlist.fromLanguageName(name); // assert assertThat(result, is(equalTo(BIP39Wordlist.CHINESE_SIMPLIFIED))); } @Test(expected = IllegalArgumentException.class) public void fromLanguageName_unknownLanguage_throwsException() { // act BIP39Wordlist.fromLanguageName("klingon"); } @Test public void fromLanguageName_allWordlistNames_roundtripSucceeds() { // assert - each enum name can be converted back to itself via lower-case for (BIP39Wordlist wordlist : BIP39Wordlist.values()) { // arrange String name = wordlist.name().toLowerCase(); // act BIP39Wordlist result = BIP39Wordlist.fromLanguageName(name); // assert assertThat(result, is(equalTo(wordlist))); } } // // @Test public void getSeparator_japaneseWordlist_returnsIdeographicSpace() { // act String separator = BIP39Wordlist.JAPANESE.getSeparator(); // assert assertThat(separator, is(equalTo(BIP39Wordlist.IDEOGRAPHIC_SPACE))); } @Test public void getSeparator_englishWordlist_returnsNormalSpace() { // act String separator = BIP39Wordlist.ENGLISH.getSeparator(); // assert assertThat(separator, is(equalTo(BIP39Wordlist.NORMAL_SPACE))); } @Test public void getSeparator_chineseSimplifiedWordlist_returnsNormalSpace() { // act String separator = BIP39Wordlist.CHINESE_SIMPLIFIED.getSeparator(); // assert assertThat(separator, is(equalTo(BIP39Wordlist.NORMAL_SPACE))); } @Test public void getSeparator_chineseTraditionalWordlist_returnsNormalSpace() { // act String separator = BIP39Wordlist.CHINESE_TRADITIONAL.getSeparator(); // assert assertThat(separator, is(equalTo(BIP39Wordlist.NORMAL_SPACE))); } @Test public void getSeparator_spanishWordlist_returnsNormalSpace() { // act String separator = BIP39Wordlist.SPANISH.getSeparator(); // assert assertThat(separator, is(equalTo(BIP39Wordlist.NORMAL_SPACE))); } @Test public void getSeparator_allNonJapaneseWordlists_returnNormalSpace() { // assert for (BIP39Wordlist wordlist : BIP39Wordlist.values()) { if (wordlist == BIP39Wordlist.JAPANESE) { continue; } // act String separator = wordlist.getSeparator(); // assert assertThat("Expected normal space for wordlist: " + wordlist.name(), separator, is(equalTo(BIP39Wordlist.NORMAL_SPACE))); } } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/Base36DecoderTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.math.BigInteger; import java.util.Arrays; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import org.junit.Test; public class Base36DecoderTest { private final Base36Decoder decoder = new Base36Decoder(); // @Test public void decodeBase36ToFixedLengthBytes_validInput_exact20Bytes() { // arrange String base36Encoded = new BigInteger(1, new byte[20]).toString(36); int expectedLength = 20; // act byte[] result = decoder.decodeBase36ToFixedLengthBytes(base36Encoded, expectedLength); // assert assertThat(result.length, is(equalTo(expectedLength))); assertThat(result, is(new byte[20])); } @Test public void decodeBase36ToFixedLengthBytes_validInput_exact1Byte() { // arrange byte[] original = {0x7F}; String base36Encoded = new BigInteger(1, original).toString(36); // act byte[] result = decoder.decodeBase36ToFixedLengthBytes(base36Encoded, 1); // assert assertThat(result.length, is(equalTo(1))); assertThat(result[0], is(equalTo((byte) 0x7F))); } @Test public void decodeBase36ToFixedLengthBytes_zeroBytes_producesAllZeros() { // arrange String base36Encoded = "0"; int expectedLength = 20; byte[] expectedAllZeros = new byte[expectedLength]; // act byte[] result = decoder.decodeBase36ToFixedLengthBytes(base36Encoded, expectedLength); // assert assertThat(result, is(expectedAllZeros)); } // // @Test public void decodeBase36ToFixedLengthBytes_validInput_shorterThan20Bytes() { // arrange byte[] original = {0x01, 0x02, 0x03}; // 3 bytes String base36Encoded = new BigInteger(1, original).toString(36); final int expectedLength = 20; final int paddingLength = expectedLength - original.length; // act byte[] result = decoder.decodeBase36ToFixedLengthBytes(base36Encoded, expectedLength); // assert assertThat(result.length, is(equalTo(expectedLength))); // The original bytes should be right-aligned (at the end) assertThat(Arrays.copyOfRange(result, paddingLength, expectedLength), is(original)); // Leading bytes should be padded with zeros byte[] expectedPadding = new byte[paddingLength]; assertThat(Arrays.copyOfRange(result, 0, paddingLength), is(expectedPadding)); } @Test public void decodeBase36ToFixedLengthBytes_singleByteInput_leftPaddedWithZeros() { // arrange byte[] original = {(byte) 0xAB}; String base36Encoded = new BigInteger(1, original).toString(36); final int targetLength = 10; // act byte[] result = decoder.decodeBase36ToFixedLengthBytes(base36Encoded, targetLength); // assert assertThat(result.length, is(equalTo(targetLength))); assertThat(result[targetLength - 1], is(equalTo((byte) 0xAB))); byte[] expectedPadding = new byte[targetLength - 1]; assertThat(Arrays.copyOfRange(result, 0, targetLength - 1), is(expectedPadding)); } @Test public void decodeBase36ToFixedLengthBytes_twoBytesInput_leftPaddedWithZeros() { // arrange byte[] original = {0x12, 0x34}; String base36Encoded = new BigInteger(1, original).toString(36); final int targetLength = 5; final int paddingLength = targetLength - original.length; // act byte[] result = decoder.decodeBase36ToFixedLengthBytes(base36Encoded, targetLength); // assert assertThat(result.length, is(equalTo(targetLength))); assertThat(Arrays.copyOfRange(result, paddingLength, targetLength), is(original)); byte[] expectedPadding = new byte[paddingLength]; assertThat(Arrays.copyOfRange(result, 0, paddingLength), is(expectedPadding)); } // // @Test public void decodeBase36ToFixedLengthBytes_validInput_longerThan20Bytes() { // arrange byte[] longBytes = new byte[25]; Arrays.fill(longBytes, (byte) 0x7F); String base36Encoded = new BigInteger(1, longBytes).toString(36); final int targetLength = 20; // act byte[] result = decoder.decodeBase36ToFixedLengthBytes(base36Encoded, targetLength); // assert assertThat(result.length, is(equalTo(targetLength))); // When input is longer, the least-significant bytes are kept // Verify that result contains expected byte values byte[] expectedContent = new byte[targetLength]; Arrays.fill(expectedContent, (byte) 0x7F); assertThat(result, is(expectedContent)); } @Test public void decodeBase36ToFixedLengthBytes_muchlongerInput_trimsToTargetLength() { // arrange byte[] longBytes = new byte[50]; Arrays.fill(longBytes, (byte) 0xFF); String base36Encoded = new BigInteger(1, longBytes).toString(36); final int targetLength = 10; // act byte[] result = decoder.decodeBase36ToFixedLengthBytes(base36Encoded, targetLength); // assert // Verify both length and that result contains expected values byte[] expectedContent = new byte[targetLength]; Arrays.fill(expectedContent, (byte) 0xFF); assertThat(result, is(expectedContent)); } // // @Test public void decodeBase36ToFixedLengthBytes_maxByteValue_decodesCorrectly() { // arrange byte[] original = {(byte) 0xFF}; String base36Encoded = new BigInteger(1, original).toString(36); // act byte[] result = decoder.decodeBase36ToFixedLengthBytes(base36Encoded, 1); // assert assertThat(result.length, is(equalTo(1))); assertThat(result[0], is(equalTo((byte) 0xFF))); } @Test public void decodeBase36ToFixedLengthBytes_allMaxBytes_decodesCorrectly() { // arrange byte[] expected = new byte[5]; Arrays.fill(expected, (byte) 0xFF); String base36Encoded = new BigInteger(1, expected).toString(36); // act byte[] result = decoder.decodeBase36ToFixedLengthBytes(base36Encoded, expected.length); // assert assertThat(result, is(expected)); } // // @Test(expected = NumberFormatException.class) public void decodeBase36ToFixedLengthBytes_invalidCharacters_throwsException() { // arrange String invalidBase36 = "O0I1L$%"; // invalid characters for BigInteger(36) // act decoder.decodeBase36ToFixedLengthBytes(invalidBase36, 20); } @Test(expected = NumberFormatException.class) public void decodeBase36ToFixedLengthBytes_emptyString_throwsException() { // arrange String emptyString = ""; // act decoder.decodeBase36ToFixedLengthBytes(emptyString, 20); } @Test(expected = NumberFormatException.class) public void decodeBase36ToFixedLengthBytes_invalidCharacterSpace_throwsException() { // arrange String invalidBase36 = "123 456"; // space is invalid in base36 // act decoder.decodeBase36ToFixedLengthBytes(invalidBase36, 20); } // // @Test public void decodeBase36ToFixedLengthBytes_encodeDecodeRoundTrip_producesOriginalData() { // arrange byte[] original = {0x01, 0x02, 0x03, 0x04, 0x05}; String encoded = new BigInteger(1, original).toString(36); // act byte[] decoded = decoder.decodeBase36ToFixedLengthBytes(encoded, 5); // pre-assert assertThat(decoded, is(original)); // Re-encode should produce the same base36 string String reencoded = new BigInteger(1, decoded).toString(36); // assert assertThat(reencoded, is(equalTo(encoded))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/Bech32HelperTest.java ================================================ // @formatter:off /** * Copyright 2026 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.nio.ByteBuffer; import net.ladenthin.bitcoinaddressfinder.staticaddresses.enums.P2PKH; import net.ladenthin.bitcoinaddressfinder.staticaddresses.enums.P2WPKH; import org.bitcoinj.base.Bech32; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.startsWith; public class Bech32HelperTest { private final KeyUtility keyUtility = new KeyUtility(new NetworkParameterFactory().getNetwork(), new ByteBufferUtility(false)); // @Test public void decodeBech32CharsetToValues_fullCharset_returnsValuesZeroToThirtyOne() { // arrange Bech32Helper sut = new Bech32Helper(); byte[] expected = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}; // act byte[] result = sut.decodeBech32CharsetToValues(Bech32Helper.CHARSET); // assert assertThat(result, is(expected)); } @Test(expected = IllegalArgumentException.class) public void decodeBech32CharsetToValues_invalidCharacter_throwsException() { // arrange Bech32Helper sut = new Bech32Helper(); // act // 'i' is not part of the Bech32 character set (excluded to avoid visual ambiguity with '1') sut.decodeBech32CharsetToValues("i"); } // // @Test public void extractPKHFromBitcoinCashAddress_withoutPrefix_returnsCorrectHash160() throws ReflectiveOperationException { // arrange P2PKH address = P2PKH.BitcoinCash; // act byte[] hash160 = new Bech32Helper().extractPKHFromBitcoinCashAddress(address.getPublicAddress()); // assert ByteBuffer buffer = keyUtility.byteBufferUtility().byteArrayToByteBuffer(hash160); String actualHashHex = keyUtility.byteBufferUtility().getHexFromByteBuffer(buffer); assertThat(actualHashHex, is(equalTo(address.getPublicKeyHashAsHex()))); } @Test public void extractPKHFromBitcoinCashAddress_withPrefix_returnsCorrectHash160() throws ReflectiveOperationException { // arrange P2PKH address = P2PKH.BitcoinCashWithPrefix; // pre-assert assertThat(address.getPublicAddress(), startsWith(AddressTxtLine.BITCOIN_CASH_PREFIX)); // act byte[] hash160 = new Bech32Helper().extractPKHFromBitcoinCashAddress(address.getPublicAddress()); // assert ByteBuffer buffer = keyUtility.byteBufferUtility().byteArrayToByteBuffer(hash160); String actualHashHex = keyUtility.byteBufferUtility().getHexFromByteBuffer(buffer); assertThat(actualHashHex, is(equalTo(address.getPublicKeyHashAsHex()))); } // // @Test public void getWitnessPrograms_validBech32Data_returnsWitnessProgram() throws ReflectiveOperationException { // arrange P2WPKH address = P2WPKH.Bitcoin; Bech32.Bech32Data bechData = Bech32.decode(address.getPublicAddress()); Bech32Helper sut = new Bech32Helper(); // act byte[] witnessProgram = sut.getWitnessPrograms(bechData); // assert assertThat(witnessProgram, is(address.getWitnessProgram())); } // // @Test public void getWitnessVersion_validBech32Data_returnsZero() throws ReflectiveOperationException { // arrange P2WPKH address = P2WPKH.Bitcoin; Bech32.Bech32Data bechData = Bech32.decode(address.getPublicAddress()); Bech32Helper sut = new Bech32Helper(); // act Short witnessVersion = sut.getWitnessVersion(bechData); // assert assertThat(witnessVersion, is((short) 0)); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/BitHelperTest.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.io.IOException; import java.math.BigInteger; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(DataProviderRunner.class) public class BitHelperTest { // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_KILL_BITS, location = CommonDataProvider.class) public void getKillBits_bitsGiven_killBitsEqualsExpectation(int bits, BigInteger killBits) throws IOException { // arrange BitHelper bitHelper = new BitHelper(); // act, assert assertThat(bitHelper.getKillBits(bits), is(equalTo(killBits))); } // // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_BITS_TO_SIZE, location = CommonDataProvider.class) public void convertBitsToSize_bitsGiven_sizeEqualsExpectation(int bits, int size) throws IOException { // arrange BitHelper bitHelper = new BitHelper(); // act, assert assertThat(bitHelper.convertBitsToSize(bits), is(equalTo(size))); } // // @Test(expected = IllegalArgumentException.class) public void assertBatchSizeInBitsIsInRange_bitsGivenBelowMinimum_exceptionThrown() throws IOException { // arrange BitHelper bitHelper = new BitHelper(); // act, assert bitHelper.assertBatchSizeInBitsIsInRange(-1); } @Test(expected = IllegalArgumentException.class) public void assertBatchSizeInBitsCorrect_bitsGivenOverMaximum_exceptionThrown() throws IOException { // arrange BitHelper bitHelper = new BitHelper(); // act, assert bitHelper.assertBatchSizeInBitsIsInRange(PublicKeyBytes.BIT_COUNT_FOR_MAX_CHUNKS_ARRAY + 1); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_BIT_SIZES_AT_MOST_MAX, location = CommonDataProvider.class) public void assertBatchSizeInBitsIsInRange_bitsGivenInRange_exceptionThrown(int bits) throws IOException { // arrange BitHelper bitHelper = new BitHelper(); // act, assert bitHelper.assertBatchSizeInBitsIsInRange(bits); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/ByteBufferUtilityTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.io.IOException; import java.lang.reflect.Field; import java.math.BigInteger; import java.nio.BufferOverflowException; import java.nio.ByteBuffer; import java.util.Arrays; import org.junit.Before; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.*; import org.junit.runner.RunWith; import jdk.internal.ref.Cleaner; import sun.nio.ch.DirectBuffer; @RunWith(DataProviderRunner.class) public class ByteBufferUtilityTest { /** * It does not matter if the value is true or false. */ private final static boolean ALLOCATE_DIRECT_DOES_NOT_MATTER = false; @Before public void init() throws IOException { } // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_ALLOCATE_DIRECT, location = CommonDataProvider.class) public void freeByteBuffer_nullGiven_noExceptionThrown(boolean allocateDirect) throws IOException { // arrange final ByteBufferUtility byteBufferUtility = new ByteBufferUtility(allocateDirect); // act byteBufferUtility.freeByteBuffer(null); // assert } @Test public void freeByteBuffer_cleanerIsNull_noExceptionThrown() throws IOException, IllegalArgumentException, IllegalAccessException, NoSuchFieldException { // arrange byte[] bytesGiven = createDummyByteArray(7); final ByteBufferUtility byteBufferUtility = new ByteBufferUtility(true); ByteBuffer bytesAsByteBuffer = byteBufferUtility.byteArrayToByteBuffer(bytesGiven); DirectBuffer directBuffer = (DirectBuffer)bytesAsByteBuffer; ByteBuffer duplicate = bytesAsByteBuffer.duplicate(); DirectBuffer directBufferDuplicate = (DirectBuffer)duplicate; // pre assert assertThat(directBuffer.cleaner(), is(not(nullValue()))); assertThat(directBufferDuplicate.cleaner(), is(nullValue())); // act byteBufferUtility.freeByteBuffer(bytesAsByteBuffer); // assert } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_ALLOCATE_DIRECT, location = CommonDataProvider.class) public void freeByteBuffer_freeAGivenByteBuffer_noExceptionThrown(boolean allocateDirect) throws IOException, IllegalArgumentException, IllegalAccessException, NoSuchFieldException { // arrange byte[] bytesGiven = createDummyByteArray(7); final ByteBufferUtility byteBufferUtility = new ByteBufferUtility(allocateDirect); ByteBuffer bytesAsByteBuffer = byteBufferUtility.byteArrayToByteBuffer(bytesGiven); // pre assert if (allocateDirect) { assertThat(isDirectBufferFreed((DirectBuffer)bytesAsByteBuffer), is(false)); } // act byteBufferUtility.freeByteBuffer(bytesAsByteBuffer); // assert if (allocateDirect) { assertThat(isDirectBufferFreed((DirectBuffer)bytesAsByteBuffer), is(true)); } } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_ALLOCATE_DIRECT, location = CommonDataProvider.class) public void freeByteBuffer_freeAGivenByteBufferGivenTwice_noExceptionThrown(boolean allocateDirect) throws IOException { // arrange byte[] bytesGiven = createDummyByteArray(7); final ByteBufferUtility byteBufferUtility = new ByteBufferUtility(allocateDirect); ByteBuffer bytesAsByteBuffer = byteBufferUtility.byteArrayToByteBuffer(bytesGiven); // act byteBufferUtility.freeByteBuffer(bytesAsByteBuffer); byteBufferUtility.freeByteBuffer(bytesAsByteBuffer); // assert } // // private ByteBuffer createDummyByteBuffer(int size) { ByteBuffer byteBuffer = ByteBuffer.allocate(size); for (int i = 0; i < size; i++) { byteBuffer.put((byte) i); } byteBuffer.flip(); return byteBuffer; } private byte[] createDummyByteArray(int size) { byte[] bytes = new byte[size]; for (int i = 0; i < size; i++) { bytes[i] = (byte) i; } return bytes; } // // @Test public void byteBufferToBytes_allBytesEquals() throws IOException { // arrange ByteBuffer dummy = createDummyByteBuffer(7); // act byte[] bytes = new ByteBufferUtility(false).byteBufferToBytes(dummy); // assert assertThat(Arrays.toString(bytes), is(equalTo("[0, 1, 2, 3, 4, 5, 6]"))); } @Test public void byteBufferToBytes_idempotence() throws IOException { // arrange ByteBuffer dummy = createDummyByteBuffer(7); // act byte[] bytes1 = new ByteBufferUtility(false).byteBufferToBytes(dummy); byte[] bytes2 = new ByteBufferUtility(false).byteBufferToBytes(dummy); // assert assertThat(Arrays.toString(bytes2), is(equalTo(Arrays.toString(bytes1)))); } // // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_ALLOCATE_DIRECT, location = CommonDataProvider.class) public void byteArrayToByteBuffer_wrapped_allBytesEquals(boolean allocateDirect) throws IOException { // arrange byte[] bytes = createDummyByteArray(7); // act ByteBuffer byteBuffer = new ByteBufferUtility(allocateDirect).byteArrayToByteBuffer(bytes); // assert assertThat(byteBuffer.isDirect(), is(equalTo(allocateDirect))); byte[] bytesFromByteBuffer = new ByteBufferUtility(ALLOCATE_DIRECT_DOES_NOT_MATTER).byteBufferToBytes(byteBuffer); assertThat(Arrays.toString(bytesFromByteBuffer), is(equalTo("[0, 1, 2, 3, 4, 5, 6]"))); } // // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_ALLOCATE_DIRECT, location = CommonDataProvider.class) public void getHexFromByteBuffer_byteBufferProvided_returnHex(boolean allocateDirect) throws IOException { // arrange String hexExpected = "00010203040506"; byte[] bytesGiven = createDummyByteArray(7); final ByteBufferUtility byteBufferUtility = new ByteBufferUtility(allocateDirect); ByteBuffer bytesAsByteBuffer = byteBufferUtility.byteArrayToByteBuffer(bytesGiven); // act String hex = byteBufferUtility.getHexFromByteBuffer(bytesAsByteBuffer); // assert assertThat(hex, is(equalTo(hexExpected))); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_ALLOCATE_DIRECT, location = CommonDataProvider.class) public void getByteBufferFromHex_HexProvided_returnByteBuffer(boolean allocateDirect) throws IOException { // arrange String hexGiven = "00010203040506"; byte[] bytesExpected = createDummyByteArray(7); // act ByteBuffer byteBuffer = new ByteBufferUtility(allocateDirect).getByteBufferFromHex(hexGiven); // assert assertThat(byteBuffer.isDirect(), is(equalTo(allocateDirect))); byte[] bytesFromByteBuffer = new ByteBufferUtility(ALLOCATE_DIRECT_DOES_NOT_MATTER).byteBufferToBytes(byteBuffer); assertThat(bytesFromByteBuffer, is(equalTo(bytesExpected))); } // private long getAddressFromDirectBuffer(DirectBuffer directBuffer) throws IllegalArgumentException, NoSuchFieldException, SecurityException, IllegalAccessException { Cleaner cleaner = directBuffer.cleaner(); Field thunkField = cleaner.getClass().getDeclaredField("thunk"); thunkField.setAccessible(true); Object deallocator = thunkField.get(cleaner); Field addressField = deallocator.getClass().getDeclaredField("address"); addressField.setAccessible(true); return addressField.getLong(deallocator); } private boolean isDirectBufferFreed(DirectBuffer directBuffer) throws IllegalArgumentException, NoSuchFieldException, SecurityException, IllegalAccessException { // does not work with newer JVMs (21) anymore boolean testWithAddress = false; boolean addressTest = true; Cleaner cleaner = directBuffer.cleaner(); Field nextField = cleaner.getClass().getDeclaredField("next"); nextField.setAccessible(true); Object next = nextField.get(cleaner); Field prevField = cleaner.getClass().getDeclaredField("prev"); prevField.setAccessible(true); Object prev = prevField.get(cleaner); if (testWithAddress) { long address = getAddressFromDirectBuffer(directBuffer); addressTest = address == 0L; } return next == prev && addressTest; } // @Test public void ensureByteBufferCapacityFitsInt_zeroGiven_returnZero() { // arrange long capacity = 0L; // act int result = ByteBufferUtility.ensureByteBufferCapacityFitsInt(capacity); // assert assertThat(result, is(equalTo(0))); } @Test public void ensureByteBufferCapacityFitsInt_smallValueGiven_returnAsInt() { // arrange long capacity = 1234L; // act int result = ByteBufferUtility.ensureByteBufferCapacityFitsInt(capacity); // assert assertThat(result, is(equalTo(1234))); } @Test public void ensureByteBufferCapacityFitsInt_maxIntGiven_returnAsInt() { // arrange long capacity = Integer.MAX_VALUE; // act int result = ByteBufferUtility.ensureByteBufferCapacityFitsInt(capacity); // assert assertThat(result, is(equalTo(Integer.MAX_VALUE))); } @Test(expected = IllegalArgumentException.class) public void ensureByteBufferCapacityFitsInt_valueTooLarge_throwsException() { // arrange long capacity = (long) Integer.MAX_VALUE + 1L; // act ByteBufferUtility.ensureByteBufferCapacityFitsInt(capacity); // assert is handled by exception rule } @Test(expected = IllegalArgumentException.class) public void ensureByteBufferCapacityFitsInt_negativeValueGiven_throwsException() { // arrange long capacity = -1L; // act ByteBufferUtility.ensureByteBufferCapacityFitsInt(capacity); // assert is handled by exception rule } // // /** * Ensures that a direct ByteBuffer is successfully allocated when configured to allow direct allocation. */ @Test public void allocateByteBufferDirectStrict_directAllocationEnabled_returnsDirectBuffer() { // arrange final ByteBufferUtility byteBufferUtility = new ByteBufferUtility(true); // act ByteBuffer directBuffer = byteBufferUtility.allocateByteBufferDirectStrict(16); // assert assertThat(directBuffer.isDirect(), is(true)); assertThat(directBuffer.capacity(), is(equalTo(16))); } /** * Ensures that an exception is thrown when trying to allocate a direct ByteBuffer while direct allocation is disabled. */ @Test(expected = IllegalStateException.class) public void allocateByteBufferDirectStrict_directAllocationDisabled_throwsException() { // arrange final ByteBufferUtility byteBufferUtility = new ByteBufferUtility(false); // act byteBufferUtility.allocateByteBufferDirectStrict(16); // assert handled by exception } // // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_BIG_INTEGER_VARIANTS, location = CommonDataProvider.class) public void bigIntegerToBytes_leadingZeroStripped(BigInteger input, int expectedLength, byte expectedFirstByte) { // act byte[] actualBytes = ByteBufferUtility.bigIntegerToBytes(input); // assert assertThat(actualBytes.length, is(equalTo(expectedLength))); if (actualBytes.length > 0) { assertThat(actualBytes[0], is(equalTo(expectedFirstByte))); } } // // @Test public void bigIntegerToBytes_maxPrivateKeyGiven_returnWithoutLeadingZeros() throws IOException { // arrange BigInteger key = PublicKeyBytes.MAX_TECHNICALLY_PRIVATE_KEY; byte[] maxPrivateKey = key.toByteArray(); assertThat(maxPrivateKey.length, is(equalTo(33))); ByteBufferUtility byteBufferUtility = new ByteBufferUtility(true); // act byte[] keyWithoutLeadingZeros = ByteBufferUtility.bigIntegerToBytes(key); // assert assertThat(keyWithoutLeadingZeros.length, is(equalTo(32))); // copy back byte[] arrayWithLeadingZero = new byte[33]; System.arraycopy(keyWithoutLeadingZeros, 0, arrayWithLeadingZero, 1, 32); // assert content equals assertThat(arrayWithLeadingZero, is(equalTo(maxPrivateKey))); } // // @Test public void reverse_singleElement_noChange() { // arrange ByteBufferUtility byteBufferUtility = new ByteBufferUtility(true); byte[] input = { 0x42 }; byte[] expected = { 0x42 }; // act byteBufferUtility.reverse(input); // assert assertThat(input, is(equalTo(expected))); } @Test public void reverse_evenLengthArray_correctlyReversed() { // arrange ByteBufferUtility byteBufferUtility = new ByteBufferUtility(true); byte[] input = { 0x01, 0x02, 0x03, 0x04 }; byte[] expected = { 0x04, 0x03, 0x02, 0x01 }; // act byteBufferUtility.reverse(input); // assert assertThat(input, is(equalTo(expected))); } @Test public void reverse_oddLengthArray_correctlyReversed() { // arrange ByteBufferUtility byteBufferUtility = new ByteBufferUtility(true); byte[] input = { 0x01, 0x02, 0x03 }; byte[] expected = { 0x03, 0x02, 0x01 }; // act byteBufferUtility.reverse(input); // assert assertThat(input, is(equalTo(expected))); } // // @Test public void putToByteBuffer_arraySmallerThanBuffer_writtenCorrectly() { ByteBuffer buffer = ByteBuffer.allocate(4); byte[] input = { 0x11, 0x22 }; ByteBufferUtility.putToByteBuffer(buffer, input); buffer.rewind(); assertThat(buffer.get(), is((byte) 0x11)); assertThat(buffer.get(), is((byte) 0x22)); } @Test public void putToByteBuffer_arraySameSizeAsBuffer_writtenCompletely() { ByteBuffer buffer = ByteBuffer.allocate(2); byte[] input = { 0x11, 0x22 }; ByteBufferUtility.putToByteBuffer(buffer, input); buffer.rewind(); assertThat(buffer.get(), is((byte) 0x11)); assertThat(buffer.get(), is((byte) 0x22)); } @Test(expected = BufferOverflowException.class) public void putToByteBuffer_arrayLargerThanBuffer_throwsBufferOverflowException() { ByteBuffer buffer = ByteBuffer.allocate(1); byte[] input = { 0x11, 0x22 }; ByteBufferUtility.putToByteBuffer(buffer, input); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/ByteConversionTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.io.IOException; import org.apache.commons.codec.DecoderException; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(DataProviderRunner.class) public class ByteConversionTest { private final ByteConversion byteConversion = new ByteConversion(); // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_BYTES_TO_MIB, location = CommonDataProvider.class) public void bytesToMib_bytesGiven_returnExpectedMib(long bytes, double expectedMib) throws IOException, InterruptedException, DecoderException { // act double result = byteConversion.bytesToMib(bytes); // assert assertThat(result, is(equalTo(expectedMib))); } @Test public void bytesToMib_zeroBytes_returnsZero() { // act double result = byteConversion.bytesToMib(0L); // assert assertThat(result, is(equalTo(0.0))); } @Test public void bytesToMib_oneMib_returnsOne() { // arrange long oneMemInBytes = 1024L * 1024L; // act double result = byteConversion.bytesToMib(oneMemInBytes); // assert assertThat(result, is(equalTo(1.0))); } @Test public void bytesToMib_twoMib_returnsTwo() { // arrange long twoMibInBytes = 2L * 1024L * 1024L; // act double result = byteConversion.bytesToMib(twoMibInBytes); // assert assertThat(result, is(equalTo(2.0))); } @Test public void bytesToMib_largeValue_returnsCorrectMib() { // arrange long oneThouandMibInBytes = 1000L * 1024L * 1024L; // act double result = byteConversion.bytesToMib(oneThouandMibInBytes); // assert assertThat(result, is(equalTo(1000.0))); } @Test public void bytesToMib_singleByte_returnsSmallFraction() { // act double result = byteConversion.bytesToMib(1L); // assert assertThat(result > 0.0, is(true)); assertThat(result < 0.001, is(true)); } @Test public void bytesToMib_maxLongValue_returnsLargeValue() { // act double result = byteConversion.bytesToMib(Long.MAX_VALUE); // assert assertThat(result > 0.0, is(true)); } // // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_MIB_TO_BYTES, location = CommonDataProvider.class) public void mibToBytes_mibGiven_returnExpectedBytes(long mib, long expectedBytes) throws IOException, InterruptedException, DecoderException { // act long result = byteConversion.mibToBytes(mib); // assert assertThat(result, is(equalTo(expectedBytes))); } @Test public void mibToBytes_zeroMib_returnsZeroBytes() { // act long result = byteConversion.mibToBytes(0L); // assert assertThat(result, is(equalTo(0L))); } @Test public void mibToBytes_oneMib_returnsOneMibInBytes() { // act long result = byteConversion.mibToBytes(1L); // assert assertThat(result, is(equalTo(1024L * 1024L))); } @Test public void mibToBytes_twoMib_returnsTwoMibInBytes() { // act long result = byteConversion.mibToBytes(2L); // assert assertThat(result, is(equalTo(2L * 1024L * 1024L))); } @Test public void mibToBytes_largeValue_returnsCorrectBytes() { // arrange long largeValue = 1000L; // act long result = byteConversion.mibToBytes(largeValue); // assert assertThat(result, is(equalTo(1000L * 1024L * 1024L))); } @Test public void mibToBytes_oneGigabyte_returnsCorrectBytes() { // arrange long oneGibInMib = 1024L; // act long result = byteConversion.mibToBytes(oneGibInMib); // assert assertThat(result, is(equalTo(1024L * 1024L * 1024L))); } // // @Test public void mibToBytes_bytesToMib_roundTrip_preservesValue() { // arrange long originalMib = 512L; // act long bytes = byteConversion.mibToBytes(originalMib); double resultMib = byteConversion.bytesToMib(bytes); // assert assertThat(resultMib, is(equalTo((double) originalMib))); } @Test public void bytesToMib_mibToBytes_roundTrip_preservesValue() { // arrange long originalBytes = 10L * 1024L * 1024L; // act double mib = byteConversion.bytesToMib(originalBytes); long resultBytes = byteConversion.mibToBytes((long) mib); // assert assertThat(resultBytes, is(equalTo(originalBytes))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/CommonDataProvider.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.tngtech.java.junit.dataprovider.DataProvider; import java.math.BigInteger; import java.util.Arrays; import java.nio.ByteOrder; import java.util.ArrayList; import java.util.Collections; import java.util.List; import net.ladenthin.bitcoinaddressfinder.configuration.CSecretFormat; import net.ladenthin.bitcoinaddressfinder.staticaddresses.enums.*; public class CommonDataProvider { /** * For {@link #cSecretFormat()}. */ public final static String DATA_PROVIDER_LARGE_SECRETS_AS_HEX = "largeSecretsAsHex"; /** * Provides valid 64-character (32-byte) hex strings representing large unsigned secrets. * * These values are used to verify correct conversion from hex to BigInteger and back to hex, * without losing leading zero bytes — a common issue with BigInteger.toByteArray(). * * ⚠️ Important: * - Avoid using {@code new BigInteger(...).toByteArray()} directly, as it may introduce a leading sign byte (0x00) * or drop leading zeros depending on the value. * - Instead, use {@code BigInteger.toString(16)} cautiously, or prefer utility methods like * {@code keyUtility.bigIntegerToFixedLengthHex(...)} to ensure fixed-length 64-char hex encoding. * * These test cases help detect and avoid those pitfalls. */ @DataProvider public static Object[][] largeSecretsAsHex() { return new Object[][] { {"0000000000000000000000000000000000000000000000000000000000000000"}, {"0000000000000000000000000000000000000000000000000000000000000001"}, {"0000000000000000000000000000000000000000000000400000000000000000"}, {"00000000000000000000000000000000000000000000007fffffffffffffffff"}, {"2c7419465eaba472fd5ff50055a363e55936567a72995be2788aebb4ae74f3ff"}, {"a6eaa2a8fa07686f3ef73736ea4668f5dbcc1f7c178b99afcacdadb64f0ce8bf"}, // must remain 64 hex chars; don't truncate/pad during conversion {PublicKeyBytes.MAX_PRIVATE_KEY_HEX.toLowerCase()}, }; } /** * For {@link #cSecretFormat()}. */ public final static String DATA_PROVIDER_CSECRET_FORMAT = "cSecretFormat"; @DataProvider public static Object[][] cSecretFormat() { return transformFlatToObjectArrayArray(CSecretFormat.values()); } /** * For {@link EndiannessConverterTest}. */ public static final String DATA_PROVIDER_ENDIANNESS = "endiannessScenarios"; @DataProvider public static Object[][] endiannessScenarios() { return new Object[][] { {ByteOrder.LITTLE_ENDIAN, ByteOrder.LITTLE_ENDIAN, false}, {ByteOrder.BIG_ENDIAN, ByteOrder.BIG_ENDIAN, false}, {ByteOrder.LITTLE_ENDIAN, ByteOrder.BIG_ENDIAN, true}, {ByteOrder.BIG_ENDIAN, ByteOrder.LITTLE_ENDIAN, true}, }; } public enum KeyProducerTypesLocal { KeyProducerJavaBip39, KeyProducerJavaIncremental, KeyProducerJavaRandom, KeyProducerJavaSocket, KeyProducerJavaWebSocket, KeyProducerJavaZmq } /** * For {@link FinderTest}. */ public static final String DATA_PROVIDER_KEY_PRODUCER_TYPES = "keyProducerTypes"; @DataProvider public static Object[][] keyProducerTypes() { return Arrays.stream(KeyProducerTypesLocal.values()) .map(type -> new Object[]{type}) .toArray(Object[][]::new); } /** * For tests validating combinations of key producer types and bit sizes. */ public static final String DATA_PROVIDER_JAVA_KEY_PRODUCER_AND_BIT_SIZE = "keyProducerTypeAndBitSize"; @DataProvider public static Object[][] keyProducerTypeAndBitSize() { return mergeMany( keyProducerTypes(), // e.g., Socket, ZMQ, etc. bitSizesAtMostMax() // e.g., 0 – PublicKeyBytes#BIT_COUNT_FOR_MAX_CHUNKS_ARRAY ); } /** * Merges multiple Object[][] data providers into a cartesian product. * Each Object[][] must be a 2D array, where each row is a test case argument set. * * Example: * mergeMany(dp1, dp2, dp3) → returns all combinations of dp1 × dp2 × dp3 */ public static Object[][] mergeMany(Object[][]... providers) { List result = new ArrayList<>(); mergeRecursive(providers, 0, new ArrayList<>(), result); return result.toArray(new Object[0][]); } private static void mergeRecursive(Object[][][] providers, int index, List current, List result) { if (index == providers.length) { result.add(current.toArray()); return; } for (Object[] row : providers[index]) { List next = new ArrayList<>(current); Collections.addAll(next, row); mergeRecursive(providers, index + 1, next, result); } } /** * For {@link #bitsToSize()}. */ public final static String DATA_PROVIDER_BITS_TO_SIZE = "bitsToSize"; @DataProvider public static Object[][] bitsToSize() { return new Object[][]{ {0, 1}, {1, 2}, {2, 4}, {3, 8}, {8, 256}, }; } /** * For {@link #killBits()}. */ public final static String DATA_PROVIDER_KILL_BITS = "killBits"; @DataProvider public static Object[][] killBits() { return new Object[][]{ {0, BigInteger.valueOf(0L)}, {1, BigInteger.valueOf(1L)}, {2, BigInteger.valueOf(3L)}, {3, BigInteger.valueOf(7L)}, {8, BigInteger.valueOf(255L)}, }; } /** * For {@link #bytesToMib()}. */ public final static String DATA_PROVIDER_BYTES_TO_MIB = "bytesToMib"; @DataProvider public static Object[][] bytesToMib() { return new Object[][]{ {1L, 0.00000095367431640625d}, {1024L * 1024L, 1.0d}, {1024L * 1024L, 1.0d}, {1024L * 1024L * 10, 10.0d}, }; } /** * For {@link #mibToBytes()}. */ public final static String DATA_PROVIDER_MIB_TO_BYTES = "mibToBytes"; @DataProvider public static Object[][] mibToBytes() { return new Object[][]{ {1L, 1024L*1024L}, {2L, 1024L*1024L *2L}, {1024L, 1024L*1024L * 1024L}, }; } /** * For {@link #lmdbAmounts()}. */ public final static String DATA_PROVIDER_LMDB_AMOUNTS = "lmdbAmounts"; @DataProvider public static Object[][] lmdbAmounts() { long randomAmount = 13371337L; return new Object[][]{ // use static amount {true, -1337L, randomAmount, -1337L}, {true, -7L, randomAmount, -7L}, {true, -6L, randomAmount, -6L}, {true, -5L, randomAmount, -5L}, {true, -4L, randomAmount, -4L}, {true, -3L, randomAmount, -3L}, {true, -2L, randomAmount, -2L}, {true, -1L, randomAmount, -1L}, {true, 0L, randomAmount, 0L}, {true, 1L, randomAmount, 1L}, {true, 2L, randomAmount, 2L}, {true, 3L, randomAmount, 3L}, {true, 4L, randomAmount, 4L}, {true, 5L, randomAmount, 5L}, {true, 6L, randomAmount, 6L}, {true, 7L, randomAmount, 7L}, {true, 1337L, randomAmount, 1337L}, // not use static amount {false, -1337L, randomAmount, randomAmount}, {false, -7L, randomAmount, randomAmount}, {false, -6L, randomAmount, randomAmount}, {false, -5L, randomAmount, randomAmount}, {false, -4L, randomAmount, randomAmount}, {false, -3L, randomAmount, randomAmount}, {false, -2L, randomAmount, randomAmount}, {false, -1L, randomAmount, randomAmount}, {false, 0L, randomAmount, randomAmount}, {false, 1L, randomAmount, randomAmount}, {false, 2L, randomAmount, randomAmount}, {false, 3L, randomAmount, randomAmount}, {false, 4L, randomAmount, randomAmount}, {false, 5L, randomAmount, randomAmount}, {false, 6L, randomAmount, randomAmount}, {false, 7L, randomAmount, randomAmount}, {false, 1337L, randomAmount, randomAmount}, }; } /** * For {@link #lmdbIncreaseSize()}. */ public final static String DATA_PROVIDER_LMDB_INCREASE_SIZE = "lmdbIncreaseSize"; @DataProvider public static Object[][] lmdbIncreaseSize() { return new Object[][]{ {1024L}, {2048L}, {4096L} }; } /** * For {@link #bitSizesAtMostMax()}. */ public final static String DATA_PROVIDER_BIT_SIZES_AT_MOST_MAX = "bitSizesAtMostMax"; @DataProvider public static Object[][] bitSizesAtMostMax() { final int max = PublicKeyBytes.BIT_COUNT_FOR_MAX_CHUNKS_ARRAY; Object[][] data = new Object[max + 1][1]; for (int i = 0; i <= max; i++) { data[i][0] = i; } return data; } /** * For {@link #compressedAndStaticAmount()}. */ public final static String DATA_PROVIDER_COMPRESSED_AND_STATIC_AMOUNT = "compressedAndStaticAmount"; @DataProvider public static Object[][] compressedAndStaticAmount() { return new Object[][]{ {true, true}, {false, true}, {true, false}, {false, false} }; } /** * For {@link #staticAmount()}. */ public final static String DATA_PROVIDER_STATIC_AMOUNT = "staticAmount"; @DataProvider public static Object[][] staticAmount() { return new Object[][]{ {true}, {false}, }; } /** * For {@link #compressed()}. */ public final static String DATA_PROVIDER_COMPRESSED = "compressed"; @DataProvider public static Object[][] compressed() { return new Object[][]{ {true}, {false}, }; } /** * For {@link #addressSeperator()}. */ public final static String DATA_PROVIDER_ADDRESS_SEPARATOR = "addressSeperator"; @DataProvider public static Object[][] addressSeperator() { return Arrays.stream(SeparatorFormat.values()) .map(format -> new Object[]{format.getSymbol()}) .toArray(Object[][]::new); } /** * For {@link #invalidP2WPKHAddressesValidBase58()}. */ public final static String DATA_PROVIDER_INVALID_P2WPKH_ADDRESSES_VALID_BASE58 = "invalidP2WPKHAddressesValidBase58"; @DataProvider public static Object[][] invalidP2WPKHAddressesValidBase58() { return new Object[][]{ {"bc1zqyqsywvzqeeeeeee", "5347dec05b6f03de6cc004c1ec33000000000000"}, // bitcoin {"bc1zqyqsywvzqeeeeeeeee", "183a5c6b17b17eced6cd0b3e8443d6b300000000"}, // bitcoin {"bc1zqyqsywvzqeeeeeeeeeeeeee1", "b3d1231a68d6dbb47594deac07a0a9fe8352188e"}, // bitcoin {"vtc1zqyqsywvzqe", "51b9d9757bfedb535b3100000000000000000000"}, // vertcoin {"dgb1zqyqsywvzqe", "edaa0ede31d01c768b3100000000000000000000"}, // digibyte }; } /** * For {@link #invalidBech32WitnessVersion2()}. */ public final static String DATA_PROVIDER_INVALID_BECH32_WITNESS_VERSION_2 = "invalidBech32WitnessVersion2"; @DataProvider public static Object[][] invalidBech32WitnessVersion2() { return new Object[][]{ // Not sure where this address comes from, but it has a witness version of 2 and a witness program length of 2 {"bc1zqyqsywvzqe"}, // bitcoin }; } /** * For {@link #invalidBase58()}. */ public final static String DATA_PROVIDER_INVALID_BASE58 = "invalidBase58"; @DataProvider public static Object[][] invalidBase58() { return new Object[][]{ // P2PKH {"1Wr0ngAddressFormat"}, {"1WrongAddressFormat0"}, {"1WrongIAddressFormat"}, {"1WronglAddressFormat"}, // P2WPKH // l (small L) is appended and not a valid base58 char {"bc1zqyqsywvzqel"}, // bitcoin {"vtc1zqyqsywvzqel"}, // vertcoin {"dgb1zqyqsywvzqel"}, // digibyte }; } /** * For {@link #bitcoinAddressesCorrectBase58()}. * A correct base58 format should be parsed anyway. */ public final static String DATA_PROVIDER_BITCOIN_ADDRESSES_CORRECT_BASE_58 = "bitcoinAddressesCorrectBase58"; @DataProvider public static Object[][] bitcoinAddressesCorrectBase58() { return new Object[][]{ {"1WrongAddressFormat","01667b78604490800f88b15c77a5000000000000"}, {"1WrongAddressFormat2","5137f945cf88bd0384f82ef31b63000000000000"}, {"1Wrong1Address2Format3","042b438790b52de2b8235712dbd6e2e400000000"}, }; } /** * For {@link #correctBase58()}. * A correct base58 format should be parsed anyway. */ public final static String DATA_PROVIDER_CORRECT_BASE_58 = "correctBase58"; @DataProvider public static Object[][] correctBase58() { return new Object[][]{ {"1","0000000000000000000000000000000000000000"}, {"15T","0102000000000000000000000000000000000000"}, {"Ldp","0203000000000000000000000000000000000000"}, {"7bWpTW","0203040500000000000000000000000000000000"}, {"t3JZcvsuaXE6ygokL4XUiZSTrQBUoLyYfwu","0000000000000000000000000000000000000000"}, }; } /** * For {@link #srcPos()}. */ public final static String DATA_PROVIDER_SRC_POS = "srcPos"; @DataProvider public static Object[][] srcPos() { return new Object[][]{ {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {20}, }; } /** * For {@link #bitcoinCashAddressesChecksumInvalid()}. * TODO: I don't know if this is right. It seems like it's a base58 format. * I've asked Blockchair and they've answered: "The addresses you listed are for internal purposes.". */ public final static String DATA_PROVIDER_BITCOIN_CASH_ADDRESSES_CHECKSUM_INVALID = "bitcoinCashAddressesChecksumInvalid"; @DataProvider public static Object[][] bitcoinCashAddressesChecksumInvalid() { return new Object[][]{ {"dSn3treXZQfJRktvoApJKM","27225957c54a53b10e4f4e00b2562af400000000"}, {"bq2ZTwe8pt3hyCuy5MudVG","1a0b606a1f1de7a130aae81dc66c665700000000"}, {"W6xvVjvtRobnz9dDdjEugV","ae340f03861fd08558312b97e7926a0000000000"}, {"N1JULkP6RqW3LcbpWvgryV","1aadd1f5457c0f8c08763e55745ff80000000000"}, {"8cE2K6rzN1dVjQXfX3SFcZ","9b072e05be8ff2d1a26e73c694644e0000000000"}, {"kGuKp2vSFzNQ5SJftineWu","5e715d6cc9f93ed922579fd06c47017200000000"}, {"5QmydJKnwKPJb8m1zEQpUV","b661051dd8b1893dd2c10fae9c00de0000000000"}, {"FyXF2p5s8qbonKTuB4MWFr","443ac752c9c5e5445abfe6898dad010000000000"}, {"rWMr7gq4bDKs3T1TgWpTrg","90e9360283cee7ba62e81fe2ef67dcf100000000"}, {"d6qya271t3cYzW8qEEui4E","2459e48a008f3c73c00f9f6e9b24ff0f00000000"}, }; } /** * For {@link #bitcoinCashAddressesInternalPurpose()}. * TODO: I don't know if this is right. It seems like it's a hex format. * I've asked Blockchair and they've answered: "The addresses you listed are for internal purposes.". */ public final static String DATA_PROVIDER_BITCOIN_CASH_ADDRESSES_INTERNAL_PURPOSE = "bitcoinCashAddressesInternalPurpose"; @DataProvider public static Object[][] bitcoinCashAddressesInternalPurpose() { return new Object[][]{ {"d-32551cbc0d16a34c5995b4057c3f027c"}, {"d-29a0bd5b4cfbb05b493a11e0b69cedcc"}, {"d-732cbc077831c75aba49f95eb629bc32"}, {"d-f92fe84dd1620a12daea311393b37549"}, {"d-ca0cf82e6bd2261f3a648a06090dc815"}, }; } /** * For {@link #createSecretBaseLogged()}. */ public final static String DATA_PROVIDER_CREATE_SECRET_BASE_LOGGED = "createSecretBaseLogged"; @DataProvider public static Object[][] createSecretBaseLogged() { return new Object[][]{ // small key, batchSizeInBits: 2 {"ABCDEF", 2, "0000000000000000000000000000000000000000000000000000000000abcdec", "secretBase: 0000000000000000000000000000000000000000000000000000000000abcdec/2", "secret BigInteger: 11259375", "secret as byte array: 0000000000000000000000000000000000000000000000000000000000abcdef", "killBits: 03", "secretBase: 11259372", "secretBase as byte array: 0000000000000000000000000000000000000000000000000000000000abcdec"}, {"FEDCBA", 2, "0000000000000000000000000000000000000000000000000000000000fedcb8", "secretBase: 0000000000000000000000000000000000000000000000000000000000fedcb8/2", "secret BigInteger: 16702650", "secret as byte array: 0000000000000000000000000000000000000000000000000000000000fedcba", "killBits: 03", "secretBase: 16702648", "secretBase as byte array: 0000000000000000000000000000000000000000000000000000000000fedcb8"}, // small key, batchSizeInBits: 21 {"ABCDEF", 21, "0000000000000000000000000000000000000000000000000000000000a00000", "secretBase: 0000000000000000000000000000000000000000000000000000000000a00000/21", "secret BigInteger: 11259375", "secret as byte array: 0000000000000000000000000000000000000000000000000000000000abcdef", "killBits: 1fffff", "secretBase: 10485760", "secretBase as byte array: 0000000000000000000000000000000000000000000000000000000000a00000"}, {"FEDCBA", 21, "0000000000000000000000000000000000000000000000000000000000e00000", "secretBase: 0000000000000000000000000000000000000000000000000000000000e00000/21", "secret BigInteger: 16702650", "secret as byte array: 0000000000000000000000000000000000000000000000000000000000fedcba", "killBits: 1fffff", "secretBase: 14680064", "secretBase as byte array: 0000000000000000000000000000000000000000000000000000000000e00000"}, // large key, batchSizeInBits: 21 {"123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdeff", 21, "123456789abcdef0123456789abcdef0123456789abcdef0123456789aa00000", "secretBase: 123456789abcdef0123456789abcdef0123456789abcdef0123456789aa00000/21", "secret BigInteger: 8234104123542484900769178205574010627627573691361805720124810878238590820095", "secret as byte array: 123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdeff", "killBits: 1fffff", "secretBase: 8234104123542484900769178205574010627627573691361805720124810878238588928000", "secretBase as byte array: 123456789abcdef0123456789abcdef0123456789abcdef0123456789aa00000"}, // large key with odd number, batchSizeInBits: 21 {"00d456789abcdef0123456789abcdef0123456789abcdef0123456789abcdeff", 21, "00d456789abcdef0123456789abcdef0123456789abcdef0123456789aa00000", "secretBase: 00d456789abcdef0123456789abcdef0123456789abcdef0123456789aa00000/21", "secret BigInteger: 375168379408231402782670922269509069226925318059052594399906494889018056447", "secret as byte array: 00d456789abcdef0123456789abcdef0123456789abcdef0123456789abcdeff", "killBits: 1fffff", "secretBase: 375168379408231402782670922269509069226925318059052594399906494889016164352", "secretBase as byte array: 00d456789abcdef0123456789abcdef0123456789abcdef0123456789aa00000"}, {PublicKeyBytes.MAX_PRIVATE_KEY_HEX.toLowerCase(), 2, "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", "secretBase: fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140/2", "secret BigInteger: 115792089237316195423570985008687907852837564279074904382605163141518161494337", "secret as byte array: fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", "killBits: 03", "secretBase: 115792089237316195423570985008687907852837564279074904382605163141518161494336", "secretBase as byte array: fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"}, }; } /** * For {@link #staticP2PKHAddresses()}. */ public final static String DATA_PROVIDER_STATIC_P2PKH_ADDRESSES = "staticP2PKHAddresses"; @DataProvider public static Object[][] staticP2PKHAddresses() { return transformFlatToObjectArrayArray(P2PKH.values()); } /** * For {@link #staticP2SHAddresses()}. */ public final static String DATA_PROVIDER_STATIC_P2SH_ADDRESSES = "staticP2SHAddresses"; @DataProvider public static Object[][] staticP2SHAddresses() { return transformFlatToObjectArrayArray(P2SH.values()); } /** * For {@link #staticP2SHAddresses()}. */ public final static String DATA_PROVIDER_STATIC_P2WPKH_ADDRESSES = "staticP2WPKHAddresses"; @DataProvider public static Object[][] staticP2WPKHAddresses() { return transformFlatToObjectArrayArray(P2WPKH.values()); } /** * For {@link #staticUnsupportedAddresses()}. */ public final static String DATA_PROVIDER_STATIC_UNSUPPORTED_ADDRESSES = "staticUnsupportedAddresses"; @DataProvider public static Object[][] staticUnsupportedAddresses() { return transformFlatToObjectArrayArray(StaticUnsupportedAddress.values()); } private static Object[][] transformFlatToObjectArrayArray(Object[] object) { Object[][] objectArray = new Object[object.length][1]; for (int i = 0; i < objectArray.length; i++) { objectArray[i][0] = object[i]; } return objectArray; } /** * For {@link ByteBufferUtility}. * Use allocate direct. */ public final static String DATA_PROVIDER_ALLOCATE_DIRECT = "allocateDirect"; @DataProvider public static Object[][] allocateDirect() { return new Object[][]{ {true}, {false}, }; } /** * Data provider for testing with Bloom filter enabled and disabled. *

* Supplies {@code true} (Bloom filter active) and {@code false} (Bloom filter inactive), * to verify correctness and performance behavior in both configurations. */ public final static String DATA_PROVIDER_BLOOM_FILTER_ENABLED = "bloomFilterEnabled"; @DataProvider public static Object[][] bloomFilterEnabled() { return new Object[][]{ {true}, {false}, }; } /** * For {@link #largePrivateKeys()}. */ public final static String DATA_PROVIDER_LARGE_PRIVATE_KEYS = "largePrivateKeys"; @DataProvider public static Object[][] largePrivateKeys() { return new Object[][]{ // ⚠️ Important: Do not include keys that are near or equal to the maximum valid private key (e.g., MAX_PRIVATE_KEY + offset). // Since we use grid-based key derivation (e.g., k + i), these values can overflow the valid secp256k1 range and cause failures. // {PublicKeyBytes.MAX_PRIVATE_KEY}, // // Custom crafted BigIntegers with MSB set (highest bit in first byte = 1) // These will be encoded with a leading zero byte (i.e., total of 33 bytes) {new BigInteger("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8C00000000", 16)}, {new BigInteger("F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0", 16)}, {new BigInteger("F000000000000000000000000000000000000000000000000000000000000000", 16)}, // Additional examples that force 33-byte encoding due to high bit in first byte {new BigInteger("F000000000000000000000000000000000000000000000000000000000000000", 16)}, {new BigInteger("8000000000000000000000000000000000000000000000000000000000000000", 16)}, // Only MSB set {new BigInteger("C000000000000000000000000000000000000000000000000000000000000000", 16)}, // First 2 bits set // Variants with slight length differences, still 256-bit aligned or close {new BigInteger("F000000000000000000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "F00000000000000000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "F0000000000000000000000000000000000000000000000000000000000000", 16)}, // {new BigInteger("1000000000000000000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "100000000000000000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "10000000000000000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "1000000000000000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "100000000000000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "10000000000000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "1000000000000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "100000000000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "10000000000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "1000000000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "100000000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "10000000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "1000000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "100000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "10000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "1000000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "100000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "10000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "1000000000000000000000000000000000000000000000", 16)}, {new BigInteger( "100000000000000000000000000000000000000000000", 16)}, {new BigInteger( "10000000000000000000000000000000000000000000", 16)}, {new BigInteger( "1000000000000000000000000000000000000000000", 16)}, {new BigInteger( "100000000000000000000000000000000000000000", 16)}, {new BigInteger( "10000000000000000000000000000000000000000", 16)}, {new BigInteger( "1000000000000000000000000000000000000000", 16)}, {new BigInteger( "100000000000000000000000000000000000000", 16)}, {new BigInteger( "10000000000000000000000000000000000000", 16)}, {new BigInteger( "1000000000000000000000000000000000000", 16)}, {new BigInteger( "100000000000000000000000000000000000", 16)}, {new BigInteger( "10000000000000000000000000000000000", 16)}, {new BigInteger( "1000000000000000000000000000000000", 16)}, {new BigInteger( "100000000000000000000000000000000", 16)}, {new BigInteger( "10000000000000000000000000000000", 16)}, {new BigInteger( "1000000000000000000000000000000", 16)}, {new BigInteger( "100000000000000000000000000000", 16)}, {new BigInteger( "10000000000000000000000000000", 16)}, {new BigInteger( "1000000000000000000000000000", 16)}, {new BigInteger( "100000000000000000000000000", 16)}, {new BigInteger( "10000000000000000000000000", 16)}, {new BigInteger( "1000000000000000000000000", 16)}, {new BigInteger( "100000000000000000000000", 16)}, {new BigInteger( "10000000000000000000000", 16)}, {new BigInteger( "1000000000000000000000", 16)}, {new BigInteger( "100000000000000000000", 16)}, {new BigInteger( "10000000000000000000", 16)}, {new BigInteger( "1000000000000000000", 16)}, {new BigInteger( "100000000000000000", 16)}, {new BigInteger( "10000000000000000", 16)}, {new BigInteger( "1000000000000000", 16)}, {new BigInteger( "100000000000000", 16)}, {new BigInteger( "10000000000000", 16)}, {new BigInteger( "1000000000000", 16)}, {new BigInteger( "100000000000", 16)}, {new BigInteger( "10000000000", 16)}, {new BigInteger( "1000000000", 16)}, {new BigInteger( "100000000", 16)}, {new BigInteger( "10000000", 16)}, // Smallest values that still result in 33-byte encoding due to high bit {new BigInteger("8000000000000000", 16)}, // 64-bit with MSB set {new BigInteger("C000000000000000", 16)}, // 64-bit with top two bits set {new BigInteger("FF00000000000000", 16)}, // 64-bit with top byte fully set {new BigInteger("80000000000000000000000000000000", 16)}, // 128-bit with MSB set {new BigInteger("FF000000000000000000000000000000", 16)}, // 128-bit, top byte set }; } /** * For {@link #privateKeysTooLargeWithChunkSize()}. */ public final static String DATA_PROVIDER_PRIVATE_KEYS_TOO_LARGE_WITH_CHUNK_SIZE = "privateKeysTooLargeWithChunkSize"; @DataProvider public static Object[][] privateKeysTooLargeWithChunkSize() { return new Object[][]{ {PublicKeyBytes.MAX_TECHNICALLY_PRIVATE_KEY, PublicKeyBytes.BIT_COUNT_FOR_MAX_CHUNKS_ARRAY}, {PublicKeyBytes.MAX_PRIVATE_KEY, PublicKeyBytes.BIT_COUNT_FOR_MAX_CHUNKS_ARRAY}, }; } /** * For {@link #privateKeys32ByteRequiringStrip()}. */ public final static String DATA_PROVIDER_PRIVATE_KEYS_32_BYTE_REQUIRING_STRIP = "privateKeys32ByteRequiringStrip"; @DataProvider public static Object[][] privateKeys32ByteRequiringStrip() { return new Object[][]{ // Custom crafted BigIntegers with MSB set (highest bit in first byte = 1) // These will be encoded with a leading zero byte (i.e., total of 33 bytes) {new BigInteger("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8C00000000", 16)}, {new BigInteger("F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0", 16)}, {new BigInteger("F000000000000000000000000000000000000000000000000000000000000000", 16)}, }; } /** * For {@link #bigIntegerVariants()}. */ public final static String DATA_PROVIDER_BIG_INTEGER_VARIANTS = "bigIntegerVariants"; @DataProvider public static Object[][] bigIntegerVariants() { return new Object[][] { { new BigInteger("00", 16), 0, (byte) 0x00 }, // 0-value, empty result { new BigInteger("01", 16), 1, (byte) 0x01 }, { new BigInteger("7F", 16), 1, (byte) 0x7F }, { new BigInteger("FF", 16), 1, (byte) 0xFF }, // highest byte without sign extension { new BigInteger(1, new byte[]{0x00, 0x01}), 1, (byte) 0x01 }, // explicit leading zero { new BigInteger(1, new byte[]{0x00, (byte)0x80}), 1, (byte) 0x80 }, // zero removed, keep sign { new BigInteger(1, new byte[]{(byte) 0x00, (byte) 0xFF}), 1, (byte) 0xFF }, // zero removed { new BigInteger("FFFFFFFF", 16), 4, (byte) 0xFF }, // Max technically private key (leading 0x00 byte expected) { PublicKeyBytes.MAX_TECHNICALLY_PRIVATE_KEY, 32, (byte) 0xFF } }; } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/ConsumerJavaTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.io.File; import java.io.IOException; import java.math.BigInteger; import java.nio.ByteBuffer; import java.time.Duration; import java.util.*; import net.ladenthin.bitcoinaddressfinder.configuration.CConsumerJava; import net.ladenthin.bitcoinaddressfinder.configuration.CLMDBConfigurationReadOnly; import net.ladenthin.bitcoinaddressfinder.configuration.CProducerJava; import net.ladenthin.bitcoinaddressfinder.persistence.Persistence; import net.ladenthin.bitcoinaddressfinder.persistence.PersistenceUtils; import net.ladenthin.bitcoinaddressfinder.staticaddresses.TestAddresses1337; import net.ladenthin.bitcoinaddressfinder.staticaddresses.TestAddresses42; import net.ladenthin.bitcoinaddressfinder.staticaddresses.TestAddressesFiles; import net.ladenthin.bitcoinaddressfinder.staticaddresses.TestAddressesLMDB; import org.apache.commons.codec.DecoderException; import org.apache.commons.codec.binary.Hex; import org.bitcoinj.base.Network; import org.bitcoinj.crypto.ECKey; import org.bitcoinj.crypto.MnemonicException; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; import static org.hamcrest.core.StringStartsWith.startsWith; import static org.mockito.Mockito.*; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.slf4j.Logger; @RunWith(DataProviderRunner.class) public class ConsumerJavaTest { @Rule public TemporaryFolder folder = new TemporaryFolder(); private final Network network = new NetworkParameterFactory().getNetwork(); private final KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); private final PersistenceUtils persistenceUtils = new PersistenceUtils(network); private final BitHelper bitHelper = new BitHelper(); /** * Returns an example key. Example key * @return an example key. */ public static PublicKeyBytes[] createExamplePublicKeyBytesfromPrivateKey73() { PublicKeyBytes publicKeyBytes = PublicKeyBytes.fromPrivate(BigInteger.valueOf(73)); PublicKeyBytes[] publicKeyBytesArray = new PublicKeyBytes[]{publicKeyBytes}; return publicKeyBytesArray; } @Test(expected = org.lmdbjava.LmdbNativeException.class) public void initLMDB_lmdbNotExisting_noExceptionThrown() throws IOException { CConsumerJava cConsumerJava = new CConsumerJava(); cConsumerJava.lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); cConsumerJava.lmdbConfigurationReadOnly.lmdbDirectory = folder.newFolder().getAbsolutePath(); ConsumerJava consumerJava = new ConsumerJava(cConsumerJava, keyUtility, persistenceUtils); consumerJava.initLMDB(); } // @ToStringTest @Test public void toString_whenCalled_containsClassNameAndIdentityHash() throws IOException { CConsumerJava cConsumerJava = new CConsumerJava(); cConsumerJava.lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); cConsumerJava.lmdbConfigurationReadOnly.lmdbDirectory = folder.newFolder().getAbsolutePath(); ConsumerJava consumerJava = new ConsumerJava(cConsumerJava, keyUtility, persistenceUtils); String toStringOutput = consumerJava.toString(); assertThat(toStringOutput, not(emptyOrNullString())); assertThat(toStringOutput, matchesPattern("ConsumerJava@\\p{XDigit}+")); } // @Test public void startStatisticsTimer_noExceptionThrown() throws IOException, InterruptedException { final int runTimes = 3; TestAddressesLMDB testAddressesLMDB = new TestAddressesLMDB(); TestAddressesFiles testAddresses = new TestAddressesFiles(false); File lmdbFolderPath = testAddressesLMDB.createTestLMDB(folder, testAddresses, true, true); CConsumerJava cConsumerJava = new CConsumerJava(); cConsumerJava.lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); cConsumerJava.lmdbConfigurationReadOnly.lmdbDirectory = lmdbFolderPath.getAbsolutePath(); cConsumerJava.printStatisticsEveryNSeconds = 1; ConsumerJava consumerJava = new ConsumerJava(cConsumerJava, keyUtility, persistenceUtils); Logger logger = mock(Logger.class); consumerJava.setLogger(logger); consumerJava.initLMDB(); // act consumerJava.startStatisticsTimer(); // sleep close to runTimes+1 cycles to let the tasks run runTimes times Thread.sleep(((long) cConsumerJava.printStatisticsEveryNSeconds * (runTimes +1) * 1000) - 300); // assert consumerJava.interrupt(); ArgumentCaptor logCaptorInfo = ArgumentCaptor.forClass(String.class); verify(logger, atLeast(runTimes)).info(logCaptorInfo.capture()); List arguments = logCaptorInfo.getAllValues(); assertThat(arguments.get(0), is(equalTo("Statistics: [Checked 0 M keys in 0 minutes] [0 k keys/second] [0 M keys/minute] [Times an empty consumer: 0] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0]"))); } @Test(expected = IllegalArgumentException.class) public void startStatisticsTimer_invalidparameter_throwsException() throws IOException { CConsumerJava cConsumerJava = new CConsumerJava(); cConsumerJava.printStatisticsEveryNSeconds = 0; ConsumerJava consumerJava = new ConsumerJava(cConsumerJava, keyUtility, persistenceUtils); consumerJava.startStatisticsTimer(); } @AwaitTimeTest @Test public void interrupt_keysQueueNotEmpty_consumerNotRunningWaitedInternallyForTheDuration() throws IOException, InterruptedException, MnemonicException.MnemonicLengthException { // Change await duration ConsumerJava.AWAIT_DURATION_QUEUE_EMPTY = AwaitTimeTests.AWAIT_DURATION; TestAddressesLMDB testAddressesLMDB = new TestAddressesLMDB(); TestAddressesFiles testAddresses = new TestAddressesFiles(false); File lmdbFolderPath = testAddressesLMDB.createTestLMDB(folder, testAddresses, true, true); CConsumerJava cConsumerJava = new CConsumerJava(); cConsumerJava.lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); cConsumerJava.lmdbConfigurationReadOnly.lmdbDirectory = lmdbFolderPath.getAbsolutePath(); ConsumerJava consumerJava = new ConsumerJava(cConsumerJava, keyUtility, persistenceUtils); Logger logger = mock(Logger.class); consumerJava.setLogger(logger); consumerJava.initLMDB(); // add keys consumerJava.consumeKeys(createExamplePublicKeyBytesfromPrivateKey73()); // pre-assert, assert the keys queue is not empty assertThat(consumerJava.keysQueueSize(), is(equalTo(1))); assertThat(consumerJava.shouldRun.get(), is(equalTo(Boolean.TRUE))); // add a pseudo thread to the executor to test its eecution duration consumerJava.consumeKeysExecutorService.submit(() -> { try { Thread.sleep(ConsumerJava.AWAIT_DURATION_QUEUE_EMPTY); } catch (InterruptedException e) { throw new RuntimeException(e); } }); // act long beforeAct = System.currentTimeMillis(); // the consume is not running and the interrupt must wait and release nevertheless consumerJava.interrupt(); // assert assertThat(consumerJava.shouldRun.get(), is(equalTo(Boolean.FALSE))); long afterAct = System.currentTimeMillis(); Duration waitTime = Duration.ofMillis(afterAct-beforeAct); // assert the waiting time is over, substract imprecision assertThat(waitTime, is(greaterThan(ConsumerJava.AWAIT_DURATION_QUEUE_EMPTY.minus(AwaitTimeTests.IMPRECISION)))); } @Test public void interrupt_statisticsTimerStarted_executerServiceShutdown() throws IOException, InterruptedException { TestAddressesLMDB testAddressesLMDB = new TestAddressesLMDB(); TestAddressesFiles testAddresses = new TestAddressesFiles(false); File lmdbFolderPath = testAddressesLMDB.createTestLMDB(folder, testAddresses, true, true); CConsumerJava cConsumerJava = new CConsumerJava(); cConsumerJava.lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); cConsumerJava.lmdbConfigurationReadOnly.lmdbDirectory = lmdbFolderPath.getAbsolutePath(); cConsumerJava.printStatisticsEveryNSeconds = 1; ConsumerJava consumerJava = new ConsumerJava(cConsumerJava, keyUtility, persistenceUtils); Logger logger = mock(Logger.class); consumerJava.setLogger(logger); consumerJava.initLMDB(); // pre-assert assertThat(consumerJava.scheduledExecutorService.isShutdown(), is(equalTo(Boolean.FALSE))); consumerJava.startStatisticsTimer(); // wait till the scheduled TimerTask is completed Thread.sleep(Duration.ofSeconds(1L)); // pre-assert assertThat(consumerJava.scheduledExecutorService.isShutdown(), is(equalTo(Boolean.FALSE))); assertThat(consumerJava.consumeKeysExecutorService.isShutdown(), is(equalTo(Boolean.FALSE))); // act consumerJava.interrupt(); // assert assertThat(consumerJava.scheduledExecutorService.isShutdown(), is(equalTo(Boolean.TRUE))); assertThat(consumerJava.consumeKeysExecutorService.isShutdown(), is(equalTo(Boolean.TRUE))); } @Test public void initLMDB_initialize_databaseOpened() throws IOException, InterruptedException, DecoderException, MnemonicException.MnemonicLengthException { TestAddressesLMDB testAddressesLMDB = new TestAddressesLMDB(); TestAddressesFiles testAddresses = new TestAddressesFiles(false); File lmdbFolderPath = testAddressesLMDB.createTestLMDB(folder, testAddresses, true, true); CConsumerJava cConsumerJava = new CConsumerJava(); cConsumerJava.lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); cConsumerJava.lmdbConfigurationReadOnly.lmdbDirectory = lmdbFolderPath.getAbsolutePath(); ConsumerJava consumerJava = new ConsumerJava(cConsumerJava, keyUtility, persistenceUtils); // pre-assert assertThat(consumerJava.persistence, is(nullValue())); // act consumerJava.initLMDB(); // assert Persistence persistence = Objects.requireNonNull(consumerJava.persistence); assertThat(persistence.isClosed(), is(equalTo(Boolean.FALSE))); } @Test public void interrupt_consumerInitialized_databaseClosed() throws IOException, InterruptedException, DecoderException, MnemonicException.MnemonicLengthException { TestAddressesLMDB testAddressesLMDB = new TestAddressesLMDB(); TestAddressesFiles testAddresses = new TestAddressesFiles(false); File lmdbFolderPath = testAddressesLMDB.createTestLMDB(folder, testAddresses, true, true); CConsumerJava cConsumerJava = new CConsumerJava(); cConsumerJava.lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); cConsumerJava.lmdbConfigurationReadOnly.lmdbDirectory = lmdbFolderPath.getAbsolutePath(); ConsumerJava consumerJava = new ConsumerJava(cConsumerJava, keyUtility, persistenceUtils); consumerJava.initLMDB(); Persistence persistence = Objects.requireNonNull(consumerJava.persistence); // pre-assert assertThat(persistence.isClosed(), is(equalTo(Boolean.FALSE))); // act consumerJava.interrupt(); // assert assertThat(persistence.isClosed(), is(equalTo(Boolean.TRUE))); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_COMPRESSED_AND_STATIC_AMOUNT, location = CommonDataProvider.class) public void runProber_testAddressGiven_hitExpected(boolean compressed, boolean useStaticAmount) throws Exception { TestAddressesLMDB testAddressesLMDB = new TestAddressesLMDB(); TestAddressesFiles testAddresses = new TestAddressesFiles(compressed); File lmdbFolderPath = testAddressesLMDB.createTestLMDB(folder, testAddresses, useStaticAmount, false); CConsumerJava cConsumerJava = new CConsumerJava(); cConsumerJava.lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); cConsumerJava.lmdbConfigurationReadOnly.lmdbDirectory = lmdbFolderPath.getAbsolutePath(); cConsumerJava.runtimePublicKeyCalculationCheck = ManualDebugConstants.ENABLE_RUNTIME_PUBLIC_KEY_CALCULATION_CHECK; ConsumerJava consumerJava = new ConsumerJava(cConsumerJava, keyUtility, persistenceUtils); consumerJava.initLMDB(); Random randomForProducer = new Random(TestAddresses42.RANDOM_SEED); CProducerJava cProducerJava = new CProducerJava(); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, randomForProducer); ProducerJava producerJava = new ProducerJava(cProducerJava, consumerJava, keyUtility, mockKeyProducer, bitHelper); Logger logger = mock(Logger.class); consumerJava.setLogger(logger); producerJava.produceKeys(); consumerJava.consumeKeys(createHash160ByteBuffer()); // assert assertThat(consumerJava.hits.get(), is(equalTo(1L))); assertThat(consumerJava.vanityHits.get(), is(equalTo(0L))); ArgumentCaptor logCaptorInfo = ArgumentCaptor.forClass(String.class); verify(logger, times(6)).info(logCaptorInfo.capture()); List arguments = logCaptorInfo.getAllValues(); ECKey key = new TestAddresses42(1, compressed).getECKeys().get(0); PublicKeyBytes publicKeyBytes = PublicKeyBytes.fromPrivate(key.getPrivKey()); // to prevent any exception in further hit message creation and a possible missing hit message, log the secret alone first that a recovery is possible String hitMessageSecretKey = ConsumerJava.HIT_SAFE_PREFIX + "publicKeyBytes.getSecretKey(): " + key.getPrivKey(); assertThat(arguments.get(0), is(equalTo(hitMessageSecretKey))); String hitMessagePublicKeyBytesUncompressed = ConsumerJava.HIT_SAFE_PREFIX + "publicKeyBytes.getUncompressed(): " + Hex.encodeHexString(publicKeyBytes.getUncompressed()); assertThat(arguments.get(1), is(equalTo(hitMessagePublicKeyBytesUncompressed))); String hitMessagePublicKeyBytesCompressed = ConsumerJava.HIT_SAFE_PREFIX + "publicKeyBytes.getCompressed(): " + Hex.encodeHexString(publicKeyBytes.getCompressed()); assertThat(arguments.get(2), is(equalTo(hitMessagePublicKeyBytesCompressed))); String hitMessageHash160Uncompressed = ConsumerJava.HIT_SAFE_PREFIX + "hash160Uncompressed: " + Hex.encodeHexString(publicKeyBytes.getUncompressedKeyHash()); assertThat(arguments.get(3), is(equalTo(hitMessageHash160Uncompressed))); String hitMessageHash160Compressed = ConsumerJava.HIT_SAFE_PREFIX + "hash160Compressed: " + Hex.encodeHexString(publicKeyBytes.getCompressedKeyHash()); assertThat(arguments.get(4), is(equalTo(hitMessageHash160Compressed))); String hitMessageFull = ConsumerJava.HIT_PREFIX + keyUtility.createKeyDetails(key); assertThat(arguments.get(5), is(equalTo(hitMessageFull))); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_COMPRESSED_AND_STATIC_AMOUNT, location = CommonDataProvider.class) public void runProber_unknownAddressGiven_missExpectedAndLogMessagesInDebugAndTrace(boolean compressed, boolean useStaticAmount) throws Exception { TestAddressesLMDB testAddressesLMDB = new TestAddressesLMDB(); TestAddressesFiles testAddresses = new TestAddressesFiles(compressed); File lmdbFolderPath = testAddressesLMDB.createTestLMDB(folder, testAddresses, useStaticAmount, false); CConsumerJava cConsumerJava = new CConsumerJava(); cConsumerJava.lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); cConsumerJava.lmdbConfigurationReadOnly.lmdbDirectory = lmdbFolderPath.getAbsolutePath(); cConsumerJava.runtimePublicKeyCalculationCheck = ManualDebugConstants.ENABLE_RUNTIME_PUBLIC_KEY_CALCULATION_CHECK; ConsumerJava consumerJava = new ConsumerJava(cConsumerJava, keyUtility, persistenceUtils); consumerJava.initLMDB(); Random randomForProducer = new Random(TestAddresses1337.RANDOM_SEED); CProducerJava cProducerJava = new CProducerJava(); cProducerJava.batchSizeInBits = 0; MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, randomForProducer); ProducerJava producerJava = new ProducerJava(cProducerJava, consumerJava, keyUtility, mockKeyProducer, bitHelper); Logger logger = mock(Logger.class); when(logger.isDebugEnabled()).thenReturn(true); when(logger.isTraceEnabled()).thenReturn(true); consumerJava.setLogger(logger); producerJava.produceKeys(); consumerJava.consumeKeys(createHash160ByteBuffer()); // assert assertThat(consumerJava.hits.get(), is(equalTo(0L))); assertThat(consumerJava.vanityHits.get(), is(equalTo(0L))); ArgumentCaptor logCaptorDebug = ArgumentCaptor.forClass(String.class); ArgumentCaptor logCaptorTrace = ArgumentCaptor.forClass(String.class); verify(logger, times(2)).debug(logCaptorDebug.capture()); verify(logger, times(9)).trace(logCaptorTrace.capture()); List argumentsDebug = logCaptorDebug.getAllValues(); List argumentsTrace = logCaptorTrace.getAllValues(); ECKey unknownKeyUncompressed = new TestAddresses1337(1, false).getECKeys().get(0); ECKey unknownKeyCompressed = new TestAddresses1337(1, true).getECKeys().get(0); String missMessageUncompressed = ConsumerJava.MISS_PREFIX + keyUtility.createKeyDetails(unknownKeyUncompressed); String missMessageCompressed = ConsumerJava.MISS_PREFIX + keyUtility.createKeyDetails(unknownKeyCompressed); assertThat(argumentsDebug.get(0), startsWith("keysQueue.put(publicKeyBytes) with length: 1")); assertThat(argumentsDebug.get(1), startsWith("keysQueue.size(): 1")); assertThat(argumentsTrace.get(0), startsWith("consumeKeys")); assertThat(argumentsTrace.get(1), startsWith("Time before persistence.containsAddress: ")); assertThat(argumentsTrace.get(2), startsWith("Time after persistence.containsAddress: ")); assertThat(argumentsTrace.get(3), startsWith("Time delta: ")); assertThat(argumentsTrace.get(4), startsWith("Time before persistence.containsAddress: ")); assertThat(argumentsTrace.get(5), startsWith("Time after persistence.containsAddress: ")); assertThat(argumentsTrace.get(6), startsWith("Time delta: ")); // assert for expected miss messages assertThat(argumentsTrace.get(7), is(equalTo(missMessageUncompressed))); assertThat(argumentsTrace.get(8), is(equalTo(missMessageCompressed))); } @Test public void consumeKeys_invalidSecretGiven_continueExpectedAndNoExceptionThrown() throws IOException, InterruptedException, DecoderException, MnemonicException.MnemonicLengthException { TestAddressesLMDB testAddressesLMDB = new TestAddressesLMDB(); TestAddressesFiles testAddresses = new TestAddressesFiles(false); File lmdbFolderPath = testAddressesLMDB.createTestLMDB(folder, testAddresses, true, true); CConsumerJava cConsumerJava = new CConsumerJava(); cConsumerJava.lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); cConsumerJava.lmdbConfigurationReadOnly.lmdbDirectory = lmdbFolderPath.getAbsolutePath(); cConsumerJava.runtimePublicKeyCalculationCheck = ManualDebugConstants.ENABLE_RUNTIME_PUBLIC_KEY_CALCULATION_CHECK; ConsumerJava consumerJava = new ConsumerJava(cConsumerJava, keyUtility, persistenceUtils); consumerJava.initLMDB(); Logger logger = mock(Logger.class); consumerJava.setLogger(logger); PublicKeyBytes invalidPublicKeyBytes = PublicKeyBytes.INVALID_KEY_ONE; PublicKeyBytes[] publicKeyBytesArray = new PublicKeyBytes[]{invalidPublicKeyBytes}; consumerJava.consumeKeys(publicKeyBytesArray); consumerJava.consumeKeys(createHash160ByteBuffer()); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_COMPRESSED, location = CommonDataProvider.class) public void consumeKeys_withRuntimeKeyCalculationEnabled_logsError_whenPublicKeyHashIsInvalid(boolean compressed) throws IOException, InterruptedException, DecoderException, MnemonicException.MnemonicLengthException { TestAddressesLMDB testAddressesLMDB = new TestAddressesLMDB(); TestAddressesFiles testAddresses = new TestAddressesFiles(false); File lmdbFolderPath = testAddressesLMDB.createTestLMDB(folder, testAddresses, true, true); CConsumerJava cConsumerJava = new CConsumerJava(); cConsumerJava.lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); cConsumerJava.lmdbConfigurationReadOnly.lmdbDirectory = lmdbFolderPath.getAbsolutePath(); cConsumerJava.runtimePublicKeyCalculationCheck = true; ConsumerJava consumerJava = new ConsumerJava(cConsumerJava, keyUtility, persistenceUtils); consumerJava.initLMDB(); Logger logger = mock(Logger.class); consumerJava.setLogger(logger); PublicKeyBytes invalidPublicKeyBytes = PublicKeyBytes.fromPrivate(BigInteger.valueOf(1337)); // invalidate compressed or uncompressed if (compressed) { invalidPublicKeyBytes.getCompressed()[7] = 0; } else { invalidPublicKeyBytes.getUncompressed()[7] = 0; } PublicKeyBytes[] publicKeyBytesArray = new PublicKeyBytes[]{invalidPublicKeyBytes}; consumerJava.consumeKeys(publicKeyBytesArray); consumerJava.consumeKeys(createHash160ByteBuffer()); // assert assertThat(consumerJava.hits.get(), is(equalTo(0L))); assertThat(consumerJava.vanityHits.get(), is(equalTo(0L))); ArgumentCaptor logCaptorError = ArgumentCaptor.forClass(String.class); verify(logger, times(6)).error(logCaptorError.capture()); List arguments = logCaptorError.getAllValues(); if (compressed) { assertThat(arguments.get(0), is(equalTo("fromPrivateCompressed.getPubKeyHash() != hash160Compressed"))); assertThat(arguments.get(1), is(equalTo("getSecretKey: 1337"))); assertThat(arguments.get(2), is(equalTo("pubKeyCompressed: 02db0c51cc634a0096374b0b895584a3ca2fb3bea4fd0ee2361f8db63a650fcee6"))); assertThat(arguments.get(3), is(equalTo("pubKeyCompressedFromEcKey: 02db0c51cc634a4096374b0b895584a3ca2fb3bea4fd0ee2361f8db63a650fcee6"))); assertThat(arguments.get(4), is(equalTo("hash160Compressed: a1039a5001eaccd75abb339b446b83b1ecf54ef7"))); assertThat(arguments.get(5), is(equalTo("hash160CompressedFromEcKey: 879f5696d90c1c280fa3c7d77723ebc59d7ac108"))); } else { assertThat(arguments.get(0), is(equalTo("fromPrivateUncompressed.getPubKeyHash() != hash160Uncompressed"))); assertThat(arguments.get(1), is(equalTo("getSecretKey: 1337"))); assertThat(arguments.get(2), is(equalTo("pubKeyUncompressed: 04db0c51cc634a0096374b0b895584a3ca2fb3bea4fd0ee2361f8db63a650fcee67ec0bd2baea1ae184bd16fd397b0e64d5d28257f85836486367fe33cc5b6e6a0"))); assertThat(arguments.get(3), is(equalTo("pubKeyUncompressedFromEcKey: 04db0c51cc634a4096374b0b895584a3ca2fb3bea4fd0ee2361f8db63a650fcee67ec0bd2baea1ae184bd16fd397b0e64d5d28257f85836486367fe33cc5b6e6a0"))); assertThat(arguments.get(4), is(equalTo("hash160Uncompressed: 1a69285cb42032d77801a15a30357d510b247100"))); assertThat(arguments.get(5), is(equalTo("hash160UncompressedFromEcKey: e02e1cae178d3a2f84a5d897ee8b7ed6c0e2bbc4"))); } } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_COMPRESSED, location = CommonDataProvider.class) public void consumeKeys_testVanityPattern_patternMatches(boolean compressed) throws IOException, InterruptedException, DecoderException, MnemonicException.MnemonicLengthException { TestAddressesLMDB testAddressesLMDB = new TestAddressesLMDB(); TestAddressesFiles testAddresses = new TestAddressesFiles(false); File lmdbFolderPath = testAddressesLMDB.createTestLMDB(folder, testAddresses, true, true); CConsumerJava cConsumerJava = new CConsumerJava(); cConsumerJava.lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); cConsumerJava.lmdbConfigurationReadOnly.lmdbDirectory = lmdbFolderPath.getAbsolutePath(); cConsumerJava.enableVanity = true; if (compressed) { // 1JYHzX3ndZEcnjrWSQ9VC7324TJ9BAoGy4 cConsumerJava.vanityPattern = "1JYH.*"; } else { // 14sNbmEhgiGX6BZe9Q5PCgTQT3576mniZt cConsumerJava.vanityPattern = "14sN.*"; } ConsumerJava consumerJava = new ConsumerJava(cConsumerJava, keyUtility, persistenceUtils); consumerJava.initLMDB(); Logger logger = mock(Logger.class); consumerJava.setLogger(logger); consumerJava.consumeKeys(createExamplePublicKeyBytesfromPrivateKey73()); consumerJava.consumeKeys(createHash160ByteBuffer()); // assert assertThat(consumerJava.hits.get(), is(equalTo(0L))); assertThat(consumerJava.vanityHits.get(), is(equalTo(1L))); ArgumentCaptor logCaptorInfo = ArgumentCaptor.forClass(String.class); verify(logger, times(6)).info(logCaptorInfo.capture()); List arguments = logCaptorInfo.getAllValues(); BigInteger secret = BigInteger.valueOf(73); ECKey ecKey = keyUtility.createECKey(secret, true); String mnemonics = keyUtility.createMnemonics(ecKey.getPrivKeyBytes()); Map map = new HashMap<>(); map.put(BIP39Wordlist.CHINESE_SIMPLIFIED, "的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 这 铁"); map.put(BIP39Wordlist.CHINESE_TRADITIONAL, "的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 這 鐵"); map.put(BIP39Wordlist.CZECH, "abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace ananas internet"); map.put(BIP39Wordlist.ENGLISH, "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abuse differ"); map.put(BIP39Wordlist.FRENCH, "abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abreuver cylindre"); map.put(BIP39Wordlist.ITALIAN, "abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco accenno disposto"); // attention: japanese has a special separator map.put(BIP39Wordlist.JAPANESE, "あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あさい くなん"); map.put(BIP39Wordlist.KOREAN, "가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가슴 목걸이"); map.put(BIP39Wordlist.PORTUGUESE, "abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abranger conectar"); map.put(BIP39Wordlist.RUSSIAN, "абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац агитация завтра"); map.put(BIP39Wordlist.SPANISH, "ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco abuelo cuota"); map.put(BIP39Wordlist.TURKISH, "abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur absürt fason"); assertThat(map.size(), is(BIP39Wordlist.values().length)); for (Map.Entry entry : map.entrySet()) { BIP39Wordlist bip39Wordlist = entry.getKey(); String expectedMnemonic = entry.getValue(); assertThat(mnemonics, containsString(expectedMnemonic)); } assertThat(arguments.get(0), is(equalTo("hit: safe log: publicKeyBytes.getSecretKey(): 73"))); assertThat(arguments.get(1), is(equalTo("hit: safe log: publicKeyBytes.getUncompressed(): 04af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"))); assertThat(arguments.get(2), is(equalTo("hit: safe log: publicKeyBytes.getCompressed(): 02af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45"))); assertThat(arguments.get(3), is(equalTo("hit: safe log: hash160Uncompressed: 2a6f34a72c181bdd4e6d91ffa69e84fd6c49b207"))); assertThat(arguments.get(4), is(equalTo("hit: safe log: hash160Compressed: c065379323a549fc3547bcb1937d5dcb48df2396"))); final String privateKeyBytes = "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73]"; final String privateKeyHex = "0000000000000000000000000000000000000000000000000000000000000049"; final String wif; final String publicKeyAsHex; final String publicKeyHash160Hex; final String publicKeyHash160Base58; if (compressed) { wif = "KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU7fj3itoEY"; publicKeyAsHex = "02af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45"; publicKeyHash160Hex = "c065379323a549fc3547bcb1937d5dcb48df2396"; publicKeyHash160Base58 = "1JYHzX3ndZEcnjrWSQ9VC7324TJ9BAoGy4"; } else { wif = "5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreJwwNRRr"; publicKeyAsHex = "04af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"; publicKeyHash160Hex = "2a6f34a72c181bdd4e6d91ffa69e84fd6c49b207"; publicKeyHash160Base58 = "14sNbmEhgiGX6BZe9Q5PCgTQT3576mniZt"; } String expectedMessage = "vanity pattern match: privateKeyBigInteger: [73] privateKeyBytes: ["+privateKeyBytes+"] privateKeyHex: ["+privateKeyHex+"] WiF: [" + wif +"] publicKeyAsHex: ["+publicKeyAsHex+"] publicKeyHash160Hex: ["+publicKeyHash160Hex+"] publicKeyHash160Base58: ["+publicKeyHash160Base58+"] Compressed: ["+compressed+"] "+ mnemonics; assertThat(arguments.get(5), is(equalTo(expectedMessage))); } @Test(expected = RuntimeException.class) public void interrupt_persistenceCloseThrowsException_runtimeExceptionThrown() throws Exception { TestAddressesLMDB testAddressesLMDB = new TestAddressesLMDB(); TestAddressesFiles testAddresses = new TestAddressesFiles(false); File lmdbFolderPath = testAddressesLMDB.createTestLMDB(folder, testAddresses, true, true); CConsumerJava cConsumerJava = new CConsumerJava(); cConsumerJava.lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); cConsumerJava.lmdbConfigurationReadOnly.lmdbDirectory = lmdbFolderPath.getAbsolutePath(); ConsumerJava consumerJava = new ConsumerJava(cConsumerJava, keyUtility, persistenceUtils); consumerJava.initLMDB(); // Mock the persistence to throw an exception on close Persistence mockPersistence = mock(Persistence.class); when(mockPersistence.isClosed()).thenReturn(false); doThrow(new RuntimeException("Simulated close failure")).when(mockPersistence).close(); consumerJava.persistence = mockPersistence; // act - should throw RuntimeException consumerJava.interrupt(); } private ByteBuffer createHash160ByteBuffer() { ByteBuffer threadLocalReuseableByteBuffer = ByteBuffer.allocateDirect(PublicKeyBytes.RIPEMD160_HASH_NUM_BYTES); return threadLocalReuseableByteBuffer; } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/EndiannessConverterTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import static org.mockito.Mockito.*; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import java.nio.ByteOrder; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(DataProviderRunner.class) public class EndiannessConverterTest { private final ByteBufferUtility byteBufferUtility = mock(ByteBufferUtility.class); // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_ENDIANNESS, location = CommonDataProvider.class) public void mustConvertTest(ByteOrder sourceOrder, ByteOrder targetOrder, boolean expectedMustConvert) { // arrange EndiannessConverter converter = new EndiannessConverter(sourceOrder, targetOrder, byteBufferUtility); // act boolean result = converter.mustConvert(); // assert assertThat(result, is(expectedMustConvert)); } // // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_ENDIANNESS, location = CommonDataProvider.class) public void convertEndianTest(ByteOrder sourceOrder, ByteOrder targetOrder, boolean mustConvert) { // arrange EndiannessConverter converter = new EndiannessConverter(sourceOrder, targetOrder, byteBufferUtility); byte[] array = {1, 2, 3}; // act converter.convertEndian(array); // assert if (mustConvert) { verify(byteBufferUtility).reverse(array); } else { verify(byteBufferUtility, never()).reverse(array); } } // // @Test public void getSourceOrder_returnsCorrectSourceOrder() { // arrange EndiannessConverter converter = new EndiannessConverter(ByteOrder.BIG_ENDIAN, ByteOrder.LITTLE_ENDIAN, byteBufferUtility); // act ByteOrder source = converter.getSourceOrder(); // assert assertThat(source, is(ByteOrder.BIG_ENDIAN)); } @Test public void getTargetOrder_returnsCorrectTargetOrder() { // arrange EndiannessConverter converter = new EndiannessConverter(ByteOrder.BIG_ENDIAN, ByteOrder.LITTLE_ENDIAN, byteBufferUtility); // act ByteOrder target = converter.getTargetOrder(); // assert assertThat(target, is(ByteOrder.LITTLE_ENDIAN)); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/EqualHashCodeToStringTestHelper.java ================================================ // @formatter:off /** * Copyright 2021 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import org.junit.Assert; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; public class EqualHashCodeToStringTestHelper { private final Object instanceA; private final Object instanceADifferentReference; private final Object instanceB; private final Object instanceBDifferentReference; public EqualHashCodeToStringTestHelper(Object instanceA, Object instanceADifferentReference, Object instanceB, Object instanceBDifferentReference) { this.instanceA = instanceA; this.instanceADifferentReference = instanceADifferentReference; this.instanceB = instanceB; this.instanceBDifferentReference = instanceBDifferentReference; } public void assertEqualsHashCodeToStringAIsDifferentToB() { assertDifferenceReference(); // equals assertThat(instanceA, is(equalTo(instanceADifferentReference))); assertThat(instanceB, is(equalTo(instanceBDifferentReference))); assertThat(instanceA, is(not(equalTo(instanceB)))); assertThat(instanceA, is(not(equalTo(instanceBDifferentReference)))); assertThat(instanceADifferentReference, is(not(equalTo(instanceBDifferentReference)))); // hashCode assertThat(instanceA.hashCode(), is(equalTo(instanceADifferentReference.hashCode()))); assertThat(instanceB.hashCode(), is(equalTo(instanceBDifferentReference.hashCode()))); assertThat(instanceA.hashCode(), is(not(equalTo(instanceB.hashCode())))); assertThat(instanceA.hashCode(), is(not(equalTo(instanceBDifferentReference.hashCode())))); assertThat(instanceADifferentReference.hashCode(), is(not(equalTo(instanceBDifferentReference.hashCode())))); // toString assertThat(instanceA.toString(), is(equalTo(instanceADifferentReference.toString()))); assertThat(instanceB.toString(), is(equalTo(instanceBDifferentReference.toString()))); assertThat(instanceA.toString(), is(not(equalTo(instanceB.toString())))); assertThat(instanceA.toString(), is(not(equalTo(instanceBDifferentReference.toString())))); assertThat(instanceADifferentReference.toString(), is(not(equalTo(instanceBDifferentReference.toString())))); } public void assertEqualsHashCodeToStringAIsEqualToB() { assertDifferenceReference(); // equals assertThat(instanceA, is(equalTo(instanceADifferentReference))); assertThat(instanceB, is(equalTo(instanceBDifferentReference))); assertThat(instanceA, is(equalTo(instanceB))); // hashCode assertThat(instanceA.hashCode(), is(equalTo(instanceADifferentReference.hashCode()))); assertThat(instanceB.hashCode(), is(equalTo(instanceBDifferentReference.hashCode()))); assertThat(instanceA.hashCode(), is(equalTo(instanceB.hashCode()))); // toString assertThat(instanceA.toString(), is(equalTo(instanceADifferentReference.toString()))); assertThat(instanceB.toString(), is(equalTo(instanceBDifferentReference.toString()))); assertThat(instanceA.toString(), is(equalTo(instanceB.toString()))); } private void assertDifferenceReference() { Assert.assertNotSame(instanceA, instanceADifferentReference); Assert.assertNotSame(instanceA, instanceB); Assert.assertNotSame(instanceA, instanceBDifferentReference); Assert.assertNotSame(instanceB, instanceBDifferentReference); Assert.assertNotSame(instanceB, instanceA); Assert.assertNotSame(instanceB, instanceADifferentReference); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/FileHelperTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.List; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; import static org.junit.Assert.fail; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; public class FileHelperTest { @Rule public TemporaryFolder folder = new TemporaryFolder(); private final FileHelper fileHelper = new FileHelper(); // @Test public void stringsToFiles_emptyList_returnsEmptyList() { // act List result = fileHelper.stringsToFiles(Collections.emptyList()); // assert assertThat(result, is(empty())); } @Test public void stringsToFiles_singlePath_returnsFileWithSamePath() { // arrange String path = "/some/path/to/file.txt"; // act List result = fileHelper.stringsToFiles(Collections.singletonList(path)); // assert assertThat(result, hasSize(1)); assertThat(result.get(0), is(equalTo(new File(path)))); } @Test public void stringsToFiles_multiplePaths_returnsFilesInSameOrder() { // arrange List paths = Arrays.asList("/first/file.txt", "/second/file.txt", "/third/file.txt"); // act List result = fileHelper.stringsToFiles(paths); // assert assertThat(result, hasSize(3)); assertThat(result.get(0), is(equalTo(new File(paths.get(0))))); assertThat(result.get(1), is(equalTo(new File(paths.get(1))))); assertThat(result.get(2), is(equalTo(new File(paths.get(2))))); } // // @Test public void assertFilesExists_emptyList_noExceptionThrown() { // act fileHelper.assertFilesExists(Collections.emptyList()); // assert } @Test public void assertFilesExists_existingFile_noExceptionThrown() throws IOException { // arrange File tempFile = folder.newFile("filehelper_test.tmp"); // act fileHelper.assertFilesExists(Collections.singletonList(tempFile)); // assert } @Test public void assertFilesExists_multipleExistingFiles_noExceptionThrown() throws IOException { // arrange File tempFile1 = folder.newFile("filehelper_test_a.tmp"); File tempFile2 = folder.newFile("filehelper_test_b.tmp"); // act fileHelper.assertFilesExists(Arrays.asList(tempFile1, tempFile2)); // assert } @Test(expected = IllegalArgumentException.class) public void assertFilesExists_missingFile_throwsIllegalArgumentException() { // arrange File nonExistentFile = new File("/this/path/does/not/exist/file.txt"); // act fileHelper.assertFilesExists(Collections.singletonList(nonExistentFile)); } @Test public void assertFilesExists_missingFile_exceptionMessageContainsFilePath() { // arrange File nonExistentFile = new File("/this/path/does/not/exist/file.txt"); // act try { fileHelper.assertFilesExists(Collections.singletonList(nonExistentFile)); fail("Expected IllegalArgumentException was not thrown"); } catch (IllegalArgumentException e) { // assert assertThat(e.getMessage(), containsString(nonExistentFile.toString())); } } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/FinderTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.io.File; import org.jspecify.annotations.Nullable; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import static org.hamcrest.Matchers.*; import static org.hamcrest.MatcherAssert.assertThat; import java.io.IOException; import java.time.Duration; import java.util.List; import java.util.Objects; import net.ladenthin.bitcoinaddressfinder.configuration.CConsumerJava; import net.ladenthin.bitcoinaddressfinder.configuration.CFinder; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaBip39; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaIncremental; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaRandom; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaRandomInstance; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaSocket; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaWebSocket; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaZmq; import net.ladenthin.bitcoinaddressfinder.configuration.CLMDBConfigurationReadOnly; import net.ladenthin.bitcoinaddressfinder.configuration.CProducerJava; import net.ladenthin.bitcoinaddressfinder.configuration.CProducerJavaSecretsFiles; import net.ladenthin.bitcoinaddressfinder.configuration.CProducerOpenCL; import net.ladenthin.bitcoinaddressfinder.keyproducer.*; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducerJavaRandom; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducerJavaSocketTest; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducerJavaZmqTest; import net.ladenthin.bitcoinaddressfinder.staticaddresses.TestAddressesFiles; import net.ladenthin.bitcoinaddressfinder.staticaddresses.TestAddressesLMDB; import org.junit.runner.RunWith; import org.slf4j.Logger; @RunWith(DataProviderRunner.class) public class FinderTest { @Rule public TemporaryFolder folder = new TemporaryFolder(); // @Test public void interrupt_noProducersSet_noExceptionThrown() throws IOException { // arrange CFinder cFinder = new CFinder(); Finder finder = new Finder(cFinder); // act finder.interrupt(); // assert } @Test public void interrupt_producersSetAndNotInitialized_noExceptionThrown() throws IOException { // arrange CFinder cFinder = new CFinder(); configureProducerWithExamples(cFinder); configureConsumerJava(cFinder); Finder finder = new Finder(cFinder); finder.startKeyProducer(); finder.startConsumer(); finder.configureProducer(); // act finder.interrupt(); // assert } @Test public void interrupt_consumerStarted_consumerNotStopped() throws IOException { // arrange CFinder cFinder = new CFinder(); configureProducerWithExamples(cFinder); // consumer java configuration configureConsumerJava(cFinder); Finder finder = new Finder(cFinder); finder.startConsumer(); // act finder.interrupt(); // assert } // // @Test public void shutdownAndAwaitTermination_noProducersSet_shutdownCalled() throws IOException { // arrange CFinder cFinder = new CFinder(); Finder finder = new Finder(cFinder); // pre-assert assertThat(finder.producerExecutorService.isTerminated(), is(equalTo(Boolean.FALSE))); // act finder.shutdownAndAwaitTermination(); // assert assertThat(finder.producerExecutorService.isTerminated(), is(equalTo(Boolean.TRUE))); } @Test public void shutdownAndAwaitTermination_producersSetAndNotInitialized_shutdownCalled() throws IOException { // arrange CFinder cFinder = new CFinder(); configureProducerWithExamples(cFinder); configureConsumerJava(cFinder); Finder finder = new Finder(cFinder); finder.startKeyProducer(); finder.startConsumer(); finder.configureProducer(); // act finder.shutdownAndAwaitTermination(); // assert assertThat(finder.producerExecutorService.isTerminated(), is(equalTo(Boolean.TRUE))); } @AwaitTimeTest @Test public void shutdownAndAwaitTermination_producersSetAndInitialized_shutdownCalledAndAwaitTermination() throws IOException { // Change await duration Finder.AWAIT_DURATION_TERMINATE = AwaitTimeTests.AWAIT_DURATION; // Attention: During the long duration, this test produce a lot of debug and warn output, prevent it by set the log details new LogLevelChange().turnOff(); // arrange CFinder cFinder = new CFinder(); String keyProducerId = "exampleId"; final CProducerJava cProducerJava = new CProducerJava(); cProducerJava.keyProducerId = keyProducerId; cProducerJava.runOnce = false; cFinder.producerJava.add(cProducerJava); configureKeyProducerJavaRandom(keyProducerId, cFinder); configureConsumerJava(cFinder); Finder finder = new Finder(cFinder); finder.startKeyProducer(); finder.startConsumer(); finder.configureProducer(); finder.initProducer(); finder.startProducer(); // act long beforeAct = System.currentTimeMillis(); finder.shutdownAndAwaitTermination(); // assert long afterAct = System.currentTimeMillis(); Duration waitTime = Duration.ofMillis(afterAct-beforeAct); // assert the waiting time is over, substract imprecision assertThat(waitTime, is(greaterThan(Finder.AWAIT_DURATION_TERMINATE.minus(AwaitTimeTests.IMPRECISION)))); } // // @Test public void getAllProducers_noProducersSet_returnEmptyList() throws IOException { // arrange CFinder cFinder = new CFinder(); Finder finder = new Finder(cFinder); // act List allProducers = finder.getAllProducers(); // assert assertThat(allProducers, is(empty())); } @Test public void getAllProducers_producersSetAndNotInitialized_returnList() throws IOException { // arrange CFinder cFinder = new CFinder(); configureProducerWithExamples(cFinder); configureConsumerJava(cFinder); Finder finder = new Finder(cFinder); finder.startKeyProducer(); finder.startConsumer(); finder.configureProducer(); // act List allProducers = finder.getAllProducers(); // assert assertThat(allProducers, hasSize(3)); } // // @Test(expected = KeyProducerIdNullException.class) public void startKeyProducer_keyProducerIdIsNull_ExceptionThrown() throws IOException, InterruptedException { // arrange CFinder cFinder = new CFinder(); configureKeyProducerJavaRandom(null, cFinder); configureConsumerJava(cFinder); Finder finder = new Finder(cFinder); // act finder.startKeyProducer(); } @Test(expected = KeyProducerIdIsNotUniqueException.class) public void startKeyProducer_keyProducerIdIsNotUnique_ExceptionThrown() throws IOException, InterruptedException { // arrange CFinder cFinder = new CFinder(); String sameIdTwice = "123"; configureKeyProducerJavaRandom(sameIdTwice, cFinder); configureKeyProducerJavaRandom(sameIdTwice, cFinder); configureConsumerJava(cFinder); Finder finder = new Finder(cFinder); // act finder.startKeyProducer(); } // // @Test(expected = KeyProducerIdUnknownException.class) public void configureProducer_keyProducerIdIsUnknown_ExceptionThrown() throws IOException, InterruptedException { // arrange CFinder cFinder = new CFinder(); final CProducerJava cProducerJava = new CProducerJava(); cProducerJava.runOnce = false; // null is not valid or will find any other id cProducerJava.keyProducerId = null; cFinder.producerJava.add(cProducerJava); configureKeyProducerJavaRandom("unknownId", cFinder); configureConsumerJava(cFinder); Finder finder = new Finder(cFinder); finder.startConsumer(); finder.startKeyProducer(); // act finder.configureProducer(); } // // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_KEY_PRODUCER_TYPES, location = CommonDataProvider.class) public void testFullCycle_keyProducerJavaSetAndInitialized_statesCorrect(CommonDataProvider.KeyProducerTypesLocal keyProducerType) throws IOException, InterruptedException { // arrange CFinder cFinder = new CFinder(); String keyProducerId = "exampleId"; final CProducerJava cProducerJava = new CProducerJava(); cProducerJava.keyProducerId = keyProducerId; cProducerJava.runOnce = false; cFinder.producerJava.add(cProducerJava); final Class keyProducerClass; switch (keyProducerType) { case KeyProducerJavaRandom: keyProducerClass = KeyProducerJavaRandom.class; configureKeyProducerJavaRandom(keyProducerId, cFinder); break; case KeyProducerJavaIncremental: keyProducerClass = KeyProducerJavaIncremental.class; configureKeyProducerJavaIncremental(keyProducerId, cFinder); break; case KeyProducerJavaBip39: keyProducerClass = KeyProducerJavaBip39.class; configureKeyProducerJavaBip39(keyProducerId, cFinder); break; case KeyProducerJavaSocket: keyProducerClass = KeyProducerJavaSocket.class; configureKeyProducerJavaSocket(keyProducerId, cFinder); break; case KeyProducerJavaWebSocket: keyProducerClass = KeyProducerJavaWebSocket.class; configureKeyProducerJavaWebSocket(keyProducerId, cFinder); break; case KeyProducerJavaZmq: keyProducerClass = KeyProducerJavaZmq.class; configureKeyProducerJavaZmq(keyProducerId, cFinder); break; default: throw new IllegalArgumentException("Unknown KeyProducerType: " + keyProducerType); } configureConsumerJava(cFinder); Finder finder = new Finder(cFinder); // act and assert the full cycle { // pre-assert assertThat(finder.getKeyProducers().keySet(), hasSize(0)); // act finder.startKeyProducer(); // assert assertThat(finder.getKeyProducers().keySet(), hasSize(1)); } // assert logger is correctly bound to the concrete class { KeyProducer keyProducer = Objects.requireNonNull(finder.getKeyProducers().get(keyProducerId)); Logger logger = keyProducer.getLogger(); // Verify logger name matches the fully qualified class name assertThat(logger.getName(), is(keyProducerClass.getCanonicalName())); } { // pre-assert assertThat(finder.getAllConsumers(), hasSize(0)); // act finder.startConsumer(); // assert assertThat(finder.getAllConsumers(), hasSize(1)); } { // pre-assert assertThat(finder.getAllProducers(), hasSize(0)); // act finder.configureProducer(); // assert assertThat(finder.getAllProducers(), hasSize(1)); assertProducerState(finder.getAllProducers(), ProducerState.UNINITIALIZED); } { // act finder.initProducer(); // assert assertProducerState(finder.getAllProducers(), ProducerState.INITIALIZED); } // catch the reference, it is not possible to get the reference afterwards the interrupt final List allProducers = finder.getAllProducers(); { // act finder.startProducer(); // wait Thread.sleep(Duration.ofSeconds(1L)); // assert assertProducerState(allProducers, ProducerState.RUNNING); } { // act finder.interrupt(); // assert assertThat(finder.getAllProducers(), hasSize(0)); assertProducerState(allProducers, ProducerState.NOT_RUNNING); } { // pre-assert assertThat(finder.getAllConsumers(), hasSize(1)); // act finder.shutdownAndAwaitTermination(); // assert assertThat(finder.getAllConsumers(), hasSize(0)); } } // @Test public void startKeyProducer_allConfiguredKeyProducerTypes_haveInstances() throws IOException { // Arrange CFinder cFinder = new CFinder(); // Configure one instance for each KeyProducer type // 1. JavaRandom CKeyProducerJavaRandom javaRandom = new CKeyProducerJavaRandom(); javaRandom.keyProducerId = "randomId"; javaRandom.keyProducerJavaRandomInstance = CKeyProducerJavaRandomInstance.RANDOM_CUSTOM_SEED; javaRandom.customSeed = 123L; cFinder.keyProducerJavaRandom.add(javaRandom); // 2. JavaBip39 CKeyProducerJavaBip39 bip39 = new CKeyProducerJavaBip39(); bip39.keyProducerId = "bip39Id"; bip39.mnemonic = CKeyProducerJavaBip39.DEFAULT_MNEMONIC; cFinder.keyProducerJavaBip39.add(bip39); // 3. JavaIncremental CKeyProducerJavaIncremental incremental = new CKeyProducerJavaIncremental(); incremental.keyProducerId = "incrementalId"; cFinder.keyProducerJavaIncremental.add(incremental); // 4. JavaSocket CKeyProducerJavaSocket socket = new CKeyProducerJavaSocket(); socket.keyProducerId = "socketId"; socket.port = KeyProducerJavaSocketTest.findFreePort(); cFinder.keyProducerJavaSocket.add(socket); // 5. JavaWebSocket CKeyProducerJavaWebSocket webSocket = new CKeyProducerJavaWebSocket(); webSocket.keyProducerId = "webSocketId"; webSocket.port = KeyProducerJavaSocketTest.findFreePort(); cFinder.keyProducerJavaWebSocket.add(webSocket); // 6. JavaZmq CKeyProducerJavaZmq zmq = new CKeyProducerJavaZmq(); zmq.keyProducerId = "zmqId"; zmq.address = KeyProducerJavaZmqTest.findFreeZmqAddress(); cFinder.keyProducerJavaZmq.add(zmq); Finder finder = new Finder(cFinder); // Act finder.startKeyProducer(); // Assert assertThat(finder.getKeyProducers().keySet(), hasItems("randomId", "bip39Id", "incrementalId", "socketId", "webSocketId", "zmqId")); // Additionally assert each instance is of expected class type assertThat(finder.getKeyProducers().get("randomId"), instanceOf(KeyProducerJavaRandom.class)); assertThat(finder.getKeyProducers().get("bip39Id"), instanceOf(KeyProducerJavaBip39.class)); assertThat(finder.getKeyProducers().get("incrementalId"), instanceOf(KeyProducerJavaIncremental.class)); assertThat(finder.getKeyProducers().get("socketId"), instanceOf(KeyProducerJavaSocket.class)); assertThat(finder.getKeyProducers().get("webSocketId"), instanceOf(KeyProducerJavaWebSocket.class)); assertThat(finder.getKeyProducers().get("zmqId"), instanceOf(KeyProducerJavaZmq.class)); // Interrupt and free producers finder.interrupt(); // Assert keyProducers map is empty after interrupt assertThat(finder.getKeyProducers().keySet(), is(empty())); } private void configureProducerWithExamples(CFinder cFinder) { String keyProducerId_producerJava = "exampleId_producerJava"; String keyProducerId_producerJavaSecretsFiles = "exampleId_producerJavaSecretsFiles"; String keyProducerId_producerOpenCL = "exampleId_producerOpenCL"; CProducerJava cProducerJava = new CProducerJava(); cProducerJava.keyProducerId = keyProducerId_producerJava; cFinder.producerJava.add(cProducerJava); CProducerJavaSecretsFiles cProducerJavaSecretsFiles = new CProducerJavaSecretsFiles(); cProducerJavaSecretsFiles.keyProducerId = keyProducerId_producerJavaSecretsFiles; cFinder.producerJavaSecretsFiles.add(cProducerJavaSecretsFiles); CProducerOpenCL cProducerOpenCL = new CProducerOpenCL(); cProducerOpenCL.keyProducerId = keyProducerId_producerOpenCL; cFinder.producerOpenCL.add(cProducerOpenCL); configureKeyProducerJavaRandom(keyProducerId_producerJava, cFinder); configureKeyProducerJavaRandom(keyProducerId_producerJavaSecretsFiles, cFinder); configureKeyProducerJavaRandom(keyProducerId_producerOpenCL, cFinder); } private void configureKeyProducerJavaRandom(@Nullable String keyProducerId, CFinder cFinder) { CKeyProducerJavaRandom cKeyProducerJavaRandom = new CKeyProducerJavaRandom(); cKeyProducerJavaRandom.keyProducerId = keyProducerId; cKeyProducerJavaRandom.keyProducerJavaRandomInstance = CKeyProducerJavaRandomInstance.RANDOM_CUSTOM_SEED; cKeyProducerJavaRandom.customSeed = 0L; cFinder.keyProducerJavaRandom.add(cKeyProducerJavaRandom); } private void configureKeyProducerJavaIncremental(String keyProducerId, CFinder cFinder) { CKeyProducerJavaIncremental incremental = new CKeyProducerJavaIncremental(); incremental.keyProducerId = keyProducerId; cFinder.keyProducerJavaIncremental.add(incremental); } private void configureKeyProducerJavaBip39(String keyProducerId, CFinder cFinder) { CKeyProducerJavaBip39 bip39 = new CKeyProducerJavaBip39(); bip39.keyProducerId = keyProducerId; bip39.mnemonic = CKeyProducerJavaBip39.DEFAULT_MNEMONIC; cFinder.keyProducerJavaBip39.add(bip39); } private void configureKeyProducerJavaSocket(String keyProducerId, CFinder cFinder) { CKeyProducerJavaSocket socket = new CKeyProducerJavaSocket(); socket.port = KeyProducerJavaSocketTest.findFreePort(); socket.timeout = KeyProducerJavaTest.TIMEOUT_FOR_TERMINATE; socket.keyProducerId = keyProducerId; cFinder.keyProducerJavaSocket.add(socket); } private void configureKeyProducerJavaWebSocket(String keyProducerId, CFinder cFinder) { CKeyProducerJavaWebSocket socket = new CKeyProducerJavaWebSocket(); socket.port = KeyProducerJavaSocketTest.findFreePort(); socket.timeout = KeyProducerJavaTest.TIMEOUT_FOR_TERMINATE; socket.keyProducerId = keyProducerId; cFinder.keyProducerJavaWebSocket.add(socket); } private void configureKeyProducerJavaZmq(String keyProducerId, CFinder cFinder) { CKeyProducerJavaZmq zmq = new CKeyProducerJavaZmq(); zmq.address = KeyProducerJavaZmqTest.findFreeZmqAddress(); zmq.timeout = KeyProducerJavaTest.TIMEOUT_FOR_TERMINATE; zmq.keyProducerId = keyProducerId; cFinder.keyProducerJavaZmq.add(zmq); } private void configureConsumerJava(CFinder cFinder) throws IOException { boolean compressed = false; boolean useStaticAmount = true; TestAddressesLMDB testAddressesLMDB = new TestAddressesLMDB(); TestAddressesFiles testAddresses = new TestAddressesFiles(compressed); File lmdbFolderPath = testAddressesLMDB.createTestLMDB(folder, testAddresses, useStaticAmount, false); CConsumerJava cConsumerJava = new CConsumerJava(); cConsumerJava.lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); cConsumerJava.lmdbConfigurationReadOnly.lmdbDirectory = lmdbFolderPath.getAbsolutePath(); cFinder.consumerJava = cConsumerJava; } private static void assertProducerState(List producerStateProviders, ProducerState expectedProducerState) { for (ProducerStateProvider producerStateProvider : producerStateProviders) { assertThat(producerStateProvider.getState(), is(equalTo(expectedProducerState))); } } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/HexEncodeTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import org.junit.Test; public class HexEncodeTest { // @Test public void encodeHexString_bouncyCastleAndApacheCommons_resultMustMatch() { // arrange byte[] data = {(byte) 0x8F, (byte) 0xC2, (byte) 0xAB, (byte) 0xDE}; // act String hexBc = org.bouncycastle.util.encoders.Hex.toHexString(data); String hexApache = org.apache.commons.codec.binary.Hex.encodeHexString(data); // assert assertThat("Hex encodings from BouncyCastle and Apache Commons must match", hexBc, is(hexApache)); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/KeyUtilityTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.io.IOException; import java.math.BigInteger; import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Random; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import net.ladenthin.bitcoinaddressfinder.keyproducer.NoMoreSecretsAvailableException; import net.ladenthin.bitcoinaddressfinder.staticaddresses.StaticKey; import org.bitcoinj.base.LegacyAddress; import org.bitcoinj.base.Network; import org.bitcoinj.crypto.ECKey; import org.bitcoinj.crypto.MnemonicException; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; @RunWith(DataProviderRunner.class) public class KeyUtilityTest { private final StaticKey staticKey = new StaticKey(); private final Network network = new NetworkParameterFactory().getNetwork(); // @Test public void createECKey_uncompressedKey_returnsCorrectPublicKeyHash() throws IOException { // arrange BigInteger bigIntegerFromHex = new BigInteger(staticKey.privateKeyHex, 16); // act ECKey key = new KeyUtility(network, new ByteBufferUtility(false)).createECKey(bigIntegerFromHex, false); // assert byte[] hash160 = key.getPubKeyHash(); ByteBuffer hash160AsByteBuffer = new ByteBufferUtility(false).byteArrayToByteBuffer(hash160); assertThat(key.isCompressed(), is(equalTo(Boolean.FALSE))); assertThat(hash160AsByteBuffer, is(equalTo(staticKey.byteBufferPublicKeyUncompressed))); } @Test public void createECKey_compressedKey_returnsCorrectPublicKeyHash() throws IOException { // arrange BigInteger bigIntegerFromHex = new BigInteger(staticKey.privateKeyHex, 16); // act ECKey key = new KeyUtility(network, new ByteBufferUtility(false)).createECKey(bigIntegerFromHex, true); // assert byte[] hash160 = key.getPubKeyHash(); ByteBuffer hash160AsByteBuffer = new ByteBufferUtility(false).byteArrayToByteBuffer(hash160); assertThat(key.isCompressed(), is(equalTo(Boolean.TRUE))); assertThat(hash160AsByteBuffer, is(equalTo(staticKey.byteBufferPublicKeyCompressed))); } // // @Test public void getHash160ByteBufferFromBase58String_uncompressedPublicKeyAddress_returnsExpectedByteBuffer() throws IOException { // act ByteBuffer byteBufferPublicKeyUncompressed = new KeyUtility(network, new ByteBufferUtility(false)).getHash160ByteBufferFromBase58String(staticKey.publicKeyUncompressed); // assert assertThat(byteBufferPublicKeyUncompressed, is(equalTo(staticKey.byteBufferPublicKeyUncompressed))); } @Test public void getHash160ByteBufferFromBase58String_compressedPublicKeyAddress_returnsExpectedByteBuffer() throws IOException { // act ByteBuffer byteBufferPublicKeyCompressed = new KeyUtility(network, new ByteBufferUtility(false)).getHash160ByteBufferFromBase58String(staticKey.publicKeyCompressed); // assert assertThat(byteBufferPublicKeyCompressed, is(equalTo(staticKey.byteBufferPublicKeyCompressed))); } @Test public void byteBufferToAddress_isInverseOf_getHash160ByteBufferFromBase58String() { // arrange KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); String originalBase58 = staticKey.publicKeyUncompressed; // act ByteBuffer hash160Buffer = keyUtility.getHash160ByteBufferFromBase58String(originalBase58); String backToBase58 = keyUtility.byteBufferToAddress(hash160Buffer).toBase58(); // assert assertThat(backToBase58, is(equalTo(originalBase58))); } // // @Test public void getHexFromByteBuffer_uncompressedPublicKeyHash_returnsExpectedHex() throws IOException { // act String hexPublicKeyUncompressed = new ByteBufferUtility(false).getHexFromByteBuffer(staticKey.byteBufferPublicKeyUncompressed); // assert assertThat(hexPublicKeyUncompressed, is(equalTo(staticKey.publicKeyUncompressedHash160Hex))); } @Test public void getHexFromByteBuffer_compressedPublicKeyHash_returnsExpectedHex() throws IOException { // act String hexPublicKeyCompressed = new ByteBufferUtility(false).getHexFromByteBuffer(staticKey.byteBufferPublicKeyCompressed); // assert assertThat(hexPublicKeyCompressed, is(equalTo(staticKey.publicKeyCompressedHash160Hex))); } // // @Test public void getByteBufferFromHex_uncompressedPublicKeyHashHex_returnsExpectedByteBuffer() throws IOException { // act ByteBuffer byteBufferPublicKeyUncompressed = new ByteBufferUtility(false).getByteBufferFromHex(staticKey.publicKeyUncompressedHash160Hex); // assert assertThat(byteBufferPublicKeyUncompressed, is(equalTo(staticKey.byteBufferPublicKeyUncompressed))); } @Test public void getByteBufferFromHex_compressedPublicKeyHashHex_returnsExpectedByteBuffer() throws IOException { // act ByteBuffer byteBufferPublicKeyCompressed = new ByteBufferUtility(false).getByteBufferFromHex(staticKey.publicKeyCompressedHash160Hex); // assert assertThat(byteBufferPublicKeyCompressed, is(equalTo(staticKey.byteBufferPublicKeyCompressed))); } // // @Test public void createSecret_maxBitLength_returnsNonEmptySecret() throws IOException { // act BigInteger secret = new KeyUtility(network, new ByteBufferUtility(false)).createSecret(PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS, new Random(42)); // assert assertThat(secret.toString(), is(not(equalTo("")))); } @Test public void createSecret_zeroBits_returnsZero() { // act BigInteger secret = new KeyUtility(network, new ByteBufferUtility(false)).createSecret(0, new Random(123)); // assert assertThat(secret, is(equalTo(BigInteger.ZERO))); } // // @Test public void createKeyDetails_uncompressedKey_returnsExpectedDetails() throws IOException, MnemonicException.MnemonicLengthException { // arrange ByteBufferUtility byteBufferUtility = new ByteBufferUtility(false); KeyUtility keyUtility = new KeyUtility(network, byteBufferUtility); BigInteger secret = new BigInteger(staticKey.privateKeyHex, 16); ECKey ecKey = keyUtility.createECKey(secret, false); // act String keyDetails = keyUtility.createKeyDetails(ecKey); // assert String mnemonics = keyUtility.createMnemonics(ecKey.getPrivKeyBytes()); assertThat(keyDetails, is(equalTo("privateKeyBigInteger: [" + staticKey.privateKeyBigInteger + "] privateKeyBytes: [" + Arrays.toString(staticKey.privateKeyBytes) + "] privateKeyHex: [" + staticKey.privateKeyHex + "] WiF: [" + staticKey.privateKeyWiFUncompressed + "] publicKeyAsHex: [" + staticKey.publicKeyUncompressedHex + "] publicKeyHash160Hex: [" + staticKey.publicKeyUncompressedHash160Hex + "] publicKeyHash160Base58: [" + staticKey.publicKeyUncompressed + "] Compressed: [false] " + mnemonics))); } @Test public void createKeyDetails_compressedKey_returnsExpectedDetails() throws IOException, MnemonicException.MnemonicLengthException { // arrange ByteBufferUtility byteBufferUtility = new ByteBufferUtility(false); KeyUtility keyUtility = new KeyUtility(network, byteBufferUtility); BigInteger secret = new BigInteger(staticKey.privateKeyHex, 16); ECKey ecKey = keyUtility.createECKey(secret, true); // act String keyDetails = keyUtility.createKeyDetails(ecKey); // assert String mnemonics = keyUtility.createMnemonics(ecKey.getPrivKeyBytes()); assertThat(keyDetails, is(equalTo("privateKeyBigInteger: [" + staticKey.privateKeyBigInteger + "] privateKeyBytes: [" + Arrays.toString(staticKey.privateKeyBytes) + "] privateKeyHex: [" + staticKey.privateKeyHex + "] WiF: [" + staticKey.privateKeyWiFCompressed + "] publicKeyAsHex: [" + staticKey.publicKeyCompressedHex + "] publicKeyHash160Hex: [" + staticKey.publicKeyCompressedHash160Hex + "] publicKeyHash160Base58: [" + staticKey.publicKeyCompressed + "] Compressed: [true] " + mnemonics))); } // // @Test public void killBits_valueWithAllBitsSetGiven_bitsKilled() throws IOException { // act BigInteger secret = new KeyUtility(network, new ByteBufferUtility(false)).killBits(BigInteger.valueOf(63L), BigInteger.valueOf(5L)); // assert assertThat(secret, is(equalTo(BigInteger.valueOf(58)))); } @Test public void killBits_valueWithNotAllBitsSetGiven_bitsKilled() throws IOException { // act BigInteger secret = new KeyUtility(network, new ByteBufferUtility(false)).killBits(BigInteger.valueOf(62L), BigInteger.valueOf(5L)); // assert assertThat(secret, is(equalTo(BigInteger.valueOf(58)))); } // // @Test public void ecKey_fromPrivate_randomValidInRange_succeeds() { // arrange BigInteger randomValidKey = PublicKeyBytes.MIN_VALID_PRIVATE_KEY.add(BigInteger.valueOf(123456)); // act ECKey ecKey = ECKey.fromPrivate(randomValidKey, false); // assert assertThat(ecKey.getPrivKey(), is(equalTo(randomValidKey))); } @Test(expected = IllegalArgumentException.class) public void ecKey_fromPrivate_minPrivateKey_throwsException() { // act ECKey.fromPrivate(PublicKeyBytes.MIN_PRIVATE_KEY, false); } @Ignore("bitcoinj.ECKey.fromPrivate(...) accepts values > MAX_PRIVATE_KEY without throwing an exception. " + "Test ignored because the library does not enforce the upper bound.") @Test(expected = IllegalArgumentException.class) public void ecKey_fromPrivate_maxPrivateKeyPlusOne_throwsException() { // act ECKey.fromPrivate(PublicKeyBytes.MAX_PRIVATE_KEY.add(BigInteger.ONE), false); } @Test public void ecKey_fromPrivate_minValidPrivateKey_noExceptionThrown() { // act ECKey ecKey = ECKey.fromPrivate(PublicKeyBytes.MIN_VALID_PRIVATE_KEY, false); // assert assertThat(ecKey.getPrivKey(), is(equalTo(PublicKeyBytes.MIN_VALID_PRIVATE_KEY))); } @Test public void ecKey_fromPrivate_maxPrivateKey_noExceptionThrown() { // act ECKey ecKey = ECKey.fromPrivate(PublicKeyBytes.MAX_PRIVATE_KEY, false); // assert assertThat(ecKey.getPrivKey(), is(equalTo(PublicKeyBytes.MAX_PRIVATE_KEY))); } // // @Test public void intToByteArray_zero_returnsFourZeroBytes() { // arrange byte[] expected = new byte[4]; // act byte[] result = KeyUtility.intToByteArray(0); // assert assertThat(result, is(expected)); } @Test public void intToByteArray_knownValue_returnsExpectedBigEndianBytes() { // arrange byte[] expected = {0x12, 0x34, 0x56, 0x78}; // act byte[] result = KeyUtility.intToByteArray(0x12345678); // assert assertThat(result, is(expected)); } @Test public void intToByteArray_minusOne_returnsAllFfBytes() { // arrange byte[] expected = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; // act byte[] result = KeyUtility.intToByteArray(-1); // assert assertThat(result, is(expected)); } @Test public void intToByteArray_intMaxValue_returnsExpectedBytes() { // arrange byte[] expected = {0x7F, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; // act byte[] result = KeyUtility.intToByteArray(Integer.MAX_VALUE); // assert assertThat(result, is(expected)); } @Test public void intToByteArray_intMinValue_returnsExpectedBytes() { // arrange byte[] expected = {(byte) 0x80, 0x00, 0x00, 0x00}; // act byte[] result = KeyUtility.intToByteArray(Integer.MIN_VALUE); // assert assertThat(result, is(expected)); } @Test public void intToByteArray_withOffset_writesExpectedBytesAtCorrectPosition() { // arrange final int value = 0xCAFEBABE; final int bufferLength = 8; final int offset = 2; final int intByteLength = 4; byte[] buffer = new byte[bufferLength]; byte[] expectedWritten = {(byte) 0xCA, (byte) 0xFE, (byte) 0xBA, (byte) 0xBE}; // act KeyUtility.intToByteArray(value, buffer, offset); // assert assertThat(Arrays.copyOfRange(buffer, offset, offset + intByteLength), is(expectedWritten)); assertThat(Arrays.copyOfRange(buffer, 0, offset), is(new byte[offset])); assertThat(Arrays.copyOfRange(buffer, offset + intByteLength, bufferLength), is(new byte[bufferLength - offset - intByteLength])); } // // @Test public void byteArrayToInt_allZeroBytes_returnsZero() { // arrange byte[] input = new byte[4]; // act int result = KeyUtility.byteArrayToInt(input); // assert assertThat(result, is(equalTo(0))); } @Test public void byteArrayToInt_knownBytes_returnsExpectedInt() { // arrange byte[] input = {0x12, 0x34, 0x56, 0x78}; // act int result = KeyUtility.byteArrayToInt(input); // assert assertThat(result, is(equalTo(0x12345678))); } @Test public void byteArrayToInt_allFfBytes_returnsMinusOne() { // arrange byte[] input = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; // act int result = KeyUtility.byteArrayToInt(input); // assert assertThat(result, is(equalTo(-1))); } @Test public void byteArrayToInt_maxIntBytes_returnsMaxInt() { // arrange byte[] input = {0x7F, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; // act int result = KeyUtility.byteArrayToInt(input); // assert assertThat(result, is(equalTo(Integer.MAX_VALUE))); } @Test public void byteArrayToInt_withOffset_readsExpectedInt() { // arrange final int original = 0xCAFEBABE; final int offset = 2; byte[] buffer = new byte[8]; KeyUtility.intToByteArray(original, buffer, offset); // act int result = KeyUtility.byteArrayToInt(buffer, offset); // assert assertThat(result, is(equalTo(original))); } @Test public void intToByteArray_byteArrayToInt_roundTrip_zero_preservesValue() { // arrange final int original = 0; // act byte[] bytes = KeyUtility.intToByteArray(original); int result = KeyUtility.byteArrayToInt(bytes); // assert assertThat(result, is(equalTo(original))); } @Test public void intToByteArray_byteArrayToInt_roundTrip_intMaxValue_preservesValue() { // arrange final int original = Integer.MAX_VALUE; // act byte[] bytes = KeyUtility.intToByteArray(original); int result = KeyUtility.byteArrayToInt(bytes); // assert assertThat(result, is(equalTo(original))); } @Test public void intToByteArray_byteArrayToInt_roundTrip_intMinValue_preservesValue() { // arrange final int original = Integer.MIN_VALUE; // act byte[] bytes = KeyUtility.intToByteArray(original); int result = KeyUtility.byteArrayToInt(bytes); // assert assertThat(result, is(equalTo(original))); } @Test public void intToByteArray_byteArrayToInt_roundTrip_minusOne_preservesValue() { // arrange final int original = -1; // act byte[] bytes = KeyUtility.intToByteArray(original); int result = KeyUtility.byteArrayToInt(bytes); // assert assertThat(result, is(equalTo(original))); } @Test public void intToByteArray_byteArrayToInt_roundTrip_knownValue_preservesValue() { // arrange final int original = 0x12345678; // act byte[] bytes = KeyUtility.intToByteArray(original); int result = KeyUtility.byteArrayToInt(bytes); // assert assertThat(result, is(equalTo(original))); } // // @Test public void byteArrayToIntArray_knownBytes_populatesIntAtOffset() { // arrange final int original = 0x0A0B0C0D; byte[] bytes = KeyUtility.intToByteArray(original); int[] result = new int[1]; // act KeyUtility.byteArrayToIntArray(bytes, 0, result, 0); // assert assertThat(result[0], is(equalTo(original))); } @Test public void byteArrayToIntArray_withNonZeroIntArrayOffset_populatesCorrectSlot() { // arrange final int original = 0x0A0B0C0D; byte[] bytes = KeyUtility.intToByteArray(original); int[] result = new int[3]; final int intOffset = 2; // act KeyUtility.byteArrayToIntArray(bytes, 0, result, intOffset); // assert assertThat(result[intOffset], is(equalTo(original))); assertThat(result[0], is(equalTo(0))); assertThat(result[1], is(equalTo(0))); } @Test public void byteArrayToIntArray_withNonZeroByteArrayOffset_readsFromCorrectPosition() { // arrange final int original = 0x0A0B0C0D; final int byteOffset = 4; byte[] bytes = new byte[8]; KeyUtility.intToByteArray(original, bytes, byteOffset); int[] result = new int[1]; // act KeyUtility.byteArrayToIntArray(bytes, byteOffset, result, 0); // assert assertThat(result[0], is(equalTo(original))); } // // @Test public void createSecrets_returnStartSecretOnlyTrue_returnsOneSecret() throws NoMoreSecretsAvailableException { // arrange KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); int privateKeyMaxNumBits = PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS; Random random = new Random(123); SecretSupplier randomSupplier = new RandomSecretSupplier(random); int overallWorkSize = 10; boolean returnStartSecretOnly = true; // act BigInteger[] secrets = keyUtility.createSecrets(overallWorkSize, returnStartSecretOnly, privateKeyMaxNumBits, randomSupplier); // assert assertThat(secrets.length, is(1)); assertThat(secrets[0], is(notNullValue())); } @Test public void createSecrets_returnStartSecretOnlyFalse_returnsAllSecrets() throws NoMoreSecretsAvailableException { // arrange KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); int privateKeyMaxNumBits = PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS; Random random = new Random(123); SecretSupplier randomSupplier = new RandomSecretSupplier(random); int overallWorkSize = 5; boolean returnStartSecretOnly = false; // act BigInteger[] secrets = keyUtility.createSecrets(overallWorkSize, returnStartSecretOnly, privateKeyMaxNumBits, randomSupplier); // assert assertThat(secrets.length, is(overallWorkSize)); assertThat(Arrays.asList(secrets), everyItem(is(notNullValue()))); } @Test(expected = NoMoreSecretsAvailableException.class) public void createSecrets_zeroLength_throwsException() throws NoMoreSecretsAvailableException { // arrange KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); int privateKeyMaxNumBits = PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS; Random random = new Random() { @Override public void nextBytes(byte[] bytes) { throw new NoMoreSecretsAvailableException(); } }; SecretSupplier randomSupplier = new RandomSecretSupplier(random); int overallWorkSize = 1; boolean returnStartSecretOnly = false; // act keyUtility.createSecrets(overallWorkSize, returnStartSecretOnly, privateKeyMaxNumBits, randomSupplier); } // // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_LARGE_SECRETS_AS_HEX, location = CommonDataProvider.class) public void bigIntegerToFixedLengthHex_knownBigInteger_correctHex(String largeSecretsAsHex) { // arrange BigInteger input = new BigInteger(largeSecretsAsHex, 16); KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); // act String result = keyUtility.bigIntegerToFixedLengthHex(input); // assert assertThat(result, is(equalTo(largeSecretsAsHex))); } // // @Test public void bigIntegerFromUnsignedByteArray_exact32Bytes_constructsCorrectly() { // arrange KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); byte[] buffer = new byte[32]; buffer[30] = 0x12; buffer[31] = 0x34; BigInteger expected = new BigInteger("1234", 16); // act BigInteger result = keyUtility.bigIntegerFromUnsignedByteArray(buffer); // assert assertThat(result, is(equalTo(expected))); } @Test(expected = IllegalArgumentException.class) public void bigIntegerFromUnsignedByteArray_wrongLength_throwsException() { // arrange KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); byte[] invalid = new byte[31]; // act keyUtility.bigIntegerFromUnsignedByteArray(invalid); } // // @Test public void toBase58_knownHash160_returnsExpectedBase58Address() { // arrange KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); StaticKey key = new StaticKey(); byte[] hash160 = new ByteBufferUtility(false).byteBufferToBytes(key.byteBufferPublicKeyUncompressed); // act String result = keyUtility.toBase58(hash160); // assert assertThat(result, is(equalTo(key.publicKeyUncompressed))); } @Test public void toBase58_compressedHash160_returnsExpectedBase58Address() { // arrange KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); StaticKey key = new StaticKey(); byte[] hash160 = new ByteBufferUtility(false).byteBufferToBytes(key.byteBufferPublicKeyCompressed); // act String result = keyUtility.toBase58(hash160); // assert assertThat(result, is(equalTo(key.publicKeyCompressed))); } // // @Test public void addressToByteBuffer_validAddress_returnsCorrectByteBuffer() { // arrange KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); StaticKey key = new StaticKey(); LegacyAddress address = LegacyAddress.fromBase58(key.publicKeyUncompressed, network); // act ByteBuffer result = keyUtility.addressToByteBuffer(address); // assert assertThat(result, is(equalTo(key.byteBufferPublicKeyUncompressed))); } @Test public void addressToByteBuffer_roundTripWithByteBufferToAddress_returnsOriginalAddress() { // arrange KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); StaticKey key = new StaticKey(); LegacyAddress originalAddress = LegacyAddress.fromBase58(key.publicKeyCompressed, network); // act ByteBuffer buffer = keyUtility.addressToByteBuffer(originalAddress); LegacyAddress roundTripped = keyUtility.byteBufferToAddress(buffer); // assert assertThat(roundTripped, is(equalTo(originalAddress))); } // // @Test public void byteBufferToAddress_validBuffer_returnsCorrectAddress() { // arrange KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); StaticKey key = new StaticKey(); // act LegacyAddress result = keyUtility.byteBufferToAddress(key.byteBufferPublicKeyCompressed); // assert assertThat(result.toBase58(), is(equalTo(key.publicKeyCompressed))); } // // @Test public void createMnemonics_validPrivateKeyBytes_returnsNonEmptyMnemonicString() { // arrange KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); StaticKey key = new StaticKey(); // act String result = keyUtility.createMnemonics(key.privateKeyBytes); // assert assertThat(result, not(emptyOrNullString())); assertThat(result, containsString("Mnemonic:")); } @Test public void createMnemonics_validPrivateKeyBytes_containsAllWordLists() { // arrange KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); StaticKey key = new StaticKey(); // act String result = keyUtility.createMnemonics(key.privateKeyBytes); // assert for (BIP39Wordlist wordList : BIP39Wordlist.values()) { assertThat(result, containsString(wordList.name())); } } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/LMDBBase.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.io.File; import java.io.IOException; import net.ladenthin.bitcoinaddressfinder.configuration.CLMDBConfigurationReadOnly; import net.ladenthin.bitcoinaddressfinder.persistence.Persistence; import net.ladenthin.bitcoinaddressfinder.persistence.PersistenceUtils; import net.ladenthin.bitcoinaddressfinder.persistence.lmdb.LMDBPersistence; import net.ladenthin.bitcoinaddressfinder.staticaddresses.AddressesFiles; import net.ladenthin.bitcoinaddressfinder.staticaddresses.TestAddressesLMDB; import org.bitcoinj.base.Network; import org.junit.Rule; import org.junit.rules.TemporaryFolder; public class LMDBBase { @Rule public TemporaryFolder folder = new TemporaryFolder(); protected final Network network = new NetworkParameterFactory().getNetwork(); protected final KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(true)); protected Persistence createAndFillAndOpenLMDB(boolean useStaticAmount, AddressesFiles addressesFiles, boolean addInvalidAddresses, boolean useBloomFilter) throws IOException { TestAddressesLMDB testAddressesLMDB = new TestAddressesLMDB(); File lmdbFolderPath = testAddressesLMDB.createTestLMDB(folder, addressesFiles, useStaticAmount, addInvalidAddresses); CLMDBConfigurationReadOnly lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); lmdbConfigurationReadOnly.lmdbDirectory = lmdbFolderPath.getAbsolutePath(); lmdbConfigurationReadOnly.useBloomFilter = useBloomFilter; PersistenceUtils persistenceUtils = new PersistenceUtils(network); Persistence persistence = new LMDBPersistence(lmdbConfigurationReadOnly, persistenceUtils); persistence.init(); return persistence; } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/LMDBPersistencePerformanceTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import ch.qos.logback.classic.Level; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.io.File; import java.io.IOException; import java.math.BigInteger; import java.util.concurrent.Executors; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.atomic.AtomicBoolean; import net.ladenthin.bitcoinaddressfinder.configuration.CConsumerJava; import net.ladenthin.bitcoinaddressfinder.configuration.CLMDBConfigurationReadOnly; import net.ladenthin.bitcoinaddressfinder.persistence.PersistenceUtils; import net.ladenthin.bitcoinaddressfinder.staticaddresses.TestAddressesFiles; import net.ladenthin.bitcoinaddressfinder.staticaddresses.TestAddressesLMDB; import org.bitcoinj.base.Network; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.junit.runner.RunWith; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; @RunWith(DataProviderRunner.class) public class LMDBPersistencePerformanceTest { @Rule public TemporaryFolder folder = new TemporaryFolder(); private final Network network = new NetworkParameterFactory().getNetwork(); private final KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); private final PersistenceUtils persistenceUtils = new PersistenceUtils(network); private final static int ARRAY_SIZE = 1024*8; private final static BigInteger PRIVATE_KEY = BigInteger.valueOf(1337); private final static int CONSUMER_THREADS = 32; private final static int TEST_TIME_IN_SECONDS = 4; private final static int KEYS_QUEUE_SIZE = CONSUMER_THREADS*2; private final static int PRODUCER_THREADS = KEYS_QUEUE_SIZE; @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_BLOOM_FILTER_ENABLED, location = CommonDataProvider.class) public void runProber_performanceTest(boolean useBloomFilter) throws IOException, InterruptedException, IllegalArgumentException, NoSuchFieldException, IllegalAccessException { new LMDBPlatformAssume().assumeLMDBExecution(); TestAddressesLMDB testAddressesLMDB = new TestAddressesLMDB(); TestAddressesFiles testAddresses = new TestAddressesFiles(false); File lmdbFolderPath = testAddressesLMDB.createTestLMDB(folder, testAddresses, true, false); CConsumerJava cConsumerJava = new CConsumerJava(); cConsumerJava.threads = CONSUMER_THREADS; cConsumerJava.queueSize = KEYS_QUEUE_SIZE; cConsumerJava.printStatisticsEveryNSeconds = 1; cConsumerJava.delayEmptyConsumer = 1; cConsumerJava.lmdbConfigurationReadOnly = new CLMDBConfigurationReadOnly(); cConsumerJava.lmdbConfigurationReadOnly.lmdbDirectory = lmdbFolderPath.getAbsolutePath(); cConsumerJava.lmdbConfigurationReadOnly.useBloomFilter = useBloomFilter; cConsumerJava.runtimePublicKeyCalculationCheck = ManualDebugConstants.ENABLE_RUNTIME_PUBLIC_KEY_CALCULATION_CHECK; ConsumerJava consumerJava = new ConsumerJava(cConsumerJava, keyUtility, persistenceUtils); ch.qos.logback.classic.Logger logger = (ch.qos.logback.classic.Logger) consumerJava.getLogger(); logger.setLevel(Level.INFO); consumerJava.initLMDB(); // create producer PublicKeyBytes[] publicKeyByteses = createPublicKeyBytesArray(); ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(PRODUCER_THREADS); AtomicBoolean producerShouldRun = new AtomicBoolean(true); createProducerThreads(threadPoolExecutor, consumerJava, publicKeyByteses, producerShouldRun); // act consumerJava.startConsumer(); consumerJava.startStatisticsTimer(); Thread.sleep(TEST_TIME_IN_SECONDS * Statistics.ONE_SECOND_IN_MILLISECONDS); // Signal all producer threads to stop by setting the shared flag to false. // Each producer thread will check this flag in its loop and exit cleanly. producerShouldRun.set(false); // Gracefully stop consumer threads and release all resources consumerJava.interrupt(); assertThat(consumerJava.persistence, is(nullValue())); assertThat(consumerJava.shouldRun.get(), is(false )); assertThat(consumerJava.scheduledExecutorService.isShutdown(), is(true)); assertThat(consumerJava.scheduledExecutorService.isTerminated(), is(true)); assertThat(consumerJava.consumeKeysExecutorService.isShutdown(), is(true)); assertThat(consumerJava.consumeKeysExecutorService.isTerminated(), is(true)); } private void createProducerThreads(ThreadPoolExecutor threadPoolExecutor, ConsumerJava consumerJava, PublicKeyBytes[] publicKeyByteses, AtomicBoolean producerShouldRun) { for (int i = 0; i < PRODUCER_THREADS; i++) { threadPoolExecutor.submit(() ->{ while(producerShouldRun.get()) { try { consumerJava.consumeKeys(publicKeyByteses); } catch (InterruptedException e) { throw new RuntimeException(e); } } }); } } private PublicKeyBytes[] createPublicKeyBytesArray() { PublicKeyBytes publicKeyBytes = PublicKeyBytes.fromPrivate(PRIVATE_KEY); PublicKeyBytes[] publicKeyByteses = new PublicKeyBytes[ARRAY_SIZE]; for (int i = 0; i < publicKeyByteses.length; i++) { publicKeyByteses[i] = publicKeyBytes; } return publicKeyByteses; } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/LMDBPersistenceTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.io.File; import java.io.IOException; import java.math.BigInteger; import java.nio.ByteBuffer; import java.util.Random; import net.ladenthin.bitcoinaddressfinder.configuration.CLMDBConfigurationWrite; import net.ladenthin.bitcoinaddressfinder.persistence.PersistenceUtils; import net.ladenthin.bitcoinaddressfinder.persistence.lmdb.LMDBPersistence; import org.bitcoinj.base.Coin; import org.bitcoinj.base.Network; import org.bitcoinj.crypto.ECKey; import org.junit.Rule; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.*; import org.junit.rules.TemporaryFolder; import org.junit.runner.RunWith; @RunWith(DataProviderRunner.class) public class LMDBPersistenceTest { @Rule public TemporaryFolder folder = new TemporaryFolder(); private final Random random = new Random(1337); private final Network network = new NetworkParameterFactory().getNetwork(); private final ByteBufferUtility byteBufferUtility = new ByteBufferUtility(true); private final KeyUtility keyUtility = new KeyUtility(network, byteBufferUtility); private final PersistenceUtils persistenceUtils = new PersistenceUtils(network); /** * The increase should happen a few times. See {@link #TOO_MUCH_KEYS_EXPECTED_1MiB_INCREASES}. */ private final static int TOO_MUCH_KEYS_FOR_1MiB = 1024*128; /** * See {@link #TOO_MUCH_KEYS_FOR_1MiB}. */ private final static int TOO_MUCH_KEYS_EXPECTED_1MiB_INCREASES = 5; // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_LMDB_AMOUNTS, location = CommonDataProvider.class) public void putNewAmount_putNewAmount_correctAmountStored(boolean useStaticAmount, long staticAmount, long amount, long expectedAmount) throws IOException { // arrange File lmdbFolder = folder.newFolder("lmdb"); CLMDBConfigurationWrite cLMDBConfigurationWrite = new CLMDBConfigurationWrite(); cLMDBConfigurationWrite.initialMapSizeInMiB = 1; cLMDBConfigurationWrite.lmdbDirectory = lmdbFolder.getAbsolutePath(); cLMDBConfigurationWrite.useStaticAmount = useStaticAmount; cLMDBConfigurationWrite.staticAmount = staticAmount; LMDBPersistence lmdbPersistence = new LMDBPersistence(cLMDBConfigurationWrite, persistenceUtils); lmdbPersistence.init(); // create key BigInteger secret = keyUtility.createSecret(PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS, random); ECKey ecKey = keyUtility.createECKey(secret, true); byte[] hash160 = ecKey.getPubKeyHash(); ByteBuffer hash160ByteBuffer = byteBufferUtility.byteArrayToByteBuffer(hash160); // act lmdbPersistence.putNewAmount(hash160ByteBuffer, Coin.valueOf(amount)); // assert Coin amountInLmdb = lmdbPersistence.getAmount(hash160ByteBuffer); assertThat(amountInLmdb.getValue(), is(equalTo(expectedAmount))); } // // @Test public void getDatabaseSize_initialLMDBSetTo1MiB_returnInitialDatabaseSize() throws IOException { // arrange File lmdbFolder = folder.newFolder("lmdb"); CLMDBConfigurationWrite cLMDBConfigurationWrite = new CLMDBConfigurationWrite(); cLMDBConfigurationWrite.initialMapSizeInMiB = 1; cLMDBConfigurationWrite.lmdbDirectory = lmdbFolder.getAbsolutePath(); LMDBPersistence lmdbPersistence = new LMDBPersistence(cLMDBConfigurationWrite, persistenceUtils); lmdbPersistence.init(); // act long databaseSize = lmdbPersistence.getDatabaseSize(); // assert assertThat(databaseSize, is(equalTo(new ByteConversion().mibToBytes(1L)))); } @Test public void getDatabaseSize_valuesAdded_returnInitialDatabaseSize() throws IOException { // arrange int keysToAdd = 1024*16; File lmdbFolder = folder.newFolder("lmdb"); CLMDBConfigurationWrite cLMDBConfigurationWrite = new CLMDBConfigurationWrite(); cLMDBConfigurationWrite.initialMapSizeInMiB = 1; cLMDBConfigurationWrite.lmdbDirectory = lmdbFolder.getAbsolutePath(); LMDBPersistence lmdbPersistence = new LMDBPersistence(cLMDBConfigurationWrite, persistenceUtils); lmdbPersistence.init(); fillWithRandomKeys(keysToAdd, lmdbPersistence); // act long databaseSize = lmdbPersistence.getDatabaseSize(); // assert assertThat(databaseSize, is(equalTo(new ByteConversion().mibToBytes(1L)))); } // // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_LMDB_INCREASE_SIZE, location = CommonDataProvider.class) public void getDatabaseSize_initialLMDBSetTo1MiB_increaseDatabaseSize_returnResizedDatabaseSize(long increaseSize) throws IOException { // arrange File lmdbFolder = folder.newFolder("lmdb"); CLMDBConfigurationWrite cLMDBConfigurationWrite = new CLMDBConfigurationWrite(); cLMDBConfigurationWrite.initialMapSizeInMiB = 1; cLMDBConfigurationWrite.lmdbDirectory = lmdbFolder.getAbsolutePath(); LMDBPersistence lmdbPersistence = new LMDBPersistence(cLMDBConfigurationWrite, persistenceUtils); lmdbPersistence.init(); // act lmdbPersistence.increaseDatabaseSize(increaseSize); // assert long databaseSize = lmdbPersistence.getDatabaseSize(); assertThat(databaseSize, is(equalTo(new ByteConversion().mibToBytes(1L)+increaseSize))); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_LMDB_INCREASE_SIZE, location = CommonDataProvider.class) public void getDatabaseSize_valuesAdded_increaseDatabaseSize_returnResizedDatabaseSize(long increaseSize) throws IOException { // arrange int keysToAdd = 1024*16; File lmdbFolder = folder.newFolder("lmdb"); CLMDBConfigurationWrite cLMDBConfigurationWrite = new CLMDBConfigurationWrite(); cLMDBConfigurationWrite.initialMapSizeInMiB = 1; cLMDBConfigurationWrite.lmdbDirectory = lmdbFolder.getAbsolutePath(); LMDBPersistence lmdbPersistence = new LMDBPersistence(cLMDBConfigurationWrite, persistenceUtils); lmdbPersistence.init(); fillWithRandomKeys(keysToAdd, lmdbPersistence); // act lmdbPersistence.increaseDatabaseSize(increaseSize); // assert long databaseSize = lmdbPersistence.getDatabaseSize(); assertThat(databaseSize, is(equalTo(new ByteConversion().mibToBytes(1L)+increaseSize))); } // // @Test(expected = org.lmdbjava.Env.MapFullException.class) public void putNewAmount_initialLMDBSetTo1MiB_fillWithTooMuchValues_exceptionThrown() throws IOException { // arrange File lmdbFolder = folder.newFolder("lmdb"); CLMDBConfigurationWrite cLMDBConfigurationWrite = new CLMDBConfigurationWrite(); cLMDBConfigurationWrite.initialMapSizeInMiB = 1; cLMDBConfigurationWrite.lmdbDirectory = lmdbFolder.getAbsolutePath(); cLMDBConfigurationWrite.increaseMapAutomatically = false; cLMDBConfigurationWrite.increaseSizeInMiB = 1; LMDBPersistence lmdbPersistence = new LMDBPersistence(cLMDBConfigurationWrite, persistenceUtils); lmdbPersistence.init(); // pre assert assertThat(lmdbPersistence.getDatabaseSize(), is(equalTo(new ByteConversion().mibToBytes(1L)))); assertThat(lmdbPersistence.getIncreasedCounter(), is(equalTo(new ByteConversion().mibToBytes(0L)))); assertThat(lmdbPersistence.getIncreasedSum(), is(equalTo(new ByteConversion().mibToBytes(0L)))); // act, assert fillWithRandomKeys(TOO_MUCH_KEYS_FOR_1MiB, lmdbPersistence); } @Test public void putNewAmount_initialLMDBSetTo1MiB_fillWithTooMuchValues_increaseDatabaseSizeAndNoExceptionThrown() throws IOException { // arrange File lmdbFolder = folder.newFolder("lmdb"); CLMDBConfigurationWrite cLMDBConfigurationWrite = new CLMDBConfigurationWrite(); cLMDBConfigurationWrite.initialMapSizeInMiB = 1; cLMDBConfigurationWrite.lmdbDirectory = lmdbFolder.getAbsolutePath(); cLMDBConfigurationWrite.increaseMapAutomatically = true; cLMDBConfigurationWrite.increaseSizeInMiB = 1; LMDBPersistence lmdbPersistence = new LMDBPersistence(cLMDBConfigurationWrite, persistenceUtils); lmdbPersistence.init(); // pre assert assertThat(lmdbPersistence.getDatabaseSize(), is(equalTo(new ByteConversion().mibToBytes(1L)))); assertThat(lmdbPersistence.getIncreasedCounter(), is(equalTo(new ByteConversion().mibToBytes(0L)))); assertThat(lmdbPersistence.getIncreasedSum(), is(equalTo(new ByteConversion().mibToBytes(0L)))); // act fillWithRandomKeys(TOO_MUCH_KEYS_FOR_1MiB, lmdbPersistence); // post assert assertThat(lmdbPersistence.getDatabaseSize(), is(equalTo(new ByteConversion().mibToBytes(1L) + (new ByteConversion().mibToBytes(cLMDBConfigurationWrite.increaseSizeInMiB)) * TOO_MUCH_KEYS_EXPECTED_1MiB_INCREASES))); assertThat(lmdbPersistence.getIncreasedCounter(), is(equalTo((long) TOO_MUCH_KEYS_EXPECTED_1MiB_INCREASES))); assertThat(lmdbPersistence.getIncreasedSum(), is(equalTo(new ByteConversion().mibToBytes(cLMDBConfigurationWrite.increaseSizeInMiB * TOO_MUCH_KEYS_EXPECTED_1MiB_INCREASES)))); } // private void fillWithRandomKeys(int keysToAdd, LMDBPersistence lmdbPersistence) { // arrange - fill for (int i = 0; i < keysToAdd; i++) { BigInteger secret = keyUtility.createSecret(PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS, random); ECKey ecKey = keyUtility.createECKey(secret, true); byte[] hash160 = ecKey.getPubKeyHash(); ByteBuffer hash160ByteBuffer = byteBufferUtility.byteArrayToByteBuffer(hash160); lmdbPersistence.putNewAmount(hash160ByteBuffer, Coin.SATOSHI); } } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/LMDBPlatformAssume.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import static java.lang.Boolean.FALSE; import static org.hamcrest.Matchers.is; import org.junit.Assume; /** * Platform assumption for conditionally running LMDB tests. * Enabled by default, can be disabled with the system property: -DdisableLMDBTest */ public class LMDBPlatformAssume implements PlatformAssume { public void assumeLMDBExecution() { // If the system property is set, disable LMDB tests boolean disableLMDB = Boolean.getBoolean("net.ladenthin.bitcoinaddressfinder.disableLMDBTest"); Assume.assumeThat("LMDB tests are disabled via -DdisableLMDBTest", disableLMDB, is(FALSE)); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/LMDBToAddressFileTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import net.ladenthin.bitcoinaddressfinder.configuration.CAddressFileOutputFormat; import net.ladenthin.bitcoinaddressfinder.persistence.Persistence; import net.ladenthin.bitcoinaddressfinder.staticaddresses.TestAddressesFiles; import org.apache.commons.io.FileUtils; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(DataProviderRunner.class) public class LMDBToAddressFileTest extends LMDBBase { @Before public void init() throws IOException { } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_COMPRESSED_AND_STATIC_AMOUNT, location = CommonDataProvider.class) public void writeAllAmountsToAddressFileAsDynamicWidthBase58BitcoinAddressWithAmount(boolean compressed, boolean useStaticAmount) throws Exception { // arrange AtomicBoolean shouldRun = new AtomicBoolean(true); TestAddressesFiles testAddressesFiles = new TestAddressesFiles(compressed); try (Persistence persistence = createAndFillAndOpenLMDB(useStaticAmount, testAddressesFiles, false, false)) { // act File file = folder.newFile(); persistence.writeAllAmountsToAddressFile(file, CAddressFileOutputFormat.DynamicWidthBase58BitcoinAddressWithAmount, shouldRun); // assert List contents = FileUtils.readLines(file, StandardCharsets.UTF_8); // set/sort the result because the list might not have the same order for different test executions Set contentsAsSet = new HashSet<>(contents); final Set expected; if (compressed && useStaticAmount) { expected = TestAddressesFiles.compressedTestAddressesWithStaticAmountAsDynamicWidthBase58BitcoinAddressWithAmount; } else if(compressed) { expected = TestAddressesFiles.compressedTestAddressesAsDynamicWidthBase58BitcoinAddressWithAmount; } else if(useStaticAmount) { expected = TestAddressesFiles.uncompressedTestAddressesWithStaticAmountAsDynamicWidthBase58BitcoinAddressWithAmount; } else { expected = TestAddressesFiles.uncompressedTestAddressesAsDynamicWidthBase58BitcoinAddressWithAmount; } assertThat(contentsAsSet, is(equalTo(expected))); } } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_COMPRESSED_AND_STATIC_AMOUNT, location = CommonDataProvider.class) public void writeAllAmountsToAddressFileAsFixedWidthBase58BitcoinAddress(boolean compressed, boolean useStaticAmount) throws Exception { // arrange AtomicBoolean shouldRun = new AtomicBoolean(true); TestAddressesFiles testAddressesFiles = new TestAddressesFiles(compressed); try (Persistence persistence = createAndFillAndOpenLMDB(useStaticAmount, testAddressesFiles, false, false)) { // act File file = folder.newFile(); persistence.writeAllAmountsToAddressFile(file, CAddressFileOutputFormat.FixedWidthBase58BitcoinAddress, shouldRun); // assert List contents = FileUtils.readLines(file, StandardCharsets.UTF_8); // set/sort the result because the list might not have the same order for different test executions Set contentsAsSet = new HashSet<>(contents); final Set expected; if (compressed && useStaticAmount) { expected = TestAddressesFiles.compressedTestAddressesWithStaticAmountAsFixedWidthBase58BitcoinAddress; } else if(compressed) { expected = TestAddressesFiles.compressedTestAddressesAsFixedWidthBase58BitcoinAddress; } else if(useStaticAmount) { expected = TestAddressesFiles.uncompressedTestAddressesWithStaticAmountAsFixedWidthBase58BitcoinAddress; } else { expected = TestAddressesFiles.uncompressedTestAddressesAsFixedWidthBase58BitcoinAddress; } assertThat(contentsAsSet, is(equalTo(expected))); } } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_COMPRESSED_AND_STATIC_AMOUNT, location = CommonDataProvider.class) public void writeAllAmountsToAddressFileAsHexHash(boolean compressed, boolean useStaticAmount) throws Exception { // arrange AtomicBoolean shouldRun = new AtomicBoolean(true); TestAddressesFiles testAddressesFiles = new TestAddressesFiles(compressed); try (Persistence persistence = createAndFillAndOpenLMDB(useStaticAmount, testAddressesFiles, false, false)) { // act File file = folder.newFile(); persistence.writeAllAmountsToAddressFile(file, CAddressFileOutputFormat.HexHash, shouldRun); // assert List contents = FileUtils.readLines(file, StandardCharsets.UTF_8); // set/sort the result because the list might not have the same order for different test executions Set contentsAsSet = new HashSet<>(contents); final Set expected; if (compressed && useStaticAmount) { expected = TestAddressesFiles.compressedTestAddressesWithStaticAmountAsHexHash; } else if(compressed) { expected = TestAddressesFiles.compressedTestAddressesAsHexHash; } else if(useStaticAmount) { expected = TestAddressesFiles.uncompressedTestAddressesWithStaticAmountAsHexHash; } else { expected = TestAddressesFiles.uncompressedTestAddressesAsHexHash; } assertThat(contentsAsSet, is(equalTo(expected))); } } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/LogLevelChange.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Logger; import org.slf4j.LoggerFactory; public class LogLevelChange { public void turnOff() { final Logger logger = (Logger)LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); logger.setLevel(Level.OFF); } public void setLevel(Level newLevel) { final Logger logger = (Logger)LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); logger.setLevel(newLevel); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/MainTest.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import ch.qos.logback.classic.Level; import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import net.ladenthin.bitcoinaddressfinder.cli.Main; import net.ladenthin.bitcoinaddressfinder.configuration.CCommand; import net.ladenthin.bitcoinaddressfinder.configuration.CConfiguration; import static net.ladenthin.bitcoinaddressfinder.cli.Main.printAllStackTracesWithDelay; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.mockito.ArgumentCaptor; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import org.slf4j.Logger; public class MainTest { @Rule public TemporaryFolder folder = new TemporaryFolder(); private final Path resourceDirectory = Path.of("src","test","resources"); private final Path testRoundtripDirectory = resourceDirectory.resolve("testRoundtrip"); private final Path testOpenCLInfoDirectory = resourceDirectory.resolve("testOpenCLInfo"); private final Path config_AddressFilesToLMDB_json = testRoundtripDirectory.resolve("config_AddressFilesToLMDB.json"); private final Path config_LMDBToAddressFile_json = testRoundtripDirectory.resolve("config_LMDBToAddressFile.json"); private final Path config_Find_SecretsFile_json = testRoundtripDirectory.resolve("config_Find_SecretsFile.json"); private final Path config_Find_1OpenCLDevice_json = testRoundtripDirectory.resolve("config_Find_1OpenCLDevice.json"); private final Path config_OpenCLInfo_json = testOpenCLInfoDirectory.resolve("config_OpenCLInfo.json"); private final Path config_OpenCLInfo_yaml = testOpenCLInfoDirectory.resolve("config_OpenCLInfo.yaml"); private final Path config_OpenCLInfo_yml = testOpenCLInfoDirectory.resolve("config_OpenCLInfo.yml"); private final Path config_OpenCLInfo_js = testOpenCLInfoDirectory.resolve("config_OpenCLInfo.js"); /** Minimal JSON string representing an OpenCLInfo configuration for unit tests. */ private static final String OPEN_CL_INFO_JSON_STRING = "{\"command\":\"OpenCLInfo\"}"; /** Minimal YAML string representing an OpenCLInfo configuration for unit tests. */ private static final String OPEN_CL_INFO_YAML_STRING = "command: OpenCLInfo\n"; private static final long DEFAULT_INTERRUPT_DELAY_SECONDS = 10; private void interruptAfterDelay(Main main, long delaySeconds) { ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); executor.schedule(() -> { main.interrupt(); }, delaySeconds, TimeUnit.SECONDS); } // @Test public void testRoundtrip_configurationsGiven_lmdbCreatedExportedAndRunFindSecretsFile() throws IOException, InterruptedException { // arrange, act, assert Main.main(new String[]{config_AddressFilesToLMDB_json.toAbsolutePath().toString()}); Main.main(new String[]{config_LMDBToAddressFile_json.toAbsolutePath().toString()}); Main.main(new String[]{config_Find_SecretsFile_json.toAbsolutePath().toString()}); } // // @Test @OpenCLTest public void testRoundtripOpenCLProducer_configurationsGiven_lmdbCreatedAndRunFindOpenCLDevice() throws IOException, InterruptedException { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); // arrange Main mainAddressFilesToLMDB = new Main(Main.fromJson(Main.readString(config_AddressFilesToLMDB_json))); mainAddressFilesToLMDB.logConfigurationTransformation(); mainAddressFilesToLMDB.run(); new LogLevelChange().setLevel(Level.DEBUG); Main mainFind_1OpenCLDevice = new Main(Main.fromJson(Main.readString(config_Find_1OpenCLDevice_json))); // interrupt the act after 10 seconds interruptAfterDelay(mainFind_1OpenCLDevice, DEFAULT_INTERRUPT_DELAY_SECONDS); // act mainFind_1OpenCLDevice.logConfigurationTransformation(); mainFind_1OpenCLDevice.run(); } // // @Test @OpenCLTest public void testOpenCLInfo_configurationGiven_noExceptionThrown() throws IOException, InterruptedException { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); // arrange Main mainFind_SecretsFile = new Main(Main.fromJson(Main.readString(config_OpenCLInfo_json))); mainFind_SecretsFile.logConfigurationTransformation(); mainFind_SecretsFile.run(); } // // @Test public void main_noArgumentGiven_errorLogged() throws IOException, InterruptedException { // arrange Logger logger = mock(Logger.class); when(logger.isTraceEnabled()).thenReturn(true); Main.logger = logger; // act Main.main(new String[0]); // assert ArgumentCaptor logCaptor = ArgumentCaptor.forClass(String.class); verify(logger, times(1)).error(logCaptor.capture()); List arguments = logCaptor.getAllValues(); assertThat(arguments.get(0), is(equalTo("Invalid arguments. Pass path to configuration as first argument."))); } // // @Test public void printAllStackTracesWithDelay_includeDaemonsTrue_noExceptionThrown() { // act printAllStackTracesWithDelay(0, true); } @Test public void printAllStackTracesWithDelay_includeDaemonsFalse_noExceptionThrown() { // act printAllStackTracesWithDelay(0, false); } // // @Test public void fromJson_validJsonString_returnsExpectedConfiguration() { // act CConfiguration configuration = Main.fromJson(OPEN_CL_INFO_JSON_STRING); // pre-assert assertThat(configuration, is(notNullValue())); // assert assertThat(configuration.command, is(equalTo(CCommand.OpenCLInfo))); } // // @Test public void fromYaml_validYamlString_returnsExpectedConfiguration() { // act CConfiguration configuration = Main.fromYaml(OPEN_CL_INFO_YAML_STRING); // pre-assert assertThat(configuration, is(notNullValue())); // assert assertThat(configuration.command, is(equalTo(CCommand.OpenCLInfo))); } // // @Test @OpenCLTest public void main_jsonExtensionPath_parsesAndRunsConfiguration() { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); // act Main.main(new String[]{config_OpenCLInfo_json.toAbsolutePath().toString()}); } @Test @OpenCLTest public void main_jsExtensionPath_parsesAndRunsConfiguration() { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); // act Main.main(new String[]{config_OpenCLInfo_js.toAbsolutePath().toString()}); } @Test @OpenCLTest public void main_yamlExtensionPath_parsesAndRunsConfiguration() { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); // act Main.main(new String[]{config_OpenCLInfo_yaml.toAbsolutePath().toString()}); } @Test @OpenCLTest public void main_ymlExtensionPath_parsesAndRunsConfiguration() { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); // act Main.main(new String[]{config_OpenCLInfo_yml.toAbsolutePath().toString()}); } @Test(expected = IllegalArgumentException.class) public void main_unknownExtensionPath_throwsIllegalArgumentException() throws IOException { // arrange File tempFile = folder.newFile("config.txt"); Files.writeString(tempFile.toPath(), OPEN_CL_INFO_JSON_STRING, StandardCharsets.UTF_8); // act Main.main(new String[]{tempFile.getAbsolutePath()}); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/ManualDebugConstants.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; /** * Constants used exclusively for manual debugging and verification. */ public final class ManualDebugConstants { private ManualDebugConstants() { // Utility class – no instantiation allowed } /** * Enables runtime validation of public key generation logic. * * Intended only for debugging purposes such as verifying OpenCL results or testing hardware correctness. * *

Performance impact: Enabling this drastically reduces throughput.

* * @see net.ladenthin.bitcoinaddressfinder.configuration.CConsumerJava#runtimePublicKeyCalculationCheck */ public static final boolean ENABLE_RUNTIME_PUBLIC_KEY_CALCULATION_CHECK = false; } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/MockConsumer.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.util.ArrayList; import java.util.List; public class MockConsumer implements Consumer { public List publicKeyBytesArrayList = new ArrayList<>(); @Override public void consumeKeys(PublicKeyBytes[] publicKeyBytes) throws InterruptedException { publicKeyBytesArrayList.add(publicKeyBytes); } @Override public void startConsumer() { } @Override public void interrupt() { } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/MockKeyProducer.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import net.ladenthin.bitcoinaddressfinder.keyproducer.NoMoreSecretsAvailableException; import java.math.BigInteger; import java.util.Random; import net.ladenthin.bitcoinaddressfinder.keyproducer.KeyProducer; import static org.mockito.Mockito.mock; import org.slf4j.Logger; public class MockKeyProducer implements KeyProducer { private final KeyUtility keyUtility; private final Random random; private final int maximumBitLength; private final Logger mockLogger; MockKeyProducer(KeyUtility keyUtility, Random random, int maximumBitLength) { this.keyUtility = keyUtility; this.random = random; this.maximumBitLength = maximumBitLength; mockLogger = mock(Logger.class); } MockKeyProducer(KeyUtility keyUtility, Random random) { this(keyUtility, random, PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS); } @Override public BigInteger[] createSecrets(int overallWorkSize, boolean returnStartSecretOnly) throws NoMoreSecretsAvailableException { int length = returnStartSecretOnly ? 1 : overallWorkSize; BigInteger[] secrets = new BigInteger[length]; for (int i = 0; i < secrets.length; i++) { secrets[i] = keyUtility.createSecret(maximumBitLength, random); } return secrets; } @Override public void interrupt() { } @Override public Logger getLogger() { return mockLogger; } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/MockKeyProducerTest.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import net.ladenthin.bitcoinaddressfinder.keyproducer.NoMoreSecretsAvailableException; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.io.IOException; import java.math.BigInteger; import java.util.Random; import org.bitcoinj.base.Network; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(DataProviderRunner.class) public class MockKeyProducerTest { private final Network network = new NetworkParameterFactory().getNetwork(); private final KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); private final BitHelper bitHelper = new BitHelper(); /** * This random is fine to produce with lower private key bits: 1; 0; 1; 0 */ private final Random random = new Random(1); // @Test public void createSecrets_maximumBitLengthIs1BatchSizeIs0ReturnStartSecretOnlyIsTrue_returnMinPrivateKey() throws IOException, NoMoreSecretsAvailableException { // arrange int maximumBitLength = 1; int batchSizeInBits = 0; int overallWorkSize = bitHelper.convertBitsToSize(batchSizeInBits); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random, maximumBitLength); // act BigInteger[] createSecrets = mockKeyProducer.createSecrets(overallWorkSize, true); // assert assertThat(createSecrets.length, is(equalTo(1))); assertThat(createSecrets[0], is(equalTo(PublicKeyBytes.MIN_PRIVATE_KEY))); } @Test public void createSecrets_maximumBitLengthIs1BatchSizeIs1ReturnStartSecretOnlyIsTrue_returnMinPrivateKey() throws IOException, NoMoreSecretsAvailableException { // arrange int maximumBitLength = 1; int batchSizeInBits = 1; int overallWorkSize = bitHelper.convertBitsToSize(batchSizeInBits); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random, maximumBitLength); // act BigInteger[] createSecrets = mockKeyProducer.createSecrets(overallWorkSize, true); // assert assertThat(createSecrets.length, is(equalTo(1))); assertThat(createSecrets[0], is(equalTo(PublicKeyBytes.MIN_PRIVATE_KEY))); } @Test public void createSecrets_maximumBitLengthIs1BatchSizeIs2ReturnStartSecretOnlyIsTrue_returnMinPrivateKey() throws IOException, NoMoreSecretsAvailableException { // arrange int maximumBitLength = 1; int batchSizeInBits = 2; int overallWorkSize = bitHelper.convertBitsToSize(batchSizeInBits); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random, maximumBitLength); // act BigInteger[] createSecrets = mockKeyProducer.createSecrets(overallWorkSize, true); // assert assertThat(createSecrets.length, is(equalTo(1))); assertThat(createSecrets[0], is(equalTo(PublicKeyBytes.MIN_PRIVATE_KEY))); } // // @Test public void createSecrets_maximumBitLengthIs1BatchSizeIs0ReturnStartSecretOnlyIsFalse_returnMinPrivateKey() throws IOException, NoMoreSecretsAvailableException { // arrange int maximumBitLength = 1; int batchSizeInBits = 0; int overallWorkSize = bitHelper.convertBitsToSize(batchSizeInBits); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random, maximumBitLength); // act BigInteger[] createSecrets = mockKeyProducer.createSecrets(overallWorkSize, false); // assert assertThat(createSecrets.length, is(equalTo(overallWorkSize))); assertThat(createSecrets[0], is(equalTo(PublicKeyBytes.MIN_PRIVATE_KEY))); } @Test public void createSecrets_maximumBitLengthIs1BatchSizeIs1ReturnStartSecretOnlyIsFalse_returnMinPrivateKey() throws IOException, NoMoreSecretsAvailableException { // arrange int maximumBitLength = 1; int batchSizeInBits = 1; int overallWorkSize = bitHelper.convertBitsToSize(batchSizeInBits); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random, maximumBitLength); // act BigInteger[] createSecrets = mockKeyProducer.createSecrets(overallWorkSize, false); // assert assertThat(createSecrets.length, is(equalTo(overallWorkSize))); assertThat(createSecrets[0], is(equalTo(BigInteger.ONE))); assertThat(createSecrets[1], is(equalTo(BigInteger.ZERO))); } @Test public void createSecrets_maximumBitLengthIs1BatchSizeIs2ReturnStartSecretOnlyIsFalse_returnMinPrivateKey() throws IOException, NoMoreSecretsAvailableException { // arrange int maximumBitLength = 1; int batchSizeInBits = 2; int overallWorkSize = bitHelper.convertBitsToSize(batchSizeInBits); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random, maximumBitLength); // act BigInteger[] createSecrets = mockKeyProducer.createSecrets(overallWorkSize, false); // assert assertThat(createSecrets.length, is(equalTo(overallWorkSize))); assertThat(createSecrets[0], is(equalTo(BigInteger.ONE))); assertThat(createSecrets[1], is(equalTo(BigInteger.ZERO))); assertThat(createSecrets[2], is(equalTo(BigInteger.ONE))); assertThat(createSecrets[3], is(equalTo(BigInteger.ZERO))); } // // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_BIT_SIZES_AT_MOST_MAX, location = CommonDataProvider.class) public void createSecrets_parameterBatchSizeInBitsFromDataProviderAndReturnStartSecretOnlyTrue_returnExpectedSecrets(int maximumBitLength) throws NoMoreSecretsAvailableException { // arrange int batchSizeInBits = 2; int overallWorkSize = bitHelper.convertBitsToSize(batchSizeInBits); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random, maximumBitLength); // act BigInteger[] createSecrets = mockKeyProducer.createSecrets(overallWorkSize, true); // assert assertThat(createSecrets.length, is(equalTo(1))); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_BIT_SIZES_AT_MOST_MAX, location = CommonDataProvider.class) public void createSecrets_parameterBatchSizeInBitsFromDataProviderAndReturnStartSecretOnlyFalse_returnExpectedSecrets(int maximumBitLength) throws NoMoreSecretsAvailableException { // arrange int batchSizeInBits = 2; int overallWorkSize = bitHelper.convertBitsToSize(batchSizeInBits); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random, maximumBitLength); // act BigInteger[] createSecrets = mockKeyProducer.createSecrets(overallWorkSize, false); // assert assertThat(createSecrets.length, is(equalTo(overallWorkSize))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/NetworkParameterFactoryTest.java ================================================ // @formatter:off /** * Copyright 2026 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import org.bitcoinj.base.Network; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; import org.junit.Test; /** * Unit tests for {@link NetworkParameterFactory}. */ public class NetworkParameterFactoryTest { // @Test public void getNetwork_noArguments_returnsNonNull() { // arrange NetworkParameterFactory factory = new NetworkParameterFactory(); // act Network network = factory.getNetwork(); // assert assertThat(network, is(notNullValue())); } @Test public void getNetwork_calledTwice_returnsSameNetworkId() { // arrange NetworkParameterFactory factory = new NetworkParameterFactory(); // act Network first = factory.getNetwork(); Network second = factory.getNetwork(); // assert assertThat(first.id(), is(equalTo(second.id()))); } @Test public void getNetwork_differentFactoryInstances_returnSameNetworkId() { // arrange NetworkParameterFactory factory1 = new NetworkParameterFactory(); NetworkParameterFactory factory2 = new NetworkParameterFactory(); // act Network network1 = factory1.getNetwork(); Network network2 = factory2.getNetwork(); // assert assertThat(network1.id(), is(equalTo(network2.id()))); } @Test public void getNetwork_noArguments_returnsMainNet() { // arrange NetworkParameterFactory factory = new NetworkParameterFactory(); // act Network network = factory.getNetwork(); // assert assertThat(network.id(), is(equalTo("org.bitcoin.production"))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/OpenCLBuilderTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.io.IOException; import java.util.List; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLBuilder; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLDevice; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLPlatform; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.is; import org.junit.Test; public class OpenCLBuilderTest { // @Test @OpenCLTest public void build_openCLDeviceExisting_platformsAndDevicesReturned() throws IOException { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadable(); // arrange new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); OpenCLBuilder openCLBuilder = new OpenCLBuilder(); // act List openCLPlatforms = openCLBuilder.build(); // assert assertThat(openCLPlatforms.size(),is(greaterThan(Integer.valueOf(0)))); assertThat(openCLPlatforms.getFirst().openCLDevices().size(),is(greaterThan(Integer.valueOf(0)))); System.out.println(openCLPlatforms); System.out.println("isOpenCLnativeLibraryLoadable: " + OpenCLBuilder.isOpenCLnativeLibraryLoadable()); System.out.println("isOneOpenCL2DeviceAvailable: " + OpenCLBuilder.isOneOpenCL2_0OrGreaterDeviceAvailable(openCLPlatforms)); } // @Test public void isOpenCL2_0OrGreater_OpenCLVersion1_2Given_ReturnFalse() throws IOException { OpenCLBuilder openCLBuilder = new OpenCLBuilder(); assertThat(OpenCLBuilder.isOpenCL2_0OrGreater(OpenCLDevice.getComparableVersionFromDeviceVersion("OpenCL 1.2")), is(equalTo(Boolean.FALSE))); } @Test public void isOpenCL2_0OrGreater_OpenCLVersion3_0_CUDA_Given_ReturnFalse() throws IOException { OpenCLBuilder openCLBuilder = new OpenCLBuilder(); assertThat(OpenCLBuilder.isOpenCL2_0OrGreater(OpenCLDevice.getComparableVersionFromDeviceVersion("OpenCL 3.0 CUDA")), is(equalTo(Boolean.TRUE))); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/OpenCLContextTest.java ================================================ // @formatter:off /** * Copyright 2026 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.io.IOException; import net.ladenthin.bitcoinaddressfinder.configuration.CProducerOpenCL; import org.junit.Test; import org.slf4j.Logger; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; import static org.mockito.Mockito.*; public class OpenCLContextTest { private final BitHelper bitHelper = new BitHelper(); // @Test public void constructor_defaultConstructor_noExceptionThrown() { // arrange CProducerOpenCL cProducerOpenCL = new CProducerOpenCL(); // act OpenCLContext openCLContext = new OpenCLContext(cProducerOpenCL, bitHelper); // assert assertThat(openCLContext, is(notNullValue())); } @Test public void constructor_mockLoggerGiven_noExceptionThrown() { // arrange CProducerOpenCL cProducerOpenCL = new CProducerOpenCL(); Logger mockLogger = mock(Logger.class); // act OpenCLContext openCLContext = new OpenCLContext(cProducerOpenCL, bitHelper, mockLogger); // assert assertThat(openCLContext, is(notNullValue())); } // // @OpenCLTest @Test public void init_defaultConfiguration_logsSelectedDeviceInfo() throws IOException { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); // arrange Logger mockLogger = mock(Logger.class); CProducerOpenCL cProducerOpenCL = new CProducerOpenCL(); OpenCLContext openCLContext = new OpenCLContext(cProducerOpenCL, bitHelper, mockLogger); try { // act openCLContext.init(); // assert verify(mockLogger, times(1)).info(eq("Selected OpenCL device:\n{}"), argThat( (String s) -> s.contains("--- Info for OpenCL device:") )); } finally { openCLContext.close(); } } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/OpenCLDeviceTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.io.IOException; import java.nio.ByteOrder; import java.util.ArrayList; import java.util.Collections; import java.util.List; import com.google.common.collect.ImmutableList; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLBuilder; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLDevice; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLPlatform; import org.apache.maven.artifact.versioning.ComparableVersion; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.emptyOrNullString; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; import org.junit.Test; import org.jocl.CL; import org.jocl.cl_device_id; public class OpenCLDeviceTest { // @Test public void getByteOrder_endianLittleTrue_returnsLittleEndian() { // arrange OpenCLDevice device = createTestDeviceWithEndianness(true); // act ByteOrder result = device.getByteOrder(); // assert assertThat(result, is(equalTo(ByteOrder.LITTLE_ENDIAN))); } @Test public void getByteOrder_endianLittleFalse_returnsBigEndian() { // arrange OpenCLDevice device = createTestDeviceWithEndianness(false); // act ByteOrder result = device.getByteOrder(); // assert assertThat(result, is(equalTo(ByteOrder.BIG_ENDIAN))); } // // @Test @OpenCLTest @ToStringTest public void toStringPretty_openCLDeviceExisting_stringCreated() throws IOException { // arrange new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); OpenCLBuilder openCLBuilder = new OpenCLBuilder(); List openCLPlatforms = openCLBuilder.build(); final OpenCLDevice openCLDevice = openCLPlatforms.getFirst().openCLDevices().getFirst(); // act final String toStringPretty = openCLDevice.toStringPretty(); // assert assertThat(toStringPretty, not(emptyOrNullString())); } // // @Test @OpenCLTest @ToStringTest public void toStringPretty_staticDeviceData_stringCreated() { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadable(); // arrange OpenCLDevice device = new OpenCLDevice( new cl_device_id(), "NVIDIA GeForce RTX 3070 Laptop GPU", "NVIDIA Corporation", "561.19", "FULL_PROFILE", "OpenCL 3.0 CUDA", "cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_d3d10_sharing cl_khr_d3d10_sharing cl_nv_d3d11_sharing cl_nv_copy_opts cl_nv_create_buffer cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_device_uuid cl_khr_pci_bus_info cl_khr_external_semaphore cl_khr_external_memory cl_khr_external_semaphore_win32 cl_khr_external_memory_win32", CL.CL_DEVICE_TYPE_GPU, true, 40, 3, ImmutableList.copyOf(List.of(1024L, 1024L, 64L)), 1024, 1290, 64, 2047L * 1024 * 1024, 8191L * 1024 * 1024, 0, CL.CL_LOCAL, 48L * 1024, 64L * 1024, CL.CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL.CL_QUEUE_PROFILING_ENABLE, 1, 256, 32, CL.CL_FP_DENORM | CL.CL_FP_INF_NAN | CL.CL_FP_ROUND_TO_NEAREST | CL.CL_FP_ROUND_TO_ZERO | CL.CL_FP_ROUND_TO_INF | CL.CL_FP_FMA | CL.CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT, 32768, 32768, 16384, 16384, 16384, 1, 1, 1, 1, 1, 1 ); // act String output = device.toStringPretty(); // assert final String expectedString = """ --- Info for OpenCL device: NVIDIA GeForce RTX 3070 Laptop GPU --- cl_device_id: cl_device_id[0x0] CL_DEVICE_NAME: NVIDIA GeForce RTX 3070 Laptop GPU CL_DEVICE_VENDOR: NVIDIA Corporation CL_DRIVER_VERSION: 561.19 CL_DEVICE_PROFILE: FULL_PROFILE CL_DEVICE_VERSION: OpenCL 3.0 CUDA CL_DEVICE_EXTENSIONS: cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_d3d10_sharing cl_khr_d3d10_sharing cl_nv_d3d11_sharing cl_nv_copy_opts cl_nv_create_buffer cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_device_uuid cl_khr_pci_bus_info cl_khr_external_semaphore cl_khr_external_memory cl_khr_external_semaphore_win32 cl_khr_external_memory_win32 CL_DEVICE_TYPE: CL_DEVICE_TYPE_GPU CL_DEVICE_ENDIAN_LITTLE: true CL_DEVICE_MAX_COMPUTE_UNITS: 40 CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS: 3 CL_DEVICE_MAX_WORK_ITEM_SIZES: 1024 / 1024 / 64 CL_DEVICE_MAX_WORK_GROUP_SIZE: 1024 CL_DEVICE_MAX_CLOCK_FREQUENCY: 1290 MHz CL_DEVICE_ADDRESS_BITS: 64 CL_DEVICE_MAX_MEM_ALLOC_SIZE: 2047 MByte CL_DEVICE_GLOBAL_MEM_SIZE: 8191 MByte CL_DEVICE_ERROR_CORRECTION_SUPPORT: no CL_DEVICE_LOCAL_MEM_TYPE: CL_LOCAL CL_DEVICE_LOCAL_MEM_SIZE: 48 KByte CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE: 64 KByte CL_DEVICE_QUEUE_PROPERTIES: CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE CL_QUEUE_PROFILING_ENABLE CL_DEVICE_IMAGE_SUPPORT: 1 CL_DEVICE_MAX_READ_IMAGE_ARGS: 256 CL_DEVICE_MAX_WRITE_IMAGE_ARGS: 32 CL_DEVICE_SINGLE_FP_CONFIG: CL_FP_DENORM CL_FP_INF_NAN CL_FP_ROUND_TO_NEAREST CL_FP_ROUND_TO_ZERO CL_FP_ROUND_TO_INF CL_FP_FMA CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT CL_DEVICE_IMAGE2D_MAX_WIDTH: 32768 CL_DEVICE_IMAGE2D_MAX_HEIGHT: 32768 CL_DEVICE_IMAGE3D_MAX_WIDTH: 16384 CL_DEVICE_IMAGE3D_MAX_HEIGHT: 16384 CL_DEVICE_IMAGE3D_MAX_DEPTH: 16384 CL_DEVICE_PREFERRED_VECTOR_WIDTHS: CHAR 1, SHORT 1, INT 1, LONG 1, FLOAT 1, DOUBLE 1 """; assertThat(output, not(emptyOrNullString())); List outputLines = output.lines().map(String::stripTrailing).toList(); List expectedLines = expectedString.lines().map(String::stripTrailing).toList(); assertThat(outputLines, is(equalTo(expectedLines))); } // // @Test public void formatWorkItemSizes_emptyInput_returnsNone() { // arrange List input = Collections.emptyList(); // act String result = OpenCLDevice.formatWorkItemSizes(input); // assert assertThat(result, is("(none)")); } @Test public void formatWorkItemSizes_singleElement_returnsElement() { // arrange List input = List.of(42L); // act String result = OpenCLDevice.formatWorkItemSizes(input); // assert assertThat(result, is("42")); } @Test public void formatWorkItemSizes_threeElements_returnsFormattedString() { // arrange List input = List.of(64L, 128L, 256L); // act String result = OpenCLDevice.formatWorkItemSizes(input); // assert assertThat(result, is("64 / 128 / 256")); } @Test public void formatWorkItemSizes_fiveElements_returnsFormattedString() { // arrange List input = List.of(1L, 2L, 3L, 4L, 5L); // act String result = OpenCLDevice.formatWorkItemSizes(input); // assert assertThat(result, is("1 / 2 / 3 / 4 / 5")); } // // @Test public void getComparableVersionFromDeviceVersion_openCLPrefix_removedCorrectly() { // arrange String input = "OpenCL 3.0 CUDA"; // act ComparableVersion version = OpenCLDevice.getComparableVersionFromDeviceVersion(input); // assert assertThat(version.toString(), equalTo("3.0")); } @Test public void getComparableVersionFromDeviceVersion_cudaSuffix_removedCorrectly() { // arrange String input = "3.0 CUDA"; // act ComparableVersion version = OpenCLDevice.getComparableVersionFromDeviceVersion(input); // assert assertThat(version.toString(), equalTo("3.0")); } @Test public void getComparableVersionFromDeviceVersion_noPrefixOrSuffix_versionUnchanged() { // arrange String input = "2.1"; // act ComparableVersion version = OpenCLDevice.getComparableVersionFromDeviceVersion(input); // assert assertThat(version.toString(), equalTo("2.1")); } @Test public void getComparableVersionFromDeviceVersion_emptyString_returnsEmptyVersion() { // arrange String input = ""; // act ComparableVersion version = OpenCLDevice.getComparableVersionFromDeviceVersion(input); // assert assertThat(version.toString(), equalTo("")); } @Test public void getComparableVersionFromDeviceVersion_trailingWhitespace_trimmedCorrectly() { // arrange String input = "3.0 "; // act ComparableVersion version = OpenCLDevice.getComparableVersionFromDeviceVersion(input); // assert assertThat(version.toString(), equalTo("3.0")); } // // // CL_DEVICE_TYPE_GPU = (1 << 2) = 4, used as a plain literal to avoid native library loading private static final long DEVICE_TYPE_GPU = 4L; private static OpenCLDevice createTestDeviceWithEndianness(boolean endianLittle) { return new OpenCLDevice( new cl_device_id(), "TestDevice", "TestVendor", "1.0", "FULL_PROFILE", "OpenCL 2.0", "", DEVICE_TYPE_GPU, endianLittle, 1, 1L, ImmutableList.of(64L), 64L, 1000L, 32, 1024L * 1024L, 1024L * 1024L * 1024L, 0L, 1, 32L * 1024L, 64L * 1024L, 0L, 1, 128, 8, 0L, 4096L, 4096L, 2048L, 2048L, 2048L, 1, 1, 1, 1, 1, 1 ); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/OpenCLGridResultTest.java ================================================ // @formatter:off /** * Copyright 2026 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.math.BigInteger; import java.nio.ByteBuffer; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; import org.junit.Test; /** * Unit tests for {@link OpenCLGridResult}. */ public class OpenCLGridResultTest { // @Test public void getSecretKeyBase_validInput_returnsExpectedValue() { // arrange BigInteger secretKeyBase = BigInteger.valueOf(12345678L); int workSize = 1; ByteBuffer result = ByteBuffer.allocate(PublicKeyBytes.CHUNK_SIZE_NUM_BYTES * workSize); OpenCLGridResult gridResult = new OpenCLGridResult(secretKeyBase, workSize, result); // act BigInteger actual = gridResult.getSecretKeyBase(); // assert assertThat(actual, is(equalTo(secretKeyBase))); } @Test public void getSecretKeyBase_zeroBigInteger_returnsZero() { // arrange BigInteger secretKeyBase = BigInteger.ZERO; int workSize = 1; ByteBuffer result = ByteBuffer.allocate(PublicKeyBytes.CHUNK_SIZE_NUM_BYTES * workSize); OpenCLGridResult gridResult = new OpenCLGridResult(secretKeyBase, workSize, result); // act BigInteger actual = gridResult.getSecretKeyBase(); // assert assertThat(actual, is(equalTo(BigInteger.ZERO))); } // // @Test public void getWorkSize_validInput_returnsExpectedValue() { // arrange BigInteger secretKeyBase = BigInteger.ONE; int workSize = 64; ByteBuffer result = ByteBuffer.allocate(PublicKeyBytes.CHUNK_SIZE_NUM_BYTES * workSize); OpenCLGridResult gridResult = new OpenCLGridResult(secretKeyBase, workSize, result); // act int actual = gridResult.getWorkSize(); // assert assertThat(actual, is(equalTo(workSize))); } @Test public void getWorkSize_workSizeOne_returnsOne() { // arrange BigInteger secretKeyBase = BigInteger.ONE; int workSize = 1; ByteBuffer result = ByteBuffer.allocate(PublicKeyBytes.CHUNK_SIZE_NUM_BYTES * workSize); OpenCLGridResult gridResult = new OpenCLGridResult(secretKeyBase, workSize, result); // act int actual = gridResult.getWorkSize(); // assert assertThat(actual, is(equalTo(1))); } // // @Test public void getResult_validInput_returnsExpectedBuffer() { // arrange BigInteger secretKeyBase = BigInteger.ONE; int workSize = 1; ByteBuffer expectedBuffer = ByteBuffer.allocate(PublicKeyBytes.CHUNK_SIZE_NUM_BYTES * workSize); OpenCLGridResult gridResult = new OpenCLGridResult(secretKeyBase, workSize, expectedBuffer); // act ByteBuffer actual = gridResult.getResult(); // assert assertThat(actual, is(notNullValue())); assertThat(actual, is(equalTo(expectedBuffer))); } @Test public void getResult_validInput_returnsSameBufferReference() { // arrange BigInteger secretKeyBase = BigInteger.ONE; int workSize = 1; ByteBuffer buffer = ByteBuffer.allocate(PublicKeyBytes.CHUNK_SIZE_NUM_BYTES * workSize); OpenCLGridResult gridResult = new OpenCLGridResult(secretKeyBase, workSize, buffer); // act ByteBuffer actual = gridResult.getResult(); // assert assertThat(actual == buffer, is(true)); } // // @Test public void trimU32PrefixBytes_sevenByteArray_returnsFourBytes() { // arrange byte[] input = {0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04}; // act byte[] result = OpenCLGridResult.trimU32PrefixBytes(input); // assert assertThat(result.length, is(equalTo(4))); } @Test public void trimU32PrefixBytes_sevenByteArray_returnsLastFourBytes() { // arrange byte[] input = {0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04}; // act byte[] result = OpenCLGridResult.trimU32PrefixBytes(input); // assert assertThat(result[0], is(equalTo((byte) 0x01))); assertThat(result[1], is(equalTo((byte) 0x02))); assertThat(result[2], is(equalTo((byte) 0x03))); assertThat(result[3], is(equalTo((byte) 0x04))); } @Test public void trimU32PrefixBytes_exactlyThreeBytes_returnsEmptyArray() { // arrange byte[] input = {0x00, 0x00, 0x00}; // act byte[] result = OpenCLGridResult.trimU32PrefixBytes(input); // assert assertThat(result.length, is(equalTo(0))); } @Test public void trimU32PrefixBytes_fourByteArray_returnsOneByteArray() { // arrange byte[] input = {0x00, 0x00, 0x00, (byte) 0xFF}; // act byte[] result = OpenCLGridResult.trimU32PrefixBytes(input); // assert assertThat(result.length, is(equalTo(1))); assertThat(result[0], is(equalTo((byte) 0xFF))); } @Test public void trimU32PrefixBytes_largeArray_returnsCorrectLength() { // arrange byte[] input = new byte[35]; // 35 - 3 = 32 expected bytes input[3] = (byte) 0xAB; // act byte[] result = OpenCLGridResult.trimU32PrefixBytes(input); // assert assertThat(result.length, is(equalTo(32))); assertThat(result[0], is(equalTo((byte) 0xAB))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/OpenCLPlatformAssume.java ================================================ // @formatter:off /** * Copyright 2022 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import static java.lang.Boolean.TRUE; import java.util.List; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLBuilder; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLPlatform; import org.junit.Assume; import static org.hamcrest.Matchers.is; public class OpenCLPlatformAssume implements PlatformAssume { public void assumeOpenCLLibraryLoadable() { Assume.assumeThat("OpenCL library loadable", OpenCLBuilder.isOpenCLnativeLibraryLoadable(), is(TRUE)); } public void assumeOneOpenCL2_0OrGreaterDeviceAvailable(List openCLPlatforms) { Assume.assumeThat("One OpenCL 2.0 or greater device available", OpenCLBuilder.isOneOpenCL2_0OrGreaterDeviceAvailable(openCLPlatforms), is(TRUE)); } public void assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable() { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadable(); OpenCLBuilder openCLBuilder = new OpenCLBuilder(); List openCLPlatforms = openCLBuilder.build(); new OpenCLPlatformAssume().assumeOneOpenCL2_0OrGreaterDeviceAvailable(openCLPlatforms); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/OpenCLPlatformSelectorTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.util.Collections; import java.util.List; import com.google.common.collect.ImmutableList; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLDevice; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLDeviceSelection; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLPlatform; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLPlatformSelector; import org.jocl.cl_context_properties; import org.jocl.cl_device_id; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; public class OpenCLPlatformSelectorTest { // CL_DEVICE_TYPE_CPU = (1 << 1) = 2, CL_DEVICE_TYPE_GPU = (1 << 2) = 4 private static final long DEVICE_TYPE_CPU = 2L; private static final long DEVICE_TYPE_GPU = 4L; private final OpenCLPlatformSelector platformSelector = new OpenCLPlatformSelector(); // @Test public void select_validPlatformAndDeviceIndex_returnsExpectedSelection() { // arrange OpenCLDevice gpuDevice = createTestDevice(DEVICE_TYPE_GPU); OpenCLPlatform platform = createTestPlatform("Platform0", gpuDevice); List platforms = List.of(platform); // act OpenCLDeviceSelection result = platformSelector.select(platforms, 0, DEVICE_TYPE_GPU, 0); // assert assertThat(result, is(notNullValue())); assertThat(result.platform(), is(equalTo(platform))); assertThat(result.device(), is(equalTo(gpuDevice))); } @Test public void select_deviceTypeFilter_onlyMatchingDeviceSelected() { // arrange OpenCLDevice cpuDevice = createTestDevice(DEVICE_TYPE_CPU); OpenCLDevice gpuDevice = createTestDevice(DEVICE_TYPE_GPU); OpenCLPlatform platform = createTestPlatform("Platform0", cpuDevice, gpuDevice); List platforms = List.of(platform); // act OpenCLDeviceSelection result = platformSelector.select(platforms, 0, DEVICE_TYPE_GPU, 0); // assert assertThat(result.device(), is(equalTo(gpuDevice))); } @Test public void select_secondPlatformSelected_returnsDeviceFromSecondPlatform() { // arrange OpenCLDevice firstDevice = createTestDevice(DEVICE_TYPE_GPU); OpenCLDevice secondDevice = createTestDevice(DEVICE_TYPE_GPU); OpenCLPlatform firstPlatform = createTestPlatform("Platform0", firstDevice); OpenCLPlatform secondPlatform = createTestPlatform("Platform1", secondDevice); List platforms = List.of(firstPlatform, secondPlatform); // act OpenCLDeviceSelection result = platformSelector.select(platforms, 1, DEVICE_TYPE_GPU, 0); // assert assertThat(result.platform(), is(equalTo(secondPlatform))); assertThat(result.device(), is(equalTo(secondDevice))); } @Test(expected = IllegalArgumentException.class) public void select_negativePlatformIndex_throwsIllegalArgumentException() { // arrange OpenCLPlatform platform = createTestPlatform("Platform0", createTestDevice(DEVICE_TYPE_GPU)); List platforms = List.of(platform); // act platformSelector.select(platforms, -1, DEVICE_TYPE_GPU, 0); } @Test(expected = IllegalArgumentException.class) public void select_platformIndexTooLarge_throwsIllegalArgumentException() { // arrange OpenCLPlatform platform = createTestPlatform("Platform0", createTestDevice(DEVICE_TYPE_GPU)); List platforms = List.of(platform); // act platformSelector.select(platforms, 1, DEVICE_TYPE_GPU, 0); } @Test(expected = IllegalArgumentException.class) public void select_emptyPlatformList_throwsIllegalArgumentException() { // arrange List platforms = Collections.emptyList(); // act platformSelector.select(platforms, 0, DEVICE_TYPE_GPU, 0); } @Test(expected = IllegalArgumentException.class) public void select_negativeDeviceIndex_throwsIllegalArgumentException() { // arrange OpenCLDevice gpuDevice = createTestDevice(DEVICE_TYPE_GPU); OpenCLPlatform platform = createTestPlatform("Platform0", gpuDevice); List platforms = List.of(platform); // act platformSelector.select(platforms, 0, DEVICE_TYPE_GPU, -1); } @Test(expected = IllegalArgumentException.class) public void select_deviceIndexTooLarge_throwsIllegalArgumentException() { // arrange OpenCLDevice gpuDevice = createTestDevice(DEVICE_TYPE_GPU); OpenCLPlatform platform = createTestPlatform("Platform0", gpuDevice); List platforms = List.of(platform); // act platformSelector.select(platforms, 0, DEVICE_TYPE_GPU, 1); } @Test(expected = IllegalArgumentException.class) public void select_noDeviceMatchingType_throwsIllegalArgumentException() { // arrange OpenCLDevice cpuDevice = createTestDevice(DEVICE_TYPE_CPU); OpenCLPlatform platform = createTestPlatform("Platform0", cpuDevice); List platforms = List.of(platform); // act platformSelector.select(platforms, 0, DEVICE_TYPE_GPU, 0); } // // private static OpenCLPlatform createTestPlatform(String name, OpenCLDevice... devices) { return new OpenCLPlatform(name, new cl_context_properties(), ImmutableList.copyOf(devices)); } private static OpenCLDevice createTestDevice(long deviceType) { return new OpenCLDevice( new cl_device_id(), "TestDevice", "TestVendor", "1.0", "FULL_PROFILE", "OpenCL 2.0", "", deviceType, true, 1, 1L, ImmutableList.of(64L), 64L, 1000L, 32, 1024L * 1024L, 1024L * 1024L * 1024L, 0L, 1, 32L * 1024L, 64L * 1024L, 0L, 1, 128, 8, 0L, 4096L, 4096L, 2048L, 2048L, 2048L, 1, 1, 1, 1, 1, 1 ); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/OpenCLPlatformTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.google.common.collect.ImmutableList; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLDevice; import net.ladenthin.bitcoinaddressfinder.opencl.OpenCLPlatform; import org.jspecify.annotations.NonNull; import org.junit.Test; import java.util.Collections; import java.util.List; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.emptyOrNullString; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.*; import static org.hamcrest.Matchers.not; import org.jocl.cl_context_properties; public class OpenCLPlatformTest { // @Test public void constructor_validArguments_returnsPlatform() { // arrange String platformName = "Test Platform"; ImmutableList<@NonNull OpenCLDevice> devices = ImmutableList.builder().build(); // act OpenCLPlatform platform = new OpenCLPlatform(platformName, new cl_context_properties(), devices); // assert assertThat(platform, is(notNullValue())); assertThat(platform.platformName(), is(equalTo(platformName))); assertThat(platform.openCLDevices(), is(devices)); } // // @Test @ToStringTest public void toString_containsPlatformName() { // arrange String platformName = "Platform A"; OpenCLPlatform platform = new OpenCLPlatform(platformName, new cl_context_properties(), ImmutableList.builder().build()); // act String result = platform.toString(); // assert assertThat(result, not(emptyOrNullString())); assertThat(result, containsString(platformName)); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/OpenCLTest.java ================================================ // @formatter:off /** * Copyright 2022 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.METHOD) public @interface OpenCLTest { } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/PlatformAssume.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; /** * Marker interface for platform-specific test assumptions. *

* Classes implementing this interface group checks that determine whether * tests should be conditionally executed depending on the runtime environment * (e.g., required native libraries or hardware support). *

* * @see org.junit.Assume */ public interface PlatformAssume { } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/PrivateKeyTooLargeExceptionTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.math.BigInteger; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; import org.junit.Test; /** * Unit tests for {@link PrivateKeyTooLargeException}. */ public class PrivateKeyTooLargeExceptionTest { private static final BigInteger PROVIDED_KEY = new BigInteger("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", 16); private static final BigInteger MAX_ALLOWED_KEY = PublicKeyBytes.MAX_PRIVATE_KEY.subtract(BigInteger.TWO); private static final int BATCH_SIZE_IN_BITS = 10; // @Test public void constructor_validArguments_messageContainsProvidedKey() { // act PrivateKeyTooLargeException exception = new PrivateKeyTooLargeException(PROVIDED_KEY, MAX_ALLOWED_KEY, BATCH_SIZE_IN_BITS); // assert assertThat(exception.getMessage(), containsString("0x" + PROVIDED_KEY.toString(16))); } @Test public void constructor_validArguments_messageContainsMaxAllowedKey() { // act PrivateKeyTooLargeException exception = new PrivateKeyTooLargeException(PROVIDED_KEY, MAX_ALLOWED_KEY, BATCH_SIZE_IN_BITS); // assert assertThat(exception.getMessage(), containsString("0x" + MAX_ALLOWED_KEY.toString(16))); } @Test public void constructor_validArguments_messageContainsBatchSizeInBits() { // act PrivateKeyTooLargeException exception = new PrivateKeyTooLargeException(PROVIDED_KEY, MAX_ALLOWED_KEY, BATCH_SIZE_IN_BITS); // assert assertThat(exception.getMessage(), containsString("batchSizeInBits = " + BATCH_SIZE_IN_BITS)); } @Test public void constructor_validArguments_messageContainsReference() { // act PrivateKeyTooLargeException exception = new PrivateKeyTooLargeException(PROVIDED_KEY, MAX_ALLOWED_KEY, BATCH_SIZE_IN_BITS); // assert assertThat(exception.getMessage(), containsString("PublicKeyBytes.MAX_PRIVATE_KEY")); } @Test public void constructor_validArguments_isInstanceOfIllegalArgumentException() { // act PrivateKeyTooLargeException exception = new PrivateKeyTooLargeException(PROVIDED_KEY, MAX_ALLOWED_KEY, BATCH_SIZE_IN_BITS); // assert assertThat(exception, is(instanceOf(IllegalArgumentException.class))); } @Test public void constructor_validArguments_noCause() { // act PrivateKeyTooLargeException exception = new PrivateKeyTooLargeException(PROVIDED_KEY, MAX_ALLOWED_KEY, BATCH_SIZE_IN_BITS); // assert assertThat(exception.getCause(), is(nullValue())); } // // @Test public void getProvidedKey_validArguments_returnsProvidedKey() { // arrange PrivateKeyTooLargeException exception = new PrivateKeyTooLargeException(PROVIDED_KEY, MAX_ALLOWED_KEY, BATCH_SIZE_IN_BITS); // act BigInteger actual = exception.getProvidedKey(); // assert assertThat(actual, is(equalTo(PROVIDED_KEY))); } // // @Test public void getMaxAllowedKey_validArguments_returnsMaxAllowedKey() { // arrange PrivateKeyTooLargeException exception = new PrivateKeyTooLargeException(PROVIDED_KEY, MAX_ALLOWED_KEY, BATCH_SIZE_IN_BITS); // act BigInteger actual = exception.getMaxAllowedKey(); // assert assertThat(actual, is(equalTo(MAX_ALLOWED_KEY))); } // // @Test public void getBatchSizeInBits_validArguments_returnsBatchSizeInBits() { // arrange PrivateKeyTooLargeException exception = new PrivateKeyTooLargeException(PROVIDED_KEY, MAX_ALLOWED_KEY, BATCH_SIZE_IN_BITS); // act int actual = exception.getBatchSizeInBits(); // assert assertThat(actual, is(equalTo(BATCH_SIZE_IN_BITS))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/PrivateKeyValidatorTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.math.BigInteger; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import org.junit.Test; import org.junit.runner.RunWith; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; @RunWith(DataProviderRunner.class) public class PrivateKeyValidatorTest { private final PrivateKeyValidator validator = new PrivateKeyValidator(); // @Test public void getMaxPrivateKeyForBatchSize_batchSize0_returnsMaxPrivateKey() { // arrange int batchSizeInBits = 0; // act BigInteger result = validator.getMaxPrivateKeyForBatchSize(batchSizeInBits); // assert assertThat(result, is(equalTo(PublicKeyBytes.MAX_PRIVATE_KEY))); } @Test public void getMaxPrivateKeyForBatchSize_batchSize1_returnsMaxMinus1() { // arrange int batchSizeInBits = 1; // act BigInteger result = validator.getMaxPrivateKeyForBatchSize(batchSizeInBits); // assert assertThat(result.add(BigInteger.ONE), is(equalTo(PublicKeyBytes.MAX_PRIVATE_KEY))); } @Test public void getMaxPrivateKeyForBatchSize_maxAllowedBitSize_returnsMinimumSafeKey() { // arrange int batchSizeInBits = PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS - 1; // act BigInteger result = validator.getMaxPrivateKeyForBatchSize(batchSizeInBits); // assert BigInteger offset = BigInteger.ONE.shiftLeft(batchSizeInBits); BigInteger expected = PublicKeyBytes.MAX_PRIVATE_KEY.subtract(offset).add(BigInteger.ONE); assertThat(result, is(equalTo(expected))); } @Test(expected = IllegalArgumentException.class) public void getMaxPrivateKeyForBatchSize_bitSizeNegative_throwsException() { // act validator.getMaxPrivateKeyForBatchSize(-1); } @Test(expected = IllegalArgumentException.class) public void getMaxPrivateKeyForBatchSize_bitSizeTooLarge_throwsException() { // act validator.getMaxPrivateKeyForBatchSize(PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS + 1); } @Test(expected = IllegalStateException.class) public void getMaxPrivateKeyForBatchSize_tooLarge_throwsException() { // arrange int batchSizeInBits = PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS; // act validator.getMaxPrivateKeyForBatchSize(batchSizeInBits); } // // @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_PRIVATE_KEYS_TOO_LARGE_WITH_CHUNK_SIZE, location = CommonDataProvider.class) public void isInvalidWithBatchSize_keyTooLarge_returnsTrue(BigInteger privateKey, int batchSizeInBits) { // arrange BigInteger maxAllowed = validator.getMaxPrivateKeyForBatchSize(batchSizeInBits); // act boolean isInvalid = validator.isInvalidWithBatchSize(privateKey, maxAllowed); // assert assertThat(isInvalid, is(true)); } @Test public void isInvalidWithBatchSize_keyWithinLimit_returnsFalse() { // arrange int batchSizeInBits = 2; BigInteger maxAllowed = validator.getMaxPrivateKeyForBatchSize(batchSizeInBits); BigInteger validKey = maxAllowed.subtract(BigInteger.ONE); // act boolean isInvalid = validator.isInvalidWithBatchSize(validKey, maxAllowed); // assert assertThat(isInvalid, is(false)); } // // @Test public void isOutsidePrivateKeyRange_minPrivateKey_returnsTrue() { // act boolean result = validator.isOutsidePrivateKeyRange(PublicKeyBytes.MIN_PRIVATE_KEY); // assert assertThat(result, is(true)); } @Test public void isOutsidePrivateKeyRange_minValidPrivateKey_returnsFalse() { // act boolean result = validator.isOutsidePrivateKeyRange(PublicKeyBytes.MIN_VALID_PRIVATE_KEY); // assert assertThat(result, is(false)); } @Test public void isOutsidePrivateKeyRange_maxPrivateKey_returnsFalse() { // act boolean result = validator.isOutsidePrivateKeyRange(PublicKeyBytes.MAX_PRIVATE_KEY); // assert assertThat(result, is(false)); } @Test public void isOutsidePrivateKeyRange_zero_returnsTrue() { // act boolean result = validator.isOutsidePrivateKeyRange(BigInteger.ZERO); // assert assertThat(result, is(true)); } @Test public void isOutsidePrivateKeyRange_belowMin_returnsTrue() { // arrange BigInteger invalidKey = PublicKeyBytes.MIN_PRIVATE_KEY.subtract(BigInteger.ONE); // act boolean result = validator.isOutsidePrivateKeyRange(invalidKey); // assert assertThat(result, is(true)); } @Test public void isOutsidePrivateKeyRange_aboveMax_returnsTrue() { // arrange BigInteger invalidKey = PublicKeyBytes.MAX_PRIVATE_KEY.add(BigInteger.ONE); // act boolean result = validator.isOutsidePrivateKeyRange(invalidKey); // assert assertThat(result, is(true)); } // // @Test public void returnValidPrivateKey_validKey_returnsSameKey() { // arrange BigInteger valid = PublicKeyBytes.MIN_PRIVATE_KEY.add(BigInteger.ONE); // act BigInteger result = validator.returnValidPrivateKey(valid); // assert assertThat(result, is(equalTo(valid))); } @Test public void returnValidPrivateKey_tooSmall_returnsReplacement() { // arrange BigInteger tooSmall = PublicKeyBytes.MIN_PRIVATE_KEY.subtract(BigInteger.ONE); // act BigInteger result = validator.returnValidPrivateKey(tooSmall); // assert assertThat(result, is(equalTo(PublicKeyBytes.INVALID_PRIVATE_KEY_REPLACEMENT))); } @Test public void returnValidPrivateKey_tooLarge_returnsReplacement() { // arrange BigInteger tooLarge = PublicKeyBytes.MAX_PRIVATE_KEY.add(BigInteger.ONE); // act BigInteger result = validator.returnValidPrivateKey(tooLarge); // assert assertThat(result, is(equalTo(PublicKeyBytes.INVALID_PRIVATE_KEY_REPLACEMENT))); } // // @Test public void replaceInvalidPrivateKeys_mixedArray_replacesInvalids() { // arrange BigInteger[] secrets = new BigInteger[]{ PublicKeyBytes.MIN_VALID_PRIVATE_KEY, // valid PublicKeyBytes.MAX_PRIVATE_KEY.add(BigInteger.ONE), // invalid BigInteger.ZERO // invalid }; // act validator.replaceInvalidPrivateKeys(secrets); // assert assertThat(secrets[0], is(equalTo(PublicKeyBytes.MIN_VALID_PRIVATE_KEY))); assertThat(secrets[1], is(equalTo(PublicKeyBytes.INVALID_PRIVATE_KEY_REPLACEMENT))); assertThat(secrets[2], is(equalTo(PublicKeyBytes.INVALID_PRIVATE_KEY_REPLACEMENT))); } @Test public void replaceInvalidPrivateKeys_allValidKeys_keepsOriginalValues() { // arrange BigInteger[] secrets = new BigInteger[]{ PublicKeyBytes.MIN_VALID_PRIVATE_KEY, PublicKeyBytes.MAX_PRIVATE_KEY, PublicKeyBytes.MIN_VALID_PRIVATE_KEY.add(BigInteger.ONE) }; BigInteger[] expectedCopy = secrets.clone(); // act validator.replaceInvalidPrivateKeys(secrets); // assert assertThat(secrets, is(equalTo(expectedCopy))); } @Test public void replaceInvalidPrivateKeys_allInvalidKeys_replacesAll() { // arrange BigInteger[] secrets = new BigInteger[]{ BigInteger.ZERO, BigInteger.ONE.negate(), PublicKeyBytes.MAX_PRIVATE_KEY.add(BigInteger.ONE) }; // act validator.replaceInvalidPrivateKeys(secrets); // assert assertThat(secrets[0], is(equalTo(PublicKeyBytes.INVALID_PRIVATE_KEY_REPLACEMENT))); assertThat(secrets[1], is(equalTo(PublicKeyBytes.INVALID_PRIVATE_KEY_REPLACEMENT))); assertThat(secrets[2], is(equalTo(PublicKeyBytes.INVALID_PRIVATE_KEY_REPLACEMENT))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/ProbeAddressesOpenCLTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.google.common.io.Resources; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.io.File; import java.io.IOException; import java.math.BigInteger; import java.net.URL; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.charset.StandardCharsets; import org.apache.commons.io.FileUtils; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import static org.jocl.CL.*; import java.util.Arrays; import java.util.List; import java.util.Objects; import java.util.Random; import java.util.stream.Collectors; import net.ladenthin.bitcoinaddressfinder.configuration.CProducerOpenCL; import net.ladenthin.bitcoinaddressfinder.staticaddresses.TestAddresses42; import org.bitcoinj.base.Network; import org.bitcoinj.crypto.ECKey; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.everyItem; import static org.mockito.Mockito.mock; import org.jocl.*; import org.junit.Ignore; import org.junit.runner.RunWith; import org.slf4j.Logger; @RunWith(DataProviderRunner.class) public class ProbeAddressesOpenCLTest { public static final String ADDRESSES_CSV = "addresses.csv"; private final Network network = new NetworkParameterFactory().getNetwork(); private final ByteBufferUtility byteBufferUtility = new ByteBufferUtility(true); private static final TestAddresses42 testAddresses = new TestAddresses42(1024, false); /** * 22: 256Mb: executed in: 1253ms, read in: 74ms * 23: 512Mb: executed in: 2346ms, read in: 148ms * 24: 1024Mb: executed in: 4622ms, read in: 302ms */ private final static int BITS_FOR_BATCH = 8; private final static int LOOP_COUNT = BITS_FOR_BATCH >> 1; private final BitHelper bitHelper = new BitHelper(); @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); @Before public void init() throws IOException { createTemporaryAddressesFile(); } public void fillAddressesFiles(File file) throws IOException { FileUtils.writeStringToFile(file, testAddresses.getAsBase58Strings(), StandardCharsets.UTF_8.name()); } public void createTemporaryAddressesFile() throws IOException { File tempAddressesFile = tempFolder.newFile(ADDRESSES_CSV); fillAddressesFiles(tempAddressesFile); } @Test @OpenCLTest public void joclTest() { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); /** * The source code of the OpenCL program to execute */ String programSource = "__kernel void " + "sampleKernel(__global const float *a," + " __global const float *b," + " __global float *c)" + "{" + " int gid = get_global_id(0);" + " c[gid] = a[gid] * b[gid];" + "}"; // Create input- and output data int n = 10; float[] srcArrayA = new float[n]; float[] srcArrayB = new float[n]; float[] dstArray = new float[n]; for (int i = 0; i < n; i++) { srcArrayA[i] = i; srcArrayB[i] = i; } Pointer srcA = Pointer.to(srcArrayA); Pointer srcB = Pointer.to(srcArrayB); Pointer dst = Pointer.to(dstArray); // The platform, device type and device number // that will be used final int platformIndex = 0; final long deviceType = CL_DEVICE_TYPE_ALL; final int deviceIndex = 0; // Enable exceptions and subsequently omit error checks in this sample CL.setExceptionsEnabled(true); // Obtain the number of platforms int[] numPlatformsArray = new int[1]; clGetPlatformIDs(0, null, numPlatformsArray); int numPlatforms = numPlatformsArray[0]; // Obtain a platform ID cl_platform_id[] platforms = new cl_platform_id[numPlatforms]; clGetPlatformIDs(platforms.length, platforms, null); cl_platform_id platform = platforms[platformIndex]; // Initialize the context properties cl_context_properties contextProperties = new cl_context_properties(); contextProperties.addProperty(CL_CONTEXT_PLATFORM, platform); // Obtain the number of devices for the platform int[] numDevicesArray = new int[1]; clGetDeviceIDs(platform, deviceType, 0, null, numDevicesArray); int numDevices = numDevicesArray[0]; // Obtain a device ID cl_device_id[] devices = new cl_device_id[numDevices]; clGetDeviceIDs(platform, deviceType, numDevices, devices, null); cl_device_id device = devices[deviceIndex]; // Create a context for the selected device cl_context context = clCreateContext( contextProperties, 1, new cl_device_id[]{device}, null, null, null); // Create a command-queue for the selected device cl_queue_properties properties = new cl_queue_properties(); cl_command_queue commandQueue = clCreateCommandQueueWithProperties( context, device, properties, null); // Allocate the memory objects for the input- and output data cl_mem srcMemA = clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, (long)Sizeof.cl_float * n, srcA, null); cl_mem srcMemB = clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, (long)Sizeof.cl_float * n, srcB, null); cl_mem dstMem = clCreateBuffer(context, CL_MEM_READ_WRITE, (long)Sizeof.cl_float * n, null, null); // Create the program from the source code cl_program program = clCreateProgramWithSource(context, 1, new String[]{programSource}, null, null); // Build the program clBuildProgram(program, 0, null, null, null, null); // Create the kernel cl_kernel kernel = clCreateKernel(program, "sampleKernel", null); // Set the arguments for the kernel int a = 0; clSetKernelArg(kernel, a++, Sizeof.cl_mem, Pointer.to(srcMemA)); clSetKernelArg(kernel, a++, Sizeof.cl_mem, Pointer.to(srcMemB)); clSetKernelArg(kernel, a++, Sizeof.cl_mem, Pointer.to(dstMem)); // Set the work-item dimensions long[] global_work_size = new long[]{n}; // Execute the kernel clEnqueueNDRangeKernel(commandQueue, kernel, 1, null, global_work_size, null, 0, null, null); // Read the output data long cb = (long) n * Sizeof.cl_float; clEnqueueReadBuffer(commandQueue, dstMem, CL_TRUE, 0, cb, dst, 0, null, null); // Release kernel, program, and memory objects clReleaseMemObject(srcMemA); clReleaseMemObject(srcMemB); clReleaseMemObject(dstMem); clReleaseKernel(kernel); clReleaseProgram(program); clReleaseCommandQueue(commandQueue); clReleaseContext(context); // Verify the result boolean passed = true; final float epsilon = 1e-7f; for (int i = 0; i < n; i++) { float x = dstArray[i]; float y = srcArrayA[i] * srcArrayB[i]; boolean epsilonEqual = Math.abs(x - y) <= epsilon * Math.abs(x); if (!epsilonEqual) { passed = false; break; } } assertThat(passed, is(equalTo(Boolean.TRUE))); } public static int BN_NBITS = 256; public static int BN_WSHIFT = 5; public static int BN_WBITS = (1 << BN_WSHIFT); public static int BN_NWORDS = ((BN_NBITS/8) / 4); // 4 == sizeof(bn_word) public static int ACCESS_BUNDLE = 1024; public static int ACCESS_STRIDE = (ACCESS_BUNDLE/BN_NWORDS); @Test @Ignore public void reverseEngineering_startPoints() { int GLOBAL_SIZE = 1024; for (int j = 0; j < 1024; j++) { for (int k = 0; k < 64; k++) { int i, cell, start; System.out.println("========================================"); /* Load the row increment point */ i = 2 * j; System.out.println("i: " + i); cell = i; System.out.println("cell: " + cell); start = ((((2 * cell) / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % (ACCESS_STRIDE/2))); System.out.println("start: " + start); int row_in_access_1 = start + (i*ACCESS_STRIDE); System.out.println("row_in_access_1: " + row_in_access_1); start += (ACCESS_STRIDE/2); System.out.println("start: " + start); int row_in_access_2 = start + (i*ACCESS_STRIDE); System.out.println("row_in_access_2: " + row_in_access_2); cell += (k * GLOBAL_SIZE); System.out.println("cell: " + cell); start = (((cell / ACCESS_STRIDE) * ACCESS_BUNDLE) + (cell % ACCESS_STRIDE)); System.out.println("start: " + start); System.out.println("========================================"); } } } @Test @Ignore public void calcAddrsFixZeroCl_loadWithoutErrors() throws IOException { // ATTENTION: BLDEBUG int CELLS = 64; int ROW_SIZE = 2; // x1, y1 int COL_SIZE = 2; // rx, ry String calcAddrsFixZeroClFileName = "calc_addrs.cl"; URL url = Resources.getResource(calcAddrsFixZeroClFileName); String calcAddrsFixZeroCl = Resources.toString(url, StandardCharsets.UTF_8); // Create input- and output data // out: int[] src_points_out = new int[ACCESS_BUNDLE]; int[] src_z_heap = new int[ACCESS_BUNDLE]; // in: int[] src_row_in = new int[ACCESS_BUNDLE * ACCESS_STRIDE * ROW_SIZE]; int[] src_col_in = new int[ACCESS_BUNDLE * COL_SIZE]; Pointer pointsOut = Pointer.to(src_points_out); Pointer zHeap = Pointer.to(src_z_heap); Pointer rowIn = Pointer.to(src_row_in); Pointer colIn = Pointer.to(src_col_in); // The platform, device type and device number // that will be used final int platformIndex = 0; final long deviceType = CL_DEVICE_TYPE_ALL; final int deviceIndex = 0; // Enable exceptions and subsequently omit error checks in this sample CL.setExceptionsEnabled(true); // Obtain the number of platforms int[] numPlatformsArray = new int[1]; clGetPlatformIDs(0, null, numPlatformsArray); int numPlatforms = numPlatformsArray[0]; // Obtain a platform ID cl_platform_id[] platforms = new cl_platform_id[numPlatforms]; clGetPlatformIDs(platforms.length, platforms, null); cl_platform_id platform = platforms[platformIndex]; // Initialize the context properties cl_context_properties contextProperties = new cl_context_properties(); contextProperties.addProperty(CL_CONTEXT_PLATFORM, platform); // Obtain the number of devices for the platform int[] numDevicesArray = new int[1]; clGetDeviceIDs(platform, deviceType, 0, null, numDevicesArray); int numDevices = numDevicesArray[0]; // Obtain a device ID cl_device_id[] devices = new cl_device_id[numDevices]; clGetDeviceIDs(platform, deviceType, numDevices, devices, null); cl_device_id device = devices[deviceIndex]; // Create a context for the selected device cl_context context = clCreateContext( contextProperties, 1, new cl_device_id[]{device}, null, null, null); // Create a command-queue for the selected device cl_queue_properties properties = new cl_queue_properties(); cl_command_queue commandQueue = clCreateCommandQueueWithProperties( context, device, properties, null); // Allocate the memory objects for the input- and output data cl_mem pointsOutMem = clCreateBuffer(context, CL_MEM_READ_WRITE, (long)Sizeof.cl_int * src_points_out.length, pointsOut, null); cl_mem zHeapMem = clCreateBuffer(context, CL_MEM_READ_WRITE, (long)Sizeof.cl_int * src_z_heap.length, zHeap, null); cl_mem rowInMem = clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, (long)Sizeof.cl_int * src_row_in.length, null, null); cl_mem colInMem = clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, (long)Sizeof.cl_int * src_col_in.length, null, null); // Create the program from the source code cl_program program = clCreateProgramWithSource(context, 1, new String[]{calcAddrsFixZeroCl}, null, null); // Build the program clBuildProgram(program, 0, null, null, null, null); // Create the kernel cl_kernel kernel_ec_add_grid = clCreateKernel(program, "ec_add_grid", null); cl_kernel kernel_heap_invert = clCreateKernel(program, "heap_invert", null); cl_kernel kernel_hash_ec_point_get = clCreateKernel(program, "hash_ec_point_get", null); // Set the arguments for the kernel int a = 0; clSetKernelArg(kernel_ec_add_grid, a++, Sizeof.cl_mem, Pointer.to(pointsOutMem)); clSetKernelArg(kernel_ec_add_grid, a++, Sizeof.cl_mem, Pointer.to(zHeapMem)); clSetKernelArg(kernel_ec_add_grid, a++, Sizeof.cl_mem, Pointer.to(rowInMem)); clSetKernelArg(kernel_ec_add_grid, a++, Sizeof.cl_mem, Pointer.to(colInMem)); // Set the work-item dimensions long[] global_work_size = new long[]{ACCESS_BUNDLE, }; // Execute the kernel clEnqueueNDRangeKernel(commandQueue, kernel_ec_add_grid, 1, null, global_work_size, null, 0, null, null); } @Test @OpenCLTest @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_BIT_SIZES_AT_MOST_MAX, location = CommonDataProvider.class) public void createKeys_bitsLowerThan25_use32BitNevertheless(int bitSize) throws IOException { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); KeyUtility keyUtility = new KeyUtility(network, byteBufferUtility); // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ CProducerOpenCL producerOpenCL = new CProducerOpenCL(); producerOpenCL.batchSizeInBits = bitSize; try (OpenCLContext openCLContext = new OpenCLContext(producerOpenCL, bitHelper)) { openCLContext.init(); Random sr = new Random(1337); BigInteger secret = keyUtility.createSecret(bitSize, sr); BigInteger secretBase = keyUtility.killBits(secret, bitHelper.getKillBits(producerOpenCL.batchSizeInBits)); openCLContext.createKeys(secretBase); } } @Test @OpenCLTest public void createKeys_bitsLowerThanGridSize_useMoreNevertheless() throws IOException { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); KeyUtility keyUtility = new KeyUtility(network, byteBufferUtility); // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ CProducerOpenCL producerOpenCL = new CProducerOpenCL(); producerOpenCL.batchSizeInBits = BITS_FOR_BATCH; producerOpenCL.loopCount = LOOP_COUNT; try (OpenCLContext openCLContext = new OpenCLContext(producerOpenCL, bitHelper)) { openCLContext.init(); Random sr = new Random(1337); BigInteger secret = keyUtility.createSecret(BITS_FOR_BATCH-1, sr); BigInteger secretBase = keyUtility.killBits(secret, bitHelper.getKillBits(producerOpenCL.batchSizeInBits)); openCLContext.createKeys(secretBase); } } /** * Verifies that at least one test input triggers BigInteger encoding with a leading zero byte (sign bit = 1). * This is a prerequisite for testing OpenCL buffer serialization of such keys. */ @Test public void dataProvider_largePrivateKeys_containsAtLeastOneEncodingWithLeadingZeroByte() { List lengths = Arrays.stream(CommonDataProvider.largePrivateKeys()) .map(data -> ((BigInteger) data[0]).toByteArray().length) .collect(Collectors.toList()); assertThat( "Expected at least one BigInteger with 33-byte encoding (sign-preserving leading zero)", lengths, hasItem(PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES + 1) ); } /** * Verifies that all test inputs in largePrivate32ByteKeys() produce a 33-byte encoding * due to the high bit being set (i.e., sign-preserving leading zero is required). */ @Test public void dataProvider_largePrivateKeys_allHaveLeadingZeroEncoding() { List lengths = Arrays.stream(CommonDataProvider.privateKeys32ByteRequiringStrip()) .map(data -> ((BigInteger) data[0]).toByteArray().length) .collect(Collectors.toList()); assertThat( "Expected all BigIntegers to be encoded with 33 bytes (sign bit set → leading zero required)", lengths, everyItem(is(PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES + 1)) ); } @OpenCLTest @Test(expected = PrivateKeyTooLargeException.class) @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_PRIVATE_KEYS_TOO_LARGE_WITH_CHUNK_SIZE, location = CommonDataProvider.class) public void setSrcPrivateKeyChunk_privateKeyTooLarge_throwsException(BigInteger privateKey, int chunkSize) throws IOException { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); CProducerOpenCL producerOpenCL = new CProducerOpenCL(); producerOpenCL.batchSizeInBits = chunkSize; try (OpenCLContext openCLContext = new OpenCLContext(producerOpenCL, bitHelper)) { openCLContext.init(); OpenClTask openClTask = Objects.requireNonNull(openCLContext.getOpenClTask()); // Force a key that exceeds the limit openClTask.setSrcPrivateKeyChunk(privateKey); } } @Test @OpenCLTest @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_PRIVATE_KEYS_32_BYTE_REQUIRING_STRIP, location = CommonDataProvider.class) public void setSrcPrivateKeyChunk_handlesLeadingZero_correctlySerializesTo32Bytes(BigInteger privateKey) throws IOException { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); CProducerOpenCL producerOpenCL = new CProducerOpenCL(); producerOpenCL.batchSizeInBits = BITS_FOR_BATCH; producerOpenCL.loopCount = LOOP_COUNT; try (OpenCLContext openCLContext = new OpenCLContext(producerOpenCL, bitHelper)) { openCLContext.init(); byte[] encoded = privateKey.toByteArray(); assertThat("Encoded must hold exactly 33 bytes", encoded.length, is(PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES + 1)); byte[] expectedStripped = Arrays.copyOfRange(encoded, 1, encoded.length); assertThat("ExpectedStripped must hold exactly 32 bytes", expectedStripped.length, is(PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES)); // Perform the actual OpenCL buffer population OpenClTask openClTask = Objects.requireNonNull(openCLContext.getOpenClTask()); openClTask.setSrcPrivateKeyChunk(privateKey); ByteBuffer buffer = openClTask.getPrivateKeySourceArgument().getByteBuffer(); assertThat("Buffer must hold exactly 32 bytes", buffer.capacity(), is(PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES)); byte[] openClEndianBytes = new byte[PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES]; buffer.rewind(); buffer.get(openClEndianBytes); // Reconstruct BigInteger from OpenCL buffer for validation byte[] bigEndianBytes = openClEndianBytes.clone(); // OpenCL provides the bytes in device-specific endianness (could be little-endian or big-endian). // BigInteger(byte[]) always expects a Big-Endian (MSB-first) format. // Therefore, we convert the device-endian buffer to Big-Endian before creating the BigInteger. EndiannessConverter endiannessConverter = new EndiannessConverter(ByteOrder.LITTLE_ENDIAN, ByteOrder.BIG_ENDIAN, byteBufferUtility); endiannessConverter.convertEndian(bigEndianBytes); BigInteger result = new BigInteger(1, bigEndianBytes); // Validate that the OpenCL buffer correctly represents the original private key assertThat("bigEndianBytes content must match stripped BigInteger encoding", bigEndianBytes, is(equalTo(expectedStripped))); assertThat("Reconstructed BigInteger must match original private key", result, is(equalTo(privateKey))); } } @Test @OpenCLTest @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_LARGE_PRIVATE_KEYS, location = CommonDataProvider.class) public void createKeys_fromLargePrivateKey_generatesValidPublicKeys(BigInteger privateKey) throws IOException { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); KeyUtility keyUtility = new KeyUtility(network, byteBufferUtility); CProducerOpenCL producerOpenCL = new CProducerOpenCL(); producerOpenCL.batchSizeInBits = BITS_FOR_BATCH; producerOpenCL.loopCount = LOOP_COUNT; try (OpenCLContext openCLContext = new OpenCLContext(producerOpenCL, bitHelper)) { openCLContext.init(); // Perform the actual OpenCL buffer population OpenClTask openClTask = Objects.requireNonNull(openCLContext.getOpenClTask()); openClTask.setSrcPrivateKeyChunk(privateKey); BigInteger secretBase = keyUtility.killBits(privateKey, bitHelper.getKillBits(producerOpenCL.batchSizeInBits)); OpenCLGridResult createKeys = openCLContext.createKeys(secretBase); PublicKeyBytes[] publicKeys = createKeys.getPublicKeyBytes(); final ByteBufferUtility byteBufferUtility = new ByteBufferUtility(true); byteBufferUtility.freeByteBuffer(createKeys.getResult()); final boolean souts = false; assertPublicKeyBytesCalculatedCorrect(publicKeys, secretBase, souts, keyUtility); } } @Test @OpenCLTest public void createKeys_fromRandomPrivateKey_correctlyHashesAndVerifiesResults() throws IOException { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); KeyUtility keyUtility = new KeyUtility(network, byteBufferUtility); // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ CProducerOpenCL producerOpenCL = new CProducerOpenCL(); producerOpenCL.batchSizeInBits = BITS_FOR_BATCH; producerOpenCL.loopCount = LOOP_COUNT; try (OpenCLContext openCLContext = new OpenCLContext(producerOpenCL, bitHelper)) { openCLContext.init(); Random random = new Random(1337); BigInteger secretKeyBase = keyUtility.createSecret(PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS, random); BigInteger secretBase = keyUtility.killBits(secretKeyBase, bitHelper.getKillBits(producerOpenCL.batchSizeInBits)); OpenCLGridResult createKeys = openCLContext.createKeys(secretBase); PublicKeyBytes[] publicKeys = createKeys.getPublicKeyBytes(); final ByteBufferUtility byteBufferUtility = new ByteBufferUtility(true); byteBufferUtility.freeByteBuffer(createKeys.getResult()); final boolean souts = false; hashPublicKeys(publicKeys, souts); // just for performance tests hashPublicKeysFast(publicKeys, souts); // just for performance tests assertPublicKeyBytesCalculatedCorrect(publicKeys, secretBase, souts, keyUtility); } } private static void assertAllRuntimePublicKeyCalculationsValid(PublicKeyBytes[] publicKeys, Logger logger) { for (int i = 0; i < publicKeys.length; i++) { assertRuntimePublicKeyCalculationValid(publicKeys[i], logger); } } private static void assertRuntimePublicKeyCalculationValid(PublicKeyBytes publicKeyBytes, Logger logger) { boolean valid = publicKeyBytes.runtimePublicKeyCalculationCheck(logger); assertThat("runtimePublicKeyCalculationCheck failed for secretKey: " + publicKeyBytes.getSecretKey(), valid, is(true)); } private static void assertPublicKeyBytesCalculatedCorrect(PublicKeyBytes[] publicKeys, BigInteger secretBase, final boolean souts, KeyUtility keyUtility) { Logger logger = mock(Logger.class); assertAllRuntimePublicKeyCalculationsValid(publicKeys, logger); for (int i = 0; i < publicKeys.length; i++) { if (i%10_000 == 0) { if(souts) System.out.println("progress: " + i); } BigInteger privateKey = AbstractProducer.calculateSecretKey(secretBase, i); byte[] privateKeyAsByteArray = privateKey.toByteArray(); if(souts) System.out.println("privateKey: " + Arrays.toString(privateKeyAsByteArray)); PublicKeyBytes publicKeyBytes = publicKeys[i]; ECKey resultOpenCLKeyCompressed = ECKey.fromPrivateAndPrecalculatedPublic(privateKeyAsByteArray, publicKeyBytes.getCompressed()); ECKey resultOpenCLKeyUncompressed = ECKey.fromPrivateAndPrecalculatedPublic(privateKeyAsByteArray, publicKeyBytes.getUncompressed()); byte[] resultOpenCLKeyCompressedPubKey = resultOpenCLKeyCompressed.getPubKey(); byte[] resultOpenCLKeyCompressedPubKeyHash = resultOpenCLKeyCompressed.getPubKeyHash(); byte[] resultOpenCLKeyUncompressedPubKey = resultOpenCLKeyUncompressed.getPubKey(); byte[] resultOpenCLKeyUncompressedPubKeyHash = resultOpenCLKeyUncompressed.getPubKeyHash(); if (souts) { System.out.println("publicKeyBytes.compressed: " + Arrays.toString(publicKeyBytes.getCompressed())); System.out.println("publicKeyBytes.uncompressed: " + Arrays.toString(publicKeyBytes.getUncompressed())); System.out.println("resultOpenCLKeyCompressedPubKey: " + Arrays.toString(resultOpenCLKeyCompressedPubKey)); System.out.println("resultOpenCLKeyCompressedPubKeyHash: " + Arrays.toString(resultOpenCLKeyCompressedPubKeyHash)); System.out.println("resultOpenCLKeyUncompressedPubKey: " + Arrays.toString(resultOpenCLKeyUncompressedPubKey)); System.out.println("resultOpenCLKeyUncompressedPubKeyHash: " + Arrays.toString(resultOpenCLKeyUncompressedPubKeyHash)); } String resultOpenCLKeyCompressedPubKeyHashBase58 = keyUtility.toBase58(resultOpenCLKeyCompressed.getPubKeyHash()); String resultOpenCLKeyUncompressedPubKeyHashBase58 = keyUtility.toBase58(resultOpenCLKeyUncompressed.getPubKeyHash()); if (souts) { System.out.println("resultOpenCLKeyCompressedPubKeyHashBase58: " + resultOpenCLKeyCompressedPubKeyHashBase58); System.out.println("resultOpenCLKeyUncompressedPubKeyHashBase58: " + resultOpenCLKeyUncompressedPubKeyHashBase58); System.out.println("publicKeyBytes.getCompressedKeyHash(): " + Arrays.toString(publicKeyBytes.getCompressedKeyHash())); System.out.println("publicKeyBytes.getUncompressedKeyHash(): " + Arrays.toString(publicKeyBytes.getUncompressedKeyHash())); System.out.println("publicKeyBytes.getCompressedKeyHashAsBase58(keyUtility): " + publicKeyBytes.getCompressedKeyHashAsBase58(keyUtility)); System.out.println("publicKeyBytes.getUncompressedKeyHashAsBase58(keyUtility): " + publicKeyBytes.getUncompressedKeyHashAsBase58(keyUtility)); } ECKey expectedUncompressedKey = ECKey.fromPrivate(privateKey, false); BigInteger expectedPrivateKeyBigInteger = expectedUncompressedKey.getPrivKey(); ECKey expectedCompressedKey = ECKey.fromPrivate(privateKey, true); byte[] expectedCompressedPublicKeyBytes = expectedCompressedKey.getPubKey(); byte[] expectedUncompressedPublicKeyBytes = expectedUncompressedKey.getPubKey(); if (souts) { System.out.println("expectedPrivateKeyBigInteger: " + expectedPrivateKeyBigInteger); System.out.println("expectedCompressedPublicKeyBytes: " + Arrays.toString(expectedCompressedPublicKeyBytes)); System.out.println("expectedUncompressedPublicKeyBytes: " + Arrays.toString(expectedUncompressedPublicKeyBytes)); } String expectedCompressedPublicKeyHashBase58 = keyUtility.toBase58(expectedCompressedKey.getPubKeyHash()); String expectedUncompressedPublicKeyHashBase58 = keyUtility.toBase58(expectedUncompressedKey.getPubKeyHash()); assertThat(resultOpenCLKeyCompressedPubKey, is(equalTo(expectedCompressedPublicKeyBytes))); assertThat(resultOpenCLKeyUncompressedPubKey, is(equalTo(expectedUncompressedPublicKeyBytes))); assertThat(publicKeyBytes.getCompressedKeyHashAsBase58(keyUtility), is(equalTo(expectedCompressedPublicKeyHashBase58))); assertThat(publicKeyBytes.getUncompressedKeyHashAsBase58(keyUtility), is(equalTo(expectedUncompressedPublicKeyHashBase58))); } } private static void hashPublicKeysFast(PublicKeyBytes[] publicKeys, final boolean souts) { if (souts) System.out.println("execute hash fast ..."); long beforeHash = System.currentTimeMillis(); for (int i = 0; i < publicKeys.length; i++) { byte[] compressedKeyHashFast = publicKeys[i].getCompressedKeyHash(); byte[] uncompressedKeyHashFast = publicKeys[i].getUncompressedKeyHash(); //assertThat(compressedKeyHash, is(equalTo(compressedKeyHashFast))); //assertThat(uncompressedKeyHash, is(equalTo(uncompressedKeyHashFast))); if (souts) System.out.println("publicKeys["+i+"].compressedKeyHashFast: " + Arrays.toString(compressedKeyHashFast)); if (souts) System.out.println("publicKeys["+i+"].uncompressedKeyHashFast: " + Arrays.toString(uncompressedKeyHashFast)); } long afterHash = System.currentTimeMillis(); if (souts) System.out.println("... hashed fast in: " + (afterHash - beforeHash) + "ms"); } private static void hashPublicKeys(PublicKeyBytes[] publicKeys, final boolean souts) { if (souts) System.out.println("execute hash ..."); long beforeHash = System.currentTimeMillis(); for (int i = 0; i < publicKeys.length; i++) { byte[] compressedKeyHash = publicKeys[i].getCompressedKeyHash(); byte[] uncompressedKeyHash = publicKeys[i].getUncompressedKeyHash(); //assertThat(compressedKeyHash, is(equalTo(compressedKeyHashFast))); //assertThat(uncompressedKeyHash, is(equalTo(uncompressedKeyHashFast))); if (souts) System.out.println("publicKeys["+i+"].compressedKeyHash: " + Arrays.toString(compressedKeyHash)); if (souts) System.out.println("publicKeys["+i+"].uncompressedKeyHash: " + Arrays.toString(uncompressedKeyHash)); } long afterHash = System.currentTimeMillis(); if (souts) System.out.println("... hashed in: " + (afterHash - beforeHash) + "ms"); } /** * Read the inner bytes in reverse order. Remove padding bytes to return a clean byte array. Only for x with padding */ @Deprecated private static final byte[] getPublicKeyFromByteBuffer(ByteBuffer b, int keyOffset) { int paddingBytes = 3; int publicKeyByteLength = PublicKeyBytes.SEC_PUBLIC_KEY_COMPRESSED_WORDS * PublicKeyBytes.U32_NUM_BYTES; byte[] publicKey = new byte[publicKeyByteLength - paddingBytes]; // its not inverted because the memory was written in OpenCL int offset = publicKeyByteLength * keyOffset; outer: for (int i=0; i= 1 while (k.signum() > 0) { // if k is odd if (k.testBit(0)) { // k mod 2^width BigInteger remainder = k.mod(pow2wBI); // if remainder > 2^(width - 1) - 1 if (remainder.testBit(width - 1)) { wnaf[i] = (byte)(remainder.intValue() - pow2wB); } else { wnaf[i] = (byte)remainder.intValue(); } // wnaf[i] is now in [-2^(width-1), 2^(width-1)-1] k = k.subtract(BigInteger.valueOf(wnaf[i])); length = i; } else { wnaf[i] = 0; } // k = k/2 k = k.shiftRight(1); i++; } length++; // Reduce the WNAF array to its actual length byte[] wnafShort = new byte[length]; System.arraycopy(wnaf, 0, wnafShort, 0, length); return wnafShort; } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/ProducerJavaSecretsFilesTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.google.common.hash.Hashing; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.io.File; import java.io.IOException; import java.math.BigInteger; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Random; import java.util.stream.Collectors; import net.ladenthin.bitcoinaddressfinder.configuration.CProducerJavaSecretsFiles; import net.ladenthin.bitcoinaddressfinder.configuration.CSecretFormat; import static net.ladenthin.bitcoinaddressfinder.configuration.CSecretFormat.BIG_INTEGER; import static net.ladenthin.bitcoinaddressfinder.configuration.CSecretFormat.STRING_DO_SHA256; import static net.ladenthin.bitcoinaddressfinder.configuration.CSecretFormat.SHA256; import net.ladenthin.bitcoinaddressfinder.configuration.UnknownSecretFormatException; import org.apache.commons.codec.binary.Hex; import org.apache.commons.io.FileUtils; import org.bitcoinj.base.Network; import org.bitcoinj.crypto.ECKey; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.junit.runner.RunWith; @RunWith(DataProviderRunner.class) public class ProducerJavaSecretsFilesTest { @Rule public TemporaryFolder folder = new TemporaryFolder(); private static final Network network = new NetworkParameterFactory().getNetwork(); private final KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); private final BitHelper bitHelper = new BitHelper(); enum PrivateKey { TEST("test"), TEST_WITH_SPACE("test with space"), NUMBER_1337("1337"), NUMBER_73("73"), WITH_COMMENT("#WithComment"), WITH_SPECIAL_CHARACTER("schön, für schälen $%&?`´"); private final String string; PrivateKey(String string) { this.string = string; } public String getSHA256() { byte[] sha256 = Hashing.sha256().hashString(string, StandardCharsets.UTF_8).asBytes(); return Hex.encodeHexString( sha256 ); } public BigInteger getBigInteger() { return new BigInteger(getSHA256(), 16); } public PublicKeyBytes getPublicKeyBytes() { return PublicKeyBytes.fromPrivate(getBigInteger()); } public String getWiF() { return ECKey.fromPrivate(getBigInteger(), false).getPrivateKeyAsWiF(network); } public String getHex() { return ECKey.fromPrivate(getBigInteger(), false).getPrivateKeyAsHex(); } } // @Test public void initProducer_configurationGiven_stateInitializedAndLogged() throws IOException, InterruptedException { CProducerJavaSecretsFiles cProducerJavaSecretsFiles = new CProducerJavaSecretsFiles(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerJava producerJava = new ProducerJavaSecretsFiles(cProducerJavaSecretsFiles, mockConsumer, keyUtility, mockKeyProducer, bitHelper); AbstractProducerTest.verifyInitProducer(producerJava); } // // @Test public void releaseProducer_configurationGiven_stateInitializedAndLogged() throws IOException, InterruptedException { CProducerJavaSecretsFiles cProducerJavaSecretsFiles = new CProducerJavaSecretsFiles(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerJava producerJava = new ProducerJavaSecretsFiles(cProducerJavaSecretsFiles, mockConsumer, keyUtility, mockKeyProducer, bitHelper); AbstractProducerTest.verifyReleaseProducer(producerJava); } // // @Test public void produceKeys_noFileConfigured_noKeysCreated() throws IOException, InterruptedException { CProducerJavaSecretsFiles cProducerJavaSecretsFiles = new CProducerJavaSecretsFiles(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerJavaSecretsFiles producerJavaSecretsFiles = new ProducerJavaSecretsFiles(cProducerJavaSecretsFiles, mockConsumer, keyUtility, mockKeyProducer, bitHelper); // act producerJavaSecretsFiles.produceKeys(); // assert assertThat(mockConsumer.publicKeyBytesArrayList.size(), is(equalTo(0))); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_CSECRET_FORMAT, location = CommonDataProvider.class) public void produceKeys_filesConfigured_keysCreated(CSecretFormat cSecretFormat) throws IOException, InterruptedException { CProducerJavaSecretsFiles cProducerJavaSecretsFiles = new CProducerJavaSecretsFiles(); List secretsFiles = createSecretsFiles(cSecretFormat); List secretsFilesAsStringList = secretsFiles.stream().map(file -> file.getAbsolutePath()).collect(Collectors.toList()); cProducerJavaSecretsFiles.files = secretsFilesAsStringList; cProducerJavaSecretsFiles.secretFormat = cSecretFormat; cProducerJavaSecretsFiles.batchSizeInBits = 0; MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerJavaSecretsFiles producerJavaSecretsFiles = new ProducerJavaSecretsFiles(cProducerJavaSecretsFiles, mockConsumer, keyUtility, mockKeyProducer, bitHelper); // act producerJavaSecretsFiles.produceKeys(); // assert assertThat(mockConsumer.publicKeyBytesArrayList.size(), is(equalTo(6))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0).length, is(equalTo(1))); assertThat(mockConsumer.publicKeyBytesArrayList.get(1).length, is(equalTo(1))); assertThat(mockConsumer.publicKeyBytesArrayList.get(2).length, is(equalTo(1))); assertThat(mockConsumer.publicKeyBytesArrayList.get(3).length, is(equalTo(1))); assertThat(mockConsumer.publicKeyBytesArrayList.get(4).length, is(equalTo(1))); assertThat(mockConsumer.publicKeyBytesArrayList.get(5).length, is(equalTo(1))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[0], is(equalTo(PrivateKey.TEST.getPublicKeyBytes()))); assertThat(mockConsumer.publicKeyBytesArrayList.get(1)[0], is(equalTo(PrivateKey.TEST_WITH_SPACE.getPublicKeyBytes()))); assertThat(mockConsumer.publicKeyBytesArrayList.get(2)[0], is(equalTo(PrivateKey.NUMBER_1337.getPublicKeyBytes()))); assertThat(mockConsumer.publicKeyBytesArrayList.get(3)[0], is(equalTo(PrivateKey.NUMBER_73.getPublicKeyBytes()))); assertThat(mockConsumer.publicKeyBytesArrayList.get(4)[0], is(equalTo(PrivateKey.WITH_COMMENT.getPublicKeyBytes()))); assertThat(mockConsumer.publicKeyBytesArrayList.get(5)[0], is(equalTo(PrivateKey.WITH_SPECIAL_CHARACTER.getPublicKeyBytes()))); } // private List createSecretsFiles(CSecretFormat secretFormat) throws IOException { List fileList = new ArrayList<>(); { File secretsFile = folder.newFile("secretsFile0.txt"); fileList.add(secretsFile); PrivateKey[] secretsAsArray = new PrivateKey[] { PrivateKey.TEST, PrivateKey.TEST_WITH_SPACE, PrivateKey.NUMBER_1337 }; List secretsAsList = Arrays.asList(secretsAsArray); fillSecretsFile(secretsFile, secretsAsList, secretFormat); } { File secretsFile = folder.newFile("secretsFile1.txt"); fileList.add(secretsFile); PrivateKey[] secretsAsArray = new PrivateKey[] { PrivateKey.NUMBER_73, PrivateKey.WITH_COMMENT, PrivateKey.WITH_SPECIAL_CHARACTER }; List secretsAsList = Arrays.asList(secretsAsArray); fillSecretsFile(secretsFile, secretsAsList, secretFormat); } return fileList; } private void fillSecretsFile(File file, Iterable secrets, CSecretFormat secretFormat) throws IOException { StringBuilder sb = new StringBuilder(); for (PrivateKey secret : secrets) { switch(secretFormat) { case STRING_DO_SHA256: sb.append(secret.string); break; case BIG_INTEGER: sb.append(secret.getBigInteger()); break; case SHA256: sb.append(secret.getSHA256()); break; case DUMPED_RIVATE_KEY: sb.append(secret.getWiF()); break; default: throw new UnknownSecretFormatException(secretFormat); } sb.append("\n"); } String content = sb.toString(); FileUtils.writeStringToFile(file, content, StandardCharsets.UTF_8.name()); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/ProducerJavaTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import java.io.IOException; import java.math.BigInteger; import java.util.Random; import static net.ladenthin.bitcoinaddressfinder.PublicKeyBytes.INVALID_PRIVATE_KEY_REPLACEMENT; import net.ladenthin.bitcoinaddressfinder.configuration.CProducerJava; import org.bitcoinj.base.Network; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; import static org.hamcrest.text.MatchesPattern.matchesPattern; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.junit.runner.RunWith; @RunWith(DataProviderRunner.class) public class ProducerJavaTest { @Rule public TemporaryFolder folder = new TemporaryFolder(); private final Network network = new NetworkParameterFactory().getNetwork(); private final KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); private final BitHelper bitHelper = new BitHelper(); // @Test public void initProducer_configurationGiven_stateInitializedAndLogged() throws IOException, InterruptedException { CProducerJava cProducerJava = new CProducerJava(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerJava producerJava = new ProducerJava(cProducerJava, mockConsumer, keyUtility, mockKeyProducer, bitHelper); AbstractProducerTest.verifyInitProducer(producerJava); } // // @ToStringTest @Test public void toString_whenCalled_containsClassNameAndIdentityHash() { CProducerJava cProducerJava = new CProducerJava(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerJava producerJava = new ProducerJava(cProducerJava, mockConsumer, keyUtility, mockKeyProducer, bitHelper); String toStringOutput = producerJava.toString(); assertThat(toStringOutput, not(emptyOrNullString())); assertThat(toStringOutput, matchesPattern("ProducerJava@\\p{XDigit}+")); } // // @Test public void releaseProducer_configurationGiven_stateInitializedAndLogged() throws IOException, InterruptedException { CProducerJava cProducerJava = new CProducerJava(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerJava producerJava = new ProducerJava(cProducerJava, mockConsumer, keyUtility, mockKeyProducer, bitHelper); AbstractProducerTest.verifyReleaseProducer(producerJava); } // // @Test public void produceKeys_BatchSizeInBitsEqualsKeyMaxNumBits_noExceptionThrown() throws Exception { CProducerJava cProducerJava = new CProducerJava(); cProducerJava.batchUsePrivateKeyIncrement = true; cProducerJava.batchSizeInBits = 2; MockConsumer mockConsumer = new MockConsumer(); int maximumBitLength = 2; Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random, maximumBitLength); ProducerJava producerJava = new ProducerJava(cProducerJava, mockConsumer, keyUtility, mockKeyProducer, bitHelper); // act producerJava.produceKeys(); // assert assertThat(mockConsumer.publicKeyBytesArrayList.size(), is(equalTo(1))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0).length, is(equalTo(bitHelper.convertBitsToSize(cProducerJava.batchSizeInBits)))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[0], is(equalTo(PublicKeyBytes.INVALID_KEY_ONE))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[1], is(equalTo(PublicKeyBytes.INVALID_KEY_ONE))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[2], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(2))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[3], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(3))))); } @Test public void produceKeys_KeyMaxNumBitsLowerThanBatchSizeInBits_produceBatchSizeInBitsNevertheless() throws Exception { CProducerJava cProducerJava = new CProducerJava(); cProducerJava.batchUsePrivateKeyIncrement = true; cProducerJava.batchSizeInBits = 4; MockConsumer mockConsumer = new MockConsumer(); int maximumBitLength = 3; Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random, maximumBitLength); ProducerJava producerJava = new ProducerJava(cProducerJava, mockConsumer, keyUtility, mockKeyProducer, bitHelper); // act producerJava.produceKeys(); // assert assertThat(mockConsumer.publicKeyBytesArrayList.size(), is(equalTo(1))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0).length, is(equalTo(bitHelper.convertBitsToSize(cProducerJava.batchSizeInBits)))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[0], is(equalTo(PublicKeyBytes.INVALID_KEY_ONE))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[1], is(equalTo(PublicKeyBytes.INVALID_KEY_ONE))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[2], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(2))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[3], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(3))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[4], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(4))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[5], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(5))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[6], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(6))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[7], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(7))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[8], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(8))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[9], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(9))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[10], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(10))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[11], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(11))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[12], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(12))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[13], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(13))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[14], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(14))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[15], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(15))))); } @Test public void produceKeys_privateKeyMaxNumBitsIsVeryLowAndProduceReplacedKeys_keysEqualsReplacement() throws Exception { CProducerJava cProducerJava = new CProducerJava(); cProducerJava.batchUsePrivateKeyIncrement = true; cProducerJava.batchSizeInBits = 1; MockConsumer mockConsumer = new MockConsumer(); int maximumBitLength = 2; Random random = new Random(0); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random, maximumBitLength); ProducerJava producerJava = new ProducerJava(cProducerJava, mockConsumer, keyUtility, mockKeyProducer, bitHelper); // act producerJava.produceKeys(); // assert assertThat(mockConsumer.publicKeyBytesArrayList.size(), is(equalTo(1))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0).length, is(equalTo(bitHelper.convertBitsToSize(cProducerJava.batchSizeInBits)))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[0], is(equalTo(PublicKeyBytes.fromPrivate(INVALID_PRIVATE_KEY_REPLACEMENT)))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[1], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(3))))); } @Test public void produceKeys_privateKeyMaxNumBitsIsLowAndProduceReplacedKeys_keysEqualsReplacement() throws Exception { CProducerJava cProducerJava = new CProducerJava(); cProducerJava.batchUsePrivateKeyIncrement = false; cProducerJava.batchSizeInBits = 4; MockConsumer mockConsumer = new MockConsumer(); int maximumBitLength = 3; Random random = new Random(0); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random, maximumBitLength); ProducerJava producerJava = new ProducerJava(cProducerJava, mockConsumer, keyUtility, mockKeyProducer, bitHelper); // act producerJava.produceKeys(); // assert assertThat(mockConsumer.publicKeyBytesArrayList.size(), is(equalTo(1))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0).length, is(equalTo(bitHelper.convertBitsToSize(cProducerJava.batchSizeInBits)))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[0], is(equalTo(PublicKeyBytes.fromPrivate(INVALID_PRIVATE_KEY_REPLACEMENT)))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[1], is(equalTo(PublicKeyBytes.fromPrivate(INVALID_PRIVATE_KEY_REPLACEMENT)))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[2], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(2))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[3], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(6))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[4], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(6))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[5], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(2))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[6], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(7))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[7], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(3))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[8], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(6))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[9], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(5))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[10], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(3))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[11], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(3))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[12], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(3))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[13], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(5))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[14], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(7))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[15], is(equalTo(PublicKeyBytes.fromPrivate(INVALID_PRIVATE_KEY_REPLACEMENT)))); } @Test public void produceKeys_SomeBitRanges_consumerContainsData() throws Exception { CProducerJava cProducerJava = new CProducerJava(); cProducerJava.batchUsePrivateKeyIncrement = true; cProducerJava.batchSizeInBits = 3; MockConsumer mockConsumer = new MockConsumer(); int maximumBitLength = 6; Random random = new Random(2); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random, maximumBitLength); ProducerJava producerJava = new ProducerJava(cProducerJava, mockConsumer, keyUtility, mockKeyProducer, bitHelper); // act producerJava.produceKeys(); // assert assertThat(mockConsumer.publicKeyBytesArrayList.size(), is(equalTo(1))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0).length, is(equalTo(bitHelper.convertBitsToSize(cProducerJava.batchSizeInBits)))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[0], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(56))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[1], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(57))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[2], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(58))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[3], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(59))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[4], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(60))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[5], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(61))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[6], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(62))))); assertThat(mockConsumer.publicKeyBytesArrayList.get(0)[7], is(equalTo(PublicKeyBytes.fromPrivate(BigInteger.valueOf(63))))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/ProducerOpenCLTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import java.io.IOException; import java.time.Duration; import java.util.Random; import net.ladenthin.bitcoinaddressfinder.configuration.CProducerOpenCL; import org.bitcoinj.base.Network; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.is; public class ProducerOpenCLTest { @Rule public TemporaryFolder folder = new TemporaryFolder(); private final Network network = new NetworkParameterFactory().getNetwork(); private final KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); private final BitHelper bitHelper = new BitHelper(); // @OpenCLTest @Test public void initProducer_configurationGiven_stateInitializedAndLogged() throws IOException, InterruptedException { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); CProducerOpenCL cProducerOpenCL = new CProducerOpenCL(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerOpenCL producerOpenCL = new ProducerOpenCL(cProducerOpenCL, mockConsumer, keyUtility, mockKeyProducer, bitHelper); AbstractProducerTest.verifyInitProducer(producerOpenCL); } // // @OpenCLTest @Test public void releaseProducer_configurationGiven_stateInitializedAndLoggedAndExecuterServiceShutdown() throws IOException, InterruptedException { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); CProducerOpenCL cProducerOpenCL = new CProducerOpenCL(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerOpenCL producerOpenCL = new ProducerOpenCL(cProducerOpenCL, mockConsumer, keyUtility, mockKeyProducer, bitHelper); AbstractProducerTest.verifyReleaseProducer(producerOpenCL); assertThat(producerOpenCL.resultReaderThreadPoolExecutor.isShutdown(), is(equalTo(Boolean.TRUE))); } // // @OpenCLTest @Test public void initProducer_configurationGiven_stateInitializedAndOpenCLContextSet() throws IOException, InterruptedException { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); CProducerOpenCL cProducerOpenCL = new CProducerOpenCL(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerOpenCL producerOpenCL = new ProducerOpenCL(cProducerOpenCL, mockConsumer, keyUtility, mockKeyProducer, bitHelper); // pre-assert assertThat(producerOpenCL.openCLContext, nullValue()); assertThat(producerOpenCL.state, is(equalTo(ProducerState.UNINITIALIZED))); // act producerOpenCL.initProducer(); // assert assertThat(producerOpenCL.openCLContext, notNullValue()); assertThat(producerOpenCL.state, is(equalTo(ProducerState.INITIALIZED))); } // // @Test public void releaseProducers_notInitialized_noExceptionThrown() throws IOException, InterruptedException { CProducerOpenCL cProducerOpenCL = new CProducerOpenCL(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerOpenCL producerOpenCL = new ProducerOpenCL(cProducerOpenCL, mockConsumer, keyUtility, mockKeyProducer, bitHelper); // act producerOpenCL.releaseProducer(); } @Test @OpenCLTest public void releaseProducers_initialized_noExceptionThrownAndOpenCLContextFreed() throws IOException, InterruptedException { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); CProducerOpenCL cProducerOpenCL = new CProducerOpenCL(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerOpenCL producerOpenCL = new ProducerOpenCL(cProducerOpenCL, mockConsumer, keyUtility, mockKeyProducer, bitHelper); producerOpenCL.initProducer(); // pre-assert assertThat(producerOpenCL.openCLContext, notNullValue()); // act producerOpenCL.releaseProducer(); // assert assertThat(producerOpenCL.openCLContext, nullValue()); } // // @Test public void getFreeThreads_notInitialized_numberOfFreeThreadsReturned() throws IOException, InterruptedException { CProducerOpenCL cProducerOpenCL = new CProducerOpenCL(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerOpenCL producerOpenCL = new ProducerOpenCL(cProducerOpenCL, mockConsumer, keyUtility, mockKeyProducer, bitHelper); // act int freeThreads = producerOpenCL.getFreeThreads(); // assert assertThat(freeThreads, is(equalTo(Integer.valueOf(cProducerOpenCL.maxResultReaderThreads)))); } @Test @OpenCLTest public void getFreeThreads_initialized_numberOfFreeThreadsReturned() throws IOException, InterruptedException { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); CProducerOpenCL cProducerOpenCL = new CProducerOpenCL(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerOpenCL producerOpenCL = new ProducerOpenCL(cProducerOpenCL, mockConsumer, keyUtility, mockKeyProducer, bitHelper); producerOpenCL.initProducer(); // act int freeThreads = producerOpenCL.getFreeThreads(); // assert assertThat(freeThreads, is(equalTo(Integer.valueOf(cProducerOpenCL.maxResultReaderThreads)))); } // // @Test public void waitTillFreeThreadsInPool_notInitialized_returnImmediately() throws IOException, InterruptedException { CProducerOpenCL cProducerOpenCL = new CProducerOpenCL(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerOpenCL producerOpenCL = new ProducerOpenCL(cProducerOpenCL, mockConsumer, keyUtility, mockKeyProducer, bitHelper); // act producerOpenCL.waitTillFreeThreadsInPool(); // assert } @Test @OpenCLTest public void waitTillFreeThreadsInPool_initialized_returnImmediately() throws IOException, InterruptedException { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); CProducerOpenCL cProducerOpenCL = new CProducerOpenCL(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerOpenCL producerOpenCL = new ProducerOpenCL(cProducerOpenCL, mockConsumer, keyUtility, mockKeyProducer, bitHelper); producerOpenCL.initProducer(); // act producerOpenCL.waitTillFreeThreadsInPool(); // assert } @Test @OpenCLTest public void waitTillFreeThreadsInPool_initializedAndThreadPoolFull_doNotReturn() throws IOException, InterruptedException { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); CProducerOpenCL cProducerOpenCL = new CProducerOpenCL(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerOpenCL producerOpenCL = new ProducerOpenCL(cProducerOpenCL, mockConsumer, keyUtility, mockKeyProducer, bitHelper); producerOpenCL.initProducer(); Duration sleepDuration = Duration.ofSeconds(5L); for (int i = 0; i < cProducerOpenCL.maxResultReaderThreads; i++) { producerOpenCL.resultReaderThreadPoolExecutor.submit(() -> { try { Thread.sleep(sleepDuration); } catch (InterruptedException ex) { throw new RuntimeException(ex); } }); } // act final long before = System.currentTimeMillis(); producerOpenCL.waitTillFreeThreadsInPool(); final long after = System.currentTimeMillis(); Duration durationOfWait = Duration.ofMillis(after-before); // assert // expect at least the half of the sleep duration assertThat(durationOfWait, is(greaterThan(sleepDuration.dividedBy(2)))); } // // @Test(expected = IllegalStateException.class) public void produceKeys_notInitialized_illegalStateExceptionThrown() throws Exception { CProducerOpenCL cProducerOpenCL = new CProducerOpenCL(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerOpenCL producerOpenCL = new ProducerOpenCL(cProducerOpenCL, mockConsumer, keyUtility, mockKeyProducer, bitHelper); // act producerOpenCL.produceKeys(); // assert } @Test @OpenCLTest public void produceKeys_initialized_keysInConsumer() throws Exception { new OpenCLPlatformAssume().assumeOpenCLLibraryLoadableAndOneOpenCL2_0OrGreaterDeviceAvailable(); CProducerOpenCL cProducerOpenCL = new CProducerOpenCL(); MockConsumer mockConsumer = new MockConsumer(); Random random = new Random(1); MockKeyProducer mockKeyProducer = new MockKeyProducer(keyUtility, random); ProducerOpenCL producerOpenCL = new ProducerOpenCL(cProducerOpenCL, mockConsumer, keyUtility, mockKeyProducer, bitHelper); producerOpenCL.initProducer(); // act producerOpenCL.produceKeys(); // it takes some time to consume keys Thread.sleep(Duration.ofSeconds(10L)); // assert assertThat(mockConsumer.publicKeyBytesArrayList.size(), is(greaterThan(0))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/ProducerStateTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import org.junit.Test; public class ProducerStateTest { // @Test public void values_allStatesPresent_countIsFour() { // arrange, act ProducerState[] states = ProducerState.values(); // assert assertThat(states.length, is(equalTo(4))); } @Test public void values_ordinalOfUninitialized_isZero() { // arrange, act, assert assertThat(ProducerState.UNINITIALIZED.ordinal(), is(equalTo(0))); } @Test public void values_ordinalOfInitialized_isOne() { // arrange, act, assert assertThat(ProducerState.INITIALIZED.ordinal(), is(equalTo(1))); } @Test public void values_ordinalOfRunning_isTwo() { // arrange, act, assert assertThat(ProducerState.RUNNING.ordinal(), is(equalTo(2))); } @Test public void values_ordinalOfNotRunning_isThree() { // arrange, act, assert assertThat(ProducerState.NOT_RUNNING.ordinal(), is(equalTo(3))); } // // @Test public void name_uninitialized_returnsExpectedString() { // arrange, act, assert assertThat(ProducerState.UNINITIALIZED.name(), is(equalTo("UNINITIALIZED"))); } @Test public void name_initialized_returnsExpectedString() { // arrange, act, assert assertThat(ProducerState.INITIALIZED.name(), is(equalTo("INITIALIZED"))); } @Test public void name_running_returnsExpectedString() { // arrange, act, assert assertThat(ProducerState.RUNNING.name(), is(equalTo("RUNNING"))); } @Test public void name_notRunning_returnsExpectedString() { // arrange, act, assert assertThat(ProducerState.NOT_RUNNING.name(), is(equalTo("NOT_RUNNING"))); } // // @Test public void valueOf_uninitializedString_returnsUninitializedState() { // arrange, act, assert assertThat(ProducerState.valueOf("UNINITIALIZED"), is(equalTo(ProducerState.UNINITIALIZED))); } @Test public void valueOf_initializedString_returnsInitializedState() { // arrange, act, assert assertThat(ProducerState.valueOf("INITIALIZED"), is(equalTo(ProducerState.INITIALIZED))); } @Test public void valueOf_runningString_returnsRunningState() { // arrange, act, assert assertThat(ProducerState.valueOf("RUNNING"), is(equalTo(ProducerState.RUNNING))); } @Test public void valueOf_notRunningString_returnsNotRunningState() { // arrange, act, assert assertThat(ProducerState.valueOf("NOT_RUNNING"), is(equalTo(ProducerState.NOT_RUNNING))); } @Test(expected = IllegalArgumentException.class) public void valueOf_unknownString_throwsIllegalArgumentException() { // arrange, act, assert ProducerState.valueOf("UNKNOWN_STATE"); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/PublicKeyBytesTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import org.junit.Test; import java.io.IOException; import java.math.BigInteger; import java.util.Arrays; import net.ladenthin.bitcoinaddressfinder.staticaddresses.TestAddresses42; import org.apache.commons.codec.binary.Hex; import org.bitcoinj.base.LegacyAddress; import org.bitcoinj.base.Network; import org.bitcoinj.crypto.ECKey; import org.bitcoinj.crypto.internal.CryptoUtils; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.emptyOrNullString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.matchesPattern; import static org.hamcrest.Matchers.not; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.contains; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import org.slf4j.Logger; public class PublicKeyBytesTest { private final Network network = new NetworkParameterFactory().getNetwork(); private final ByteBufferUtility byteBufferUtility = new ByteBufferUtility(true); protected final KeyUtility keyUtility = new KeyUtility(network, byteBufferUtility); @Test public void publicKeyBytes_fromPublicKey_matchesExpectedHashes() { // arrange ECKey keyUncompressed = new TestAddresses42(1, false).getECKeys().get(0); ECKey keyCompressed = new TestAddresses42(1, true).getECKeys().get(0); // act PublicKeyBytes publicKeyBytesUncompressed = new PublicKeyBytes(keyUncompressed.getPrivKey(), keyUncompressed.getPubKey()); PublicKeyBytes publicKeyBytesCompressed = new PublicKeyBytes(keyUncompressed.getPrivKey(), keyUncompressed.getPubKey(), keyCompressed.getPubKey()); // assert assertThat(publicKeyBytesUncompressed.getUncompressed(), is(equalTo(keyUncompressed.getPubKey()))); assertThat(publicKeyBytesUncompressed.getUncompressedKeyHash(), is(equalTo(keyUncompressed.getPubKeyHash()))); assertThat(CryptoUtils.sha256hash160(publicKeyBytesCompressed.getUncompressed()), is(equalTo(keyUncompressed.getPubKeyHash()))); assertThat(publicKeyBytesCompressed.getUncompressedKeyHash(), is(equalTo(keyUncompressed.getPubKeyHash()))); assertThat(publicKeyBytesUncompressed.getUncompressedKeyHashAsBase58(keyUtility), is(equalTo(LegacyAddress.fromPubKeyHash(network, keyUncompressed.getPubKeyHash()).toBase58()))); assertThat(publicKeyBytesCompressed.getUncompressedKeyHashAsBase58(keyUtility), is(equalTo(LegacyAddress.fromPubKeyHash(network, keyUncompressed.getPubKeyHash()).toBase58()))); assertThat(publicKeyBytesUncompressed.getCompressed(), is(equalTo(keyCompressed.getPubKey()))); assertThat(publicKeyBytesUncompressed.getCompressedKeyHash(), is(equalTo(keyCompressed.getPubKeyHash()))); assertThat(CryptoUtils.sha256hash160(publicKeyBytesCompressed.getCompressed()), is(equalTo(keyCompressed.getPubKeyHash()))); assertThat(publicKeyBytesCompressed.getCompressedKeyHash(), is(equalTo(keyCompressed.getPubKeyHash()))); assertThat(publicKeyBytesUncompressed.getCompressedKeyHashAsBase58(keyUtility), is(equalTo(LegacyAddress.fromPubKeyHash(network, keyCompressed.getPubKeyHash()).toBase58()))); assertThat(publicKeyBytesCompressed.getCompressedKeyHashAsBase58(keyUtility), is(equalTo(LegacyAddress.fromPubKeyHash(network, keyCompressed.getPubKeyHash()).toBase58()))); } @Test public void publicKeyBytes_toStringEqualsAndHashCode_consistent() { // arrange ECKey keyUncompressed = new TestAddresses42(1, false).getECKeys().get(0); ECKey keyCompressed = new TestAddresses42(1, true).getECKeys().get(0); // act PublicKeyBytes publicKeyBytesUncompressed = new PublicKeyBytes(keyUncompressed.getPrivKey(), keyUncompressed.getPubKey()); PublicKeyBytes publicKeyBytesUncompressed2 = new PublicKeyBytes(keyUncompressed.getPrivKey(), keyUncompressed.getPubKey()); PublicKeyBytes publicKeyBytesCompressed = new PublicKeyBytes(keyUncompressed.getPrivKey(), keyUncompressed.getPubKey(), keyCompressed.getPubKey()); PublicKeyBytes publicKeyBytesCompressed2 = new PublicKeyBytes(keyUncompressed.getPrivKey(), keyUncompressed.getPubKey(), keyCompressed.getPubKey()); // assert EqualHashCodeToStringTestHelper equalHashCodeToStringTestHelper = new EqualHashCodeToStringTestHelper(publicKeyBytesUncompressed, publicKeyBytesUncompressed2, publicKeyBytesCompressed, publicKeyBytesCompressed2); equalHashCodeToStringTestHelper.assertEqualsHashCodeToStringAIsEqualToB(); // toString assertThat(publicKeyBytesUncompressed.toString(), is(equalTo(publicKeyBytesCompressed.toString()))); assertThat(publicKeyBytesUncompressed.toString(), is(equalTo("PublicKeyBytes{secretKey=24250429618215260598957696001935175135959229619080974590971174872813112994997}"))); } @Test public void maxPrivateKeyAsHexString_isEqualToConstant() { // arrange String maxPrivateKeyAsHexString = Hex.encodeHexString(ByteBufferUtility.bigIntegerToBytes(PublicKeyBytes.MAX_PRIVATE_KEY)); // act // assert assertThat(maxPrivateKeyAsHexString.toLowerCase(), is(equalTo("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141".toLowerCase()))); } // @Test public void runtimePublicKeyCalculationCheck_validKey_returnsTrue() { // arrange BigInteger secretKey = new BigInteger("1337"); ECKey ecKey = ECKey.fromPrivate(secretKey, false); byte[] uncompressed = ecKey.getPubKey(); PublicKeyBytes publicKeyBytes = new PublicKeyBytes(secretKey, uncompressed); // compressed is derived Logger logger = mock(Logger.class); // act boolean result = publicKeyBytes.runtimePublicKeyCalculationCheck(logger); // assert assertThat(result, is(true)); verify(logger, never()).error(anyString()); } @Test public void runtimePublicKeyCalculationCheck_invalidCompressedHash_returnsFalse() { // arrange BigInteger secretKey = new BigInteger("1337"); ECKey ecKey = ECKey.fromPrivate(secretKey, false); byte[] uncompressed = ecKey.getPubKey(); byte[] compressed = ECKey.fromPrivate(secretKey, true).getPubKey(); byte[] wrongCompressedHash = new byte[PublicKeyBytes.RIPEMD160_HASH_NUM_BYTES]; // all-zero hash (invalid) PublicKeyBytes publicKeyBytes = new PublicKeyBytes(secretKey, uncompressed, wrongCompressedHash); Logger logger = mock(Logger.class); // act boolean result = publicKeyBytes.runtimePublicKeyCalculationCheck(logger); // assert assertThat(result, is(false)); verify(logger).error(contains("fromPrivateCompressed.getPubKeyHash()")); } @Test public void runtimePublicKeyCalculationCheck_invalidUncompressedHash_returnsFalse() { // arrange BigInteger secretKey = new BigInteger("1337"); ECKey ecKey = ECKey.fromPrivate(secretKey, false); byte[] uncompressed = ecKey.getPubKey(); byte[] compressed = ECKey.fromPrivate(secretKey, true).getPubKey(); byte[] wrongUncompressedHash = new byte[PublicKeyBytes.RIPEMD160_HASH_NUM_BYTES]; // all-zero hash (invalid) PublicKeyBytes publicKeyBytes = new PublicKeyBytes(secretKey, wrongUncompressedHash, compressed); Logger logger = mock(Logger.class); // act boolean result = publicKeyBytes.runtimePublicKeyCalculationCheck(logger); // assert assertThat(result, is(false)); verify(logger).error(contains("fromPrivateUncompressed.getPubKeyHash()")); } @Test public void runtimePublicKeyCalculationCheck_invalidCompressedAndUncompressed_returnsFalse() { // arrange BigInteger secretKey = new BigInteger("1337"); byte[] uncompressedWrong = new byte[PublicKeyBytes.PUBLIC_KEY_UNCOMPRESSED_BYTES]; // all-zero hash (invalid) byte[] compressedWrong = new byte[PublicKeyBytes.PUBLIC_KEY_COMPRESSED_BYTES]; // all-zero hash (invalid) PublicKeyBytes publicKeyBytes = new PublicKeyBytes(secretKey, uncompressedWrong, compressedWrong); Logger logger = mock(Logger.class); // act boolean result = publicKeyBytes.runtimePublicKeyCalculationCheck(logger); // assert assertThat(result, is(false)); verify(logger).error(contains("fromPrivateUncompressed.getPubKeyHash()")); verify(logger).error(contains("fromPrivateCompressed.getPubKeyHash()")); } // // @Test public void assembleUncompressedPublicKey_validXY_correctlyAssembles() { // arrange byte[] x = new byte[PublicKeyBytes.ONE_COORDINATE_NUM_BYTES]; byte[] y = new byte[PublicKeyBytes.ONE_COORDINATE_NUM_BYTES]; for (int i = 0; i < PublicKeyBytes.ONE_COORDINATE_NUM_BYTES; i++) { x[i] = (byte) i; y[i] = (byte) (i + PublicKeyBytes.ONE_COORDINATE_NUM_BYTES); } // act byte[] result = PublicKeyBytes.assembleUncompressedPublicKey(x, y); // assert assertThat(result[0], is((byte) PublicKeyBytes.SEC_PREFIX_UNCOMPRESSED_ECDSA_POINT)); for (int i = 0; i < PublicKeyBytes.ONE_COORDINATE_NUM_BYTES; i++) { assertThat("X coordinate mismatch at index " + i, result[i + PublicKeyBytes.SEC_PREFIX_NUM_BYTES], is(x[i])); assertThat("Y coordinate mismatch at index " + i, result[i + PublicKeyBytes.SEC_PREFIX_NUM_BYTES + PublicKeyBytes.ONE_COORDINATE_NUM_BYTES], is(y[i])); } } @Test public void assembleUncompressedPublicKey_allZeros_createsValidKey() { // arrange byte[] x = new byte[PublicKeyBytes.ONE_COORDINATE_NUM_BYTES]; byte[] y = new byte[PublicKeyBytes.ONE_COORDINATE_NUM_BYTES]; // act byte[] result = PublicKeyBytes.assembleUncompressedPublicKey(x, y); // assert assertThat(result[0], is((byte) PublicKeyBytes.SEC_PREFIX_UNCOMPRESSED_ECDSA_POINT)); for (int i = PublicKeyBytes.SEC_PREFIX_NUM_BYTES; i < result.length; i++) { assertThat("Expected zero at index " + i, result[i], is((byte) 0x00)); } } @Test public void assembleUncompressedPublicKey_validXAndY_assemblesCorrectly() { // arrange BigInteger secretKey = new BigInteger("1337"); ECKey ecKey = ECKey.fromPrivate(secretKey, false); byte[] pubKey = ecKey.getPubKey(); // full uncompressed pubkey (parity + X + Y) // extract X and Y from real ECKey byte[] x = Arrays.copyOfRange(pubKey, PublicKeyBytes.SEC_PREFIX_NUM_BYTES, PublicKeyBytes.SEC_PREFIX_NUM_BYTES + PublicKeyBytes.ONE_COORDINATE_NUM_BYTES); byte[] y = Arrays.copyOfRange(pubKey, PublicKeyBytes.SEC_PREFIX_NUM_BYTES + PublicKeyBytes.ONE_COORDINATE_NUM_BYTES, PublicKeyBytes.SEC_PREFIX_NUM_BYTES + PublicKeyBytes.TWO_COORDINATES_NUM_BYTES); // act byte[] assembledUncompressed = PublicKeyBytes.assembleUncompressedPublicKey(x, y); // assert assertThat(assembledUncompressed, is(equalTo(pubKey))); } // // @ToStringTest @Test public void toString_whenCalled_containsClassNameAndPrivateKey() throws IOException { // arrange ECKey keyUncompressed = new TestAddresses42(1, false).getECKeys().get(0); // act PublicKeyBytes publicKeyBytesUncompressed = new PublicKeyBytes(keyUncompressed.getPrivKey(), keyUncompressed.getPubKey()); String toStringOutput = publicKeyBytesUncompressed.toString(); assertThat(toStringOutput, not(emptyOrNullString())); assertThat(toStringOutput, matchesPattern("PublicKeyBytes\\{secretKey=\\d+}")); } // // @Test public void fromPrivate_validSecretKey_returnsPublicKeyBytesWithCorrectKey() { // arrange BigInteger secretKey = new BigInteger("1337"); // act PublicKeyBytes result = PublicKeyBytes.fromPrivate(secretKey); // assert assertThat(result.getSecretKey(), is(equalTo(secretKey))); } @Test public void fromPrivate_validSecretKey_returnsMatchingUncompressedPubKey() { // arrange BigInteger secretKey = new BigInteger("1337"); ECKey ecKey = ECKey.fromPrivate(secretKey, false); // act PublicKeyBytes result = PublicKeyBytes.fromPrivate(secretKey); // assert assertThat(result.getUncompressed(), is(equalTo(ecKey.getPubKey()))); } @Test public void fromPrivate_validSecretKey_returnsMatchingCompressedPubKey() { // arrange BigInteger secretKey = new BigInteger("1337"); ECKey ecKeyCompressed = ECKey.fromPrivate(secretKey, true); // act PublicKeyBytes result = PublicKeyBytes.fromPrivate(secretKey); // assert assertThat(result.getCompressed(), is(equalTo(ecKeyCompressed.getPubKey()))); } @Test public void fromPrivate_minValidPrivateKey_noExceptionThrown() { // arrange BigInteger secretKey = PublicKeyBytes.MIN_VALID_PRIVATE_KEY; // act PublicKeyBytes result = PublicKeyBytes.fromPrivate(secretKey); // assert assertThat(result.getSecretKey(), is(equalTo(secretKey))); } // // @Test public void getSecretKey_constructedWithKnownKey_returnsCorrectKey() { // arrange BigInteger secretKey = new BigInteger("42"); ECKey ecKey = ECKey.fromPrivate(secretKey, false); PublicKeyBytes sut = new PublicKeyBytes(secretKey, ecKey.getPubKey()); // act BigInteger result = sut.getSecretKey(); // assert assertThat(result, is(equalTo(secretKey))); } // // @Test public void getCompressed_constructedFromUncompressed_returnsValidCompressedKey() { // arrange BigInteger secretKey = new BigInteger("1337"); ECKey ecKeyUncompressed = ECKey.fromPrivate(secretKey, false); ECKey ecKeyCompressed = ECKey.fromPrivate(secretKey, true); PublicKeyBytes sut = new PublicKeyBytes(secretKey, ecKeyUncompressed.getPubKey()); // act byte[] result = sut.getCompressed(); // assert assertThat(result, is(equalTo(ecKeyCompressed.getPubKey()))); } // // @Test public void getUncompressed_constructedWithUncompressed_returnsSameArray() { // arrange BigInteger secretKey = new BigInteger("1337"); ECKey ecKey = ECKey.fromPrivate(secretKey, false); byte[] uncompressed = ecKey.getPubKey(); PublicKeyBytes sut = new PublicKeyBytes(secretKey, uncompressed); // act byte[] result = sut.getUncompressed(); // assert assertThat(result, is(equalTo(uncompressed))); } // // @Test public void isOutsidePrivateKeyRange_validKey_returnsFalse() { // arrange BigInteger secretKey = new BigInteger("1337"); ECKey ecKey = ECKey.fromPrivate(secretKey, false); PublicKeyBytes sut = new PublicKeyBytes(secretKey, ecKey.getPubKey()); // act boolean result = sut.isOutsidePrivateKeyRange(); // assert assertThat(result, is(false)); } @Test public void isOutsidePrivateKeyRange_keyAboveMax_returnsTrue() { // arrange BigInteger secretKey = PublicKeyBytes.MAX_PRIVATE_KEY.add(BigInteger.ONE); byte[] dummyUncompressed = new byte[PublicKeyBytes.PUBLIC_KEY_UNCOMPRESSED_BYTES]; PublicKeyBytes sut = new PublicKeyBytes(secretKey, dummyUncompressed); // act boolean result = sut.isOutsidePrivateKeyRange(); // assert assertThat(result, is(true)); } @Test public void isOutsidePrivateKeyRange_keyBelowMin_returnsTrue() { // arrange BigInteger secretKey = BigInteger.ZERO; byte[] dummyUncompressed = new byte[PublicKeyBytes.PUBLIC_KEY_UNCOMPRESSED_BYTES]; PublicKeyBytes sut = new PublicKeyBytes(secretKey, dummyUncompressed); // act boolean result = sut.isOutsidePrivateKeyRange(); // assert assertThat(result, is(true)); } // // @Test public void sha256hash160Fast_knownInput_matchesCryptoUtilsResult() { // arrange BigInteger secretKey = new BigInteger("1337"); ECKey ecKey = ECKey.fromPrivate(secretKey, false); byte[] pubKey = ecKey.getPubKey(); // act byte[] fastResult = PublicKeyBytes.sha256hash160Fast(pubKey); // assert byte[] expected = CryptoUtils.sha256hash160(pubKey); assertThat(fastResult, is(equalTo(expected))); } @Test public void sha256hash160Fast_compressedKey_matchesCryptoUtilsResult() { // arrange BigInteger secretKey = new BigInteger("1337"); ECKey ecKey = ECKey.fromPrivate(secretKey, true); byte[] pubKey = ecKey.getPubKey(); // act byte[] fastResult = PublicKeyBytes.sha256hash160Fast(pubKey); // assert byte[] expected = CryptoUtils.sha256hash160(pubKey); assertThat(fastResult, is(equalTo(expected))); } @Test public void sha256hash160Fast_resultLength_isRipemd160HashLength() { // arrange byte[] input = new byte[] {0x01, 0x02, 0x03}; // act byte[] result = PublicKeyBytes.sha256hash160Fast(input); // assert assertThat(result.length, is(equalTo(PublicKeyBytes.RIPEMD160_HASH_NUM_BYTES))); } // // @Test public void createCompressedBytes_evenYCoordinate_prefixIs02() { // arrange BigInteger secretKey = new BigInteger("1337"); ECKey ecKey = ECKey.fromPrivate(secretKey, false); byte[] uncompressed = ecKey.getPubKey(); // pre-assert boolean lastByteIsEven = uncompressed[PublicKeyBytes.LAST_Y_COORDINATE_BYTE_INDEX] % 2 == 0; // act byte[] compressed = PublicKeyBytes.createCompressedBytes(uncompressed); // assert if (lastByteIsEven) { assertThat(compressed[0], is((byte) PublicKeyBytes.SEC_PREFIX_COMPRESSED_ECDSA_POINT_EVEN_Y)); } else { assertThat(compressed[0], is((byte) PublicKeyBytes.SEC_PREFIX_COMPRESSED_ECDSA_POINT_ODD_Y)); } } @Test public void createCompressedBytes_knownKey_matchesECKeyCompressed() { // arrange BigInteger secretKey = new BigInteger("1337"); ECKey ecKeyUncompressed = ECKey.fromPrivate(secretKey, false); ECKey ecKeyCompressed = ECKey.fromPrivate(secretKey, true); // act byte[] compressed = PublicKeyBytes.createCompressedBytes(ecKeyUncompressed.getPubKey()); // assert assertThat(compressed, is(equalTo(ecKeyCompressed.getPubKey()))); } @Test public void createCompressedBytes_resultLength_isCompressedKeyLength() { // arrange BigInteger secretKey = new BigInteger("42"); ECKey ecKey = ECKey.fromPrivate(secretKey, false); // act byte[] compressed = PublicKeyBytes.createCompressedBytes(ecKey.getPubKey()); // assert assertThat(compressed.length, is(equalTo(PublicKeyBytes.PUBLIC_KEY_COMPRESSED_BYTES))); } @Test public void createCompressedBytes_xCoordinate_matchesUncompressedXCoordinate() { // arrange BigInteger secretKey = new BigInteger("1337"); ECKey ecKey = ECKey.fromPrivate(secretKey, false); byte[] uncompressed = ecKey.getPubKey(); // act byte[] compressed = PublicKeyBytes.createCompressedBytes(uncompressed); // assert byte[] xFromUncompressed = Arrays.copyOfRange(uncompressed, PublicKeyBytes.SEC_PREFIX_NUM_BYTES, PublicKeyBytes.SEC_PREFIX_NUM_BYTES + PublicKeyBytes.ONE_COORDINATE_NUM_BYTES); byte[] xFromCompressed = Arrays.copyOfRange(compressed, PublicKeyBytes.SEC_PREFIX_NUM_BYTES, PublicKeyBytes.SEC_PREFIX_NUM_BYTES + PublicKeyBytes.ONE_COORDINATE_NUM_BYTES); assertThat(xFromCompressed, is(equalTo(xFromUncompressed))); } // // @Test public void constructor_fourArgs_setsAllFields() { // arrange BigInteger secretKey = new BigInteger("1337"); ECKey ecKeyUncompressed = ECKey.fromPrivate(secretKey, false); ECKey ecKeyCompressed = ECKey.fromPrivate(secretKey, true); byte[] uncompressedKeyHash = CryptoUtils.sha256hash160(ecKeyUncompressed.getPubKey()); byte[] compressedKeyHash = CryptoUtils.sha256hash160(ecKeyCompressed.getPubKey()); // act PublicKeyBytes sut = new PublicKeyBytes(secretKey, ecKeyUncompressed.getPubKey(), uncompressedKeyHash, compressedKeyHash); // assert assertThat(sut.getSecretKey(), is(equalTo(secretKey))); assertThat(sut.getUncompressedKeyHash(), is(equalTo(uncompressedKeyHash))); assertThat(sut.getCompressedKeyHash(), is(equalTo(compressedKeyHash))); } // // @Test public void isAllCoordinateBytesZero_validKey_returnsFalse() { // arrange byte[] validUncompressedKey = new byte[PublicKeyBytes.PUBLIC_KEY_UNCOMPRESSED_BYTES]; validUncompressedKey[0] = PublicKeyBytes.SEC_PREFIX_UNCOMPRESSED_ECDSA_POINT; validUncompressedKey[1] = 0x01; // at least one non-zero coordinate byte // act boolean result = PublicKeyBytes.isAllCoordinateBytesZero(validUncompressedKey); // assert assertThat(result, is(false)); } @Test public void isAllCoordinateBytesZero_allCoordinateBytesZero_returnsTrue() { // arrange byte[] invalidUncompressedKey = new byte[PublicKeyBytes.PUBLIC_KEY_UNCOMPRESSED_BYTES]; invalidUncompressedKey[0] = PublicKeyBytes.SEC_PREFIX_UNCOMPRESSED_ECDSA_POINT; // prefix byte set // act boolean result = PublicKeyBytes.isAllCoordinateBytesZero(invalidUncompressedKey); // assert assertThat(result, is(true)); } @Test public void isAllCoordinateBytesZero_validKeyOnlyLastByteNonZero_returnsFalse() { // arrange byte[] validUncompressedKey = new byte[PublicKeyBytes.PUBLIC_KEY_UNCOMPRESSED_BYTES]; validUncompressedKey[0] = PublicKeyBytes.SEC_PREFIX_UNCOMPRESSED_ECDSA_POINT; validUncompressedKey[validUncompressedKey.length - 1] = 0x01; // last coordinate byte non-zero // act boolean result = PublicKeyBytes.isAllCoordinateBytesZero(validUncompressedKey); // assert assertThat(result, is(false)); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/RandomSecretSupplierTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.math.BigInteger; import java.util.Random; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.lessThan; import static org.hamcrest.Matchers.notNullValue; import org.junit.Test; public class RandomSecretSupplierTest { // @Test public void nextSecret_zeroBitLength_returnsZero() { // arrange RandomSecretSupplier supplier = new RandomSecretSupplier(new Random(0L)); // act BigInteger result = supplier.nextSecret(0); // assert assertThat(result, is(equalTo(BigInteger.ZERO))); } @Test public void nextSecret_256BitLength_returnsNonNullValue() { // arrange RandomSecretSupplier supplier = new RandomSecretSupplier(new Random(42L)); // act BigInteger result = supplier.nextSecret(256); // assert assertThat(result, is(notNullValue())); } @Test public void nextSecret_256BitLength_returnValueFitsIn256Bits() { // arrange RandomSecretSupplier supplier = new RandomSecretSupplier(new Random(42L)); BigInteger maxValue = BigInteger.TWO.pow(256); // act BigInteger result = supplier.nextSecret(256); // assert assertThat(result, is(greaterThanOrEqualTo(BigInteger.ZERO))); assertThat(result, is(lessThan(maxValue))); } @Test public void nextSecret_1BitLength_returnsZeroOrOne() { // arrange RandomSecretSupplier supplier = new RandomSecretSupplier(new Random(0L)); BigInteger two = BigInteger.TWO; // act BigInteger result = supplier.nextSecret(1); // assert assertThat(result, is(greaterThanOrEqualTo(BigInteger.ZERO))); assertThat(result, is(lessThan(two))); } @Test public void nextSecret_seededRandom_returnsDeterministicValue() { // arrange long seed = 12345L; int bitLength = 128; // Two suppliers with the same seed must produce the same value RandomSecretSupplier supplier1 = new RandomSecretSupplier(new Random(seed)); RandomSecretSupplier supplier2 = new RandomSecretSupplier(new Random(seed)); // act BigInteger result1 = supplier1.nextSecret(bitLength); BigInteger result2 = supplier2.nextSecret(bitLength); // assert assertThat(result1, is(equalTo(result2))); } @Test public void nextSecret_consecutiveCalls_canProduceDifferentValues() { // arrange // Use a seed that is known to produce two different 256-bit values RandomSecretSupplier supplier = new RandomSecretSupplier(new Random(1L)); // act BigInteger first = supplier.nextSecret(256); BigInteger second = supplier.nextSecret(256); // assert – with a real Random the two calls should differ (not guaranteed but // statistically certain for 256-bit outputs with any reasonable seed) assertThat(first.equals(second), is(false)); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/ReadStatisticTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.aMapWithSize; import static org.hamcrest.Matchers.anEmptyMap; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; public class ReadStatisticTest { // @Test public void readStatistic_newInstance_successfulIsZero() { // arrange, act ReadStatistic readStatistic = new ReadStatistic(); // assert assertThat(readStatistic.successful, is(equalTo(0L))); } @Test public void readStatistic_newInstance_unsupportedReasonsIsEmpty() { // arrange, act ReadStatistic readStatistic = new ReadStatistic(); // assert assertThat(readStatistic.unsupportedReasons, is(anEmptyMap())); } @Test public void readStatistic_newInstance_unsupportedTotalIsZero() { // arrange, act ReadStatistic readStatistic = new ReadStatistic(); // assert assertThat(readStatistic.getUnsupportedTotal(), is(equalTo(0L))); } @Test public void readStatistic_newInstance_currentFileProgressIsZero() { // arrange, act ReadStatistic readStatistic = new ReadStatistic(); // assert assertThat(readStatistic.currentFileProgress, is(equalTo(0.0))); } @Test public void readStatistic_newInstance_errorsIsEmpty() { // arrange, act ReadStatistic readStatistic = new ReadStatistic(); // assert assertThat(readStatistic.errors, is(empty())); } // // @Test public void readStatistic_incrementUnsupported_addsReasonToMap() { // arrange ReadStatistic readStatistic = new ReadStatistic(); // act readStatistic.incrementUnsupported("address is empty"); // assert assertThat(readStatistic.unsupportedReasons, hasEntry("address is empty", 1L)); } @Test public void readStatistic_incrementUnsupportedTwiceWithSameReason_accumulatesCount() { // arrange ReadStatistic readStatistic = new ReadStatistic(); // act readStatistic.incrementUnsupported("address is empty"); readStatistic.incrementUnsupported("address is empty"); // assert assertThat(readStatistic.unsupportedReasons, hasEntry("address is empty", 2L)); } @Test public void readStatistic_incrementUnsupportedWithDifferentReasons_eachReasonTrackedSeparately() { // arrange ReadStatistic readStatistic = new ReadStatistic(); // act readStatistic.incrementUnsupported("address is empty"); readStatistic.incrementUnsupported("P2TR is not supported"); // assert assertThat(readStatistic.unsupportedReasons, aMapWithSize(2)); assertThat(readStatistic.unsupportedReasons, hasEntry("address is empty", 1L)); assertThat(readStatistic.unsupportedReasons, hasEntry("P2TR is not supported", 1L)); } // // @Test public void readStatistic_getUnsupportedTotal_sumsAllReasons() { // arrange ReadStatistic readStatistic = new ReadStatistic(); readStatistic.incrementUnsupported("address is empty"); readStatistic.incrementUnsupported("address is empty"); readStatistic.incrementUnsupported("P2TR is not supported"); // act long total = readStatistic.getUnsupportedTotal(); // assert assertThat(total, is(equalTo(3L))); } // // @Test public void readStatistic_setSuccessful_reflectsNewValue() { // arrange ReadStatistic readStatistic = new ReadStatistic(); // act readStatistic.successful = 42L; // assert assertThat(readStatistic.successful, is(equalTo(42L))); } @Test public void readStatistic_setCurrentFileProgress_reflectsNewValue() { // arrange ReadStatistic readStatistic = new ReadStatistic(); // act readStatistic.currentFileProgress = 55.5; // assert assertThat(readStatistic.currentFileProgress, is(equalTo(55.5))); } @Test public void readStatistic_addError_errorsPresentInList() { // arrange ReadStatistic readStatistic = new ReadStatistic(); // act readStatistic.errors.add("parse error at line 3"); // assert assertThat(readStatistic.errors, hasSize(1)); assertThat(readStatistic.errors.get(0), is(equalTo("parse error at line 3"))); } // // @Test @ToStringTest public void toString_defaultInstance_containsAllFieldNames() { // arrange ReadStatistic readStatistic = new ReadStatistic(); // act String result = readStatistic.toString(); // assert assertThat(result, containsString("successful=")); assertThat(result, containsString("unsupportedTotal=")); assertThat(result, containsString("unsupportedReasons=")); assertThat(result, containsString("currentFileProgress=")); assertThat(result, containsString("errors=")); } @Test @ToStringTest public void toString_withModifiedValues_containsUpdatedValues() { // arrange ReadStatistic readStatistic = createReadStatisticWithAllFieldsSet(); // act String result = readStatistic.toString(); // assert assertThat(result, containsString("successful=10")); assertThat(result, containsString("unsupportedTotal=3")); assertThat(result, containsString("address is empty=2")); assertThat(result, containsString("P2TR is not supported=1")); assertThat(result, containsString("currentFileProgress=75.0")); assertThat(result, containsString("some error")); } @Test @ToStringTest public void toString_withModifiedValues_equalsExpectedFullString() { // arrange ReadStatistic readStatistic = createReadStatisticWithAllFieldsSet(); // act String result = readStatistic.toString(); // assert assertThat(result, is(equalTo("ReadStatistic{successful=10, unsupportedTotal=3, unsupportedReasons={address is empty=2, P2TR is not supported=1}, currentFileProgress=75.0, errors=[some error]}"))); } private static ReadStatistic createReadStatisticWithAllFieldsSet() { ReadStatistic readStatistic = new ReadStatistic(); readStatistic.successful = 10L; readStatistic.incrementUnsupported("address is empty"); readStatistic.incrementUnsupported("address is empty"); readStatistic.incrementUnsupported("P2TR is not supported"); readStatistic.currentFileProgress = 75.0; readStatistic.errors.add("some error"); return readStatistic; } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/SecretsFileTest.java ================================================ // @formatter:off /** * Copyright 2026 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.io.File; import java.math.BigInteger; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import net.ladenthin.bitcoinaddressfinder.configuration.CSecretFormat; import org.apache.commons.io.FileUtils; import org.bitcoinj.base.Network; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; import net.ladenthin.bitcoinaddressfinder.staticaddresses.StaticKey; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; /** * Unit tests for {@link SecretsFile}. */ public class SecretsFileTest { private final Network network = new NetworkParameterFactory().getNetwork(); private final StaticKey staticKey = new StaticKey(); @Rule public TemporaryFolder folder = new TemporaryFolder(); // @Test public void processLine_bigIntegerFormat_consumerReceivesExpectedSecret() throws Exception { // arrange File file = folder.newFile("secrets.txt"); ReadStatistic readStatistic = new ReadStatistic(); List captured = new ArrayList<>(); SecretsFile secretsFile = new SecretsFile(network, file, CSecretFormat.BIG_INTEGER, readStatistic, captured::add); // act secretsFile.processLine("12345"); // assert assertThat(captured.size(), is(equalTo(1))); assertThat(captured.get(0)[0], is(equalTo(BigInteger.valueOf(12345)))); } @Test public void processLine_sha256Format_consumerReceivesExpectedSecret() throws Exception { // arrange File file = folder.newFile("secrets.txt"); ReadStatistic readStatistic = new ReadStatistic(); List captured = new ArrayList<>(); SecretsFile secretsFile = new SecretsFile(network, file, CSecretFormat.SHA256, readStatistic, captured::add); // act secretsFile.processLine("000000000000000000000000000000000000000000000000000000000000000f"); // assert assertThat(captured.size(), is(equalTo(1))); assertThat(captured.get(0)[0], is(equalTo(BigInteger.valueOf(15)))); } @Test public void processLine_sha256Format_singleByteValue_consumerReceivesExpected() throws Exception { // arrange File file = folder.newFile("secrets.txt"); ReadStatistic readStatistic = new ReadStatistic(); List captured = new ArrayList<>(); SecretsFile secretsFile = new SecretsFile(network, file, CSecretFormat.SHA256, readStatistic, captured::add); // act secretsFile.processLine("0000000000000000000000000000000000000000000000000000000000000001"); // assert assertThat(captured.size(), is(equalTo(1))); assertThat(captured.get(0)[0], is(equalTo(BigInteger.ONE))); } @Test public void processLine_stringDoSha256Format_consumerReceivesHashOfInput() throws Exception { // arrange File file = folder.newFile("secrets.txt"); ReadStatistic readStatistic = new ReadStatistic(); List captured = new ArrayList<>(); SecretsFile secretsFile = new SecretsFile(network, file, CSecretFormat.STRING_DO_SHA256, readStatistic, captured::add); // SHA256("test") = 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 BigInteger expectedSecret = new BigInteger("9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", 16); // act secretsFile.processLine("test"); // assert assertThat(captured.size(), is(equalTo(1))); assertThat(captured.get(0)[0], is(equalTo(expectedSecret))); } @Test public void processLine_dumpedPrivateKeyFormat_consumerReceivesNonNullPositiveSecret() throws Exception { // arrange File file = folder.newFile("secrets.txt"); ReadStatistic readStatistic = new ReadStatistic(); List captured = new ArrayList<>(); SecretsFile secretsFile = new SecretsFile(network, file, CSecretFormat.DUMPED_RIVATE_KEY, readStatistic, captured::add); // act secretsFile.processLine(staticKey.privateKeyWiFUncompressed); // assert assertThat(captured.size(), is(equalTo(1))); assertThat(captured.get(0), is(notNullValue())); assertThat(captured.get(0)[0], is(greaterThan(BigInteger.ZERO))); } @Test public void processLine_dumpedPrivateKeyFormat_consumerReceivesExpectedPrivateKey() throws Exception { // arrange File file = folder.newFile("secrets.txt"); ReadStatistic readStatistic = new ReadStatistic(); List captured = new ArrayList<>(); SecretsFile secretsFile = new SecretsFile(network, file, CSecretFormat.DUMPED_RIVATE_KEY, readStatistic, captured::add); // act secretsFile.processLine(staticKey.privateKeyWiFUncompressed); // assert assertThat(captured.get(0)[0], is(equalTo(staticKey.privateKeyBigInteger))); } @Test public void processLine_bigIntegerFormat_calledTwice_consumerCalledTwice() throws Exception { // arrange File file = folder.newFile("secrets.txt"); ReadStatistic readStatistic = new ReadStatistic(); List captured = new ArrayList<>(); SecretsFile secretsFile = new SecretsFile(network, file, CSecretFormat.BIG_INTEGER, readStatistic, captured::add); // act secretsFile.processLine("1"); secretsFile.processLine("2"); // assert assertThat(captured.size(), is(equalTo(2))); assertThat(captured.get(0)[0], is(equalTo(BigInteger.ONE))); assertThat(captured.get(1)[0], is(equalTo(BigInteger.valueOf(2)))); } // // @Test public void readFile_fileWithTwoLines_consumerCalledTwice() throws Exception { // arrange File file = folder.newFile("secrets.txt"); FileUtils.writeStringToFile(file, "1\n2\n", StandardCharsets.UTF_8.name()); ReadStatistic readStatistic = new ReadStatistic(); List captured = new ArrayList<>(); SecretsFile secretsFile = new SecretsFile(network, file, CSecretFormat.BIG_INTEGER, readStatistic, captured::add); // act secretsFile.readFile(); // assert assertThat(captured.size(), is(equalTo(2))); assertThat(captured.get(0)[0], is(equalTo(BigInteger.ONE))); assertThat(captured.get(1)[0], is(equalTo(BigInteger.valueOf(2)))); } @Test public void readFile_emptyFile_consumerNeverCalled() throws Exception { // arrange File file = folder.newFile("secrets.txt"); ReadStatistic readStatistic = new ReadStatistic(); List captured = new ArrayList<>(); SecretsFile secretsFile = new SecretsFile(network, file, CSecretFormat.BIG_INTEGER, readStatistic, captured::add); // act secretsFile.readFile(); // assert assertThat(captured.size(), is(equalTo(0))); } // // @Test public void interrupt_calledBeforeReadFile_noLinesProcessed() throws Exception { // arrange File file = folder.newFile("secrets.txt"); FileUtils.writeStringToFile(file, "1\n2\n3\n", StandardCharsets.UTF_8.name()); ReadStatistic readStatistic = new ReadStatistic(); List captured = new ArrayList<>(); SecretsFile secretsFile = new SecretsFile(network, file, CSecretFormat.BIG_INTEGER, readStatistic, captured::add); // act secretsFile.interrupt(); secretsFile.readFile(); // assert assertThat(captured.size(), is(equalTo(0))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/SeparatorFormatTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.io.IOException; import org.junit.Test; import java.util.Arrays; import java.util.List; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.*; import org.junit.runner.RunWith; /** * Unit tests for {@link SeparatorFormat}. */ @RunWith(DataProviderRunner.class) public class SeparatorFormatTest { /** * Tests that the input is correctly split into two parts using a valid * separator between them. */ @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_ADDRESS_SEPARATOR, location = CommonDataProvider.class) public void split_separatorBetweenTwoParts_returnsSplitParts(String addressSeparator) { // arrange String expectedLeft = "leftPart"; String expectedRight = "rightPart"; String input = expectedLeft + addressSeparator + expectedRight; // act String[] result = SeparatorFormat.split(input); // assert assertThat(result.length, is(equalTo(2))); assertThat(result[0], is(equalTo(expectedLeft))); assertThat(result[1], is(equalTo(expectedRight))); } /** * Tests that an input string consisting only of a separator returns two * empty strings after splitting. */ @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_ADDRESS_SEPARATOR, location = CommonDataProvider.class) public void split_inputEqualsSeparator_returnsEmptyStrings(String separator) { // arrange String input = separator; // act String[] result = SeparatorFormat.split(input); // assert assertThat(result.length, is(equalTo(2))); assertThat(result[0], is(equalTo(""))); assertThat(result[1], is(equalTo(""))); } /** * Tests that if no separator is present in the input, the original input is * returned as a single element. */ @Test public void split_noSeparatorInInput_returnsWholeInput() { // arrange String input = "justARegularString"; // act String[] result = SeparatorFormat.split(input); // assert assertThat(result.length, is(equalTo(1))); assertThat(result[0], is(equalTo(input))); } /** * Tests that the input is recursively split on all matching separators, * starting with the longest, respecting their defined priority. */ @Test public void split_inputWithMultipleValidSeparators_recursivelySplitsAll() { // arrange String input = "a" + SeparatorFormat.DOUBLE_COLON.getSymbol() + "b" + SeparatorFormat.SEMICOLON.getSymbol() + "c"; // act String[] result = SeparatorFormat.split(input); // assert assertThat(result.length, is(equalTo(3))); assertThat(result[0], is(equalTo("a"))); assertThat(result[1], is(equalTo("b"))); assertThat(result[2], is(equalTo("c"))); } /** * Tests that when multiple separators are present, the input is recursively * split by all applicable separators, starting with the longest. */ @Test public void split_multipleSeparatorsPresent_recursivelySplitsAll() { // arrange String input = "a" + SeparatorFormat.DOUBLE_COLON.getSymbol() + "b" + SeparatorFormat.COLON.getSymbol() + "c"; // act String[] result = SeparatorFormat.split(input); // assert assertThat(result.length, is(equalTo(3))); assertThat(result[0], is(equalTo("a"))); assertThat(result[1], is(equalTo("b"))); assertThat(result[2], is(equalTo("c"))); } /** * Tests that if the input starts and ends with a separator, the result * contains empty prefix and suffix parts. */ @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_ADDRESS_SEPARATOR, location = CommonDataProvider.class) public void split_inputStartsAndEndsWithSeparator_returnsEmptyAndMiddleAndEmpty(String separator) { // arrange String input = separator + "middle" + separator; // act String[] result = SeparatorFormat.split(input); // assert assertThat(result.length, is(equalTo(3))); assertThat(result[0], is(equalTo(""))); assertThat(result[1], is(equalTo("middle"))); assertThat(result[2], is(equalTo(""))); } /** * Verifies that the {@link SeparatorFormat#DOUBLE_COLON} separator appears * before the {@link SeparatorFormat#COLON} in the sorted separator list. */ @Test public void getSortedSeparators_doubleColonBeforeColon() { // act List sorted = SeparatorFormat.getSortedSeparators(); // assert int doubleColonIndex = sorted.indexOf(SeparatorFormat.DOUBLE_COLON); int colonIndex = sorted.indexOf(SeparatorFormat.COLON); assertThat(doubleColonIndex, is(lessThan(colonIndex))); } /** * Tests that when the separator appears at the end of the input, the last * part is returned as an empty string. */ @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_ADDRESS_SEPARATOR, location = CommonDataProvider.class) public void split_trailingSeparator_returnsEmptyLastPart(String separator) { // arrange String input = "value" + separator; // act String[] result = SeparatorFormat.split(input); // assert assertThat(result.length, is(equalTo(2))); assertThat(result[0], is(equalTo("value"))); assertThat(result[1], is(equalTo(""))); } /** * Tests that when the separator appears at the beginning of the input, the * first part is returned as an empty string. */ @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_ADDRESS_SEPARATOR, location = CommonDataProvider.class) public void split_leadingSeparator_returnsEmptyFirstPart(String separator) { // arrange String input = separator + "value"; // act String[] result = SeparatorFormat.split(input); // assert assertThat(result.length, is(equalTo(2))); assertThat(result[0], is(equalTo(""))); assertThat(result[1], is(equalTo("value"))); } /** * Verifies that every SeparatorFormat constant returns a non-null, * non-empty symbol. */ @Test public void getSymbol_eachSeparator_returnsExpectedString() { for (SeparatorFormat separator : SeparatorFormat.values()) { assertThat(separator.getSymbol(), is(notNullValue())); assertThat(separator.getSymbol().length(), is(greaterThan(0))); } } @Test public void allSeparators_areUnique() { long uniqueCount = Arrays.stream(SeparatorFormat.values()) .map(SeparatorFormat::getSymbol) .distinct() .count(); assertThat(uniqueCount, is(equalTo((long) SeparatorFormat.values().length))); } @Test public void split_spaceSeparator_surroundedByText_returnsParts() { String input = "left" + SeparatorFormat.SPACE.getSymbol() + "right"; String[] result = SeparatorFormat.split(input); assertThat(result.length, is(equalTo(2))); } @Test public void split_recursiveSplitting_allRelevantSeparatorsAreResolvedInOrder() { // arrange String input = "first" + SeparatorFormat.DOUBLE_COLON.getSymbol() + "second" + SeparatorFormat.COLON.getSymbol() + "third" + SeparatorFormat.PIPE.getSymbol() + "fourth"; // Expected splitting order: // 1. DOUBLE_COLON splits "first" and "second:third|fourth" // 2. COLON splits "second" and "third|fourth" // 3. PIPE splits "third" and "fourth" // // Expected output: ["first", "second", "third", "fourth"] // act String[] result = SeparatorFormat.split(input); // assert assertThat(result.length, is(equalTo(4))); assertThat(result[0], is(equalTo("first"))); assertThat(result[1], is(equalTo("second"))); assertThat(result[2], is(equalTo("third"))); assertThat(result[3], is(equalTo("fourth"))); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/StatisticsTest.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import org.junit.Test; public class StatisticsTest { // @Test public void createStatisticsMessage_statisticsGiven_returnExpectedStatisticsMessage() { // arrange Statistics statistics = new Statistics(); // act String result = statistics.createStatisticsMessage(234_000L, 999_000_000L, 345_000_000_000L, 4567L, 5678L, 6789L); // assert assertThat(result, is(equalTo("Statistics: [Checked 999 M keys in 3 minutes] [4269 k keys/second] [333 M keys/minute] [Times an empty consumer: 4567] [Average contains time: 345 ms] [keys queue size: 5678] [Hits: 6789]"))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/ToStringTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Marker annotation for tests that validate toString() implementations. */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface ToStringTest { } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/configuration/CKeyProducerJavaIncrementalTest.java ================================================ // @formatter:off /** * Copyright 2026 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; import java.math.BigInteger; import org.junit.Test; import net.ladenthin.bitcoinaddressfinder.BitHelper; import net.ladenthin.bitcoinaddressfinder.PublicKeyBytes; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; public class CKeyProducerJavaIncrementalTest { private static final String START_ADDRESS_CUSTOM_HEX = "FF"; private static final String END_ADDRESS_CUSTOM_HEX = "FF"; // @Test public void getStartAddress_defaultStartAddress_returnsMinValidPrivateKey() { // arrange CKeyProducerJavaIncremental sut = new CKeyProducerJavaIncremental(); // act BigInteger result = sut.getStartAddress(); // assert assertThat(result, is(equalTo(PublicKeyBytes.MIN_VALID_PRIVATE_KEY))); } @Test public void getStartAddress_customUppercaseHexStartAddress_returnsExpectedBigInteger() { // arrange CKeyProducerJavaIncremental sut = new CKeyProducerJavaIncremental(); sut.startAddress = START_ADDRESS_CUSTOM_HEX.toUpperCase(); // act BigInteger result = sut.getStartAddress(); // assert assertThat(result, is(equalTo(new BigInteger(START_ADDRESS_CUSTOM_HEX, BitHelper.RADIX_HEX)))); } @Test public void getStartAddress_customLowercaseHexStartAddress_returnsExpectedBigInteger() { // arrange CKeyProducerJavaIncremental sut = new CKeyProducerJavaIncremental(); sut.startAddress = START_ADDRESS_CUSTOM_HEX.toLowerCase(); // act BigInteger result = sut.getStartAddress(); // assert assertThat(result, is(equalTo(new BigInteger(START_ADDRESS_CUSTOM_HEX, BitHelper.RADIX_HEX)))); } @Test public void getStartAddress_maxPrivateKeyHexStartAddress_returnsMaxPrivateKey() { // arrange CKeyProducerJavaIncremental sut = new CKeyProducerJavaIncremental(); sut.startAddress = PublicKeyBytes.MAX_PRIVATE_KEY_HEX; // act BigInteger result = sut.getStartAddress(); // assert assertThat(result, is(equalTo(PublicKeyBytes.MAX_PRIVATE_KEY))); } // // @Test public void getEndAddress_defaultEndAddress_returnsMaxPrivateKey() { // arrange CKeyProducerJavaIncremental sut = new CKeyProducerJavaIncremental(); // act BigInteger result = sut.getEndAddress(); // assert assertThat(result, is(equalTo(PublicKeyBytes.MAX_PRIVATE_KEY))); } @Test public void getEndAddress_customUppercaseHexEndAddress_returnsExpectedBigInteger() { // arrange CKeyProducerJavaIncremental sut = new CKeyProducerJavaIncremental(); sut.endAddress = END_ADDRESS_CUSTOM_HEX.toUpperCase(); // act BigInteger result = sut.getEndAddress(); // assert assertThat(result, is(equalTo(new BigInteger(END_ADDRESS_CUSTOM_HEX, BitHelper.RADIX_HEX)))); } @Test public void getEndAddress_customLowercaseHexEndAddress_returnsExpectedBigInteger() { // arrange CKeyProducerJavaIncremental sut = new CKeyProducerJavaIncremental(); sut.endAddress = END_ADDRESS_CUSTOM_HEX.toLowerCase(); // act BigInteger result = sut.getEndAddress(); // assert assertThat(result, is(equalTo(new BigInteger(END_ADDRESS_CUSTOM_HEX, BitHelper.RADIX_HEX)))); } @Test public void getEndAddress_maxPrivateKeyHexEndAddress_returnsMaxPrivateKey() { // arrange CKeyProducerJavaIncremental sut = new CKeyProducerJavaIncremental(); sut.endAddress = PublicKeyBytes.MAX_PRIVATE_KEY_HEX; // act BigInteger result = sut.getEndAddress(); // assert assertThat(result, is(equalTo(PublicKeyBytes.MAX_PRIVATE_KEY))); } @Test public void getEndAddress_minValidPrivateKeyHexEndAddress_returnsMinValidPrivateKey() { // arrange CKeyProducerJavaIncremental sut = new CKeyProducerJavaIncremental(); sut.endAddress = PublicKeyBytes.MIN_VALID_PRIVATE_KEY_HEX; // act BigInteger result = sut.getEndAddress(); // assert assertThat(result, is(equalTo(PublicKeyBytes.MIN_VALID_PRIVATE_KEY))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/configuration/CProducerTest.java ================================================ // @formatter:off /** * Copyright 2024 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; import java.io.IOException; import net.ladenthin.bitcoinaddressfinder.BitHelper; import org.junit.Before; import org.junit.Test; public class CProducerTest { private final BitHelper bitHelper = new BitHelper(); @Before public void init() throws IOException { } // @Test public void batchSizeInBits_configurationConstantsSet_isValidDefaultValue() throws IOException { CProducer cProducer = new CProducer(); bitHelper.assertBatchSizeInBitsIsInRange(cProducer.batchSizeInBits); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/configuration/UnknownSecretFormatExceptionTest.java ================================================ // @formatter:off /** * Copyright 2026 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.configuration; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; import org.junit.Test; /** * Unit tests for {@link UnknownSecretFormatException}. */ public class UnknownSecretFormatExceptionTest { // @Test public void constructor_withBigInteger_messageContainsFormatName() { // arrange CSecretFormat secretFormat = CSecretFormat.BIG_INTEGER; // act UnknownSecretFormatException exception = new UnknownSecretFormatException(secretFormat); // assert assertThat(exception.getMessage(), containsString("BIG_INTEGER")); } @Test public void constructor_withSha256_messageContainsFormatName() { // arrange CSecretFormat secretFormat = CSecretFormat.SHA256; // act UnknownSecretFormatException exception = new UnknownSecretFormatException(secretFormat); // assert assertThat(exception.getMessage(), containsString("SHA256")); } @Test public void constructor_withStringDoSha256_messageContainsFormatName() { // arrange CSecretFormat secretFormat = CSecretFormat.STRING_DO_SHA256; // act UnknownSecretFormatException exception = new UnknownSecretFormatException(secretFormat); // assert assertThat(exception.getMessage(), containsString("STRING_DO_SHA256")); } @Test public void constructor_withDumpedPrivateKey_messageContainsFormatName() { // arrange CSecretFormat secretFormat = CSecretFormat.DUMPED_RIVATE_KEY; // act UnknownSecretFormatException exception = new UnknownSecretFormatException(secretFormat); // assert assertThat(exception.getMessage(), containsString("DUMPED_RIVATE_KEY")); } @Test public void constructor_withBigInteger_messageContainsExpectedPrefix() { // arrange CSecretFormat secretFormat = CSecretFormat.BIG_INTEGER; // act UnknownSecretFormatException exception = new UnknownSecretFormatException(secretFormat); // assert assertThat(exception.getMessage(), containsString("Unknown secret format:")); } @Test public void constructor_withBigInteger_messageEqualsExpected() { // arrange CSecretFormat secretFormat = CSecretFormat.BIG_INTEGER; // act UnknownSecretFormatException exception = new UnknownSecretFormatException(secretFormat); // assert assertThat(exception.getMessage(), is(equalTo("Unknown secret format: BIG_INTEGER"))); } @Test public void constructor_withSha256_messageEqualsExpected() { // arrange CSecretFormat secretFormat = CSecretFormat.SHA256; // act UnknownSecretFormatException exception = new UnknownSecretFormatException(secretFormat); // assert assertThat(exception.getMessage(), is(equalTo("Unknown secret format: SHA256"))); } @Test public void constructor_withBigInteger_isInstanceOfIllegalArgumentException() { // arrange CSecretFormat secretFormat = CSecretFormat.BIG_INTEGER; // act UnknownSecretFormatException exception = new UnknownSecretFormatException(secretFormat); // assert assertThat(exception, is(instanceOf(IllegalArgumentException.class))); } @Test public void constructor_withBigInteger_noCause() { // arrange CSecretFormat secretFormat = CSecretFormat.BIG_INTEGER; // act UnknownSecretFormatException exception = new UnknownSecretFormatException(secretFormat); // assert assertThat(exception.getCause(), is(nullValue())); } // // @Test public void getSecretFormat_withBigInteger_returnsSecretFormat() { // arrange CSecretFormat secretFormat = CSecretFormat.BIG_INTEGER; // act UnknownSecretFormatException exception = new UnknownSecretFormatException(secretFormat); CSecretFormat actual = exception.getSecretFormat(); // assert assertThat(actual, is(equalTo(secretFormat))); } @Test public void getSecretFormat_withSha256_returnsSecretFormat() { // arrange CSecretFormat secretFormat = CSecretFormat.SHA256; // act UnknownSecretFormatException exception = new UnknownSecretFormatException(secretFormat); CSecretFormat actual = exception.getSecretFormat(); // assert assertThat(actual, is(equalTo(secretFormat))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/eckey/Secp256k1Test.java ================================================ package net.ladenthin.bitcoinaddressfinder.eckey; import org.junit.Test; import java.math.BigInteger; import java.security.KeyFactory; import java.security.PrivateKey; import java.security.interfaces.ECPrivateKey; import java.security.interfaces.ECPublicKey; import java.security.spec.PKCS8EncodedKeySpec; import static net.ladenthin.bitcoinaddressfinder.eckey.Secp256k1.getPublicKey; import static net.ladenthin.bitcoinaddressfinder.eckey.Secp256k1.byteArrayToHexString; import static net.ladenthin.bitcoinaddressfinder.eckey.Secp256k1.hexStringToByteArray; import org.bitcoinj.crypto.ECKey; import org.bouncycastle.jce.ECNamedCurveTable; import org.bouncycastle.jce.spec.ECNamedCurveParameterSpec; public class Secp256k1Test { @Test public void testme() throws Exception { System.out.println("Generate ECPublicKey from PrivateKey (String) for curve secp256k1 (final)"); System.out.println("Check keys with https://gobittest.appspot.com/Address"); // https://gobittest.appspot.com/Address String privateKey = "D12D2FACA9AD92828D89683778CB8DFCCDBD6C9E92F6AB7D6065E8AACC1FF6D6"; String publicKeyExpected = "04661BA57FED0D115222E30FE7E9509325EE30E7E284D3641E6FB5E67368C2DB185ADA8EFC5DC43AF6BF474A41ED6237573DC4ED693D49102C42FFC88510500799"; System.out.println("\nprivatekey given : " + privateKey); System.out.println("publicKeyExpected: " + publicKeyExpected); // routine with bouncy castle System.out.println("\nGenerate PublicKey from PrivateKey with BouncyCastle"); ECNamedCurveParameterSpec spec = ECNamedCurveTable.getParameterSpec("secp256k1"); // this ec curve is used for bitcoin operations org.bouncycastle.math.ec.ECPoint pointQ = spec.getG().multiply(new BigInteger(1, hexStringToByteArray(privateKey))); byte[] publickKeyByte = pointQ.getEncoded(false); String publicKeyBc = byteArrayToHexString(publickKeyByte); System.out.println("publicKeyExpected: " + publicKeyExpected); System.out.println("publicKey BC : " + publicKeyBc); System.out.println("publicKeys match : " + publicKeyBc.contentEquals(publicKeyExpected)); // regeneration of ECPublicKey with java native starts here System.out.println("\nGenerate PublicKey from PrivateKey with Java native routines"); // the preset "303E.." only works for elliptic curve secp256k1 // see answer by user dave_thompson_085 // https://stackoverflow.com/questions/48832170/generate-ec-public-key-from-byte-array-private-key-in-native-java-7 String privateKeyFull = "303E020100301006072A8648CE3D020106052B8104000A042730250201010420" + privateKey; byte[] privateKeyFullByte = hexStringToByteArray(privateKeyFull); System.out.println("privateKey full : " + privateKeyFull); KeyFactory keyFactory = KeyFactory.getInstance("EC"); PrivateKey privateKeyNative = keyFactory.generatePrivate(new PKCS8EncodedKeySpec(privateKeyFullByte)); ECPrivateKey ecPrivateKeyNative = (ECPrivateKey) privateKeyNative; ECPublicKey ecPublicKeyNative = getPublicKey(ecPrivateKeyNative); byte[] ecPublicKeyNativeByte = ecPublicKeyNative.getEncoded(); String publicKeyNativeFull = byteArrayToHexString(ecPublicKeyNativeByte); String publicKeyNativeHeader = publicKeyNativeFull.substring(0, 46); String publicKeyNativeKey = publicKeyNativeFull.substring(46, 176); System.out.println("ecPublicKeyFull : " + publicKeyNativeFull); System.out.println("ecPublicKeyHeader: " + publicKeyNativeHeader); System.out.println("ecPublicKeyKey : " + publicKeyNativeKey); System.out.println("publicKeyExpected: " + publicKeyExpected); System.out.println("publicKeys match : " + publicKeyNativeKey.contentEquals(publicKeyExpected)); // ECKey ecKeyPre = ECKey.fromPrivateAndPrecalculatedPublic(hexStringToByteArray(privateKey), hexStringToByteArray(publicKeyNativeKey)); ECKey ecKeyFull = ECKey.fromPrivate(hexStringToByteArray(privateKey), false); byte[] ecKeyPrePubKeyHash = ecKeyPre.getPubKeyHash(); byte[] ecKeyPrePubKey = ecKeyPre.getPubKey(); byte[] ecKeyFullPubKeyHash = ecKeyFull.getPubKeyHash(); byte[] ecKeyFullPubKey = ecKeyFull.getPubKey(); System.out.println("---BLDEBUG---"); System.out.println("ecKeyPrePubKey : " + byteArrayToHexString(ecKeyPrePubKey)); System.out.println("ecKeyPrePubKeyHash : " + byteArrayToHexString(ecKeyPrePubKeyHash)); System.out.println("ecKeyFullPubKey: " + byteArrayToHexString(ecKeyFullPubKey)); System.out.println("ecKeyFullPubKeyHash: " + byteArrayToHexString(ecKeyFullPubKeyHash)); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/keyproducer/AbstractKeyProducerQueueBufferedTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import org.junit.Before; import org.junit.Test; import java.math.BigInteger; import net.ladenthin.bitcoinaddressfinder.ByteBufferUtility; import net.ladenthin.bitcoinaddressfinder.NetworkParameterFactory; import org.bitcoinj.base.Network; import static org.junit.Assert.assertEquals; import java.util.*; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import net.ladenthin.bitcoinaddressfinder.BitHelper; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import org.slf4j.Logger; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaReceiver; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.times; import static org.mockito.ArgumentMatchers.eq; public class AbstractKeyProducerQueueBufferedTest { private final Network network = new NetworkParameterFactory().getNetwork(); private final KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); private final BitHelper bitHelper = new BitHelper(); private Logger mockLogger; @Before public void setUp() { mockLogger = mock(Logger.class); } static class TestKeyProducer extends AbstractKeyProducerQueueBuffered { public TestKeyProducer(CKeyProducerJavaReceiver config, KeyUtility keyUtility, Logger logger) { super(config, keyUtility, logger); } public TestKeyProducer(CKeyProducerJavaReceiver config, KeyUtility keyUtility, Logger logger, BlockingQueue queue) { super(config, keyUtility, logger, queue); } @Override protected int getReadTimeout() { return TestTimeProvider.DEFAULT_SOCKET_TIMEOUT; } @Override public void interrupt() { shouldStop = true; } } private TestKeyProducer createTestKeyProducer(CKeyProducerJavaReceiver config) { return new TestKeyProducer(config, keyUtility, mockLogger); } @Test public void createSecrets_returnsSecret_whenAvailableInQueue() throws Exception { CKeyProducerJavaReceiver config = new CKeyProducerJavaReceiver(); TestKeyProducer producer = createTestKeyProducer(config); byte[] secret = new KeyProducerTestUtility().createFilledSecret((byte) 0xAB); BigInteger expectedSecret = new BigInteger(1, secret); producer.addSecret(secret); BigInteger[] secrets = producer.createSecrets(1, true); assertEquals(1, secrets.length); assertEquals(expectedSecret, secrets[0]); } @Test public void createSecrets_readsMultipleSecrets() throws Exception { CKeyProducerJavaReceiver config = new CKeyProducerJavaReceiver(); TestKeyProducer producer = createTestKeyProducer(config); byte[] secret = new KeyProducerTestUtility().createFilledSecret((byte) 0xAB); BigInteger expectedSecret = new BigInteger(1, secret); producer.addSecret(secret); producer.addSecret(secret); BigInteger[] secrets = producer.createSecrets(2, false); assertEquals(2, secrets.length); for (BigInteger bi : secrets) { assertEquals(expectedSecret, bi); } } @Test(expected = NoMoreSecretsAvailableException.class) public void createSecrets_throwsException_onInvalidLength() throws Exception { CKeyProducerJavaReceiver config = new CKeyProducerJavaReceiver(); TestKeyProducer producer = createTestKeyProducer(config); byte[] invalidSecret = new KeyProducerTestUtility().createInvalidSecret(); producer.addSecret(invalidSecret); producer.createSecrets(1, true); // should throw } @Test(expected = NoMoreSecretsAvailableException.class) public void createSecrets_throwsException_onTimeout() throws Exception { CKeyProducerJavaReceiver config = new CKeyProducerJavaReceiver(); TestKeyProducer producer = createTestKeyProducer(config); // Do not add anything to queue producer.createSecrets(1, true); // should timeout } @Test(expected = NoMoreSecretsAvailableException.class) public void createSecrets_throwsException_whenShouldStopSet() throws Exception { CKeyProducerJavaReceiver config = new CKeyProducerJavaReceiver(); TestKeyProducer producer = createTestKeyProducer(config); producer.shouldStop = true; producer.createSecrets(1, true); // should throw immediately } @Test public void createSecrets_logsSecret_whenEnabled() throws Exception { CKeyProducerJavaReceiver config = new CKeyProducerJavaReceiver(); config.logReceivedSecret = true; TestKeyProducer producer = createTestKeyProducer(config); byte[] secret = new KeyProducerTestUtility().createFilledSecret((byte) 0xAB); BigInteger expectedSecret = new BigInteger(1, secret); String expectedHex = keyUtility.bigIntegerToFixedLengthHex(expectedSecret); producer.addSecret(secret); producer.createSecrets(1, true); // Verify that logger.info was called with the expected message verify(mockLogger, times(1)).info(eq("Received key: {}"), eq(expectedHex)); } @Test() public void addSecret_throwsWhenQueueFull() { CKeyProducerJavaReceiver config = new CKeyProducerJavaReceiver(); BlockingQueue queue = new LinkedBlockingQueue<>(1); TestKeyProducer producer = new TestKeyProducer(config, keyUtility, mockLogger, queue); byte[] secret = new KeyProducerTestUtility().createFilledSecret((byte) 0xAB); producer.addSecret(secret); // fills queue producer.addSecret(secret); // must fail verify(mockLogger).error( eq("Secret queue is full, ignore secret: {}"), eq(secret) ); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/keyproducer/ConnectionUtilsTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.net.ServerSocket; import java.util.concurrent.*; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; public class ConnectionUtilsTest { private ExecutorService executorService; @Before public void setup() { executorService = Executors.newCachedThreadPool(); } @After public void teardown() { executorService.shutdownNow(); } private int findFreePort() { try (ServerSocket socket = new ServerSocket(0)) { return socket.getLocalPort(); } catch (Exception e) { throw new RuntimeException(e); } } @Test public void waitUntilTcpPortOpen_whenServerAlreadyListening_returnsImmediately() throws Exception { int port = findFreePort(); try (ServerSocket serverSocket = new ServerSocket(port)) { long start = System.currentTimeMillis(); ConnectionUtils.waitUntilTcpPortOpen("localhost", port, 2000); long duration = System.currentTimeMillis() - start; // Should return very quickly (< 500ms) assertThat("waitUntilTcpPortOpen should return quickly when port is open", duration, lessThan(500L)); } } @Test public void waitUntilTcpPortOpen_whenServerStartsLate_returnsAfterStart() throws Exception { int port = findFreePort(); // Delay server start by 1 second executorService.submit(() -> { Thread.sleep(1000); try (ServerSocket serverSocket = new ServerSocket(port)) { Thread.sleep(1000); // Keep it open for a bit } return null; }); long start = System.currentTimeMillis(); ConnectionUtils.waitUntilTcpPortOpen("localhost", port, 3000); long duration = System.currentTimeMillis() - start; // Should return after ~1 second assertThat("waitUntilTcpPortOpen should return after port becomes available", duration, greaterThanOrEqualTo(900L)); assertThat(duration, lessThan(2500L)); // with some margin } @Test(expected = IllegalStateException.class) public void waitUntilTcpPortOpen_whenPortNeverOpens_throwsException() throws Exception { int unusedPort = findFreePort(); // Do not bind anything to this port ConnectionUtils.waitUntilTcpPortOpen("localhost", unusedPort, 1000); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerIdIsNotUniqueExceptionTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; import org.junit.Test; /** * Unit tests for {@link KeyProducerIdIsNotUniqueException}. */ public class KeyProducerIdIsNotUniqueExceptionTest { // @Test public void constructor_withId_messageContainsId() { // arrange String id = "myProducerId"; // act KeyProducerIdIsNotUniqueException exception = new KeyProducerIdIsNotUniqueException(id); // assert assertThat(exception.getMessage(), containsString(id)); } @Test public void constructor_withId_messageContainsExpectedPrefix() { // arrange String id = "anyId"; // act KeyProducerIdIsNotUniqueException exception = new KeyProducerIdIsNotUniqueException(id); // assert assertThat(exception.getMessage(), containsString("unique")); } @Test public void constructor_withId_messageEqualsExpected() { // arrange String id = "myProducerId"; // act KeyProducerIdIsNotUniqueException exception = new KeyProducerIdIsNotUniqueException(id); // assert assertThat(exception.getMessage(), is(equalTo("Key producer id must be unique: " + id))); } @Test public void constructor_withId_isInstanceOfRuntimeException() { // arrange String id = "anyId"; // act KeyProducerIdIsNotUniqueException exception = new KeyProducerIdIsNotUniqueException(id); // assert assertThat(exception, is(instanceOf(RuntimeException.class))); } @Test public void constructor_withId_noCause() { // arrange String id = "anyId"; // act KeyProducerIdIsNotUniqueException exception = new KeyProducerIdIsNotUniqueException(id); // assert assertThat(exception.getCause(), is(nullValue())); } // // @Test public void getId_withId_returnsId() { // arrange String id = "producerAlpha"; // act KeyProducerIdIsNotUniqueException exception = new KeyProducerIdIsNotUniqueException(id); String actual = exception.getId(); // assert assertThat(actual, is(equalTo(id))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerIdNullExceptionTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; import org.junit.Test; /** * Unit tests for {@link KeyProducerIdNullException}. */ public class KeyProducerIdNullExceptionTest { // @Test public void constructor_noArg_messageContainsNull() { // act KeyProducerIdNullException exception = new KeyProducerIdNullException(); // assert assertThat(exception.getMessage(), containsString("null")); } @Test public void constructor_noArg_messageEqualsExpected() { // act KeyProducerIdNullException exception = new KeyProducerIdNullException(); // assert assertThat(exception.getMessage(), is(equalTo("Key producer id must not be null."))); } @Test public void constructor_noArg_isInstanceOfRuntimeException() { // act KeyProducerIdNullException exception = new KeyProducerIdNullException(); // assert assertThat(exception, is(instanceOf(RuntimeException.class))); } @Test public void constructor_noArg_noCause() { // act KeyProducerIdNullException exception = new KeyProducerIdNullException(); // assert assertThat(exception.getCause(), is(nullValue())); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerIdUnknownExceptionTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; import org.junit.Test; /** * Unit tests for {@link KeyProducerIdUnknownException}. */ public class KeyProducerIdUnknownExceptionTest { // @Test public void constructor_withId_messageContainsId() { // arrange String id = "unknownProducer"; // act KeyProducerIdUnknownException exception = new KeyProducerIdUnknownException(id); // assert assertThat(exception.getMessage(), containsString(id)); } @Test public void constructor_withId_messageContainsExpectedPrefix() { // arrange String id = "anyId"; // act KeyProducerIdUnknownException exception = new KeyProducerIdUnknownException(id); // assert assertThat(exception.getMessage(), containsString("unknown")); } @Test public void constructor_withId_messageEqualsExpected() { // arrange String id = "unknownProducer"; // act KeyProducerIdUnknownException exception = new KeyProducerIdUnknownException(id); // assert assertThat(exception.getMessage(), is(equalTo("Key producer id is unknown: " + id))); } @Test public void constructor_withId_isInstanceOfRuntimeException() { // arrange String id = "anyId"; // act KeyProducerIdUnknownException exception = new KeyProducerIdUnknownException(id); // assert assertThat(exception, is(instanceOf(RuntimeException.class))); } @Test public void constructor_withId_noCause() { // arrange String id = "anyId"; // act KeyProducerIdUnknownException exception = new KeyProducerIdUnknownException(id); // assert assertThat(exception.getCause(), is(nullValue())); } @Test public void constructor_withNullId_messageContainsNull() { // act KeyProducerIdUnknownException exception = new KeyProducerIdUnknownException(null); // assert assertThat(exception.getMessage(), containsString("null")); } // // @Test public void getId_withId_returnsId() { // arrange String id = "unknownProducer"; // act KeyProducerIdUnknownException exception = new KeyProducerIdUnknownException(id); String actual = exception.getId(); // assert assertThat(actual, is(equalTo(id))); } @Test public void getId_withNullId_returnsNull() { // act KeyProducerIdUnknownException exception = new KeyProducerIdUnknownException(null); String actual = exception.getId(); // assert assertThat(actual, is(nullValue())); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerJavaBip39Test.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import java.math.BigInteger; import net.ladenthin.bitcoinaddressfinder.BitHelper; import net.ladenthin.bitcoinaddressfinder.ByteBufferUtility; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import net.ladenthin.bitcoinaddressfinder.NetworkParameterFactory; import net.ladenthin.bitcoinaddressfinder.PublicKeyBytes; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaBip39; import org.bitcoinj.base.Network; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import org.junit.Before; import org.junit.Test; import static org.mockito.Mockito.mock; import org.slf4j.Logger; public class KeyProducerJavaBip39Test { private final Network network = new NetworkParameterFactory().getNetwork(); private final KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); private final BitHelper bitHelper = new BitHelper(); private Logger mockLogger; String keyProducerId = "exampleId"; @Before public void setUp() { mockLogger = mock(Logger.class); } private KeyProducerJavaBip39 createKeyProducerJavaBip39(CKeyProducerJavaBip39 config) { return new KeyProducerJavaBip39(config, keyUtility, bitHelper, mockLogger); } private BigInteger[] generateSecrets() throws NoMoreSecretsAvailableException { CKeyProducerJavaBip39 config = new CKeyProducerJavaBip39(); config.keyProducerId = keyProducerId; config.privateKeyMaxNumBits = PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS; config.mnemonic = CKeyProducerJavaBip39.DEFAULT_MNEMONIC; config.passphrase = ""; config.creationTimeSeconds = 0L; config.hardened = false; KeyProducerJavaBip39 producer = createKeyProducerJavaBip39(config); return producer.createSecrets(bitHelper.convertBitsToSize(0), true); } @Test public void testBip39() throws NoMoreSecretsAvailableException { BigInteger[] result = generateSecrets(); assertThat(result.length, is(equalTo(1))); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerJavaIncrementalTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import java.math.BigInteger; import net.ladenthin.bitcoinaddressfinder.*; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaIncremental; import static org.junit.Assert.fail; import org.bitcoinj.base.Network; import org.junit.Before; import org.junit.Test; import static org.mockito.Mockito.mock; import org.slf4j.Logger; /** * Tests for KeyProducerJavaIncremental with respect to key range boundaries and batch handling. * *

Behavior Matrix for createSecrets(batchSize, returnStartSecretOnly=false): * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
ScenariocurrentValue positionBatch SizeBatch fully within range?Expected ResultException?Related Test(s)
1. Start of range, batch fitsAt startAddress (min)≤ keys remainingYesReturns full batch sequential keysNocreateSecrets_returnStartSecretOnlyFalse_returnsBatchSecrets,
createSecrets_currentValueAdvancesByBatchSize
2. Inside range, batch fitsInside range (between start and end)≤ keys remainingYesReturns full batch sequential keysNocreateSecrets_currentValueAdvancesByBatchSize
3. Inside range, partial batchInside range (between start and end)Partial batch (batch size > keys remaining)NoThrows NoMoreSecretsAvailableExceptionYescreateSecrets_threeBatches_twoElementsEach_thirdThrowsException
4. At end, batch size = 1, returnStartSecretOnly=trueAt endAddress (max)1Yes (single key)Returns single key (currentValue)NocreateSecrets_returnStartSecretOnlyTrue_returnsOneSecret
5. At end, batch size > 1, partial batch not allowedAt endAddress (max)Batch size > 1No (batch overruns end)Throws NoMoreSecretsAvailableExceptionYescreateSecrets_endAddressInclusive_butPartialBatchNotAllowed_throwsException
6. Beyond end addressBeyond endAddressAnyN/AThrows NoMoreSecretsAvailableException immediatelyYescreateSecrets_startExceedsEnd_throwsException
7. End address exactly on batch boundaryAt endAddress (max)Batch size divides range exactlyYesReturns all batches fullyNocreateSecrets_endAddressExactlyAtBatchBoundary_allBatchesValid
8. Partial batch allowed with returnStartSecretOnly=true at endAt endAddress (max)Batch size > keys remainingNoReturns single start key without exceptionNocreateSecrets_endAddressInclusive_partialBatchAllowedWithReturnStartOnly_noException
9. Batch larger than keys before end (batchExceedsEnd)Inside range or startBatch size > keys remainingNoThrows NoMoreSecretsAvailableExceptionYescreateSecrets_batchExceedsEnd_throwsException
* *

Note: When returnStartSecretOnly=true, only the starting key of the batch is returned * regardless of batch size, allowing partial batch retrieval without exception. */ public class KeyProducerJavaIncrementalTest { private final Network network = new NetworkParameterFactory().getNetwork(); private final ByteBufferUtility byteBufferUtility = new ByteBufferUtility(true); private KeyUtility keyUtility; private BitHelper bitHelper; private String startHex; private String endHex; private Logger mockLogger; @Before public void setUp() { keyUtility = new KeyUtility(network, byteBufferUtility); bitHelper = new BitHelper(); startHex = PublicKeyBytes.MIN_VALID_PRIVATE_KEY_HEX; endHex = "000000000000000000000000000000000000000000000000000000000000000A"; mockLogger = mock(Logger.class); } private KeyProducerJavaIncremental createKeyProducerJavaIncremental(String start, String end) { CKeyProducerJavaIncremental config = new CKeyProducerJavaIncremental(); config.startAddress = start; config.endAddress = end; return new KeyProducerJavaIncremental(config, keyUtility, bitHelper, mockLogger); } /** * Verifies that when requesting only the start secret, exactly one secret is returned, * regardless of batch size. This is important for scenarios where only the initial key is needed. */ @Test public void createSecrets_returnStartSecretOnlyTrue_returnsOneSecret() throws Exception { KeyProducerJavaIncremental producer = createKeyProducerJavaIncremental(startHex, endHex); BigInteger[] secrets = producer.createSecrets(5, true); assertThat(secrets.length, is(equalTo(1))); assertThat(secrets[0], is(equalTo(new BigInteger(startHex, BitHelper.RADIX_HEX)))); } /** * Tests that when requesting a full batch of secrets, the returned array has the requested batch size, * and that the keys are sequential starting from the configured start address. */ @Test public void createSecrets_returnStartSecretOnlyFalse_returnsBatchSecrets() throws Exception { KeyProducerJavaIncremental producer = createKeyProducerJavaIncremental(startHex, endHex); int batchSize = 5; BigInteger[] secrets = producer.createSecrets(batchSize, false); assertThat(secrets.length, is(equalTo(batchSize))); BigInteger expected = new BigInteger(startHex, BitHelper.RADIX_HEX); for (int i = 0; i < batchSize; i++) { assertThat(secrets[i], is(equalTo(expected))); expected = expected.add(BigInteger.ONE); } } /** * Ensures that if the start key is greater than the configured end key, * the method immediately throws NoMoreSecretsAvailableException. * This prevents invalid key ranges. */ @Test(expected = NoMoreSecretsAvailableException.class) public void createSecrets_startExceedsEnd_throwsException() throws Exception { KeyProducerJavaIncremental producer = createKeyProducerJavaIncremental( "0000000000000000000000000000000000000000000000000000000000000010", "0000000000000000000000000000000000000000000000000000000000000005" ); producer.createSecrets(1, true); } /** * Tests that requesting a batch larger than the available keys before the end address * causes a NoMoreSecretsAvailableException to be thrown. */ @Test(expected = NoMoreSecretsAvailableException.class) public void createSecrets_batchExceedsEnd_throwsException() throws Exception { KeyProducerJavaIncremental producer = createKeyProducerJavaIncremental( startHex, "0000000000000000000000000000000000000000000000000000000000000003" ); producer.createSecrets(5, false); } /** * Verifies that the internal currentValue advances exactly by the batch size * after each call to createSecrets, ensuring consistent sequential key generation. */ @Test public void createSecrets_currentValueAdvancesByBatchSize() throws Exception { KeyProducerJavaIncremental producer = createKeyProducerJavaIncremental(startHex, endHex); int batchSize = 3; BigInteger expectedFirstBatchStart = new BigInteger(startHex, BitHelper.RADIX_HEX); BigInteger[] secrets1 = producer.createSecrets(batchSize, false); verifySecrets(secrets1, expectedFirstBatchStart); BigInteger expectedSecondBatchStart = expectedFirstBatchStart.add(BigInteger.valueOf(batchSize)); BigInteger[] secrets2 = producer.createSecrets(batchSize, false); verifySecrets(secrets2, expectedSecondBatchStart); } private void verifySecrets(BigInteger[] secrets, BigInteger expectedStart) { for (int i = 0; i < secrets.length; i++) { assertThat(secrets[i], is(equalTo(expectedStart.add(BigInteger.valueOf(i))))); } } /** * Tests the case where the end address is exactly at the boundary of a batch. * Confirms that all batches complete successfully without exceptions. */ @Test public void createSecrets_endAddressExactlyAtBatchBoundary_allBatchesValid() throws Exception { // Setup: start=1, end=4 (allowed keys: 1, 2, 3, 4) KeyProducerJavaIncremental producer = createKeyProducerJavaIncremental( "0000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000004" ); int batchSize = 2; // 1st batch: [1, 2] BigInteger[] batch1 = producer.createSecrets(batchSize, false); assertThat(batch1.length, is(equalTo(batchSize))); assertThat(batch1[0], is(equalTo(BigInteger.ONE))); assertThat(batch1[1], is(equalTo(BigInteger.TWO))); // 2nd batch: [3, 4] BigInteger[] batch2 = producer.createSecrets(batchSize, false); assertThat(batch2.length, is(equalTo(batchSize))); assertThat(batch2[0], is(equalTo(BigInteger.valueOf(3)))); assertThat(batch2[1], is(equalTo(BigInteger.valueOf(4)))); } /** * Tests that if a batch would partially exceed the end address, an exception is thrown. * This test confirms partial batches are not allowed when returnStartSecretOnly is false. */ @Test(expected = NoMoreSecretsAvailableException.class) public void createSecrets_threeBatches_twoElementsEach_thirdThrowsException() throws Exception { // Setup: start = 1, end = 5 (allowed keys: 1, 2, 3, 4, 5) KeyProducerJavaIncremental producer = createKeyProducerJavaIncremental( "0000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000004" ); int batchSize = 2; assertTwoBatchedOk(producer, batchSize); // 3rd batch: should throw NoMoreSecretsAvailableException because // the next values would be 5 and 6, but 6 exceeds the end address producer.createSecrets(batchSize, false); } /** * Similar to above, but with the end address included. * Demonstrates that partial batches beyond the end are disallowed and cause an exception, * even if the end address itself is technically within the allowed range. */ @Test(expected = NoMoreSecretsAvailableException.class) public void createSecrets_endAddressInclusive_butPartialBatchNotAllowed_throwsException() throws Exception { // Setup: start=1, end=5 (allowed keys: 1, 2, 3, 4, 5) KeyProducerJavaIncremental producer = createKeyProducerJavaIncremental( "0000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000005" ); int batchSize = 2; assertTwoBatchedOk(producer, batchSize); // 3rd batch: tries [5, 6], but 6 > end (5), so exception thrown producer.createSecrets(batchSize, false); } /** * Tests that if partial batches are allowed by setting returnStartSecretOnly=true, * the last single key within the range can still be retrieved without exception, * even if a full batch would exceed the end address. */ @Test public void createSecrets_endAddressInclusive_partialBatchAllowedWithReturnStartOnly_noException() throws Exception { // Setup: start=1, end=5 (allowed keys: 1, 2, 3, 4, 5) KeyProducerJavaIncremental producer = createKeyProducerJavaIncremental( "0000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000005" ); int batchSize = 2; assertTwoBatchedOk(producer, batchSize); // 3rd batch: returnStartSecretOnly = true, so only start value [5] is returned without exception BigInteger[] batch3 = producer.createSecrets(batchSize, true); assertThat(batch3.length, is(equalTo(1))); assertThat(batch3[0], is(equalTo(BigInteger.valueOf(5)))); } private void assertTwoBatchedOk(KeyProducerJavaIncremental producer, int batchSize) { try { // 1st batch: [1, 2] – OK BigInteger[] batch1 = producer.createSecrets(batchSize, false); assertThat(batch1.length, is(equalTo(batchSize))); assertThat(batch1[0], is(equalTo(BigInteger.ONE))); assertThat(batch1[1], is(equalTo(BigInteger.TWO))); // 2nd batch: [3, 4] – OK BigInteger[] batch2 = producer.createSecrets(batchSize, false); assertThat(batch2.length, is(equalTo(batchSize))); assertThat(batch2[0], is(equalTo(BigInteger.valueOf(3)))); assertThat(batch2[1], is(equalTo(BigInteger.valueOf(4)))); } catch (NoMoreSecretsAvailableException e) { fail("Exception thrown too early: " + e.getMessage()); } } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerJavaRandomTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.math.BigInteger; import net.ladenthin.bitcoinaddressfinder.BitHelper; import net.ladenthin.bitcoinaddressfinder.ByteBufferUtility; import net.ladenthin.bitcoinaddressfinder.CommonDataProvider; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import net.ladenthin.bitcoinaddressfinder.NetworkParameterFactory; import net.ladenthin.bitcoinaddressfinder.PublicKeyBytes; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaRandom; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaRandomInstance; import org.bitcoinj.base.Network; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import org.jspecify.annotations.Nullable; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import static org.mockito.Mockito.mock; import org.slf4j.Logger; @RunWith(DataProviderRunner.class) public class KeyProducerJavaRandomTest { private final Network network = new NetworkParameterFactory().getNetwork(); private final KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); private final BitHelper bitHelper = new BitHelper(); private Logger mockLogger; String keyProducerId = "exampleId"; @Before public void setUp() { mockLogger = mock(Logger.class); } private KeyProducerJavaRandom createKeyProducerJavaRandom(CKeyProducerJavaRandom cKeyProducerJavaRandom) { return new KeyProducerJavaRandom(cKeyProducerJavaRandom, keyUtility, bitHelper, mockLogger); } // @Test public void createSecrets_parameterBatchSizeInBitsZeroAndReturnStartSecretOnlyTrue_returnExpectedSecrets() throws NoMoreSecretsAvailableException { // arrange CKeyProducerJavaRandom cKeyProducerJavaRandom = new CKeyProducerJavaRandom(); cKeyProducerJavaRandom.keyProducerId = keyProducerId; cKeyProducerJavaRandom.keyProducerJavaRandomInstance = CKeyProducerJavaRandomInstance.RANDOM_CUSTOM_SEED; cKeyProducerJavaRandom.customSeed = 0L; cKeyProducerJavaRandom.privateKeyMaxNumBits = PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS; KeyProducerJavaRandom keyProducerJavaRandom = createKeyProducerJavaRandom(cKeyProducerJavaRandom); int overallWorkSize = bitHelper.convertBitsToSize(0); // act BigInteger[] result = keyProducerJavaRandom.createSecrets(overallWorkSize, true); // assert assertThat(result.length, is(equalTo(1))); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_BIT_SIZES_AT_MOST_MAX, location = CommonDataProvider.class) public void createSecrets_parameterBatchSizeInBitsFromDataProviderAndReturnStartSecretOnlyTrue_returnExpectedSecrets(int batchSizeInBits) throws NoMoreSecretsAvailableException { // arrange CKeyProducerJavaRandom cKeyProducerJavaRandom = new CKeyProducerJavaRandom(); cKeyProducerJavaRandom.keyProducerId = keyProducerId; cKeyProducerJavaRandom.keyProducerJavaRandomInstance = CKeyProducerJavaRandomInstance.RANDOM_CUSTOM_SEED; cKeyProducerJavaRandom.customSeed = 0L; cKeyProducerJavaRandom.privateKeyMaxNumBits = PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS; KeyProducerJavaRandom keyProducerJavaRandom = createKeyProducerJavaRandom(cKeyProducerJavaRandom); int overallWorkSize = bitHelper.convertBitsToSize(batchSizeInBits); // act BigInteger[] result = keyProducerJavaRandom.createSecrets(overallWorkSize, true); // assert assertThat(result.length, is(equalTo(1))); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_BIT_SIZES_AT_MOST_MAX, location = CommonDataProvider.class) public void createSecrets_parameterBatchSizeInBitsFromDataProviderAndReturnStartSecretOnlyFalse_returnExpectedSecrets(int batchSizeInBits) throws NoMoreSecretsAvailableException { // arrange CKeyProducerJavaRandom cKeyProducerJavaRandom = new CKeyProducerJavaRandom(); cKeyProducerJavaRandom.keyProducerId = keyProducerId; cKeyProducerJavaRandom.keyProducerJavaRandomInstance = CKeyProducerJavaRandomInstance.RANDOM_CUSTOM_SEED; cKeyProducerJavaRandom.customSeed = 0L; cKeyProducerJavaRandom.privateKeyMaxNumBits = PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS; KeyProducerJavaRandom keyProducerJavaRandom = createKeyProducerJavaRandom(cKeyProducerJavaRandom); int overallWorkSize = bitHelper.convertBitsToSize(batchSizeInBits); // act BigInteger[] result = keyProducerJavaRandom.createSecrets(overallWorkSize, false); // assert assertThat(result.length, is(equalTo(bitHelper.convertBitsToSize(batchSizeInBits)))); } // // private BigInteger[] generateSecrets(CKeyProducerJavaRandomInstance instance, @Nullable Long customSeed) throws NoMoreSecretsAvailableException { CKeyProducerJavaRandom config = new CKeyProducerJavaRandom(); config.keyProducerId = keyProducerId; config.keyProducerJavaRandomInstance = instance; config.customSeed = customSeed; config.privateKeyMaxNumBits = PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS; KeyProducerJavaRandom producer = createKeyProducerJavaRandom(config); return producer.createSecrets(bitHelper.convertBitsToSize(0), true); } @Test public void testSecureRandom() throws NoMoreSecretsAvailableException { BigInteger[] result = generateSecrets(CKeyProducerJavaRandomInstance.SECURE_RANDOM, null); assertThat(result.length, is(equalTo(1))); } @Test public void testRandomSeedCurrentTimeMillis() throws NoMoreSecretsAvailableException { BigInteger[] result = generateSecrets(CKeyProducerJavaRandomInstance.RANDOM_CURRENT_TIME_MILLIS_SEED, null); assertThat(result.length, is(equalTo(1))); } @Test public void testRandomCustomSeed_default() throws NoMoreSecretsAvailableException { BigInteger[] result = generateSecrets(CKeyProducerJavaRandomInstance.RANDOM_CUSTOM_SEED, null); assertThat(result.length, is(equalTo(1))); } @Test public void testRandomCustomSeed_fixed() throws NoMoreSecretsAvailableException { BigInteger[] result = generateSecrets(CKeyProducerJavaRandomInstance.RANDOM_CUSTOM_SEED, 123456789L); assertThat(result.length, is(equalTo(1))); } @Test public void testSha1Prng_default() throws NoMoreSecretsAvailableException { BigInteger[] result = generateSecrets(CKeyProducerJavaRandomInstance.SHA1_PRNG, null); assertThat(result.length, is(equalTo(1))); } @Test public void testSha1Prng_fixed() throws NoMoreSecretsAvailableException { BigInteger[] result = generateSecrets(CKeyProducerJavaRandomInstance.SHA1_PRNG, 987654321L); assertThat(result.length, is(equalTo(1))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerJavaSocketTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import java.io.DataInputStream; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaSocket; import org.jspecify.annotations.Nullable; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.io.DataOutputStream; import java.io.IOException; import java.math.BigInteger; import java.net.ServerSocket; import java.net.Socket; import java.net.SocketTimeoutException; import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicInteger; import net.ladenthin.bitcoinaddressfinder.BitHelper; import net.ladenthin.bitcoinaddressfinder.ByteBufferUtility; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import net.ladenthin.bitcoinaddressfinder.NetworkParameterFactory; import net.ladenthin.bitcoinaddressfinder.PublicKeyBytes; import org.bitcoinj.base.Network; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; import org.junit.runner.RunWith; import static org.junit.Assert.fail; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.mockito.Mockito.*; import org.slf4j.Logger; @RunWith(DataProviderRunner.class) public class KeyProducerJavaSocketTest { private final Network network = new NetworkParameterFactory().getNetwork(); private final KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); private final BitHelper bitHelper = new BitHelper(); private ExecutorService executorService; private Logger mockLogger; public static int findFreePort() { try (ServerSocket socket = new ServerSocket(0)) { return socket.getLocalPort(); } catch (IOException e) { throw new RuntimeException(e); } } @Before public void setup() { executorService = Executors.newCachedThreadPool(); mockLogger = mock(Logger.class); } @After public void teardown() { executorService.shutdownNow(); } private CKeyProducerJavaSocket createServerConfig(int port) { CKeyProducerJavaSocket config = new CKeyProducerJavaSocket(); config.mode = CKeyProducerJavaSocket.Mode.SERVER; config.port = port; return config; } private CKeyProducerJavaSocket createClientConfig(String host, int port) { CKeyProducerJavaSocket config = new CKeyProducerJavaSocket(); config.mode = CKeyProducerJavaSocket.Mode.CLIENT; config.host = host; config.port = port; return config; } @Test public void testServerReadsSecretWithoutReset() throws Exception { int port = findFreePort(); CountDownLatch serverStarted = new CountDownLatch(1); Future serverFuture = executorService.submit(() -> { try (ServerSocket serverSocket = new ServerSocket(port)) { serverStarted.countDown(); // only now signal ready try (Socket socket = serverSocket.accept(); DataInputStream in = new DataInputStream(socket.getInputStream())) { byte[] buffer = new byte[PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES]; in.readFully(buffer); // exactly 32 bytes } } return null; }); serverStarted.await(); // wait for real readiness try (Socket clientSocket = new Socket("localhost", port); DataOutputStream out = new DataOutputStream(clientSocket.getOutputStream())) { byte[] secret = new KeyProducerTestUtility().createZeroedSecret(); out.write(secret); out.flush(); } serverFuture.get(TestTimeProvider.DEFAULT_SOCKET_TIMEOUT, TimeUnit.MILLISECONDS); } @Test public void openCloseConnection_serverMode_success() throws Exception { int port = findFreePort(); CountDownLatch serverReadyLatch = new CountDownLatch(1); // Set up server CKeyProducerJavaSocket serverConfig = createServerConfig(port); serverConfig.timeout = TestTimeProvider.DEFAULT_SOCKET_TIMEOUT; serverConfig.readRetryCount = TestTimeProvider.DEFAULT_RETRY_COUNT; serverConfig.connectionRetryCount = TestTimeProvider.DEFAULT_CONNECTION_RETRY_COUNT; serverConfig.retryDelayMillisConnect = TestTimeProvider.SHORT_DELAY; serverConfig.retryDelayMillisRead = TestTimeProvider.SHORT_DELAY; KeyProducerJavaSocket serverKeyProducer = new KeyProducerJavaSocket(serverConfig, keyUtility, bitHelper, mockLogger); // Server thread: start createSecrets(1, true) Future serverFuture = executorService.submit(() -> { try { serverReadyLatch.countDown(); // Signal readiness serverKeyProducer.createSecrets(1, true); // Reads 32 bytes, then exits } catch (NoMoreSecretsAvailableException e) { fail("Server failed to read secret: " + e.getMessage()); } return null; }); // Wait until server is accepting serverReadyLatch.await(); waitUntilPortOpen(TestTimeProvider.DEFAULT_ESTABLISH_DELAY); // Client: connect and send exactly 1 secret try (Socket clientSocket = new Socket(serverConfig.host, serverConfig.port); DataOutputStream out = new DataOutputStream(clientSocket.getOutputStream())) { byte[] secret = new KeyProducerTestUtility().createZeroedSecret(); out.write(secret); out.flush(); // Wait briefly to let server finish reading Thread.sleep(TestTimeProvider.SHORT_DELAY); } // Wait for server to complete serverFuture.get(TestTimeProvider.DEFAULT_SOCKET_TIMEOUT, TimeUnit.MILLISECONDS); serverKeyProducer.interrupt(); } private void waitUntilPortOpen(int timeoutMillis) throws Exception { Thread.sleep(timeoutMillis); } @Test public void openCloseConnection_serverClient_success() throws Exception { int port = findFreePort(); // Start server thread that accepts connection but does nothing ServerSocket serverSocket = new ServerSocket(port); Future serverFuture = executorService.submit(() -> { try (Socket s = serverSocket.accept()) { // Just accept and hold open Thread.sleep(TestTimeProvider.DEFAULT_TIMEOUT); } return null; }); // Client config to connect CKeyProducerJavaSocket clientConfig = createClientConfig("localhost", port); KeyProducerJavaSocket client = new KeyProducerJavaSocket(clientConfig, keyUtility, bitHelper, mockLogger); // Open connection implicitly on createSecrets call with length=1 and returnStartSecretOnly true (1 secret) try { client.createSecrets(1, true); } catch (NoMoreSecretsAvailableException e) { // Expect failure because server sends no bytes - but at least connection opened assertThat(e.getMessage(), containsString("Timeout while waiting for secret")); } cleanup(client, serverFuture, serverSocket); } @Test public void createSecrets_success_readsExpectedBigInteger() throws Exception { int port = findFreePort(); // The secret bytes to send (32 bytes = 256 bits) byte[] secretBytes = new KeyProducerTestUtility().createFilledSecret((byte)0xCC); BigInteger expected = new BigInteger(1, secretBytes); ServerSocket serverSocket = new ServerSocket(port); Future serverFuture = executorService.submit(() -> { try (Socket clientSocket = serverSocket.accept(); DataOutputStream dos = new DataOutputStream(clientSocket.getOutputStream())) { // Send exactly one private key (32 bytes) dos.write(secretBytes); dos.flush(); // Keep socket open a bit Thread.sleep(TestTimeProvider.SHORT_DELAY); } return null; }); CKeyProducerJavaSocket clientConfig = createClientConfig("localhost", port); KeyProducerJavaSocket client = new KeyProducerJavaSocket(clientConfig, keyUtility, bitHelper, mockLogger); BigInteger[] secrets = client.createSecrets(1, true); assertThat(secrets.length, is(1)); assertThat(secrets[0], is(equalTo(expected))); cleanup(client, serverFuture, serverSocket); } @Test(expected = NoMoreSecretsAvailableException.class) public void createSecrets_prematureStreamClose_throwsException() throws Exception { int port = findFreePort(); // Server sends fewer bytes than required (e.g. 10 bytes instead of 32) ServerSocket serverSocket = new ServerSocket(port); Future serverFuture = executorService.submit(() -> { try (Socket clientSocket = serverSocket.accept(); DataOutputStream dos = new DataOutputStream(clientSocket.getOutputStream())) { dos.write(new byte[10]); // insufficient bytes dos.flush(); // Close immediately } return null; }); CKeyProducerJavaSocket clientConfig = createClientConfig("localhost", port); KeyProducerJavaSocket client = new KeyProducerJavaSocket(clientConfig, keyUtility, bitHelper, mockLogger); try { client.createSecrets(1, true); } finally { cleanup(client, serverFuture, serverSocket); } } @Test public void interrupt_closesConnectionAndNoExceptionThrown() throws Exception { int port = findFreePort(); final int serverHoldTime = TestTimeProvider.DEFAULT_SOCKET_TIMEOUT; // ms - server keeps connection open without sending data final int clientSocketTimeout = TestTimeProvider.LONG_SOCKET_TIMEOUT; // ms - socket read timeout (should never be hit due to interrupt) final int clientSettleTime = TestTimeProvider.DEFAULT_SETTLE_DELAY; // ms - allow client to enter blocking read final int futureWaitTime = clientSocketTimeout; // ms - how long we wait for the future to complete ServerSocket serverSocket = new ServerSocket(port); Future serverFuture = executorService.submit(() -> { try (Socket clientSocket = serverSocket.accept()) { // simulate a hanging server that does not respond Thread.sleep(serverHoldTime); } return null; }); // Configure client socket with read timeout CKeyProducerJavaSocket clientConfig = createClientConfig("localhost", port); clientConfig.timeout = clientSocketTimeout; KeyProducerJavaSocket client = new KeyProducerJavaSocket(clientConfig, keyUtility, bitHelper, mockLogger); // Launch a thread that will block on reading secrets Future future = executorService.submit(() -> { try { return client.createSecrets(10, false); // blocks until secret data or interruption } catch (NoMoreSecretsAvailableException e) { return null; } }); Thread.sleep(clientSettleTime); // Give time to enter read state client.interrupt(); // Should trigger socket close and exit read // Wait for the client thread to exit cleanly BigInteger[] result = future.get(futureWaitTime, TimeUnit.MILLISECONDS); assertThat("Future should return null after interrupt", result, nullValue()); // Final cleanup cleanup(client, serverFuture, serverSocket, clientSocketTimeout, TimeUnit.MILLISECONDS); } @Test public void createSecrets_afterClose_reconnectsAndReadsSuccessfully() throws Exception { int port = findFreePort(); // Server that sends a single valid secret ServerSocket serverSocket = new ServerSocket(port); Future serverFuture = executorService.submit(() -> { try (Socket s = serverSocket.accept(); DataOutputStream dos = new DataOutputStream(s.getOutputStream())) { byte[] secretBytes = new KeyProducerTestUtility().createZeroedSecret(); dos.write(secretBytes); dos.flush(); Thread.sleep(100); // keep open shortly } return null; }); CKeyProducerJavaSocket clientConfig = createClientConfig("localhost", port); KeyProducerJavaSocket client = new KeyProducerJavaSocket(clientConfig, keyUtility, bitHelper, mockLogger); // Successful read BigInteger[] secrets1 = client.createSecrets(1, true); assertThat(secrets1.length, is(1)); byte expectedByte1 = 1; for (byte b : secrets1[0].toByteArray()) { // Just check one byte, overall logic assumes full byte array match assertThat(b, is(notNullValue())); } // Close client forcibly (simulate socket closed) client.interrupt(); // Try reuse and expect specific exception try { client.createSecrets(1, true); fail("Expected NoMoreSecretsAvailableException due to reuse after close"); } catch (NoMoreSecretsAvailableException e) { assertThat(e.getMessage(), containsString("Interrupted")); } cleanup(client, serverFuture, serverSocket); } @Test public void createSecrets_multipleSequentialCalls_readsAllSuccessfully() throws Exception { int port = findFreePort(); ServerSocket serverSocket = new ServerSocket(port); Future serverFuture = executorService.submit(() -> { try (Socket s = serverSocket.accept(); DataOutputStream dos = new DataOutputStream(s.getOutputStream())) { for (int i = 0; i < 3; i++) { byte[] secretBytes = new KeyProducerTestUtility().createFilledSecret((byte) (i + 10)); dos.write(secretBytes); dos.flush(); Thread.sleep(TestTimeProvider.SHORT_DELAY); } } return null; }); CKeyProducerJavaSocket clientConfig = createClientConfig("localhost", port); KeyProducerJavaSocket client = new KeyProducerJavaSocket(clientConfig, keyUtility, bitHelper, mockLogger); for (int i = 0; i < 3; i++) { BigInteger[] secrets = client.createSecrets(1, true); assertThat(secrets.length, is(1)); byte expectedByte = (byte) (i + 10); assertThat(secrets[0].toByteArray()[secrets[0].toByteArray().length - 1], is(equalTo(expectedByte))); } cleanup(client, serverFuture, serverSocket); } @Test public void createSecrets_connectionRetry_worksWhenServerStartsLate() throws Exception { int port = findFreePort(); final byte fillByte = (byte)99; // Server that only starts after a delay (simulate late server start) Future serverFuture = executorService.submit(() -> { Thread.sleep(TestTimeProvider.DEFAULT_SOCKET_TIMEOUT); // Delay start by 2 seconds try (ServerSocket serverSocket = new ServerSocket(port); Socket s = serverSocket.accept(); DataOutputStream dos = new DataOutputStream(s.getOutputStream())) { byte[] secretBytes = new KeyProducerTestUtility().createFilledSecret(fillByte); dos.write(secretBytes); dos.flush(); } return null; }); CKeyProducerJavaSocket clientConfig = createClientConfig("localhost", port); clientConfig.connectionRetryCount = TestTimeProvider.DEFAULT_CONNECTION_RETRY_COUNT; clientConfig.retryDelayMillisConnect = TestTimeProvider.DEFAULT_RETRY_DELAY; clientConfig.timeout = TestTimeProvider.LONG_SOCKET_TIMEOUT; KeyProducerJavaSocket client = new KeyProducerJavaSocket(clientConfig, keyUtility, bitHelper, mockLogger); // This will retry internally until server comes up Thread.sleep(TestTimeProvider.DEFAULT_SETTLE_DELAY); // allow background thread time to connect and read BigInteger[] secrets = client.createSecrets(1, true); assertThat(secrets.length, is(1)); new KeyProducerTestUtility().assertFilledSecret(secrets[0], fillByte); cleanup(client, serverFuture, null, 3, TimeUnit.SECONDS); } @Test(expected = NoMoreSecretsAvailableException.class) public void createSecrets_socketClosedMidRead_throwsException() throws Exception { int port = findFreePort(); ServerSocket serverSocket = new ServerSocket(port); Future serverFuture = executorService.submit(() -> { try (Socket s = serverSocket.accept(); DataOutputStream dos = new DataOutputStream(s.getOutputStream())) { // Write partial bytes, then close abruptly dos.write(new byte[10]); // Less than 32 bytes dos.flush(); s.close(); } return null; }); CKeyProducerJavaSocket clientConfig = createClientConfig("localhost", port); KeyProducerJavaSocket client = new KeyProducerJavaSocket(clientConfig, keyUtility, bitHelper, mockLogger); try { client.createSecrets(1, true); } finally { cleanup(client, serverFuture, serverSocket); } } @Test(expected = NoMoreSecretsAvailableException.class) public void createSecrets_serverDisconnectsMidTransfer_throwsException() throws Exception { int port = findFreePort(); ServerSocket serverSocket = new ServerSocket(port); Future serverFuture = executorService.submit(() -> { try (Socket s = serverSocket.accept(); DataOutputStream dos = new DataOutputStream(s.getOutputStream())) { dos.write(new byte[16]); // only half of a secret (32 bytes) dos.flush(); s.close(); } return null; }); CKeyProducerJavaSocket clientConfig = createClientConfig("localhost", port); KeyProducerJavaSocket client = new KeyProducerJavaSocket(clientConfig, keyUtility, bitHelper, mockLogger); try { client.createSecrets(1, true); } finally { cleanup(client, serverFuture, serverSocket); } } @Test public void createSecrets_zeroSecretsRequested_returnsEmptyArray() throws Exception { int port = findFreePort(); // Server never sends anything, shouldn't matter ServerSocket serverSocket = new ServerSocket(port); serverSocket.setSoTimeout(TestTimeProvider.SOCKET_ACCEPT_TIMEOUT); Future serverFuture = executorService.submit(() -> { try { try (Socket ignored = serverSocket.accept()) { // No-op } } catch (SocketTimeoutException ignored) { // Accept timed out - expected when client does not connect } return null; }); CKeyProducerJavaSocket clientConfig = createClientConfig("localhost", port); KeyProducerJavaSocket client = new KeyProducerJavaSocket(clientConfig, keyUtility, bitHelper, mockLogger); BigInteger[] secrets = client.createSecrets(0, false); assertThat(secrets.length, is(0)); cleanup(client, serverFuture, serverSocket); } @Test(expected = NoMoreSecretsAvailableException.class) public void createSecrets_malformedSecretStream_throwsException() throws Exception { int port = findFreePort(); ServerSocket serverSocket = new ServerSocket(port); Future serverFuture = executorService.submit(() -> { try (Socket s = serverSocket.accept(); DataOutputStream dos = new DataOutputStream(s.getOutputStream())) { // Send 40 bytes which cannot be split into two full 32-byte secrets dos.write(new byte[40]); dos.flush(); } return null; }); CKeyProducerJavaSocket clientConfig = createClientConfig("localhost", port); KeyProducerJavaSocket client = new KeyProducerJavaSocket(clientConfig, keyUtility, bitHelper, mockLogger); try { client.createSecrets(2, false); } finally { cleanup(client, serverFuture, serverSocket); } } @Test public void testReadRetriesAndCloseCalledOnceMaxReached() throws Exception { int port = findFreePort(); AtomicInteger connectionAttempts = new AtomicInteger(0); ServerSocket serverSocket = new ServerSocket(port); serverSocket.setSoTimeout(TestTimeProvider.SOCKET_ACCEPT_TIMEOUT); // Server: accepts but sends too few bytes (always triggers IOException) Future serverFuture = executorService.submit(() -> { for (int i = 0; i < 3; i++) { // allow up to 3 connections try (Socket s = serverSocket.accept(); DataOutputStream dos = new DataOutputStream(s.getOutputStream())) { connectionAttempts.incrementAndGet(); dos.write(new byte[10]); // too few bytes (less than 32) dos.flush(); Thread.sleep(50); // simulate partial send delay s.close(); // force premature closure } catch (SocketTimeoutException timeout) { break; // no more clients, exit early } } return null; }); CKeyProducerJavaSocket clientConfig = createClientConfig("localhost", port); clientConfig.readRetryCount = TestTimeProvider.DEFAULT_RETRY_COUNT; clientConfig.retryDelayMillisRead = TestTimeProvider.SHORT_DELAY; clientConfig.timeout = TestTimeProvider.SOCKET_ACCEPT_TIMEOUT; KeyProducerJavaSocket client = new KeyProducerJavaSocket(clientConfig, keyUtility, bitHelper, mockLogger); try { client.createSecrets(1, true); fail("Expected NoMoreSecretsAvailableException"); } catch (NoMoreSecretsAvailableException e) { assertThat(e.getMessage(), containsString("Timeout while waiting for secret")); } // We expect only one connection attempt, even after retries, because the socket is reused // unless IOException forces reconnection (your logic determines this) assertThat("Expected one connection for all retries", connectionAttempts.get(), is(1)); // Wait longer in case of multiple connection retries / socket handshakes cleanup(client, serverFuture, serverSocket, 5, TimeUnit.SECONDS); } private ServerSocket hangServer(int port) throws IOException { ServerSocket serverSocket = new ServerSocket(port); new Thread(() -> { try { Socket client = serverSocket.accept(); // Do nothing, just hang the connection Thread.sleep(Long.MAX_VALUE); } catch (Exception ignored) {} }).start(); return serverSocket; } @Test(timeout = 5000) public void testInterruptCausesShutdownDuringConnectionAttemptOnly() throws Exception { final int STATE_UNEXPECTED_SUCCESS = -1; final int STATE_UNKNOWN = 0; final int STATE_ENTERED = 1; final int STATE_INTERRUPT_TRIGGERED = 2; final int STATE_INTERRUPTED_EXIT = 3; final int STATE_NATURAL_EXIT = 4; int port = findFreePort(); ServerSocket dummyServer = hangServer(port); // <-- make sure something accepts CKeyProducerJavaSocket config = createClientConfig("localhost", port); config.connectionRetryCount = 3; config.timeout = TestTimeProvider.DEFAULT_SOCKET_TIMEOUT; // make connection attempt long enough to interrupt mid-way config.retryDelayMillisConnect = 0; KeyProducerJavaSocket client = new KeyProducerJavaSocket(config, keyUtility, bitHelper, mockLogger); ExecutorService executor = Executors.newSingleThreadExecutor(); AtomicInteger state = new AtomicInteger(STATE_UNKNOWN); Future future = executor.submit(() -> { state.set(STATE_ENTERED); // entered createSecrets try { client.createSecrets(1, true); state.set(STATE_UNEXPECTED_SUCCESS); // no exception, test failed } catch (NoMoreSecretsAvailableException e) { if (state.get() == STATE_INTERRUPT_TRIGGERED) { state.set(STATE_INTERRUPTED_EXIT); // interrupted before exception } else { state.set(STATE_NATURAL_EXIT); // exception came naturally without interrupt } } }); // wait to allow connect() to begin (must be < timeout) Thread.sleep(TestTimeProvider.DEFAULT_SETTLE_DELAY); state.set(STATE_INTERRUPT_TRIGGERED); // interrupt about to happen client.interrupt(); future.get(3, TimeUnit.SECONDS); executor.shutdownNow(); assertNotEquals("Thread exited without triggering interrupt", STATE_UNEXPECTED_SUCCESS, state.get()); assertEquals("Expected interrupt to cause shutdown", STATE_INTERRUPTED_EXIT, state.get()); } @Test(timeout = 5000) public void serverAcceptTimesOut_whenNoClientConnects() throws Exception { int port = findFreePort(); CKeyProducerJavaSocket config = createServerConfig(port); config.timeout = TestTimeProvider.SOCKET_ACCEPT_TIMEOUT; config.connectionRetryCount = 1; config.retryDelayMillisConnect = 0; KeyProducerJavaSocket server = new KeyProducerJavaSocket(config, keyUtility, bitHelper, mockLogger); long start = System.currentTimeMillis(); try { server.createSecrets(1, true); fail("Expected NoMoreSecretsAvailableException due to accept timeout"); } catch (NoMoreSecretsAvailableException e) { long duration = System.currentTimeMillis() - start; // Timeout must be honored within reasonable margin (±200ms) assertTrue("Timeout did not occur as expected", duration >= TestTimeProvider.SOCKET_ACCEPT_TIMEOUT && duration <= TestTimeProvider.SOCKET_ACCEPT_TIMEOUT + 200); assertThat(e.getMessage(), containsString("Timeout while waiting for secret")); } finally { server.interrupt(); } } private void cleanup(@Nullable KeyProducerJavaSocket client, @Nullable Future serverFuture, @Nullable ServerSocket serverSocket) throws Exception { cleanup(client, serverFuture, serverSocket, TestTimeProvider.DEFAULT_SOCKET_TIMEOUT, TimeUnit.MILLISECONDS); } private void cleanup(@Nullable KeyProducerJavaSocket client, @Nullable Future serverFuture, @Nullable ServerSocket serverSocket, long timeout, TimeUnit unit) throws Exception { if (client != null) client.interrupt(); if (serverFuture != null) serverFuture.get(timeout, unit); if (serverSocket != null && !serverSocket.isClosed()) serverSocket.close(); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerJavaTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; import java.io.IOException; import net.ladenthin.bitcoinaddressfinder.*; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJava; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaBip39; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaIncremental; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaRandom; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaRandomInstance; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaSocket; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaWebSocket; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaZmq; import static org.junit.Assert.fail; import org.bitcoinj.base.Network; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import static org.mockito.Mockito.mock; import org.slf4j.Logger; @RunWith(DataProviderRunner.class) public class KeyProducerJavaTest { /** * A timeout is required to ensure the producer can terminate. * Without it, the producer may block indefinitely while waiting for keys. */ public final static int TIMEOUT_FOR_TERMINATE = 3_000; private KeyUtility keyUtility; private BitHelper bitHelper; private Logger mockLogger; private final Network network = new NetworkParameterFactory().getNetwork(); @Before public void setUp() { keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); bitHelper = new BitHelper(); mockLogger = mock(Logger.class); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_JAVA_KEY_PRODUCER_AND_BIT_SIZE, location = CommonDataProvider.class) public void createSecrets_throwsException_whenWorkSizeExceedsMax(CommonDataProvider.KeyProducerTypesLocal keyProducerType, int bits) throws IOException, InterruptedException { // arrange final int maxWorkSize = 1 << bits; // 2^bits KeyProducerJava keyProducer = createKeyProducer(keyProducerType, maxWorkSize); // act, assert assertWorkSizeTooLargeThrows(keyProducer, maxWorkSize + 1); } @Test @UseDataProvider(value = CommonDataProvider.DATA_PROVIDER_KEY_PRODUCER_TYPES, location = CommonDataProvider.class) public void createSecrets_throwsException_whenWorkSizeTooLess(CommonDataProvider.KeyProducerTypesLocal keyProducerType) throws IOException, InterruptedException { // arrange KeyProducerJava keyProducer = createKeyProducer(keyProducerType, 1); // act // act, assert assertWorkSizeTooLessThrows(keyProducer); } public KeyProducerJava createKeyProducer(CommonDataProvider.KeyProducerTypesLocal keyProducerType, final int maxWorkSize) throws IllegalArgumentException { final String keyProducerId = "id"; final KeyProducerJava keyProducer; switch (keyProducerType) { case KeyProducerJavaRandom: CKeyProducerJavaRandom configureKeyProducerJavaRandom = configureKeyProducerJavaRandom(keyProducerId, maxWorkSize); keyProducer = new KeyProducerJavaRandom(configureKeyProducerJavaRandom, keyUtility, bitHelper, mockLogger); break; case KeyProducerJavaIncremental: CKeyProducerJavaIncremental configureKeyProducerJavaIncremental = configureKeyProducerJavaIncremental(keyProducerId, maxWorkSize); keyProducer = new KeyProducerJavaIncremental(configureKeyProducerJavaIncremental, keyUtility, bitHelper, mockLogger); break; case KeyProducerJavaBip39: CKeyProducerJavaBip39 configureKeyProducerJavaBip39 = configureKeyProducerJavaBip39(keyProducerId, maxWorkSize); keyProducer = new KeyProducerJavaBip39(configureKeyProducerJavaBip39, keyUtility, bitHelper, mockLogger); break; case KeyProducerJavaSocket: CKeyProducerJavaSocket configureKeyProducerJavaSocket = configureKeyProducerJavaSocket(keyProducerId, maxWorkSize); keyProducer = new KeyProducerJavaSocket(configureKeyProducerJavaSocket, keyUtility, bitHelper, mockLogger); break; case KeyProducerJavaWebSocket: CKeyProducerJavaWebSocket configureKeyProducerJavaWebSocket = configureKeyProducerJavaWebSocket(keyProducerId, maxWorkSize); keyProducer = new KeyProducerJavaWebSocket(configureKeyProducerJavaWebSocket, keyUtility, bitHelper, mockLogger); break; case KeyProducerJavaZmq: CKeyProducerJavaZmq configureKeyProducerJavaZmq = configureKeyProducerJavaZmq(keyProducerId, maxWorkSize); keyProducer = new KeyProducerJavaZmq(configureKeyProducerJavaZmq, keyUtility, bitHelper, mockLogger); break; default: throw new IllegalArgumentException("Unknown KeyProducerType: " + keyProducerType); } return keyProducer; } public static void assertWorkSizeTooLargeThrows( KeyProducerJava producer, int requestedSize ) { try { producer.createSecrets(requestedSize, false); fail("Expected NoMoreSecretsAvailableException for oversized work size"); } catch (IllegalArgumentException e) { // expected } } public static void assertWorkSizeTooLessThrows( KeyProducerJava producer ) { try { producer.createSecrets(-1, false); fail("Expected NoMoreSecretsAvailableException for oversized work size"); } catch (IllegalArgumentException e) { // expected } } private CKeyProducerJavaRandom configureKeyProducerJavaRandom(String keyProducerId, int maxWorkSize) { CKeyProducerJavaRandom cKeyProducerJavaRandom = new CKeyProducerJavaRandom(); cKeyProducerJavaRandom.keyProducerId = keyProducerId; cKeyProducerJavaRandom.keyProducerJavaRandomInstance = CKeyProducerJavaRandomInstance.RANDOM_CUSTOM_SEED; cKeyProducerJavaRandom.customSeed = 0L; cKeyProducerJavaRandom.maxWorkSize = maxWorkSize; return cKeyProducerJavaRandom; } private CKeyProducerJavaIncremental configureKeyProducerJavaIncremental(String keyProducerId, int maxWorkSize) { CKeyProducerJavaIncremental incremental = new CKeyProducerJavaIncremental(); incremental.keyProducerId = keyProducerId; incremental.maxWorkSize = maxWorkSize; return incremental; } private CKeyProducerJavaBip39 configureKeyProducerJavaBip39(String keyProducerId, int maxWorkSize) { CKeyProducerJavaBip39 bip39 = new CKeyProducerJavaBip39(); bip39.keyProducerId = keyProducerId; bip39.mnemonic = CKeyProducerJavaBip39.DEFAULT_MNEMONIC; bip39.maxWorkSize = maxWorkSize; return bip39; } private CKeyProducerJavaSocket configureKeyProducerJavaSocket(String keyProducerId, int maxWorkSize) { CKeyProducerJavaSocket socket = new CKeyProducerJavaSocket(); socket.port = KeyProducerJavaSocketTest.findFreePort(); socket.timeout = TIMEOUT_FOR_TERMINATE; socket.keyProducerId = keyProducerId; socket.maxWorkSize = maxWorkSize; return socket; } private CKeyProducerJavaWebSocket configureKeyProducerJavaWebSocket(String keyProducerId, int maxWorkSize) { CKeyProducerJavaWebSocket webSocket = new CKeyProducerJavaWebSocket(); webSocket.port = KeyProducerJavaSocketTest.findFreePort(); webSocket.timeout = TIMEOUT_FOR_TERMINATE; webSocket.keyProducerId = keyProducerId; webSocket.maxWorkSize = maxWorkSize; return webSocket; } private CKeyProducerJavaZmq configureKeyProducerJavaZmq(String keyProducerId, int maxWorkSize) { CKeyProducerJavaZmq zmq = new CKeyProducerJavaZmq(); zmq.address = KeyProducerJavaZmqTest.findFreeZmqAddress(); zmq.timeout = TIMEOUT_FOR_TERMINATE; zmq.keyProducerId = keyProducerId; zmq.maxWorkSize = maxWorkSize; return zmq; } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerJavaWebSocketTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import net.ladenthin.bitcoinaddressfinder.BitHelper; import net.ladenthin.bitcoinaddressfinder.ByteBufferUtility; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import net.ladenthin.bitcoinaddressfinder.NetworkParameterFactory; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaWebSocket; import org.bitcoinj.base.Network; import org.java_websocket.client.WebSocketClient; import org.java_websocket.handshake.ServerHandshake; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import java.math.BigInteger; import java.net.URI; import java.util.concurrent.*; import net.ladenthin.bitcoinaddressfinder.PublicKeyBytes; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; import static org.mockito.Mockito.mock; public class KeyProducerJavaWebSocketTest { private KeyUtility keyUtility; private BitHelper bitHelper; private Logger mockLogger; private ExecutorService executorService; @Before public void setUp() { Network network = new NetworkParameterFactory().getNetwork(); keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); bitHelper = new BitHelper(); mockLogger = mock(Logger.class); executorService = Executors.newCachedThreadPool(); } @After public void tearDown() { executorService.shutdownNow(); } private CKeyProducerJavaWebSocket createConfig() { CKeyProducerJavaWebSocket config = new CKeyProducerJavaWebSocket(); config.port = KeyProducerJavaSocketTest.findFreePort(); config.timeout = TestTimeProvider.DEFAULT_SOCKET_TIMEOUT; return config; } @Test public void createSecrets_receivesValidSecret() throws Exception { CKeyProducerJavaWebSocket config = createConfig(); KeyProducerJavaWebSocket producer = new KeyProducerJavaWebSocket(config, keyUtility, bitHelper, mockLogger); // WebSocket client to send a valid 32-byte secret byte[] secret = new KeyProducerTestUtility().createZeroedSecret(); BigInteger expected = new BigInteger(1, secret); CountDownLatch connected = new CountDownLatch(1); WebSocketClient client = new WebSocketClient(new URI("ws://localhost:" + config.port)) { @Override public void onOpen(ServerHandshake handshakedata) { connected.countDown(); } @Override public void onMessage(String message) {} @Override public void onClose(int code, String reason, boolean remote) {} @Override public void onError(Exception ex) { ex.printStackTrace(); } }; client.connectBlocking(); connected.await(TestTimeProvider.DEFAULT_SOCKET_TIMEOUT, TestTimeProvider.TIME_UNIT); client.send(secret); BigInteger[] secrets = producer.createSecrets(1, true); assertThat(secrets.length, is(1)); assertThat(secrets[0], is(expected)); producer.interrupt(); client.close(); } @Test(expected = NoMoreSecretsAvailableException.class) public void createSecrets_timeoutWithoutMessage_throwsException() throws Exception { CKeyProducerJavaWebSocket config = createConfig(); config.timeout = TestTimeProvider.DEFAULT_TIMEOUT; KeyProducerJavaWebSocket producer = new KeyProducerJavaWebSocket(config, keyUtility, bitHelper, mockLogger); producer.createSecrets(1, true); } @Test public void interrupt_stopsReceiverAndCausesNoMoreSecretsAvailableException() throws Exception { CKeyProducerJavaWebSocket config = createConfig(); KeyProducerJavaWebSocket producer = new KeyProducerJavaWebSocket(config, keyUtility, bitHelper, mockLogger); Future future = executorService.submit(() -> { try { return producer.createSecrets(1, true); } catch (NoMoreSecretsAvailableException e) { return null; } }); Thread.sleep(TestTimeProvider.DEFAULT_DELAY); producer.interrupt(); BigInteger[] result = future.get(2, TimeUnit.SECONDS); assertThat("Receiver thread should have exited due to interrupt", result, is(nullValue())); } @Test public void createSecrets_invalidMessageLength_ignoredByServer() throws Exception { CKeyProducerJavaWebSocket config = createConfig(); KeyProducerJavaWebSocket producer = new KeyProducerJavaWebSocket(config, keyUtility, bitHelper, mockLogger); ConnectionUtils.waitUntilTcpPortOpen("localhost", config.port, TestTimeProvider.DEFAULT_SOCKET_TIMEOUT); byte[] invalidSecret = new KeyProducerTestUtility().createInvalidSecret(); CountDownLatch connected = new CountDownLatch(1); WebSocketClient client = new WebSocketClient(new URI("ws://localhost:" + config.port)) { @Override public void onOpen(ServerHandshake handshakedata) { connected.countDown(); } @Override public void onMessage(String message) {} @Override public void onClose(int code, String reason, boolean remote) {} @Override public void onError(Exception ex) { ex.printStackTrace(); } }; client.connectBlocking(); // blocks at socket level waitForConnectionOrFail(client, connected, TestTimeProvider.DEFAULT_SOCKET_TIMEOUT); client.send(invalidSecret); try { producer.createSecrets(1, true); } catch (NoMoreSecretsAvailableException e) { assertThat(e.getMessage(), containsString("Timeout while waiting for secret")); } producer.interrupt(); client.close(); } public static void waitForConnectionOrFail(WebSocketClient client, CountDownLatch latch, int timeoutMillis) throws InterruptedException { boolean opened = latch.await(timeoutMillis, TimeUnit.MILLISECONDS); if (!opened || !client.isOpen()) { throw new IllegalStateException("WebSocket not open after " + timeoutMillis + "ms"); } } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerJavaZmqTest.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import java.math.BigInteger; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import net.ladenthin.bitcoinaddressfinder.BitHelper; import net.ladenthin.bitcoinaddressfinder.ByteBufferUtility; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import net.ladenthin.bitcoinaddressfinder.NetworkParameterFactory; import net.ladenthin.bitcoinaddressfinder.configuration.CKeyProducerJavaZmq; import org.bitcoinj.base.Network; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.zeromq.SocketType; import org.zeromq.ZContext; import org.zeromq.ZMQ; import org.zeromq.ZMQException; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; public class KeyProducerJavaZmqTest { private final Network network = new NetworkParameterFactory().getNetwork(); private final KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(false)); private final BitHelper bitHelper = new BitHelper(); private ExecutorService executorService; private Logger mockLogger; @Before public void setup() { executorService = Executors.newCachedThreadPool(); mockLogger = mock(Logger.class); } @After public void teardown() { executorService.shutdownNow(); } private KeyProducerJavaZmq createKeyProducerJavaZmq(CKeyProducerJavaZmq config) { return new KeyProducerJavaZmq(config, keyUtility, bitHelper, mockLogger); } public static String findFreeZmqAddress() { return "tcp://127.0.0.1:" + KeyProducerJavaSocketTest.findFreePort(); } private CKeyProducerJavaZmq createBindConfig(String address) { CKeyProducerJavaZmq config = new CKeyProducerJavaZmq(); config.address = address; config.mode = CKeyProducerJavaZmq.Mode.BIND; return config; } private CKeyProducerJavaZmq createConnectConfig(String address) { CKeyProducerJavaZmq config = new CKeyProducerJavaZmq(); config.address = address; config.mode = CKeyProducerJavaZmq.Mode.CONNECT; return config; } // @Test public void createSecrets_connectMode_receivesSecret() throws Exception { // arrange try (ZContext context = new ZContext()) { String address = findFreeZmqAddress(); // Server socket (push) binds ZMQ.Socket sender = context.createSocket(SocketType.PUSH); sender.bind(address); // Client config connects to that address CKeyProducerJavaZmq config = createConnectConfig(address); KeyProducerJavaZmq keyProducer = createKeyProducerJavaZmq(config); // Create dummy key byte[] secretBytes = new KeyProducerTestUtility().createZeroedSecret(); for (int i = 0; i < secretBytes.length; i++) { secretBytes[i] = (byte) (i + 1); } BigInteger expected = new BigInteger(1, secretBytes); // Send secret sender.send(secretBytes, 0); // act BigInteger[] secrets = keyProducer.createSecrets(1, true); // assert assertThat(secrets.length, is(1)); assertThat(secrets[0], is(equalTo(expected))); keyProducer.interrupt(); sender.close(); } } @Test public void createSecrets_success_receivesOneKey() throws Exception { // arrange String address = findFreeZmqAddress(); byte[] secretBytes = new KeyProducerTestUtility().createZeroedSecret(); BigInteger expected = new BigInteger(1, secretBytes); // Create the BIND receiver first (so it's ready to accept) CKeyProducerJavaZmq config = createBindConfig(address); config.timeout = TestTimeProvider.DEFAULT_SOCKET_TIMEOUT; KeyProducerJavaZmq producer = createKeyProducerJavaZmq(config); // Latch to ensure sender has connected before consuming final CountDownLatch senderReady = new CountDownLatch(1); // Now spawn the sender thread Future senderFuture = executorService.submit(() -> { try (ZContext context = new ZContext(); ZMQ.Socket socket = context.createSocket(ZMQ.PUSH)) { socket.connect(address); Thread.sleep(TestTimeProvider.DEFAULT_ESTABLISH_DELAY); // let connection establish socket.send(secretBytes); Thread.sleep(TestTimeProvider.DEFAULT_ESTABLISH_DELAY); // let message be delivered senderReady.countDown(); } return null; }); // Wait for sender to have sent the message before consuming senderReady.await(TestTimeProvider.LONG_SOCKET_TIMEOUT, TestTimeProvider.TIME_UNIT); // act BigInteger[] secrets = producer.createSecrets(1, true); // assert assertThat(secrets.length, is(1)); assertThat(secrets[0], is(equalTo(expected))); producer.interrupt(); senderFuture.get(TestTimeProvider.DEFAULT_SOCKET_TIMEOUT, TestTimeProvider.TIME_UNIT); } @Test(expected = NoMoreSecretsAvailableException.class) public void createSecrets_timeout_throwsException() throws Exception { // arrange String address = findFreeZmqAddress(); CKeyProducerJavaZmq config = createBindConfig(address); config.timeout = TestTimeProvider.DEFAULT_TIMEOUT; KeyProducerJavaZmq producer = createKeyProducerJavaZmq(config); // act producer.createSecrets(1, true); } @Test public void createSecrets_multipleKeys_success() throws Exception { // arrange String address = findFreeZmqAddress(); final int numberOfSecrets = 3; // Bind receiver first (small but important ordering) CKeyProducerJavaZmq config = createBindConfig(address); config.timeout = TestTimeProvider.DEFAULT_SOCKET_TIMEOUT; KeyProducerJavaZmq producer = createKeyProducerJavaZmq(config); // Latch to ensure sender has connected before consuming final CountDownLatch senderReady = new CountDownLatch(1); // Latch to ensure all sends actually happened final CountDownLatch sentLatch = new CountDownLatch(numberOfSecrets); Future senderFuture = executorService.submit(() -> { try (ZContext context = new ZContext(); ZMQ.Socket socket = context.createSocket(ZMQ.PUSH)) { socket.connect(address); // Let the ZMQ connection fully establish before the first send: Thread.sleep(TestTimeProvider.DEFAULT_ESTABLISH_DELAY); senderReady.countDown(); for (int i = 0; i < numberOfSecrets; i++) { byte[] secretBytes = new KeyProducerTestUtility().createIncrementedSecret((byte) i); socket.send(secretBytes); sentLatch.countDown(); Thread.sleep(TestTimeProvider.DEFAULT_SEND_DELAY); } } return null; }); // Wait for sender to be connected before consuming senderReady.await(TestTimeProvider.LONG_SOCKET_TIMEOUT, TestTimeProvider.TIME_UNIT); // act BigInteger[] secrets = producer.createSecrets(numberOfSecrets, false); // assert assertThat(secrets.length, is(numberOfSecrets)); new KeyProducerTestUtility().assertIncrementedSecrets(secrets); // Wait until the sender really pushed all messages boolean allSent = sentLatch.await( (long) numberOfSecrets * TestTimeProvider.DEFAULT_SEND_DELAY + TestTimeProvider.DEFAULT_DELAY, TestTimeProvider.TIME_UNIT ); assertThat("Sender did not send all secrets in time", allSent, is(true)); producer.interrupt(); senderFuture.get(TestTimeProvider.DEFAULT_SOCKET_TIMEOUT, TestTimeProvider.TIME_UNIT); } @Test public void createSecrets_invalidSecretLength_errorLogged() throws Exception { // arrange try (ZContext context = new ZContext()) { String address = findFreeZmqAddress(); // Server socket (push) binds ZMQ.Socket sender = context.createSocket(SocketType.PUSH); sender.bind(address); // Client config connects to that address CKeyProducerJavaZmq config = createConnectConfig(address); KeyProducerJavaZmq keyProducer = createKeyProducerJavaZmq(config); // Create invalid secret with wrong length (e.g., 16 bytes instead of 32) byte[] invalidSecretBytes = new byte[16]; for (int i = 0; i < invalidSecretBytes.length; i++) { invalidSecretBytes[i] = (byte) (i + 1); } // Send invalid secret sender.send(invalidSecretBytes, 0); // Wait a bit to ensure the receiver thread processes the message Thread.sleep(TestTimeProvider.DEFAULT_SEND_WAIT); // Now send a valid secret so createSecrets can return byte[] validSecretBytes = new KeyProducerTestUtility().createZeroedSecret(); sender.send(validSecretBytes, 0); // act BigInteger[] secrets = keyProducer.createSecrets(1, true); // assert assertThat(secrets.length, is(1)); // Verify logger was called with error message for invalid length verify(mockLogger).error("Received invalid secret length: 16"); keyProducer.interrupt(); sender.close(); } } // // @Test public void interrupt_duringReceive_stopsCleanly() throws Exception { // arrange String address = findFreeZmqAddress(); // Setup ZMQ PULL socket that will wait for messages CKeyProducerJavaZmq config = createBindConfig(address); config.timeout = -1; // block indefinitely KeyProducerJavaZmq producer = createKeyProducerJavaZmq(config); // Start a thread that will block on createSecrets Future future = executorService.submit(() -> { try { return producer.createSecrets(1, true); } catch (NoMoreSecretsAvailableException e) { return null; } }); // Let it enter the blocking receive Thread.sleep(TestTimeProvider.DEFAULT_SEND_WAIT); // act // Now interrupt from another thread (will close socket/context) producer.interrupt(); // assert // Assert the future exits cleanly within timeout BigInteger[] result = future.get(2, TimeUnit.SECONDS); assertThat(result, is(nullValue())); // Verify no unexpected ZMQ errors were logged verify(mockLogger, never()).error(eq("ZMQ error"), any(ZMQException.class)); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/keyproducer/KeyProducerTestUtility.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import net.ladenthin.bitcoinaddressfinder.PublicKeyBytes; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.equalTo; import java.math.BigInteger; /** * Utility class providing convenience methods for creating and initializing * byte arrays that represent Bitcoin private key secrets. *

* These helpers are mainly used for testing and mock implementations of key producers * (e.g. {@code KeyProducerJavaZmqTest}) where deterministic or filled byte arrays * are required to simulate secret key transmission. */ public class KeyProducerTestUtility { /** * Creates a new secret byte array of the standard private key length * defined by {@link PublicKeyBytes#PRIVATE_KEY_MAX_NUM_BYTES}, filled entirely with zeroes. *

* This method is a shorthand for {@link #createFilledSecret(byte)} with a fill byte of {@code 0x00}. * * @return a new byte array filled with {@code 0x00}, having a length equal to * {@link PublicKeyBytes#PRIVATE_KEY_MAX_NUM_BYTES}. */ public byte[] createZeroedSecret() { return createFilledSecret((byte)0x0); } /** * Creates a new secret byte array filled with the specified byte value. *

* Each position in the resulting array will contain the provided {@code fillByte}. * * @param fillByte the byte value used to fill every position in the secret array. * @return a new byte array of size {@link PublicKeyBytes#PRIVATE_KEY_MAX_NUM_BYTES} * where each element is set to {@code fillByte}. */ public byte[] createFilledSecret(byte fillByte) { byte[] secretBytes = new byte[PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES]; for (int i = 0; i < secretBytes.length; i++) { secretBytes[i] = fillByte; } return secretBytes; } /** * Creates a new secret byte array where each byte is derived by incrementing the given {@code fillByte}. *

* This variant is useful for generating non-uniform test data, as each byte will contain * {@code (fillByte + 1)}. *

* Note that this implementation currently applies the same incremented value to all bytes * in the array — it does not perform cumulative iteration. * * @param startByte the base byte value used as the starting point for incrementing. * @return a new byte array of size {@link PublicKeyBytes#PRIVATE_KEY_MAX_NUM_BYTES}, * filled with the value {@code (fillByte + 1)}. */ public byte[] createIncrementedSecret(byte startByte) { byte[] secretBytes = new byte[PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES]; for (int i = 0; i < secretBytes.length; i++) { secretBytes[i] = (byte) (startByte + 1); } return secretBytes; } /** * Asserts that an array of secrets increases by one per index. *

* Each secret is expected to represent a BigInteger whose least-significant byte * equals {@code (index + 1)}. * * @param secrets the array of BigInteger secrets to verify */ public void assertIncrementedSecrets(BigInteger[] secrets) { for (int i = 0; i < secrets.length; i++) { byte[] bytes = secrets[i].toByteArray(); // Handle BigInteger sign and potential leading zero byte lastByte = bytes[bytes.length - 1]; byte expected = (byte) (i + 1); assertThat( "Secret at index " + i + " should end with byte value " + expected, lastByte, is(expected) ); } } /** * Asserts that the given secret consists entirely of the specified fill byte. *

* This checks the least significant byte of the {@link BigInteger}'s backing array, * which is sufficient when verifying uniformly filled secrets produced by * {@code generateFilledSecret(byte)} or similar utilities. * * @param secret the BigInteger secret to verify * @param fillByte the byte value expected to fill the secret */ public void assertFilledSecret(BigInteger secret, byte fillByte) { byte[] bytes = secret.toByteArray(); // Defensive: skip any sign byte (0x00) that BigInteger may prepend int lastIndex = bytes.length - 1; byte lastByte = bytes[lastIndex]; assertThat( "Secret should end with byte value " + fillByte + " but was " + lastByte, lastByte, is(equalTo(fillByte)) ); } /** * Creates a deliberately invalid secret byte array for negative or edge-case testing. *

* The returned array is one byte shorter than the valid private key length defined by * {@link PublicKeyBytes#PRIVATE_KEY_MAX_NUM_BYTES}, ensuring it will be rejected by * validation logic that enforces correct secret sizes. *

* This method is typically used in unit tests to verify that components such as * {@code KeyProducerJavaZmq} or {@code AbstractKeyProducerQueueBuffered} * properly handle malformed or truncated input. * * @return a new byte array with a length of * {@code PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES - 1}, representing an invalid secret. */ public byte[] createInvalidSecret() { return new byte[PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BYTES - 1]; } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/keyproducer/NoMoreSecretsAvailableExceptionTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; import org.junit.Test; /** * Unit tests for {@link NoMoreSecretsAvailableException}. */ public class NoMoreSecretsAvailableExceptionTest { // @Test public void constructor_noArg_isInstanceOfRuntimeException() { // act NoMoreSecretsAvailableException exception = new NoMoreSecretsAvailableException(); // assert assertThat(exception, is(instanceOf(RuntimeException.class))); } @Test public void constructor_noArg_nullMessage() { // act NoMoreSecretsAvailableException exception = new NoMoreSecretsAvailableException(); // assert assertThat(exception.getMessage(), is(nullValue())); } @Test public void constructor_noArg_noCause() { // act NoMoreSecretsAvailableException exception = new NoMoreSecretsAvailableException(); // assert assertThat(exception.getCause(), is(nullValue())); } @Test public void constructor_withMessage_messageIsPreserved() { // arrange String message = "no more secrets in the file"; // act NoMoreSecretsAvailableException exception = new NoMoreSecretsAvailableException(message); // assert assertThat(exception.getMessage(), is(equalTo(message))); } @Test public void constructor_withMessage_noCause() { // arrange String message = "a message"; // act NoMoreSecretsAvailableException exception = new NoMoreSecretsAvailableException(message); // assert assertThat(exception.getCause(), is(nullValue())); } @Test public void constructor_withMessageAndCause_messageIsPreserved() { // arrange String message = "wrapped IO failure"; Throwable cause = new RuntimeException("root cause"); // act NoMoreSecretsAvailableException exception = new NoMoreSecretsAvailableException(message, cause); // assert assertThat(exception.getMessage(), containsString(message)); } @Test public void constructor_withMessageAndCause_causeIsPreserved() { // arrange String message = "msg"; Throwable cause = new RuntimeException("root cause"); // act NoMoreSecretsAvailableException exception = new NoMoreSecretsAvailableException(message, cause); // assert assertThat(exception.getCause(), is(equalTo(cause))); } @Test public void constructor_withCause_causeIsPreserved() { // arrange Throwable cause = new IllegalStateException("underlying cause"); // act NoMoreSecretsAvailableException exception = new NoMoreSecretsAvailableException(cause); // assert assertThat(exception.getCause(), is(equalTo(cause))); } @Test public void constructor_withCause_messageContainsCauseMessage() { // arrange Throwable cause = new IllegalStateException("underlying cause"); // act NoMoreSecretsAvailableException exception = new NoMoreSecretsAvailableException(cause); // assert assertThat(exception.getMessage(), containsString("underlying cause")); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/keyproducer/TestTimeProvider.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.keyproducer; import java.util.concurrent.TimeUnit; public class TestTimeProvider { public final static TimeUnit TIME_UNIT = TimeUnit.MILLISECONDS; public final static int DEFAULT_DELAY = 500; public final static int DEFAULT_SEND_DELAY = 300; public final static int DEFAULT_SEND_WAIT = 1000; public final static int DEFAULT_SETTLE_DELAY = 300; public final static int DEFAULT_ESTABLISH_DELAY = 300; public final static int DEFAULT_TIMEOUT = 500; public final static int DEFAULT_SOCKET_TIMEOUT = 2_000; public final static int DEFAULT_RETRY_COUNT = 3; public final static int DEFAULT_CONNECTION_RETRY_COUNT = 10; public final static int DEFAULT_RETRY_DELAY = 500; public final static int SHORT_DELAY = 100; public final static int LONG_SOCKET_TIMEOUT = 3_000; public final static int SOCKET_ACCEPT_TIMEOUT = 1_000; } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/persistence/PersistenceUtilsTest.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.persistence; import java.nio.ByteBuffer; import net.ladenthin.bitcoinaddressfinder.NetworkParameterFactory; import org.bitcoinj.base.Network; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.sameInstance; public class PersistenceUtilsTest { private final Network network = new NetworkParameterFactory().getNetwork(); private final PersistenceUtils persistenceUtils = new PersistenceUtils(network); // @Test public void longToByteBufferDirect_zeroValue_returnsNotNull() { // act ByteBuffer result = persistenceUtils.longToByteBufferDirect(0L); // assert assertThat(result, is(notNullValue())); } @Test public void longToByteBufferDirect_zeroValue_returnsSameInstanceOnRepeatedCalls() { // act ByteBuffer first = persistenceUtils.longToByteBufferDirect(0L); ByteBuffer second = persistenceUtils.longToByteBufferDirect(0L); // assert assertThat(first, is(sameInstance(second))); } @Test public void longToByteBufferDirect_zeroValue_capacityIsLongBytes() { // act ByteBuffer result = persistenceUtils.longToByteBufferDirect(0L); // assert assertThat(result.capacity(), is(equalTo(Long.BYTES))); } @Test public void longToByteBufferDirect_zeroValue_absoluteGetLongReturnsZero() { // act ByteBuffer result = persistenceUtils.longToByteBufferDirect(0L); // assert assertThat(result.getLong(0), is(equalTo(0L))); } // // @Test public void longToByteBufferDirect_positiveValue_returnsNotNull() { // act ByteBuffer result = persistenceUtils.longToByteBufferDirect(42L); // assert assertThat(result, is(notNullValue())); } @Test public void longToByteBufferDirect_positiveValue_capacityIsLongBytes() { // act ByteBuffer result = persistenceUtils.longToByteBufferDirect(42L); // assert assertThat(result.capacity(), is(equalTo(Long.BYTES))); } @Test public void longToByteBufferDirect_positiveValue_absoluteGetLongReturnsCorrectValue() { // arrange long expected = 42L; // act ByteBuffer result = persistenceUtils.longToByteBufferDirect(expected); // assert assertThat(result.getLong(0), is(equalTo(expected))); } @Test public void longToByteBufferDirect_positiveValue_remainingIsLongBytes() { // act ByteBuffer result = persistenceUtils.longToByteBufferDirect(42L); // assert assertThat(result.remaining(), is(equalTo(Long.BYTES))); } // // @Test public void longToByteBufferDirect_negativeValue_absoluteGetLongReturnsCorrectValue() { // arrange long expected = -1L; // act ByteBuffer result = persistenceUtils.longToByteBufferDirect(expected); // assert assertThat(result.getLong(0), is(equalTo(expected))); } @Test public void longToByteBufferDirect_negativeValue_capacityIsLongBytes() { // act ByteBuffer result = persistenceUtils.longToByteBufferDirect(-1L); // assert assertThat(result.capacity(), is(equalTo(Long.BYTES))); } // // @Test public void longToByteBufferDirect_longMaxValue_absoluteGetLongReturnsMaxValue() { // arrange long expected = Long.MAX_VALUE; // act ByteBuffer result = persistenceUtils.longToByteBufferDirect(expected); // assert assertThat(result.getLong(0), is(equalTo(expected))); } @Test public void longToByteBufferDirect_longMinValue_absoluteGetLongReturnsMinValue() { // arrange long expected = Long.MIN_VALUE; // act ByteBuffer result = persistenceUtils.longToByteBufferDirect(expected); // assert assertThat(result.getLong(0), is(equalTo(expected))); } @Test public void longToByteBufferDirect_oneValue_absoluteGetLongReturnsOne() { // arrange long expected = 1L; // act ByteBuffer result = persistenceUtils.longToByteBufferDirect(expected); // assert assertThat(result.getLong(0), is(equalTo(expected))); } @Test public void longToByteBufferDirect_nonZeroValueCalledTwice_returnsDifferentInstances() { // act ByteBuffer first = persistenceUtils.longToByteBufferDirect(100L); ByteBuffer second = persistenceUtils.longToByteBufferDirect(100L); // assert assertThat(first, is(not(sameInstance(second)))); } @Test public void longToByteBufferDirect_nonZeroValueNotSameAsZeroCachedBuffer_returnsDifferentInstance() { // act ByteBuffer zeroBuffer = persistenceUtils.longToByteBufferDirect(0L); ByteBuffer nonZeroBuffer = persistenceUtils.longToByteBufferDirect(1L); // assert assertThat(zeroBuffer, is(not(sameInstance(nonZeroBuffer)))); } // } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/staticaddresses/AbstractTestAddresses.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.staticaddresses; import java.math.BigInteger; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; import java.util.Random; import net.ladenthin.bitcoinaddressfinder.ByteBufferUtility; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import net.ladenthin.bitcoinaddressfinder.NetworkParameterFactory; import net.ladenthin.bitcoinaddressfinder.PublicKeyBytes; import org.apache.commons.codec.binary.Hex; import org.bitcoinj.base.LegacyAddress; import org.bitcoinj.base.Network; import org.bitcoinj.base.ScriptType; import org.bitcoinj.crypto.ECKey; public abstract class AbstractTestAddresses implements TestAddresses { public final Network network = new NetworkParameterFactory().getNetwork(); private final List ecKeys = new ArrayList<>(); public AbstractTestAddresses(int randomSeed, int numberOfAddresses, boolean compressed) { Random random = new Random(randomSeed); for (int i = 0; i < numberOfAddresses; i++) { BigInteger secret = new KeyUtility(network, new ByteBufferUtility(false)).createSecret(PublicKeyBytes.PRIVATE_KEY_MAX_NUM_BITS, random); ECKey ecKey = ECKey.fromPrivate(secret, compressed); ecKeys.add(ecKey); } } @Override public int getNumberOfAddresses() { return ecKeys.size(); } @Override public List getECKeys() { return ecKeys; } private LegacyAddress toLegacyAddress(ECKey ecKey) { return (LegacyAddress) ecKey.toAddress(ScriptType.P2PKH, network); } private LegacyAddress getLegacyAddressAtIndex(int index) { ECKey ecKey = getECKeys().get(index); return toLegacyAddress(ecKey); } @Override public String getIndexAsBase58String(int index) { LegacyAddress legacyAddress = getLegacyAddressAtIndex(index); return legacyAddress.toBase58(); } @Override public byte[] getIndexAsHash160(int index) { LegacyAddress legacyAddress = getLegacyAddressAtIndex(index); return legacyAddress.getHash(); } @Override public String getIndexAsHash160HexEncoded(int index) { byte[] hash = getIndexAsHash160(index); return Hex.encodeHexString(hash); } @Override public ByteBuffer getIndexAsHash160ByteBuffer(int index) { ByteBufferUtility byteBufferUtility = new ByteBufferUtility(true); byte[] hash160 = getIndexAsHash160(index); ByteBuffer byteBuffer = byteBufferUtility.byteArrayToByteBuffer(hash160); return byteBuffer; } @Override public String getAsBase58Strings() { StringBuilder sb = new StringBuilder(); List base58StringList = getAsBase58StringList(); for (String base58 : base58StringList) { sb.append(base58); sb.append(System.lineSeparator()); } return sb.toString(); } @Override public List getAsBase58StringList() { List base58Strings = new ArrayList<>(); List ecKeys = getECKeys(); for (ECKey ecKey : ecKeys) { LegacyAddress address = toLegacyAddress(ecKey); String base58 = address.toBase58(); base58Strings.add(base58); } return base58Strings; } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/staticaddresses/AddressesFileSpecialUsecases.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.staticaddresses; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.util.ArrayList; import java.util.List; import org.junit.rules.TemporaryFolder; import static net.ladenthin.bitcoinaddressfinder.SeparatorFormat.COMMA; import static net.ladenthin.bitcoinaddressfinder.SeparatorFormat.SEMICOLON; import static net.ladenthin.bitcoinaddressfinder.SeparatorFormat.TAB_SPLIT; public class AddressesFileSpecialUsecases implements AddressesFiles { private final static String ADDRESS_FILE_ONE = "staticAddressesFile.txt"; public final static int NUMBER_OF_ADRESSES = 3; private final TestAddresses42 testAddresses; public AddressesFileSpecialUsecases() { testAddresses = new TestAddresses42(NUMBER_OF_ADRESSES, false); } @Override public List createAddressesFiles(TemporaryFolder folder, boolean addInvalidAddresses) throws IOException { File one = folder.newFile(ADDRESS_FILE_ONE); Files.write(one.toPath(), getAllAddresses()); List addresses = new ArrayList<>(); addresses.add(one.getAbsolutePath()); return addresses; } /** * See {@link net.ladenthin.bitcoinaddressfinder.AddressFileToLMDBTest#addressFilesToLMDB_addressWithAmountOfZero_noExceptionThrown} why {@code 0} is necessary. */ public List getAllAddresses() { List addresses = new ArrayList<>(); addresses.add(testAddresses.getIndexAsBase58String(0) + COMMA.getSymbol() + "0"); addresses.add(testAddresses.getIndexAsBase58String(1) + TAB_SPLIT.getSymbol() + "0"); addresses.add(testAddresses.getIndexAsBase58String(2) + SEMICOLON.getSymbol() + "0"); return addresses; } @Override public TestAddresses getTestAddresses() { return testAddresses; } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/staticaddresses/AddressesFiles.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.staticaddresses; import java.io.IOException; import java.util.List; import org.junit.rules.TemporaryFolder; public interface AddressesFiles { List createAddressesFiles(TemporaryFolder folder, boolean addInvalidAddresses) throws IOException; TestAddresses getTestAddresses(); } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/staticaddresses/StaticAddressesFiles.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.staticaddresses; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; import org.bitcoinj.base.Coin; import org.junit.rules.TemporaryFolder; import net.ladenthin.bitcoinaddressfinder.staticaddresses.enums.*; public class StaticAddressesFiles implements AddressesFiles { private final static String ADDRESS_FILE_ONE = "staticAddressesFile.txt"; public static final Coin amountOtherAddresses = Coin.SATOSHI; public StaticAddressesFiles() { } @Override public List createAddressesFiles(TemporaryFolder folder, boolean addInvalidAddresses) throws IOException { File one = folder.newFile(ADDRESS_FILE_ONE); Files.write(one.toPath(), getAllAddresses()); List addresses = new ArrayList<>(); addresses.add(one.getAbsolutePath()); return addresses; } public List getSupportedAddresses() { List addresses = new ArrayList<>(); addresses.addAll(extractAddresses(P2PKH.class)); addresses.addAll(extractAddresses(P2SH.class)); addresses.addAll(extractAddresses(P2WPKH.class)); return addresses; } public List getAllAddresses() { List addresses = new ArrayList<>(); addresses.addAll(getSupportedAddresses()); addresses.addAll(getUnsupportedAddresses()); return addresses; } public List getUnsupportedAddresses() { return extractAddresses(StaticUnsupportedAddress.class); } private & PublicAddress> List extractAddresses(Class enumClass) { return Arrays.stream(enumClass.getEnumConstants()) .map(PublicAddress::getPublicAddress) .collect(Collectors.toList()); } @Override public TestAddresses getTestAddresses() { throw new UnsupportedOperationException("Not supported yet."); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/staticaddresses/StaticKey.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.staticaddresses; import java.math.BigInteger; import java.nio.ByteBuffer; import net.ladenthin.bitcoinaddressfinder.ByteBufferUtility; /** * Static strings from a random generated address https://www.bitaddress.org */ public class StaticKey { final public String privateKeyHex = "68e23530deb6d5011ab56d8ad9f7b4a3b424f1112f08606357497495929f72dc"; final public BigInteger privateKeyBigInteger = new BigInteger("47440210799387980664936216788675555637818488436833759923669526136462528967388"); final public byte[] privateKeyBytes = {104, -30, 53, 48, -34, -74, -43, 1, 26, -75, 109, -118, -39, -9, -76, -93, -76, 36, -15, 17, 47, 8, 96, 99, 87, 73, 116, -107, -110, -97, 114, -36}; final public String privateKeyWiFUncompressed = "5JcUh9ET11ZZHnEhSvzEUCg3opTa9WCmsGuCFYGQGhBzKJpgJ39"; final public String privateKeyWiFCompressed = "KzjbEBLMm3UhX4fTXTHcT4XMPeUHJXty2uBNfAzyiGPVynPeFMeV"; final public String publicKeyUncompressedHex = "045d99d81d9e731e0d7eebd1c858b1155da7981b1f0a16d322a361f8b589ad2e3bde53dc614e3a84164dab3f5899abde3b09553dca10c9716fa623a5942b9ea420"; final public byte[] publicKeyUncompressedBytes = {4, 93, -103, -40, 29, -98, 115, 30, 13, 126, -21, -47, -56, 88, -79, 21, 93, -89, -104, 27, 31, 10, 22, -45, 34, -93, 97, -8, -75, -119, -83, 46, 59, -34, 83, -36, 97, 78, 58, -124, 22, 77, -85, 63, 88, -103, -85, -34, 59, 9, 85, 61, -54, 16, -55, 113, 111, -90, 35, -91, -108, 43, -98, -92, 32}; final public String publicKeyCompressedHex = "025d99d81d9e731e0d7eebd1c858b1155da7981b1f0a16d322a361f8b589ad2e3b"; final public byte[] publicKeyCompressedBytes = {2, 93, -103, -40, 29, -98, 115, 30, 13, 126, -21, -47, -56, 88, -79, 21, 93, -89, -104, 27, 31, 10, 22, -45, 34, -93, 97, -8, -75, -119, -83, 46, 59}; final public String publicKeyUncompressedHash160Hex = "024336956610316605d1051cb9b8e88f82b70b29"; final public String publicKeyCompressedHash160Hex = "892852a28710e156b07fa7933edd5490cbbcfa4f"; final public String publicKeyUncompressed = "1CxsSWgsWNxoqS1XB5QgchtMpWrzzPCES"; final public String publicKeyCompressed = "1DWDsxY3mvzjPLHD67nRq15M8vs6VLZaqV"; final public ByteBuffer byteBufferPublicKeyUncompressed = new ByteBufferUtility(false).getByteBufferFromHex(publicKeyUncompressedHash160Hex); final public ByteBuffer byteBufferPublicKeyCompressed = new ByteBufferUtility(false).getByteBufferFromHex(publicKeyCompressedHash160Hex); } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/staticaddresses/TestAddresses.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.staticaddresses; import java.nio.ByteBuffer; import java.util.List; import org.bitcoinj.crypto.ECKey; public interface TestAddresses { int getNumberOfAddresses(); List getECKeys(); String getAsBase58Strings(); List getAsBase58StringList(); String getIndexAsBase58String(int index); String getIndexAsHash160HexEncoded(int index); byte[] getIndexAsHash160(int index); ByteBuffer getIndexAsHash160ByteBuffer(int index); } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/staticaddresses/TestAddresses1337.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.staticaddresses; public class TestAddresses1337 extends AbstractTestAddresses { public final static int RANDOM_SEED = 1337; public TestAddresses1337(int numberOfAddresses, boolean compressed) { super(RANDOM_SEED, numberOfAddresses, compressed); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/staticaddresses/TestAddresses42.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.staticaddresses; public class TestAddresses42 extends AbstractTestAddresses { public final static int RANDOM_SEED = 42; public TestAddresses42(int numberOfAddresses, boolean compressed) { super(RANDOM_SEED, numberOfAddresses, compressed); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/staticaddresses/TestAddressesFiles.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.staticaddresses; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.util.*; import java.util.function.Function; import java.util.function.Supplier; import net.ladenthin.bitcoinaddressfinder.PublicKeyBytes; import net.ladenthin.bitcoinaddressfinder.SeparatorFormat; import static net.ladenthin.bitcoinaddressfinder.SeparatorFormat.COMMA; import static net.ladenthin.bitcoinaddressfinder.SeparatorFormat.SEMICOLON; import static net.ladenthin.bitcoinaddressfinder.SeparatorFormat.TAB_SPLIT; import net.ladenthin.bitcoinaddressfinder.staticaddresses.enums.P2WPKH; import org.bitcoinj.base.Coin; import org.junit.rules.TemporaryFolder; public class TestAddressesFiles implements AddressesFiles { public final static Set compressedTestAddressesAsDynamicWidthBase58BitcoinAddressWithAmount = new HashSet<>(); public final static Set uncompressedTestAddressesAsDynamicWidthBase58BitcoinAddressWithAmount = new HashSet<>(); public final static Set compressedTestAddressesWithStaticAmountAsDynamicWidthBase58BitcoinAddressWithAmount = new HashSet<>(); public final static Set uncompressedTestAddressesWithStaticAmountAsDynamicWidthBase58BitcoinAddressWithAmount = new HashSet<>(); public final static Set compressedTestAddressesAsFixedWidthBase58BitcoinAddress = new HashSet<>(); public final static Set uncompressedTestAddressesAsFixedWidthBase58BitcoinAddress = new HashSet<>(); public final static Set compressedTestAddressesWithStaticAmountAsFixedWidthBase58BitcoinAddress = new HashSet<>(); public final static Set uncompressedTestAddressesWithStaticAmountAsFixedWidthBase58BitcoinAddress = new HashSet<>(); public final static Set compressedTestAddressesAsHexHash = new HashSet<>(); public final static Set uncompressedTestAddressesAsHexHash = new HashSet<>(); public final static Set compressedTestAddressesWithStaticAmountAsHexHash = new HashSet<>(); public final static Set uncompressedTestAddressesWithStaticAmountAsHexHash = new HashSet<>(); private final static String ADDRESS_FILE_ONE = "addressesOne.txt"; private final static String ADDRESS_FILE_TWO = "addressesTwo.txt"; private final static String ADDRESS_FILE_THREE = "addressesThree.txt"; public final static int NUMBER_OF_ADRESSES = 5; public static final Coin amountFirstAddress = Coin.FIFTY_COINS; public static final Coin amountOtherAddresses = Coin.SATOSHI; public static final String AMOUNT_FIRST_ADDRESS_AS_STRING = "5000000000"; public static final String AMOUNT_OTHER_ADDRESSES_AS_STRING = "1"; public static final String STATIC_EMPTY_AMOUNT_AS_STRING = "0"; public final static Coin[] AMOUNTS = { amountFirstAddress, amountOtherAddresses, amountOtherAddresses, amountOtherAddresses, amountOtherAddresses }; private final TestAddresses42 testAddresses; private static final String COMMA_SEPARATOR = SeparatorFormat.COMMA.getSymbol(); private static final List NO_AMOUNTS = List.of(); /** * A 20-byte test address (hash160) that is guaranteed not to exist in the generated test datasets. *

* This address is used in negative unit tests to verify that lookup methods * (e.g. {@code containsAddress}) correctly return {@code false} or {@code null} * when queried with a hash160 value that is not present. *

* The array contains exactly {@link PublicKeyBytes#RIPEMD160_HASH_NUM_BYTES} distinct byte values. * The final byte is explicitly set to the constant value itself to emphasize the expected length. *

* Note: This address does not collide with any hash160 values in {@link TestAddresses42}. */ public static final byte[] NON_EXISTING_ADDRESS = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, PublicKeyBytes.RIPEMD160_HASH_NUM_BYTES }; public TestAddressesFiles(boolean compressed) { testAddresses = new TestAddresses42(NUMBER_OF_ADRESSES, compressed); TestAddresses42 uc = new TestAddresses42(NUMBER_OF_ADRESSES, false); TestAddresses42 co = new TestAddresses42(NUMBER_OF_ADRESSES, true); final String witnessProgramAsBase58 = P2WPKH.BitcoinP2WPKH.getWitnessProgramAsBase58(); final String witnessProgramAsHex = P2WPKH.BitcoinP2WPKH.getWitnessProgramAsHex(); // DynamicWidthBase58BitcoinAddressWithAmount addFormattedAddresses( uncompressedTestAddressesAsDynamicWidthBase58BitcoinAddressWithAmount, uc::getIndexAsBase58String, () -> witnessProgramAsBase58, List.of(AMOUNT_FIRST_ADDRESS_AS_STRING, AMOUNT_OTHER_ADDRESSES_AS_STRING) ); addFormattedAddresses( compressedTestAddressesAsDynamicWidthBase58BitcoinAddressWithAmount, co::getIndexAsBase58String, () -> witnessProgramAsBase58, List.of(AMOUNT_FIRST_ADDRESS_AS_STRING, AMOUNT_OTHER_ADDRESSES_AS_STRING) ); addFormattedAddresses( uncompressedTestAddressesWithStaticAmountAsDynamicWidthBase58BitcoinAddressWithAmount, uc::getIndexAsBase58String, () -> witnessProgramAsBase58, List.of(STATIC_EMPTY_AMOUNT_AS_STRING) ); addFormattedAddresses( compressedTestAddressesWithStaticAmountAsDynamicWidthBase58BitcoinAddressWithAmount, co::getIndexAsBase58String, () -> witnessProgramAsBase58, List.of(STATIC_EMPTY_AMOUNT_AS_STRING) ); // FixedWidthBase58BitcoinAddress (no amounts) addFormattedAddresses( uncompressedTestAddressesAsFixedWidthBase58BitcoinAddress, uc::getIndexAsBase58String, () -> witnessProgramAsBase58, NO_AMOUNTS ); addFormattedAddresses( compressedTestAddressesAsFixedWidthBase58BitcoinAddress, co::getIndexAsBase58String, () -> witnessProgramAsBase58, NO_AMOUNTS ); addFormattedAddresses( uncompressedTestAddressesWithStaticAmountAsFixedWidthBase58BitcoinAddress, uc::getIndexAsBase58String, () -> witnessProgramAsBase58, NO_AMOUNTS ); addFormattedAddresses( compressedTestAddressesWithStaticAmountAsFixedWidthBase58BitcoinAddress, co::getIndexAsBase58String, () -> witnessProgramAsBase58, NO_AMOUNTS ); // HexHash (no amounts) addFormattedAddresses( uncompressedTestAddressesAsHexHash, uc::getIndexAsHash160HexEncoded, () -> witnessProgramAsHex, NO_AMOUNTS ); addFormattedAddresses( compressedTestAddressesAsHexHash, co::getIndexAsHash160HexEncoded, () -> witnessProgramAsHex, NO_AMOUNTS ); addFormattedAddresses( uncompressedTestAddressesWithStaticAmountAsHexHash, uc::getIndexAsHash160HexEncoded, () -> witnessProgramAsHex, NO_AMOUNTS ); addFormattedAddresses( compressedTestAddressesWithStaticAmountAsHexHash, co::getIndexAsHash160HexEncoded, () -> witnessProgramAsHex, NO_AMOUNTS ); } private void addFormattedAddresses( Set targetSet, Function addressGenerator, Supplier staticAddressSupplier, List amounts ) { boolean includeAmounts = !amounts.isEmpty(); String fallbackAmount = includeAmounts ? amounts.getLast() : null; for (int i = 0; i < NUMBER_OF_ADRESSES; i++) { String address = addressGenerator.apply(i); if (includeAmounts) { String amount = i < amounts.size() ? amounts.get(i) : fallbackAmount; targetSet.add(address + COMMA_SEPARATOR + amount); } else { targetSet.add(address); } } String staticAddress = staticAddressSupplier.get(); targetSet.add(includeAmounts ? staticAddress + COMMA_SEPARATOR + fallbackAmount : staticAddress ); } @Override public List createAddressesFiles(TemporaryFolder folder, boolean addInvalidAddresses) throws IOException { File one = folder.newFile(ADDRESS_FILE_ONE); File two = folder.newFile(ADDRESS_FILE_TWO); File three = folder.newFile(ADDRESS_FILE_THREE); Files.write(one.toPath(), Arrays.asList( testAddresses.getIndexAsBase58String(0) + COMMA.getSymbol() + amountFirstAddress, testAddresses.getIndexAsBase58String(1) + TAB_SPLIT.getSymbol() + amountOtherAddresses, testAddresses.getIndexAsBase58String(2) + SEMICOLON.getSymbol() + "1" )); Files.write(two.toPath(), Collections.singletonList( testAddresses.getIndexAsBase58String(3) )); List listThree = new ArrayList<>(); { listThree.add("# Test"); listThree.add("1WrOngAddressFormat"); listThree.add(P2WPKH.BitcoinP2WPKH.getPublicAddress()); listThree.add(testAddresses.getIndexAsBase58String(4)); if (addInvalidAddresses) { // secret : 1 listThree.add("1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm"); listThree.add("1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH"); } } Files.write(three.toPath(), listThree); List addresses = new ArrayList<>(); addresses.add(one.getAbsolutePath()); addresses.add(two.getAbsolutePath()); addresses.add(three.getAbsolutePath()); return addresses; } @Override public TestAddresses getTestAddresses() { return testAddresses; } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/staticaddresses/TestAddressesLMDB.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.staticaddresses; import java.io.File; import java.io.IOException; import java.util.List; import net.ladenthin.bitcoinaddressfinder.AddressFilesToLMDB; import net.ladenthin.bitcoinaddressfinder.configuration.CAddressFilesToLMDB; import net.ladenthin.bitcoinaddressfinder.configuration.CLMDBConfigurationWrite; import org.junit.rules.TemporaryFolder; public class TestAddressesLMDB { public File createTestLMDB(TemporaryFolder folder, AddressesFiles addressesFiles, boolean useStaticAmount, boolean addInvalidAddresses) throws IOException { CAddressFilesToLMDB addressFilesToLMDBConfigurationWrite = new CAddressFilesToLMDB(); List files = addressesFiles.createAddressesFiles(folder, addInvalidAddresses); addressFilesToLMDBConfigurationWrite.addressesFiles.addAll(files); addressFilesToLMDBConfigurationWrite.lmdbConfigurationWrite = new CLMDBConfigurationWrite(); addressFilesToLMDBConfigurationWrite.lmdbConfigurationWrite.useStaticAmount = useStaticAmount; addressFilesToLMDBConfigurationWrite.lmdbConfigurationWrite.staticAmount = 0L; File lmdbFolder = folder.newFolder("lmdb"); String lmdbFolderPath = lmdbFolder.getAbsolutePath(); addressFilesToLMDBConfigurationWrite.lmdbConfigurationWrite.lmdbDirectory = lmdbFolderPath; AddressFilesToLMDB addressFilesToLMDB = new AddressFilesToLMDB(addressFilesToLMDBConfigurationWrite); addressFilesToLMDB.run(); return lmdbFolder; } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/staticaddresses/enums/P2PKH.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.staticaddresses.enums; import java.nio.ByteBuffer; import net.ladenthin.bitcoinaddressfinder.ByteBufferUtility; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import net.ladenthin.bitcoinaddressfinder.NetworkParameterFactory; import org.bitcoinj.base.Network; import org.bouncycastle.util.encoders.Hex; public enum P2PKH implements PublicAddress { /** * https://chainz.cryptoid.info/42/address.dws?7793.htm */ _42Coin("4MTfaF2ummgMp456oxRqefv3YSXPAJJUrt", "55136a92273338f277a5d8a845e637b7f4b8f1b2"), /** * https://chainz.cryptoid.info/alias/address.dws?53237.htm */ Alias("SSvrL2DGaCHFTbEA3CBx6pNTzs6EMXfrcp", "3dd0c10264dc3167da849fd62f297b7d2ae0c556"), /** * https://chainz.cryptoid.info/agm/address.dws?110142.htm */ Argoneum("MJuv7nHoyyv7F4Dy8m33uMPqitnkRrRxsw", "78ce046cb8eb2e3671e9f96cb96923357acc156e"), /** * https://chainz.cryptoid.info/aby/address.dws?4281.htm */ Artbyte("CVVdgmYmygNSParn5SR8agYKEMsiMVFQiF", "8eee0ae5d8eaa9a0440feb600e41a1463f7d7b39"), /** * https://chainz.cryptoid.info/aur/address.dws?947212.htm */ AuroraCoin("AYZUxKP8JcgwxksZTnDKyAeb5o4EwYXyiT", "b822342d1c6b82cc8979128cbf76186463c3a6c0"), /** * https://chainz.cryptoid.info/b3/address.dws?1103.htm */ B3Coin("SSYpeH33oR9MqnFufvET9Zv9968aDv9k6r", "39a6322da11d08048136fe580b4c69ff32571280"), /** * https://chainz.cryptoid.info/bqc/address.dws?563888.htm */ BBQCoin("bF4YneWzKSnyirMsuWd1dLqY2ACuBdLvE5", "199596c432527bc1cef625d465a122a12c87d65b"), /** * https://chainz.cryptoid.info/bean/address.dws?2910182.htm */ BeanCash("2XkvbsZ6Tza19Lwix4HBwK9aHgXqV6bqAC", "cd99b30b02ae8392b4ef41060ae040202b5d4331"), /** * https://chainz.cryptoid.info/bbp/address.dws?1816663.htm */ Biblepay("BCkjnP5jbs87VnPQZqBKrBqZB6j7icUCnc", "5b17f002a587662b46bf597f679a21ab89425d48"), /** * https://chainz.cryptoid.info/bay/address.dws?68031.htm */ BitBay("BJLZ29gAk9aGW9HoAnsEzqmWp6BX7tZEN8", "9855b998e3207a7c21357b5ecf10a46265dae9b0"), /** * https://chainz.cryptoid.info/bbk/address.dws?348283.htm */ BitBlocks("BKxdSFuJQDgMgegACDtnv5SoR5iqB5WATk", "aa2082ea8a4ea667f767d37fdea9986b14469006"), /** * https://privatekeys.pw/bitcoin/address/1JRW4d8vHZseMEtYbgJ7MwPG1TasHUUVNq */ Bitcoin("1JRW4d8vHZseMEtYbgJ7MwPG1TasHUUVNq", "bf1c61ac19576d71d4623b185f3bae2a3d4df6bc"), /** * https://privatekeys.pw/bitcoin-cash/address/qz7xc0vl85nck65ffrsx5wvewjznp9lflgktxc5878 */ BitcoinCash("qz7xc0vl85nck65ffrsx5wvewjznp9lflgktxc5878", "bc6c3d9f3d278b6a8948e06a399974853097e9fa"), /** * https://privatekeys.pw/address/bitcoin-cash/qzh96ajgz9ufvs4zmrzq8jr95s7nm0qlnclvk3vpe0 */ BitcoinCashWithPrefix("bitcoincash:qzh96ajgz9ufvs4zmrzq8jr95s7nm0qlnclvk3vpe0", "ae5d764811789642a2d8c403c865a43d3dbc1f9e"), /** * https://bitinfocharts.com/de/bitcoin%20gold/address/GUGsnYNyGYDe4GT2iQKLDjKFPpd4KBXMQB */ BitcoinGold("GUGsnYNyGYDe4GT2iQKLDjKFPpd4KBXMQB", "726975f819dc2043a0350257e92560e59d2e48ae"), /** * https://btc.cryptoid.info/btco/address.dws?13423.htm */ BitcoinOil("BY1DJzLaaTnjcueh2QLTnV3C8EBHWymcPN", "2e3f213ff41f777385de34e333d79c17efe04015"), /** * https://chainz.cryptoid.info/xbc/address.dws?117821.htm */ BitcoinPlus("BMPf5LdLW5bRtG7VnTsKH2tQBd4RpVatrW", "b9d4679855e410bb7e3881594299b2b9e3f5cc9c"), /** * https://privatekeys.pw/bitcoin-testnet/address/miner8VH6WPrsQ1Fxqb7MPgJEoFYX2RCkS */ BitcoinTestnet("miner8VH6WPrsQ1Fxqb7MPgJEoFYX2RCkS", "23e077ffac6f109795a82021dc1698bd9ce40119"), /** * https://chainz.cryptoid.info/btx/address.dws?6572703.htm */ BitCore("2NuwYZ1frd3s7FPTGLqkR2zNLTviQcac7o", "6c9519147914a961d277d5daff370ae1c7c4a5fa"), /** * https://chainz.cryptoid.info/btmk/address.dws?1351759.htm */ Bitmark("bb2CrvTj9EfwxYkqkf5oYpEq8sTxxxTzzV", "f486a398c5071b090a64b41c97bf42024063eb3d"), /** * https://bitinfocharts.com/de/blackcoin/address/BF58Wm7hXSPXxfXm6HwrkWAr45qrZhNHJu */ BlackCoin("BF58Wm7hXSPXxfXm6HwrkWAr45qrZhNHJu", "7482a6aabd8e0bdb6d56a507a6f1352f7cc872fa"), /** * https://chainz.cryptoid.info/bbtc/address.dws?1165674.htm */ BlakeBitcoin("2gpsus4Tvd7KDPErd4bWTY3CMqcNa2B7BiZ", "1e227f527ddb3ba72ebdf7b97749a2fd4835d121"), /** * https://chainz.cryptoid.info/blc/address.dws?673727.htm */ Blakecoin("Bdzkka2a7GUBSgqffVYwmkPjzvUGWC8dc9", "6ff9b6dba70fb1e94f27a03bccbb991b82051a6f"), /** * https://chainz.cryptoid.info/block/address.dws?16204.htm */ Blocknet("BUE65eaeh3NZwNm2p5yKSstxteYvShi4yu", "04cdffba976b79c0d25f06c56151fef6a2a3156b"), /** * https://chainz.cryptoid.info/boli/address.dws?25860.htm */ BolivarCoin("bKkVYXDjG8cRrR11cvmujAg7RkVHD2Whz7", "4d0405e0b2932f994cc0f686512a3ccd2c7d714d"), /** * https://chainz.cryptoid.info/bytz/address.dws?547646.htm */ BYTZ("sLR4SH5jyqyBW7PSvynBcuj3ftSxF89A6s", "17c40395c01837b0661ca7542b0812eb685d3dbc"), /** * https://btc.cryptoid.info/cdn/address.dws?124.htm */ CanadaECoin("CQcWHGHSwa3oNVdKMQ2QQrsprAusKVHpgh", "596224cf7ea3ea29af56db750c1056c9769415fa"), /** * https://chainz.cryptoid.info/cat/address.dws?161276.htm */ Catcoin("9jMLSxzshX8dHvv2SjhrfGcKq15UsyjeZY", "b248332ed86b2041fe7222953cbc4de6607ab7b6"), /** * https://chainz.cryptoid.info/chess/address.dws?142577.htm */ ChessCoin("CahtBj65GuRju1qLkxhx1Ebc8FzGKECNG1", "c817c433719ca903caba000ec6763da7f3675d7a"), /** * https://chainz.cryptoid.info/clam/address.dws?3846102.htm */ Clam("xJDCLAMZpUG2XsTdek7ZBSW5RhUxHL5MrV", "6ca9d69643c78efc8f82a62b73793f711c3b6c2c"), /** * https://chainz.cryptoid.info/cloak/address.dws?316050.htm */ CloakCoin("C5REwXC5GL9HN3bLy6XcikhwLzitcE2Kha", "86d65f6ff0ecacf26f33a31a7d74f22f426ff77b"), /** * https://chainz.cryptoid.info/cnote/address.dws?CPZPjKt9Bm6CAiV3ycS8dd4W5toJPbJive.htm */ CNote("CPZPjKt9Bm6CAiV3ycS8dd4W5toJPbJive", "4dd34d4a0938d11f0a4f2c2ac8e60115e0696c63"), /** * https://chainz.cryptoid.info/cno/address.dws?221360.htm */ Coino("UWdeqR8s34asJ1qEtWdWeCyNDqg3aXeCjH", "5edf2ec006b5312443f66cc966472d2b1b385b89"), /** * https://chainz.cryptoid.info/colx/address.dws?116595.htm */ ColossusXT("DSesymccyAQr6LjGLCHsvHzE41uKMk86XS", "ebfca2b8c5f6bdcc926ee3fe238a74c1440e22a7"), /** * https://chainz.cryptoid.info/comp/address.dws?41809.htm */ Compound("CHHJHhRUsWfi2jgJjqg839FVQ9RA7nsuUr", "08f7596368cb2edab1c2621ff97b5a76bbb0ef6e"), /** * https://chainz.cryptoid.info/crw/address.dws?1628649.htm */ CROWN("CRWVHacqVcMNdCduFLTKRT9EmiJCku7ydH6R", "7507bdfe41900b209a5f8d341b867cbc72f470ec"), /** * https://chainz.cryptoid.info/shares/address.dws?355140.htm */ Cryptoshares("B9M5WjVn3MbGgsp9TpnVP1mh5Y6bDeZphw", "35b60c0baaf8bd75b0d6ae0160adc906eba7e62c"), /** * https://chainz.cryptoid.info/cure/address.dws?12256.htm */ Curecoin("B4dbDb5Qt7DifAd26LqJZi756fNB9YS2JB", "01fcde97ab8306f16ea73417c5e474c42b647ffb"), /** * https://privatekeys.pw/dash/address/XdAUmwtig27HBG6WfYyHAzP8n6XC9jESEw */ Dash("XdAUmwtig27HBG6WfYyHAzP8n6XC9jESEw", "1b2a522cc8d42b0be7ceb8db711416794d50c846"), /** * https://chainz.cryptoid.info/defcon/address.dws?DK18QNPWoD4PYRXDSzWsyoTLSPhxmEYKRn.htm */ Defcon("DK18QNPWoD4PYRXDSzWsyoTLSPhxmEYKRn", "980ffd3fd11b82d4e5f7e049e62c41269f7170e2"), /** * https://chainz.cryptoid.info/dfi/address.dws?2581182.htm */ DeFiChain("dbxMfrpLMQXUdcdz8dUs5gp97nzH5A2br5", "f7330ba6437fe7454c8e46f967fc28ca01cd5d2f"), /** * https://chainz.cryptoid.info/dem/address.dws?85.htm */ DeutscheEMark("NbN8X6sUKw9cuX5JYX7X8RS2ro5ZbkAFDf", "a97c7e369e2a6143f740a102dff61ba39e8aec39"), /** * https://chainz.cryptoid.info/dmd/address.dws?250463.htm */ Diamond("dZ2n5pMvviVjps7kJ4CYMniakSeDLjz4su", "d720b604208ce237d575dc2223fec7214488864a"), /** * https://chainz.cryptoid.info/dimi/address.dws?E78M6JWfXF219B721XmUatwPtcXonWPtua.htm */ DiminutiveCoin("E78M6JWfXF219B721XmUatwPtcXonWPtua", "92034764067da1cfe5a5c7e3f0a34f58a47dd878"), /** * https://dgb.tokenview.io/en/address/DUFy8rH6dxkGutvo43WZryXjR3DU612sjh */ Digibyte("DUFy8rH6dxkGutvo43WZryXjR3DU612sjh", "fd979fe2f333d8a6cc0cb21eeb34d958a2691aa8"), /** * https://chainz.cryptoid.info/dgc/address.dws?1250320.htm */ DigitalCoin("DQMLne3GZHo4uiu5nWsxdFsTrrmxYJnubS", "d2bb4667cb0c1b5d7eae0a97d2af3d83961778f4"), /** * https://chainz.cryptoid.info/dime/address.dws?1095943.htm */ Dimecoin("7LgAUerFPc2RfGJ9bLK14NCH2ZmXZNFnc4", "c11e4bc44d8874da582f33b25304fa3207d2b229"), /** * https://chainz.cryptoid.info/divi/address.dws?896418.htm */ Divicoin("DGu4qUwJNK3MW4EA1YgYoNMPgvBfggN8az", "80fa43aa6c5b022acf18b7a82ee866e334e035a0"), /** * https://privatekeys.pw/dogecoin/address/DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L */ Dogecoin("DH5yaieqoZN36fDVciNyRueRGvGLR3mr7L", "830a7420e63d76244ff7cbd1c248e94c14463259"), /** * https://chainz.cryptoid.info/dogm/address.dws?57664657.htm */ Dogmcoin("DBs4WcRE7eysKwRxHNX88XZVCQ9M6QSUSz", "49c0882928a51fe36c50977417a9a34025912803"), /** * https://btc.cryptoid.info/doi/address.dws?54325.htm */ Doichain("N6QZUS3kbPyyTHa1Km6YKereP4rNjiiCyJ", "6bd681fb9d151be554e28d3c95b9fb73d9e6c11c"), /** * https://chainz.cryptoid.info/efl/address.dws?228227.htm */ eGulden("LfWE9Jqe8sJG31eeYemjvJN5yPyYxDNRJ1", "de766d85720138fc3fef6192e8c3641c55d9c867"), /** * https://chainz.cryptoid.info/elt/address.dws?5151818.htm */ Electron("eCYQZH1khh3p6LEWYE2skmSuDU8UPuZu7T", "7297dfd7cc4bacaf7400f0f27d09907701781870"), /** * https://chainz.cryptoid.info/hyp/address.dws?187625.htm */ Element("pQBXh5QCNMSu5kAqc3xzc1XUhePncwugmA", "6f8f0a226685adc6654c5e7f3ba1746515f2e1a3"), /** * https://chainz.cryptoid.info/1337/address.dws?758581.htm */ Elite("LZ1mXdpVU9akMvav4BKXXbg28MUzVLNGJB", "9743cf1eae02588033f86ef3b48204561df43197"), /** * https://chainz.cryptoid.info/emd/address.dws?1369726.htm */ Emerald("EnMcky7NAEaJUEDS5DfG4J6VQ4So66XDqK", "4052ab77e7f4ea9ffe56b439de36bf4f64155123"), /** * https://chainz.cryptoid.info/egc/address.dws?259889.htm */ EverGreenCoin("EN4TgTCzrfpBxvXFKGyjm7Esad3gZXBnhc", "35d10077a94254b7194328851896a53f154ead69"), /** * https://bitinfocharts.com/de/feathercoin/address/7E2vzSfb8o3N8E3PEZ6A48sp6bUGUTA8ro */ Feathercoin("7E2vzSfb8o3N8E3PEZ6A48sp6bUGUTA8ro", "7842e48f5012d40ec702ec41d377559bc51f817a"), /** * https://chainz.cryptoid.info/firo/address.dws?1494520.htm */ Firo("a8tXPzGEYxcehK6ehfpCUXTtQ6VocQHHRT", "59a837e0745d9119d7ae272be5239ebb080def77"), /** * https://chainz.cryptoid.info/freed/address.dws?35349.htm */ Freedomcoin("TZgGMmNmu7ozAuwcQ7bgKapVQovn4wxzMw", "040ebfefff7fe443ed5f1bc5b0fbb73d6ce44578"), /** * https://bitcointalk.org/index.php?topic=822498.0 */ GapCoin("GQE3hMaBz1uCCMATzXGfYK13A8PjqxKxz6", "45fffb945d96b0ba152d9e3c76245bf67f4ef441"), /** * https://chainz.cryptoid.info/gold/address.dws?83174.htm */ Goldcash("GJU2Y9Nk8mhEcsEXfJRv7y8QLeSEW48Q7c", "06d4158cc047ae8b2861fb51817c9e66ea95c42f"), /** * https://chainz.cryptoid.info/glc/address.dws?3389113.htm */ GoldCoin("EBjzKcELCkTehejJuk9UFimSHhTYcXB6hf", "c4a16b0fcf3e21514795e54cbae1e36e75f77be9"), /** * https://chainz.cryptoid.info/grs/address.dws?1346801.htm */ Groestlcoin("Fm5t7ayvYgJX7UF8CYiMRQyLRy6F38Px9S", "ae9800906772c4578cb27c0f90e3f165a2bc031e"), /** * https://chainz.cryptoid.info/hms/address.dws?6549.htm */ Hemis("HQCt7Rt4gwfnnjcMtyAV4CCPvxojkaEt5F", "c1fedc737068099b9379ee2536c54cd929c5c80a"), /** * https://chainz.cryptoid.info/heirs/address.dws?2933.htm */ Herencia("HSBNkVSiw1JXe54pcm8sF8gMDViGgChdpv", "d7a62ff9cf419b28c2701502c5b98da27dd6d023"), /** * https://chainz.cryptoid.info/hbn/address.dws?446420.htm */ HoboNickels("Encp6KpMCfnV7ks3PMmC64xK7bTMNxDPSi", "43325ec28ecd5e623eabc3a9390b484a2cfb6389"), /** * https://chainz.cryptoid.info/html/address.dws?399577.htm */ HTMLCOIN("HfLvLV5tedPCu3KjB9jmCwXpKg4t1Q8cFX", "680deed90b17bb4793d13b9afd1311f117637b9e"), /** * https://chainz.cryptoid.info/ioc/address.dws?65914.htm */ IOCoin("iYL3GepzxkhnojHbxriiKub4eSG5yd2gZh", "3c80cfa9a979502574351e84ec0f7ef8f0d134bb"), /** * https://chainz.cryptoid.info/dct/address.dws?501.htm */ IDChain("DUARKejqgQY56Ro9rr48iggZ4GgqgA4hKN", "fc8afcea04e9f1a7da5c893747fee960cfa427d5"), /** * https://chainz.cryptoid.info/inn/address.dws?17764.htm */ Innova("i8N8m3h8DXWrBYkFAgCKjnPY2vriezuB5h", "35a334ed46aaa35a7795bf1b576850a3406f8800"), /** * https://chainz.cryptoid.info/il8p/address.dws?111.htm */ InfiniLooP("EYWLjjKWCTrb8hCTg8RJXUfbnjhNa8rRJ6", "a867474e613850d49d8414fce7d8bb966040bb06"), /** * https://chainz.cryptoid.info/ifc/address.dws?2316816.htm */ Infinitecoin("iRRmTw3y6dLTG6Qpu1R141yc1rL49wtQQH", "f0cd3b9102e339eab7ba40bdb57619263ed89432"), /** * https://chainz.cryptoid.info/ixc/address.dws?634789.htm */ iXcoin("xuwcXvEq64V5cYJ8ChrfoiRs53JaB98ee6", "f49bea19b0d0c89d12007716268c1c54cc001979"), /** * https://chainz.cryptoid.info/kobo/address.dws?13486.htm */ Kobocoin("FMGXA8MyNqu4EuoA5TYjZRB96aPpXRSXWe", "a95810cceb527f7c9d968c7fc6fa639e27ff8796"), /** * https://chainz.cryptoid.info/kmd/address.dws?2911308.htm */ Komodo("RBmjPBHH65gbBSgLBByM1NxJJWwZMmG3Pa", "1b5607bab686183e8cde7f77f5a887e807a4930a"), /** * https://chainz.cryptoid.info/lana/address.dws?78499.htm */ Lanacoin("LTdb5KrqryPihAU1RebDCy8tVxi1SVtGqu", "5c394d80bcd5525edd67777d3566c39ee52a3872"), /** * https://privatekeys.pw/litecoin/address/LQTpS3VaYTjCr4s9Y1t5zbeY26zevf7Fb3 */ Litecoin("LQTpS3VaYTjCr4s9Y1t5zbeY26zevf7Fb3", "3977ea726e43b1db5c1f3ddd634d56ade26eb0a2"), /** * https://chainz.cryptoid.info/lcc/address.dws?CdEK8wqqzg5ekA6hT9uwiv1TfPad9Wjx1z.htm */ LitecoinCash("CdEK8wqqzg5ekA6hT9uwiv1TfPad9Wjx1z", "e3c953658a0c16ec171553fc923d7c2e11163d32"), /** * https://chainz.cryptoid.info/ldoge/address.dws?132909.htm */ LiteDoge("dcdGuzwAjRH8DwpvyzKyLPdvuArfzXcxtN", "fe8f4c38418fea2d9b0c184c812537e78f2f35d0"), /** * https://chainz.cryptoid.info/lit/address.dws?1790.htm */ Lithium("8y4ntNNxfGuFFFerq4owz6kxoJsPq5XZ6K", "cc81a9d59440c823efc483c73c121b7074083a7a"), /** * https://chainz.cryptoid.info/lky/address.dws?358026.htm */ Luckycoin("LBZYLUyFVyA3FymzQD7EpFfPNC28SLwpX3", "abf35719593fd163e15fb9daba4752e3ce0fbda5"), /** * https://chainz.cryptoid.info/lynx/address.dws?999646.htm */ Lynx("KJ2MGS3jq4DPkVmE1ephMCbT7ojDcDSJRG", "769eca30fe71718db7fba89f101d243d55d50b02"), /** * https://chainz.cryptoid.info/mn2/address.dws?3764.htm */ MasterNoder2("JXdRe3J2ZP3U865Y4jLZwGheNV5nRarJKM", "8fa35695a1d627429797681c059a8efed34188ab"), /** * https://chainz.cryptoid.info/moon/address.dws?1498374.htm */ Mooncoin("MR3pPKTnPAdGaGAabC47ax954hzufzobkr", "bc1d5093b7e68e334b973f20adeb54ba85389a76"), /** * https://chainz.cryptoid.info/mota/address.dws?66980.htm */ MotaCoin("MQwRgiHeTj12KsX3DjtwXsVuivPntNMAPb", "bae7deb0c0c247b66356c64dee97df7993a6537f"), /** * https://chainz.cryptoid.info/xmy/address.dws?3867024.htm */ Myriad("4qJBRfzfsXHjTn22B946xTgV1EjBAAUwN3", "866bb2b191810842189f0dab3ad6fcdcf2ee368d"), /** * https://bitinfocharts.com/de/namecoin/address/NAxZHe6yUCADnGAeCs4xrkgEKHjSFVrK5m */ Namecoin("NAxZHe6yUCADnGAeCs4xrkgEKHjSFVrK5m", "9dc42a94d1852c6b42f93e8130d4a589bc3ffa1f"), /** * https://chainz.cryptoid.info/nyc/address.dws?1710034.htm */ NewYorkCoin("RWKh9kHForWNUqoAiQpzoekiPUpwhGceRQ", "e6d3be0495d42340b2b95d269ffcec077d3a040b"), /** * https://bitinfocharts.com/de/novacoin/address/4aLpet1cqwr6TuEb8grfAnpvD1eJbTqyvN */ Novacoin("4aLpet1cqwr6TuEb8grfAnpvD1eJbTqyvN", "e261b8251b26231b0e2d62d7f6698d7acee1dbae"), /** * https://chainz.cryptoid.info/owc/address.dws?AdNSnHTdxx57E7PbQsZ2jKy8JaM3m4P9yc.htm */ Oduwacoin("AdNSnHTdxx57E7PbQsZ2jKy8JaM3m4P9yc", "ece47177e78e643426d866903bde1ec426a07378"), /** * https://chainz.cryptoid.info/pnd/address.dws?5.htm */ PandaCoin("PWdoUrPx9F2jeZpQGhFs5jr5CDmuE98Foe", "f1d1ec1375ef9cf6ce0232563ea7b611ea04dfb7"), /** * https://chainz.cryptoid.info/part/address.dws?437060.htm */ Particl_P("PfF7TAgTcKBLKNqrzBP7BEf1giQ1YzBmfq", "50407d0e5fae1e4b440a51aa0ddc75bcc0b3925e"), /** * https://chainz.cryptoid.info/part/address.dws?168727.htm */ Particl_R("RQYUDd3EJohpjq62So4ftcV5XZfxZxJPe9", "a76d99568f600ad29333229f74b4724bc991192a"), /** * https://chainz.cryptoid.info/pcn/address.dws?95072.htm */ PeepCoin("PB2WBA65zL8CA6UmQgBoJkvzd4ukNTwkGx", "1aba872ee91a1ee53975bec9222b795d3ac9b22f"), /** * https://chainz.cryptoid.info/pac/address.dws?1398861.htm */ PACProtocol("PRppFVk7UgeZEZzEF2zHWkvRPGU4rqzSxc", "bd0e82e8d1170adade5253c0293a3904261f73cc"), /** * https://chainz.cryptoid.info/pak/address.dws?3611.htm */ PakCoin("PQC6NTc7Pi4reEPWnJEDAmMhqumjmrSAwV", "ab24738aec2c21a9263e89b4973b84c7e0263a78"), /** * https://chainz.cryptoid.info/ppc/address.dws?932101.htm */ Peercoin("PN9ZrKwPttJxM8VMsfBFtAWzbycpG2cosD", "94b9e4350dd548e23642a903b79ec90d65ede272"), /** * https://chainz.cryptoid.info/pho/address.dws?1869533.htm */ Photon("Brs3KRPZBUMnFN35j87aRNUtMEqQqDtqf3", "fd1dd9c88af3350afc254ad747d5e815a2705315"), /** * https://chainz.cryptoid.info/pink/address.dws?299.htm */ Pinkcoin("2Ki78CrqJMZBPP8y4ShhstMJantscKUe24", "496fb9eab64aad43243809fe5f7842eed1ae5cea"), /** * https://chainz.cryptoid.info/pivx/address.dws?884545.htm */ PIVX("DSfrFyx2pYR2GzxQuVoysfmqaiRbNf9iR6", "ec2b9d8bf19a3bd4cf75f1c72823832fab597200"), /** * https://chainz.cryptoid.info/pot/address.dws?1587087.htm */ PotCoin("PSSaD2tSKy3NBi3SgeR8UKFXVzjmp8kTj9", "c3d1c390d84f32d482eb8e3cfcf120ed82eb3192"), /** * https://chainz.cryptoid.info/xpm/address.dws?4777847.htm */ Primecoin("ALcTQaSPKVNdkXMZNG5b75GYHr1C5Yf2Zi", "3510a69548ee579eae8271d0f2b81094d48d1b69"), /** * https://chainz.cryptoid.info/ppc/address.dws?1288727.htm */ Peercoin_SmallPrefix("p77CZFn9jvg9waCzKBzkQfSvBBzPH1nRre", "23c89acd257e796c209f6f1914ed999f45076d10"), /** * https://chainz.cryptoid.info/put/address.dws?6846.htm */ PutinCoinV2("PLb6rb9pxN4YtmfUxjzwUW7TeoqzRPu9cY", "839deb912be5bd9f306cb7dae3d8fdb7562ba983"), /** * https://chainz.cryptoid.info/qrk/address.dws?1060048.htm */ Quark("QNix46KwSXLWZnfaTPeEKo4LAN8rrhgRMS", "17417298753389ceed2a4be28c2b4876ddd14d3e"), /** * https://chainz.cryptoid.info/rtm/address.dws?1909401.htm */ RaptoreumCore("RSbJLCmy8bntuXSeCkFJN72y3ZS1jWopXC", "bde6d877af4d3bcc751ed975cfb8a3d2ae281a4d"), /** * https://bitinfocharts.com/de/reddcoin/address/RdLmuVt2ByWxXhiqhKSk4aV9UPLj6Lu3HL */ Reddcoin("RdLmuVt2ByWxXhiqhKSk4aV9UPLj6Lu3HL", "33d101e6da33f9d1da43069cfd7bf370208c9c37"), /** * https://chainz.cryptoid.info/sls/address.dws?1722.htm */ SaluS("SMi87Up6Jh6GKTGFGfx1LLPKwFFWKRhDA3", "048fe4a5563845f36912a0878c03f1871ddc251b"), /** * https://chainz.cryptoid.info/sxc/address.dws?930873.htm */ SexCoin_R("RxZUt9y7zAAD9dZrNnxzAh4RY2qSTVJkDi", "06a2983808b90eabc717fd46cfaa7b970bb7b59c"), /** * https://chainz.cryptoid.info/sxc/address.dws?952091.htm */ SexCoin_S("SH6sWzoWUnVz2kFJ4CrMmdkiTKwWejg1yc", "d204a600a32353e2f1e0035d9308073f22a98036"), /** * https://chainz.cryptoid.info/slm/address.dws?77842.htm */ Slimcoin("SfkdJxgVVPR1S8DomypDfihAyRcthFCCzm", "ca7b5cc5b8e95a01f32f0dbc6358d8020aa247a0"), /** * https://chainz.cryptoid.info/smly/address.dws?940996.htm */ Smileycoin("BDKdA9AkMvcQSHeMKy5ua6TJ4PnCK4vsQd", "61502257e1724b08f97ae822ef304a619d09d86a"), /** * https://chainz.cryptoid.info/smoke/address.dws?1.htm */ Smoke("SRAz9FdB9MsmpvdmgQUXwzxFmjryCp5DHQ", "2a8cd9528e74d0da9a1bab9a5cafc06d826c8cb3"), /** * https://btc.cryptoid.info/rod/address.dws?676451.htm */ SpaceXpanse("RFufZfLKFiZrDjQUZrEFDCr5din6syy8gM", "48b6ac418c0622e4bf41e21d142638d2a9fd445f"), /** * https://chainz.cryptoid.info/spk/address.dws?194876.htm */ Sparks("Gc5z6Wrx9j5oHz2BbFAYK3fTxxhju1AuCZ", "c81b28a348c3592195395fac9608f94ca2ab6b60"), /** * https://chainz.cryptoid.info/stk/address.dws?24242.htm */ Stakecoin("JM8BsqX9cQYWeKzrtpxA6z5Au1WXJqmnph", "1c6a878a1e7ff50fb82d5bb91d5017035d3d56aa"), /** * https://chainz.cryptoid.info/slg/address.dws?88363.htm */ Sterlingcoin("SeZm4fynaUaxwpsLmTPcXk8pCUbABbe2Z9", "bd75222a12897b9430d273cd14fd18c2514732b1"), /** * https://chainz.cryptoid.info/shnd/address.dws?167849.htm */ Stronghands("SNDtNuEqiNN1U4p5J9opMXM5UTfSkHRtQn", "0a30e8473e2e489d3a5e468a6fadab937f17b4d9"), /** * https://chainz.cryptoid.info/sys/address.dws?10476.htm */ Syscoin("SUBbe8vb7ng9CxZE9J3hma2CCkBh5VBHrv", "4b92dbc7787cc53b5aa02bc026bd27c5dd5b1d93"), /** * https://chainz.cryptoid.info/taj/address.dws?43831.htm */ TajCoin("THNWmgEnfZwE8aSFnCVaXcjqDVucMmJXmy", "513147d92076e92214bc2d00331c100fdb93809d"), /** * https://chainz.cryptoid.info/trc/address.dws?1286494.htm */ Terracoin("1FkmsofK4BMZPSZhQk55AoPKSiWiS933En", "a1d91b9dde62edbccda90476572842c5bdafbd53"), /** * https://btc.cryptoid.info/roger/address.dws?56145.htm */ TheHolyRogerCoin("VWHKSae8spVDCXqQLUNWpjmLPERfGrgToN", "d73df84312ce9b05929ce462fae447eccff9bc3f"), /** * https://chainz.cryptoid.info/tzc/address.dws?956019.htm */ Trezarcoin("TwSNVquvjtSdChxo8dbj7uq2pruKfmXAYM", "f2c0d17f28c7785222a1393a231a4aa06382b2a1"), /** * https://chainz.cryptoid.info/troll/address.dws?41302.htm */ Trollcoin("TsLrBvjAJXs4PJcj45WKqTL42gTWSM2N7z", "c5d4ef4ec1a91d6a7a847f82be51fd01c16327bc"), /** * https://chainz.cryptoid.info/ufo/address.dws?193002.htm */ UFO("Bs9EsQi1EnR5gAca148MJiYGx7SyaYN7uA", "002e2619af0dfd932513e5f3e855a0357abc9995"), /** * https://chainz.cryptoid.info/ufohub/address.dws?41.htm */ UFOhub("UhKK81G37pZxqjLZj3KCBCytFA9LjnXBig", "d4109f5d09158a5dc03cf996b675cedaff157d05"), /** * https://chainz.cryptoid.info/uis/address.dws?690.htm */ Unitus("ug5uuo39uXq8JaQGoQ7gsrDBSk4oDKhk82", "e7f619bc4a9cf90ef5a78c8a0a16c0a98798065d"), /** * https://chainz.cryptoid.info/umo/address.dws?3456423.htm */ UniversalMolecule("uYj4bfbjwj3X3mUZabb4hLsNVqiAUB97qi", "973bbc9c336870a27eea7b054dee864eaacab414"), /** * https://chainz.cryptoid.info/uno/address.dws?291074.htm */ Unobtanium("uRJ4zdTGSLVDTXoVdB7jHHz6W14DhicmWV", "45b8c9a7faee655dd92163bf5ff68066b076ac35"), /** * https://chainz.cryptoid.info/val/address.dws?117121.htm */ Validity("XeUbUeeR5igC3qoiY7ZdvRNrdq5QvBDFTS", "298f874855a346589845ecc35635cfef81788a2e"), /** * https://chainz.cryptoid.info/xvc/address.dws?22910.htm */ Vanillacash("8Z7GY7YR2pDLwLxqLmzca6oHXVnT6NbQzU", "c5b68ee79f2ba1af86375ab221b2e72728ec89c7"), /** * https://chainz.cryptoid.info/vrc/address.dws?531079.htm */ VeriCoin("VSXZqy4WxCtXL8CPjvpndvfJPKkpHM1Aqg", "ae0f5034a122fcd995a44c69f7edb1945d4f4daa"), /** * https://chainz.cryptoid.info/vcn/address.dws?22215.htm */ Versacoin("VUKvcdKG1UhdcWtwhT8iDN43XC253khqnu", "c1cbe947645e17b019b7595c6c86798046df4161"), /** * https://bitinfocharts.com/de/vertcoin/address/VfukW89WKT9h3YjHZdSAAuGNVGELY31wyj */ Vertcoin("VfukW89WKT9h3YjHZdSAAuGNVGELY31wyj", "40daff13d20e5c9fdbf17badda0a8a2df6c83f06"), /** * https://chainz.cryptoid.info/vta/address.dws?3929787.htm */ VirtaCoin("1Cz37kbZyAbYEZWWLXsKB428X1hBFQZCfe", "8372dc3199c2ac3f72dce1b11c7da9ae61efe7c3"), /** * https://chainz.cryptoid.info/xvp/address.dws?40603.htm */ VirtacoinPlus("VBJoxxG2QmXLXzwTKrxwQNFRQPhrCpUhMN", "071bce6346ddba9212682c8177322f491153f6c7"), /** * https://chainz.cryptoid.info/wdc/address.dws?1582980.htm */ WorldCoin("WTUGT6Qgj1DXWfJ6vNjyoT2ambqgxNZJdw", "349ef771619cc37b392d9872b12eb86e9db20921"), /** * https://chainz.cryptoid.info/zet/address.dws?87.htm */ Zetacoin("99zBB5o1KLrHvo6t3MARTnTwA77t3iFfC4", "444b928c98c0bf3877640d38c028ac834f8e5431"), /** * https://privatekeys.pw/zcash/address/t1VShHAhsQc5RVndQLyM1ZbQXLHKd35GkG1 */ Zcash("t1VShHAhsQc5RVndQLyM1ZbQXLHKd35GkG1", "7eeb8313a6c3829217d83a28acb0433a3d6a2bb0"); private final String publicAddress; private final String publicKeyHash; P2PKH(String publicAddress, String publicKeyHash) { this.publicAddress = publicAddress; this.publicKeyHash = publicKeyHash; } @Override public String getPublicAddress() { return publicAddress; } public String getPublicKeyHashAsHex() { return publicKeyHash; } public byte[] getPublicKeyHash() { return Hex.decode(getPublicKeyHashAsHex()); } public ByteBuffer getPublicKeyHashAsByteBuffer() { return new ByteBufferUtility(true).getByteBufferFromHex(getPublicKeyHashAsHex()); } public String getPublicKeyHashAsBase58() { final Network network = new NetworkParameterFactory().getNetwork(); KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(true)); return keyUtility.toBase58(getPublicKeyHash()); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/staticaddresses/enums/P2SH.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.staticaddresses.enums; import java.nio.ByteBuffer; import net.ladenthin.bitcoinaddressfinder.ByteBufferUtility; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import net.ladenthin.bitcoinaddressfinder.NetworkParameterFactory; import org.bitcoinj.base.Network; import org.bouncycastle.util.encoders.Hex; public enum P2SH implements PublicAddress { /** * https://chainz.cryptoid.info/42/address.dws?5973.htm */ _42Coin("9QEnUA3JnXaFXCAjm6fC2naraT6otg6jmV", "e0a09e80866feacac2567198f312b1bce774b2e4"), /** * https://bitcoin.stackexchange.com/questions/62781/litecoin-constants-and-prefixes * https://privatekeys.pw/litecoin/address/M8T1B2Z97gVdvmfkQcAtYbEepune1tzGua * https://privatekeys.pw/bitcoin/address/3MSvaVbVFFLML86rt5eqgA9SvW23upaXdY */ BitcoinAndLitecoinDeprecated("3MSvaVbVFFLML86rt5eqgA9SvW23upaXdY", "d8b83ad7bf8795b9ff61464fcf06f156c28e3e1f"), /** * https://chainz.cryptoid.info/bytz/address.dws?1494.htm */ BYTZ("8VS5PNwJ8URbpUdbsQAPwazu22TFNg9PiN", "9d64a67ad444c2a00373cca73c85fd5f731f1c62"), /** * https://chainz.cryptoid.info/cloak/address.dws?299452.htm */ CloakCoin("BsXZiNs4wZurSwHBbLTZywhcqD4JKRX5oM", "046707c85e3de21f4f7701f724e0e952c6a5ddad"), /** * https://privatekeys.pw/dash/address/7dZe6LvtGPd2TLPpARzThqdF4YwAZvAKDv */ Dash("7dZe6LvtGPd2TLPpARzThqdF4YwAZvAKDv", "7a5c931f83bb3a356c2dcf72b24e1bea461df587"), /** * https://chainz.cryptoid.info/defcon/address.dws?jp6qj5arxERb9xyvRPAHxrvFj9M4BchNdgRbWP9SNnU8aM2VfX65CVckJ4rkeDncswpJv1A.htm */ Defcon("jp6qj5arxERb9xyvRPAHxrvFj9M4BchNdgRbWP9SNnU8aM2VfX65CVckJ4rkeDncswpJv1A", "5b20fbd82666a13dda6c27be3a867e043cf048d5"), /** * https://chainz.cryptoid.info/dfi/address.dws?2770030.htm */ DeFiChain("8W8yVQDEaQiJ5PB4Hy8CvKj9pBtD3zqkhb", "a520c86a08366941cd90d22e11ac1c7eefa2db37"), /** * https://privatekeys.pw/dogecoin/address/A8c3xNz2mqsDLFwv5KL5fpH12QEwDaoTXo */ Dogecoin("A8c3xNz2mqsDLFwv5KL5fpH12QEwDaoTXo", "b15b9098e14dc3c48b4f0a6ac548c66771d30f54"), /** * https://privatekeys.pw/dogecoin/address/9tp7THhBG3fNNFka1AJm95DU3E4x3pwQA3 */ DogecoinMultisig("9tp7THhBG3fNNFka1AJm95DU3E4x3pwQA3", "1a11b73ad3dd99d77da9f858cf323205a84dd5da"), /** * https://privatekeys.pw/litecoin/address/M8T1B2Z97gVdvmfkQcAtYbEepune1tzGua */ Litecoin("M8T1B2Z97gVdvmfkQcAtYbEepune1tzGua", "0605bfbd71b78f7e9fc815fe9cc90aaeb1d9a728"), /** * https://chainz.cryptoid.info/moon/address.dws?846906.htm */ Mooncoin("2QovBjnVke4fgn9UXdz9osheNLxQCk3d8R", "8161b82d4543b119cd8317ff4d33f278fc4feac7"), /** * https://chainz.cryptoid.info/xmy/address.dws?4587668.htm */ Myriad("MAZExxxhYSjr6zmrxd3SRu4sChjYbWW7Ef", "1d240263b4555a8fa09d7e1780ea526e22535fd5"), /** * https://chainz.cryptoid.info/part/address.dws?167783.htm */ Particl_2("2vSfGkmkaqG9XQusB4nWbk2sJXE6ZnGoyT5X3TroxaJfAVeonry", "5487c9b5a7db93e200ca72a2fd32c4d322e70bdc"), /** * https://chainz.cryptoid.info/part/address.dws?166420.htm */ Particl_3("34GQxGYXTZeGQSj8Q1typubQaKYQhEGT7X3QV6HDsjwE93kuDBN", "5ad51842f557faa595eee94a521c790e94a7beaf"), /** * https://chainz.cryptoid.info/ric/address.dws?1357243.htm */ Riecoin("76a914a17ee99993b6fdd0c717a052c35cd654f17e338088ac", "a17ee99993b6fdd0c717a052c35cd654f17e3380"), /** * https://chainz.cryptoid.info/sls/address.dws?3825.htm */ SaluS("AeZbYSeAK6gWWz7aX1eiPPWYFShfi16cih", "f9f8754cfcc9e49ff024a37cd81b8ec99a24164b"), /** * https://chainz.cryptoid.info/ufo/address.dws?312088.htm */ UFO("C4viFjPP5YQwPT61ZdLXowJDwJJYiXj4nk", "81711c475bc15419e47397817e8bf7cb3e5a145a"), /** * https://privatekeys.pw/zcash/address/t3JcMe1E5UkFsUtVb7k17eJwXX5FYUewMBy */ Zcash("t3JcMe1E5UkFsUtVb7k17eJwXX5FYUewMBy", "00847bd140242bd1c9c19024bfe00a4acefbbb85"); private final String publicAddress; private final String scriptHash; P2SH(String publicAddress, String scriptHash) { this.publicAddress = publicAddress; this.scriptHash = scriptHash; } @Override public String getPublicAddress() { return publicAddress; } public String getScriptHashAsHex() { return scriptHash; } public byte[] getScriptHash() { return Hex.decode(getScriptHashAsHex()); } public ByteBuffer getScriptHashAsByteBuffer() { return new ByteBufferUtility(true).getByteBufferFromHex(getScriptHashAsHex()); } private String getScriptHashAsBase58() { final Network network = new NetworkParameterFactory().getNetwork(); KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(true)); return keyUtility.toBase58(getScriptHash()); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/staticaddresses/enums/P2WPKH.java ================================================ // @formatter:off /** * Copyright 2025 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.staticaddresses.enums; import java.nio.ByteBuffer; import net.ladenthin.bitcoinaddressfinder.ByteBufferUtility; import net.ladenthin.bitcoinaddressfinder.KeyUtility; import net.ladenthin.bitcoinaddressfinder.NetworkParameterFactory; import org.bitcoinj.base.Network; import org.bouncycastle.util.encoders.Hex; // P2WPKH addresses public enum P2WPKH implements PublicAddress { /** * https://privatekeys.pw/address/bitcoin/bc1qazcm763858nkj2dj986etajv6wquslv8uxwczt */ Bitcoin("bc1qazcm763858nkj2dj986etajv6wquslv8uxwczt", "e8b1bf6a27a1e76929b229f595f64cd381c87d87"), // Bitcoin Bech32 (P2WPKH) // Created with random data via https://learnmeabitcoin.com/technical/script/p2wsh/ // Public Key Hash: 458cda0e1178d8dd97598df1307ea448bc34c76e BitcoinP2WPKH_Random("bc1qgkxd5rs30rvdm96e3hcnql4yfz7rf3mwdgcxkc", "458cda0e1178d8dd97598df1307ea448bc34c76e"), /** * https://privatekeys.pw/bitcoin/address/bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq */ BitcoinP2WPKH("bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq", "e8df018c7e326cc253faac7e46cdc51e68542c42"), // Bitcoin Oil Bech32 (P2WPKH) /** * https://btc.cryptoid.info/btco/address.dws?3851.htm */ BitcoinOil("btco1q8xgl5s6sknp0kx3a7axk63p8xk797rnwp4fx7z", "3991fa4350b4c2fb1a3df74d6d442735bc5f0e6e"), // BitCore Bech32 (P2WPKH) /** * https://chainz.cryptoid.info/btx/address.dws?7481872.htm */ BitCore("btx1q7tn0z9mln8dq7c73dkrfqpx4wkutqh37sdprwv", "f2e6f1177f99da0f63d16d869004d575b8b05e3e"), // BitCore (WKH) /** * https://btc.cryptoid.info/btx/address.dws?6631790.htm */ BitCoreWKH("wkh_HPOOHTFGYCOP6IBAC6KMKVUQBU6VOHYD", "531d86860dc97923d3dda2c2682fce57637e67e5"), // CanadaECoin Bech32 (P2WPKH) /** * https://btc.cryptoid.info/cdn/address.dws?cdn1qf7kyhfue3fjn4y09ec6cqqsxq56vh7q3z9ea8e.htm */ CanadaECoin("cdn1qf7kyhfue3fjn4y09ec6cqqsxq56vh7q3z9ea8e", "4fac4ba7998a653a91e5ce358002060534cbf811"), // DeFiChain Bech32 (P2WPKH) /** * https://btc.cryptoid.info/dfi/address.dws?df1qvkmmsj6z602rymrx7fn82gqh68dp3v2f068gsu.htm */ DeFiChain("df1qvkmmsj6z602rymrx7fn82gqh68dp3v2f068gsu", "65b7b84b42d3d4326c66f266752017d1da18b149"), // Digibyte Bech32 (P2WPKH) /** * https://dgb.tokenview.io/en/address/dgb1qnjf7e2a5ezft480kxzmhgg66pnzqk0aawxa06u */ Digibyte("dgb1qnjf7e2a5ezft480kxzmhgg66pnzqk0aawxa06u", "9c93ecabb4c892ba9df630b774235a0cc40b3fbd"), // Doichain Bech32 (P2WPKH) /** * https://chainz.cryptoid.info/doi/address.dws?2476957.htm */ Doichain("dc1qzlspyu8t5ax9rspzd7f2ftn4awusl095c3udhg", "17e01270eba74c51c0226f92a4ae75ebb90fbcb4"), // feathercoin Bech32 (P2WPKH) /** * https://chainz.cryptoid.info/ftc/address.dws?fc1qvr9zesajsdw8aydcndd70wxj2wdgzu6zzltsph.htm */ Feathercoin("fc1qvr9zesajsdw8aydcndd70wxj2wdgzu6zzltsph", "60ca2cc3b2835c7e91b89b5be7b8d2539a817342"), // Groestlcoin Bech32 (P2WPKH) /** * https://chainz.cryptoid.info/grs/address.dws?1455068.htm */ Groestlcoin("grs1qpuf9cmfysp6dgdxmmar9eap8qrf5p2hl6a52pj", "0f125c6d248074d434dbdf465cf42700d340aaff"), // Groestlcoin Bech32 (P2WPKH) /** * https://btc.cryptoid.info/grs-test/address.dws?673.htm */ GroestlcoinTestNet("tgrs1qw4z3xrtgx4f6w7akwpp2xa0gupmkv4yauemmm9", "7545130d683553a77bb67042a375e8e07766549d"), // litecoin Bech32 (P2WPKH) /** * https://chainz.cryptoid.info/ltc/address.dws?187430165.htm */ Litecoin("ltc1qr07zu594qf63xm7l7x6pu3a2v39m2z6hh5pp4t", "1bfc2e50b50275136fdff1b41e47aa644bb50b57"), // litecoin cash Bech32 (P2WPKH) /** * https://chainz.cryptoid.info/lcc/address.dws?lcc1qrzlsxpjl0tynu3t2fkrw2ff2dgm0pv53ern0s5.htm */ LitecoinCash("lcc1qrzlsxpjl0tynu3t2fkrw2ff2dgm0pv53ern0s5", "18bf03065f7ac93e456a4d86e5252a6a36f0b291"), // Mooncoin Bech32 (P2WPKH) /** * https://chainz.cryptoid.info/moon/address.dws?moon1q2rhkqa03lq2hza99ezpfsauvgqmgqz5xjlawjq.htm */ Mooncoin("moon1q2rhkqa03lq2hza99ezpfsauvgqmgqz5xjlawjq", "50ef6075f1f8157174a5c88298778c4036800a86"), // Myriad Bech32 (P2WPKH) /** * https://btc.cryptoid.info/xmy/address.dws?4567225.htm */ Myriad("my1qgsy2zfpk63xst000zqs6npyjzrn7udvcnlejcc", "4408a12436d44d05bdef1021a9849210e7ee3598"), // namecoin Bech32 (P2WPKH) /** * https://chainz.cryptoid.info/nmc/address.dws?nc1q2ml905jv7gx0d8z5f7kl23af0vtrjk4j0llmwr.htm */ Namecoin("nc1q2ml905jv7gx0d8z5f7kl23af0vtrjk4j0llmwr", "56fe57d24cf20cf69c544fadf547a97b16395ab2"), // Riecoin Bech32 (P2WPKH) /** * https://chainz.cryptoid.info/ric/address.dws?2133357.htm */ Riecoin("ric1qhklsed3veursw2m0gjt8xftkhm78uhmyk38exe", "bdbf0cb62ccf07072b6f4496732576befc7e5f64"), // SpaceXpanse Bech32 (P2WPKH) /** * https://btc.cryptoid.info/rod/address.dws?652202.htm */ SpaceXpanse("rod1qkw670qzp4gg4gkg9g25jvt7z357c7ykwesha3v", "b3b5e78041aa1154590542a9262fc28d3d8f12ce"), // syscoin Bech32 (P2WPKH) /** * https://chainz.cryptoid.info/sys/address.dws?1435968.htm */ Syscoin("sys1qync7erear7cvpkysvv0a28mj45g2ps0kq9c6qs", "24f1ec8f3d1fb0c0d890631fd51f72ad10a0c1f6"), // TheHolyRogerCoin Bech32 (P2WPKH) /** * https://btc.cryptoid.info/roger/address.dws?139264.htm */ TheHolyRogerCoin("rog1q4vs95czpvgffxtsdz0l858gkkda6nmjkzly8qy", "ab205a60416212932e0d13fe7a1d16b37ba9ee56"), // UFO Bech32 (P2WPKH) /** * https://btc.cryptoid.info/ufo/address.dws?570258.htm */ UFO("uf1qpp3rflelg3h79cnr9xcszr0htyk6n2hkusghed", "086234ff3f446fe2e26329b1010df7592da9aaf6"), // vertcoin Bech32 (P2WSH or P2WPKH) /** * https://chainz.cryptoid.info/vtc/address.dws?vtc1qa4wejdlw9lmc7ks7l8hplc9fm394u79qjj0792.htm */ Vertcoin("vtc1qa4wejdlw9lmc7ks7l8hplc9fm394u79qjj0792", "ed5d9937ee2ff78f5a1ef9ee1fe0a9dc4b5e78a0"); // See SegwitAddress#WITNESS_PROGRAM_LENGTH_PKH private final String publicAddress; private final String witnessProgramAsHex; P2WPKH(String publicAddress, String witnessProgramAsHex) { this.publicAddress = publicAddress; this.witnessProgramAsHex = witnessProgramAsHex; } @Override public String getPublicAddress() { return publicAddress; } public String getWitnessProgramAsHex() { return witnessProgramAsHex; } public byte[] getWitnessProgram() { return Hex.decode(getWitnessProgramAsHex()); } public ByteBuffer getWitnessProgramAsByteBuffer() { return new ByteBufferUtility(true).getByteBufferFromHex(getWitnessProgramAsHex()); } public String getWitnessProgramAsBase58() { final Network network = new NetworkParameterFactory().getNetwork(); KeyUtility keyUtility = new KeyUtility(network, new ByteBufferUtility(true)); return keyUtility.toBase58(getWitnessProgram()); } } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/staticaddresses/enums/PublicAddress.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.staticaddresses.enums; public interface PublicAddress { /** * Returns the public address. * @return the public address. */ String getPublicAddress(); } ================================================ FILE: src/test/java/net/ladenthin/bitcoinaddressfinder/staticaddresses/enums/StaticUnsupportedAddress.java ================================================ // @formatter:off /** * Copyright 2020 Bernard Ladenthin bernard.ladenthin@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // @formatter:on package net.ladenthin.bitcoinaddressfinder.staticaddresses.enums; public enum StaticUnsupportedAddress implements PublicAddress { // Scripts with 32 bytes /** * bitcoin Bech32 (P2WSH) with 32 bytes * https://privatekeys.pw/bitcoin/address/bc1qp762gmkychywl4elnuyuwph68hqw0uc2jkzu3ax48zfjkskslpsq8p66gf * The hash of this script has 32 bytes: 0fb4a46ec4c5c8efd73f9f09c706fa3dc0e7f30a9585c8f4d538932b42d0f860 */ Bitcoin("bc1qp762gmkychywl4elnuyuwph68hqw0uc2jkzu3ax48zfjkskslpsq8p66gf"), // Bitcoin Bech32 (P2WSH) BitcoinP2SH("bc1pmfr3p9j00pfxjh0zmgp99y8zftmd3s5pmedqhyptwy6lm87hf5ss52r5n8"), // Bitcoin Bech32 (P2WSH) // Created with random data via https://learnmeabitcoin.com/technical/script/p2wsh/ // Script Hash: d698321d7b9f5883fa1bf99b9cb87a9cac9bd462affb300a844998a28d67584d BitcoinP2SH_Random("bc1q66vry8tmnavg87smlxdeewr6njkfh4rz4lanqz5yfxv29rt8tpxs8z4cmm"), // Bitcoin Bech32 (P2TR) // Created with random data via https://learnmeabitcoin.com/technical/script/p2wsh/ // tweaked public key: 52a5d35869fedad2a5ce56b39d78500124dfb77b612f9931d4d8f7a1398b0d18 BitcoinP2TRRandom("bc1p22jaxkrflmdd9fww26ee67zsqyjdldmmvyhejvw5mrm6zwvtp5vq9y5p0g"), // Bitcoin Cash Bech32 (P2WSH) /** * https://privatekeys.pw/bitcoin-cash/address/prseh0a4aejjcewhc665wjqhppgwrz2lw5txgn666a */ BitcoinCashP2SH("prseh0a4aejjcewhc665wjqhppgwrz2lw5txgn666a"), /** * Erroneous Bitcoin Cash address - invalid format or checksum. * There seems to be an invalid char: F */ BitcoinCash_Erroneous0("qnfuF7UrkAgwtxcSgZqhkV"), /** * Erroneous Bitcoin Cash address - invalid format or checksum. * There seems to be an invalid char: E */ BitcoinCash_Erroneous1("qEPTALtCh3xTWUpTpRn1Rt"), /** * Erroneous Bitcoin Cash address - invalid format or checksum. * There seems to be an invalid char: P */ BitcoinCash_Erroneous2("qsrPaN8AtbByikRAUJZTU8"), /** * Erroneous Bitcoin Cash address - invalid format or checksum. * There seems to be an invalid char: D */ BitcoinCash_Erroneous3("q4DWJuRAUZv8K7bD4sDS2t"), // P2MS (Pay to Multisig) /** * */ BitcoinP2MS("d-414f1537e051163a5a558d5e9ee37439"), /** * https://privatekeys.pw/address/bitcoin-cash/m-6d14a66d55f88b28b41132f32d1f3059 */ BitcoinCashP2MS("m-6d14a66d55f88b28b41132f32d1f3059"), /** * */ BitcoinCashP2MS_2("s-8f1a5a77bd8e884c66044ec2081a05b0"), // Doichain Bech32 (P2WSH) /** * https://btc.cryptoid.info/doi/address.dws?2378564.htm */ DoichainP2WSH("dc1q7pmm98r4shmvtjwy6u5ulj4tqemq00fkjgrc2a9alj5z5keaf6ysn5t2m0"), // litecoin Bech32 (P2WSH) /** * https://bitcoin.stackexchange.com/questions/110995/how-can-i-find-samples-for-p2tr-transactions-on-mainnet */ Litecoin("ltc1qd5wm03t5kcdupjuyq5jffpuacnaqahvfsdu8smf8z0u0pqdqpatqsdrn8h"), // Riecoin Bech32 (P2SH) /** * https://chainz.cryptoid.info/ric/address.dws?2130005.htm */ Riecoin("ric1pmm582sczt9zw8zn7j5eflqlle3p9ap75wwcpjewpdp34wscg0kjsmp5h35"), // P2TR /** * P2TR (Pay-to-Taproot) with 32 bytes * https://bitcoin.stackexchange.com/questions/110995/how-can-i-find-samples-for-p2tr-transactions-on-mainnet * The hash of this script has 32 bytes: a37c3903c8d0db6512e2b40b0dffa05e5a3ab73603ce8c9c4b7771e5412328f9 */ BitcoinP2TR("bc1p5d7rjq7g6rdk2yhzks9smlaqtedr4dekq08ge8ztwac72sfr9rusxg3297"); private final String publicAddress; StaticUnsupportedAddress(String publicAddress) { this.publicAddress = publicAddress; } @Override public String getPublicAddress() { return publicAddress; } } ================================================ FILE: src/test/resources/testOpenCLInfo/config_OpenCLInfo.js ================================================ { "command": "OpenCLInfo" } ================================================ FILE: src/test/resources/testOpenCLInfo/config_OpenCLInfo.json ================================================ { "command": "OpenCLInfo" } ================================================ FILE: src/test/resources/testOpenCLInfo/config_OpenCLInfo.yaml ================================================ command: OpenCLInfo ================================================ FILE: src/test/resources/testOpenCLInfo/config_OpenCLInfo.yml ================================================ command: OpenCLInfo ================================================ FILE: src/test/resources/testRoundtrip/addresses/fileContainingAddresses0.txt ================================================ # comment 12R4kPeSK6i9427ctH15j2NcJ1ST1FT21C,0 13z55AGS14pSPiPpMqAAFHb576tSmSmR77,1 14rDamyE53BNLPSj4cku6ZXiW6xbBdMJ97,2 15ArtCgi3wmpQAAfYx4riaFmo4prJA4VsK,3 ================================================ FILE: src/test/resources/testRoundtrip/addresses/fileContainingAddresses1.tsv ================================================ # comment 15VjRaDX9zpbA8LVnbrCAFzrVzN7ixHNsC;1337 17LYqSzhuWksgoGsgakiWBG8PmbCKyrrac;1337 17RTTUAiiPqUTKtEggJPec8RxLMi2n9EZ9;1337 ================================================ FILE: src/test/resources/testRoundtrip/addresses/fileContainingAddresses2.csv ================================================ # comment 17aDRzRQK8ccBLVBzsms3ZasVKc9q3o3Qk 18LDvu2nqr8a5AK9AHkkqDK6Z65dzbTgtn 1966U1pjj15tLxPXZ19U48c99EJDkdXeqb ================================================ FILE: src/test/resources/testRoundtrip/config_AddressFilesToLMDB.json ================================================ { "command": "AddressFilesToLMDB", "addressFilesToLMDB": { "addressesFiles": [ "src/test/resources/testRoundtrip/addresses/fileContainingAddresses0.txt", "src/test/resources/testRoundtrip/addresses/fileContainingAddresses1.tsv", "src/test/resources/testRoundtrip/addresses/fileContainingAddresses2.csv" ], "lmdbConfigurationWrite": { "initialMapSizeInMiB": 16, "deleteEmptyAddresses": false, "staticAmount": 0, "useStaticAmount": true, "increaseMapAutomatically": true, "increaseSizeInMiB": 1, "lmdbDirectory": "src/test/resources/testRoundtrip/lmdb", "useProxyOptimal": true, "logStatsOnInit": true, "logStatsOnClose": true } } } ================================================ FILE: src/test/resources/testRoundtrip/config_Find_1OpenCLDevice.json ================================================ { "command": "Find", "finder": { "keyProducerJavaRandom": [ { "keyProducerJavaRandomInstance": "SECURE_RANDOM", "customSeed": 0, "keyProducerId": "exampleKeyProducerSecureRandomId", "privateKeyMaxNumBits": 256 } ], "consumerJava": { "lmdbConfigurationReadOnly": { "lmdbDirectory": "src/test/resources/testRoundtrip/lmdb", "useProxyOptimal": true, "logStatsOnInit": true, "logStatsOnClose": false }, "printStatisticsEveryNSeconds": 10, "threads": 8, "delayEmptyConsumer": 50, "queueSize": 4, "runtimePublicKeyCalculationCheck": false, "enableVanity": false, "vanityPattern": "1[Ee][Mm][Ii][Ll].*" }, "producerJava": [], "producerJavaSecretsFiles": [], "producerOpenCL": [ { "platformIndex": 0, "deviceType": -1, "deviceIndex": 0, "maxResultReaderThreads": 4, "delayBlockedReader": 50, "keyProducerId": "exampleKeyProducerSecureRandomId", "batchSizeInBits": 18, "batchUsePrivateKeyIncrement": true, "logSecretBase": false, "runOnce": false } ] } } ================================================ FILE: src/test/resources/testRoundtrip/config_Find_SecretsFile.json ================================================ { "command": "Find", "finder": { "keyProducerJavaRandom": [ { "keyProducerJavaRandomInstance": "SECURE_RANDOM", "customSeed": 0, "keyProducerId": "exampleKeyProducerSecureRandomId", "privateKeyMaxNumBits": 256 } ], "consumerJava": { "lmdbConfigurationReadOnly": { "lmdbDirectory": "src/test/resources/testRoundtrip/lmdb", "useProxyOptimal": true, "logStatsOnInit": true, "logStatsOnClose": false }, "printStatisticsEveryNSeconds": 10, "threads": 4, "delayEmptyConsumer": 50, "queueSize": 4, "runtimePublicKeyCalculationCheck": false, "enableVanity": false, "vanityPattern": "1[Ee][Mm][Ii][Ll].*" }, "producerJava": [], "producerJavaSecretsFiles": [ { "files": [ "src/test/resources/testRoundtrip/secrets/fileContainingSecrets_BIG_INTEGER.txt" ], "secretFormat": "BIG_INTEGER", "keyProducerId": "exampleKeyProducerSecureRandomId", "batchSizeInBits": 0, "batchUsePrivateKeyIncrement": true, "logSecretBase": true, "runOnce": true }, { "files": [ "src/test/resources/testRoundtrip/secrets/fileContainingSecrets_DUMPED_RIVATE_KEY.txt" ], "secretFormat": "DUMPED_RIVATE_KEY", "keyProducerId": "exampleKeyProducerSecureRandomId", "batchSizeInBits": 0, "batchUsePrivateKeyIncrement": true, "logSecretBase": true, "runOnce": true }, { "files": [ "src/test/resources/testRoundtrip/secrets/fileContainingSecrets_SHA256.txt" ], "secretFormat": "SHA256", "keyProducerId": "exampleKeyProducerSecureRandomId", "batchSizeInBits": 0, "batchUsePrivateKeyIncrement": true, "logSecretBase": true, "runOnce": true }, { "files": [ "src/test/resources/testRoundtrip/secrets/fileContainingSecrets_STRING_DO_SHA256.txt" ], "secretFormat": "STRING_DO_SHA256", "keyProducerId": "exampleKeyProducerSecureRandomId", "batchSizeInBits": 0, "batchUsePrivateKeyIncrement": true, "logSecretBase": true, "runOnce": true } ], "producerOpenCL": [] } } ================================================ FILE: src/test/resources/testRoundtrip/config_LMDBToAddressFile.json ================================================ { "command": "LMDBToAddressFile", "lmdbToAddressFile": { "lmdbConfigurationReadOnly": { "lmdbDirectory": "src/test/resources/testRoundtrip/lmdb", "useProxyOptimal": true, "logStatsOnInit": false, "logStatsOnClose": false }, "addressesFile": "src/test/resources/testRoundtrip/export.txt", "addressFileOutputFormat": "HexHash" } } ================================================ FILE: src/test/resources/testRoundtrip/secrets/fileContainingSecrets_BIG_INTEGER.txt ================================================ 72155939486846849509759369733266486982821795810448245423168957390607644363272 39929263256442288830290225612580366403172818928633701045115663441379782969864 42379586058257162021782620237913525000692985364990081801945649219990416465578 ================================================ FILE: src/test/resources/testRoundtrip/secrets/fileContainingSecrets_DUMPED_RIVATE_KEY.txt ================================================ 5K2YUVmWfxbmvsNxCsfvArXdGXm7d5DC9pn4yD75k2UaSYgkXTh 5JVAXLpkZ21svEzwyimMHn5hAkWNqJq8uGxqUqcRrNb8F4Csp8V 5JXYuGrwSbyp8sKBmiLcvokqSnxALPjKWQMPJXZYyBWKof7c2pk ================================================ FILE: src/test/resources/testRoundtrip/secrets/fileContainingSecrets_SHA256.txt ================================================ 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 58472980a1d3449939eadc2652370972d5007fa9c059ce84fb3ab98f544e4a08 5db1fee4b5703808c48078a76768b155b421b210c0761cd6a5d223f4d99f1eaa ================================================ FILE: src/test/resources/testRoundtrip/secrets/fileContainingSecrets_STRING_DO_SHA256.txt ================================================ test test with space 1337 ================================================ FILE: src/test/resources/vectors.json ================================================ { "english": [ [ "00000000000000000000000000000000", "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about", "c55257c360c07c72029aebc1b53c05ed0362ada38ead3e3e9efa3708e53495531f09a6987599d18264c1e1c92f2cf141630c7a3c4ab7c81b2f001698e7463b04", "xprv9s21ZrQH143K3h3fDYiay8mocZ3afhfULfb5GX8kCBdno77K4HiA15Tg23wpbeF1pLfs1c5SPmYHrEpTuuRhxMwvKDwqdKiGJS9XFKzUsAF" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "legal winner thank year wave sausage worth useful legal winner thank yellow", "2e8905819b8723fe2c1d161860e5ee1830318dbf49a83bd451cfb8440c28bd6fa457fe1296106559a3c80937a1c1069be3a3a5bd381ee6260e8d9739fce1f607", "xprv9s21ZrQH143K2gA81bYFHqU68xz1cX2APaSq5tt6MFSLeXnCKV1RVUJt9FWNTbrrryem4ZckN8k4Ls1H6nwdvDTvnV7zEXs2HgPezuVccsq" ], [ "80808080808080808080808080808080", "letter advice cage absurd amount doctor acoustic avoid letter advice cage above", "d71de856f81a8acc65e6fc851a38d4d7ec216fd0796d0a6827a3ad6ed5511a30fa280f12eb2e47ed2ac03b5c462a0358d18d69fe4f985ec81778c1b370b652a8", "xprv9s21ZrQH143K2shfP28KM3nr5Ap1SXjz8gc2rAqqMEynmjt6o1qboCDpxckqXavCwdnYds6yBHZGKHv7ef2eTXy461PXUjBFQg6PrwY4Gzq" ], [ "ffffffffffffffffffffffffffffffff", "zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo wrong", "ac27495480225222079d7be181583751e86f571027b0497b5b5d11218e0a8a13332572917f0f8e5a589620c6f15b11c61dee327651a14c34e18231052e48c069", "xprv9s21ZrQH143K2V4oox4M8Zmhi2Fjx5XK4Lf7GKRvPSgydU3mjZuKGCTg7UPiBUD7ydVPvSLtg9hjp7MQTYsW67rZHAXeccqYqrsx8LcXnyd" ], [ "000000000000000000000000000000000000000000000000", "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon agent", "035895f2f481b1b0f01fcf8c289c794660b289981a78f8106447707fdd9666ca06da5a9a565181599b79f53b844d8a71dd9f439c52a3d7b3e8a79c906ac845fa", "xprv9s21ZrQH143K3mEDrypcZ2usWqFgzKB6jBBx9B6GfC7fu26X6hPRzVjzkqkPvDqp6g5eypdk6cyhGnBngbjeHTe4LsuLG1cCmKJka5SMkmU" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth useful legal will", "f2b94508732bcbacbcc020faefecfc89feafa6649a5491b8c952cede496c214a0c7b3c392d168748f2d4a612bada0753b52a1c7ac53c1e93abd5c6320b9e95dd", "xprv9s21ZrQH143K3Lv9MZLj16np5GzLe7tDKQfVusBni7toqJGcnKRtHSxUwbKUyUWiwpK55g1DUSsw76TF1T93VT4gz4wt5RM23pkaQLnvBh7" ], [ "808080808080808080808080808080808080808080808080", "letter advice cage absurd amount doctor acoustic avoid letter advice cage absurd amount doctor acoustic avoid letter always", "107d7c02a5aa6f38c58083ff74f04c607c2d2c0ecc55501dadd72d025b751bc27fe913ffb796f841c49b1d33b610cf0e91d3aa239027f5e99fe4ce9e5088cd65", "xprv9s21ZrQH143K3VPCbxbUtpkh9pRG371UCLDz3BjceqP1jz7XZsQ5EnNkYAEkfeZp62cDNj13ZTEVG1TEro9sZ9grfRmcYWLBhCocViKEJae" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffff", "zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo when", "0cd6e5d827bb62eb8fc1e262254223817fd068a74b5b449cc2f667c3f1f985a76379b43348d952e2265b4cd129090758b3e3c2c49103b5051aac2eaeb890a528", "xprv9s21ZrQH143K36Ao5jHRVhFGDbLP6FCx8BEEmpru77ef3bmA928BxsqvVM27WnvvyfWywiFN8K6yToqMaGYfzS6Db1EHAXT5TuyCLBXUfdm" ], [ "0000000000000000000000000000000000000000000000000000000000000000", "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art", "bda85446c68413707090a52022edd26a1c9462295029f2e60cd7c4f2bbd3097170af7a4d73245cafa9c3cca8d561a7c3de6f5d4a10be8ed2a5e608d68f92fcc8", "xprv9s21ZrQH143K32qBagUJAMU2LsHg3ka7jqMcV98Y7gVeVyNStwYS3U7yVVoDZ4btbRNf4h6ibWpY22iRmXq35qgLs79f312g2kj5539ebPM" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth title", "bc09fca1804f7e69da93c2f2028eb238c227f2e9dda30cd63699232578480a4021b146ad717fbb7e451ce9eb835f43620bf5c514db0f8add49f5d121449d3e87", "xprv9s21ZrQH143K3Y1sd2XVu9wtqxJRvybCfAetjUrMMco6r3v9qZTBeXiBZkS8JxWbcGJZyio8TrZtm6pkbzG8SYt1sxwNLh3Wx7to5pgiVFU" ], [ "8080808080808080808080808080808080808080808080808080808080808080", "letter advice cage absurd amount doctor acoustic avoid letter advice cage absurd amount doctor acoustic avoid letter advice cage absurd amount doctor acoustic bless", "c0c519bd0e91a2ed54357d9d1ebef6f5af218a153624cf4f2da911a0ed8f7a09e2ef61af0aca007096df430022f7a2b6fb91661a9589097069720d015e4e982f", "xprv9s21ZrQH143K3CSnQNYC3MqAAqHwxeTLhDbhF43A4ss4ciWNmCY9zQGvAKUSqVUf2vPHBTSE1rB2pg4avopqSiLVzXEU8KziNnVPauTqLRo" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo vote", "dd48c104698c30cfe2b6142103248622fb7bb0ff692eebb00089b32d22484e1613912f0a5b694407be899ffd31ed3992c456cdf60f5d4564b8ba3f05a69890ad", "xprv9s21ZrQH143K2WFF16X85T2QCpndrGwx6GueB72Zf3AHwHJaknRXNF37ZmDrtHrrLSHvbuRejXcnYxoZKvRquTPyp2JiNG3XcjQyzSEgqCB" ], [ "9e885d952ad362caeb4efe34a8e91bd2", "ozone drill grab fiber curtain grace pudding thank cruise elder eight picnic", "274ddc525802f7c828d8ef7ddbcdc5304e87ac3535913611fbbfa986d0c9e5476c91689f9c8a54fd55bd38606aa6a8595ad213d4c9c9f9aca3fb217069a41028", "xprv9s21ZrQH143K2oZ9stBYpoaZ2ktHj7jLz7iMqpgg1En8kKFTXJHsjxry1JbKH19YrDTicVwKPehFKTbmaxgVEc5TpHdS1aYhB2s9aFJBeJH" ], [ "6610b25967cdcca9d59875f5cb50b0ea75433311869e930b", "gravity machine north sort system female filter attitude volume fold club stay feature office ecology stable narrow fog", "628c3827a8823298ee685db84f55caa34b5cc195a778e52d45f59bcf75aba68e4d7590e101dc414bc1bbd5737666fbbef35d1f1903953b66624f910feef245ac", "xprv9s21ZrQH143K3uT8eQowUjsxrmsA9YUuQQK1RLqFufzybxD6DH6gPY7NjJ5G3EPHjsWDrs9iivSbmvjc9DQJbJGatfa9pv4MZ3wjr8qWPAK" ], [ "68a79eaca2324873eacc50cb9c6eca8cc68ea5d936f98787c60c7ebc74e6ce7c", "hamster diagram private dutch cause delay private meat slide toddler razor book happy fancy gospel tennis maple dilemma loan word shrug inflict delay length", "64c87cde7e12ecf6704ab95bb1408bef047c22db4cc7491c4271d170a1b213d20b385bc1588d9c7b38f1b39d415665b8a9030c9ec653d75e65f847d8fc1fc440", "xprv9s21ZrQH143K2XTAhys3pMNcGn261Fi5Ta2Pw8PwaVPhg3D8DWkzWQwjTJfskj8ofb81i9NP2cUNKxwjueJHHMQAnxtivTA75uUFqPFeWzk" ], [ "c0ba5a8e914111210f2bd131f3d5e08d", "scheme spot photo card baby mountain device kick cradle pact join borrow", "ea725895aaae8d4c1cf682c1bfd2d358d52ed9f0f0591131b559e2724bb234fca05aa9c02c57407e04ee9dc3b454aa63fbff483a8b11de949624b9f1831a9612", "xprv9s21ZrQH143K3FperxDp8vFsFycKCRcJGAFmcV7umQmcnMZaLtZRt13QJDsoS5F6oYT6BB4sS6zmTmyQAEkJKxJ7yByDNtRe5asP2jFGhT6" ], [ "6d9be1ee6ebd27a258115aad99b7317b9c8d28b6d76431c3", "horn tenant knee talent sponsor spell gate clip pulse soap slush warm silver nephew swap uncle crack brave", "fd579828af3da1d32544ce4db5c73d53fc8acc4ddb1e3b251a31179cdb71e853c56d2fcb11aed39898ce6c34b10b5382772db8796e52837b54468aeb312cfc3d", "xprv9s21ZrQH143K3R1SfVZZLtVbXEB9ryVxmVtVMsMwmEyEvgXN6Q84LKkLRmf4ST6QrLeBm3jQsb9gx1uo23TS7vo3vAkZGZz71uuLCcywUkt" ], [ "9f6a2878b2520799a44ef18bc7df394e7061a224d2c33cd015b157d746869863", "panda eyebrow bullet gorilla call smoke muffin taste mesh discover soft ostrich alcohol speed nation flash devote level hobby quick inner drive ghost inside", "72be8e052fc4919d2adf28d5306b5474b0069df35b02303de8c1729c9538dbb6fc2d731d5f832193cd9fb6aeecbc469594a70e3dd50811b5067f3b88b28c3e8d", "xprv9s21ZrQH143K2WNnKmssvZYM96VAr47iHUQUTUyUXH3sAGNjhJANddnhw3i3y3pBbRAVk5M5qUGFr4rHbEWwXgX4qrvrceifCYQJbbFDems" ], [ "23db8160a31d3e0dca3688ed941adbf3", "cat swing flag economy stadium alone churn speed unique patch report train", "deb5f45449e615feff5640f2e49f933ff51895de3b4381832b3139941c57b59205a42480c52175b6efcffaa58a2503887c1e8b363a707256bdd2b587b46541f5", "xprv9s21ZrQH143K4G28omGMogEoYgDQuigBo8AFHAGDaJdqQ99QKMQ5J6fYTMfANTJy6xBmhvsNZ1CJzRZ64PWbnTFUn6CDV2FxoMDLXdk95DQ" ], [ "8197a4a47f0425faeaa69deebc05ca29c0a5b5cc76ceacc0", "light rule cinnamon wrap drastic word pride squirrel upgrade then income fatal apart sustain crack supply proud access", "4cbdff1ca2db800fd61cae72a57475fdc6bab03e441fd63f96dabd1f183ef5b782925f00105f318309a7e9c3ea6967c7801e46c8a58082674c860a37b93eda02", "xprv9s21ZrQH143K3wtsvY8L2aZyxkiWULZH4vyQE5XkHTXkmx8gHo6RUEfH3Jyr6NwkJhvano7Xb2o6UqFKWHVo5scE31SGDCAUsgVhiUuUDyh" ], [ "066dca1a2bb7e8a1db2832148ce9933eea0f3ac9548d793112d9a95c9407efad", "all hour make first leader extend hole alien behind guard gospel lava path output census museum junior mass reopen famous sing advance salt reform", "26e975ec644423f4a4c4f4215ef09b4bd7ef924e85d1d17c4cf3f136c2863cf6df0a475045652c57eb5fb41513ca2a2d67722b77e954b4b3fc11f7590449191d", "xprv9s21ZrQH143K3rEfqSM4QZRVmiMuSWY9wugscmaCjYja3SbUD3KPEB1a7QXJoajyR2T1SiXU7rFVRXMV9XdYVSZe7JoUXdP4SRHTxsT1nzm" ], [ "f30f8c1da665478f49b001d94c5fc452", "vessel ladder alter error federal sibling chat ability sun glass valve picture", "2aaa9242daafcee6aa9d7269f17d4efe271e1b9a529178d7dc139cd18747090bf9d60295d0ce74309a78852a9caadf0af48aae1c6253839624076224374bc63f", "xprv9s21ZrQH143K2QWV9Wn8Vvs6jbqfF1YbTCdURQW9dLFKDovpKaKrqS3SEWsXCu6ZNky9PSAENg6c9AQYHcg4PjopRGGKmdD313ZHszymnps" ], [ "c10ec20dc3cd9f652c7fac2f1230f7a3c828389a14392f05", "scissors invite lock maple supreme raw rapid void congress muscle digital elegant little brisk hair mango congress clump", "7b4a10be9d98e6cba265566db7f136718e1398c71cb581e1b2f464cac1ceedf4f3e274dc270003c670ad8d02c4558b2f8e39edea2775c9e232c7cb798b069e88", "xprv9s21ZrQH143K4aERa2bq7559eMCCEs2QmmqVjUuzfy5eAeDX4mqZffkYwpzGQRE2YEEeLVRoH4CSHxianrFaVnMN2RYaPUZJhJx8S5j6puX" ], [ "f585c11aec520db57dd353c69554b21a89b20fb0650966fa0a9d6f74fd989d8f", "void come effort suffer camp survey warrior heavy shoot primary clutch crush open amazing screen patrol group space point ten exist slush involve unfold", "01f5bced59dec48e362f2c45b5de68b9fd6c92c6634f44d6d40aab69056506f0e35524a518034ddc1192e1dacd32c1ed3eaa3c3b131c88ed8e7e54c49a5d0998", "xprv9s21ZrQH143K39rnQJknpH1WEPFJrzmAqqasiDcVrNuk926oizzJDDQkdiTvNPr2FYDYzWgiMiC63YmfPAa2oPyNB23r2g7d1yiK6WpqaQS" ] ], "chinese_simplified": [ [ "00000000000000000000000000000000", "的 的 的 的 的 的 的 的 的 的 的 在", "7f7c7f91ef81f0fb6a3b95b346c50e6472c1d554f8ba90637bad8afce4a4de87c322c1acafa2f6f5e9a8f9b2d2c40e9d389efdc2adbe4445c21a0939fb39e91f", "xprv9s21ZrQH143K2LTAgxJMxVMKie6n9HQHMUohP6x2cx1TVBr6dxnL3mnSLRiXjiCM7g2ZF3BHzpdbFuhdeh7ZRrzv2EEjg5Tv7kgKZrqbVLc" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "枪 疫 霉 尝 俩 闹 饿 贤 枪 疫 霉 卿", "816a69d6866891b246b4d33f54d6d2be624470141754396205d039bdd8003949fec4340253dde4c8e11437a181ad992f56d5b976eb9fbe48f4c5e5fec60a27e1", "xprv9s21ZrQH143K2t2fMBqtVAVWU3JSpmEbbddwouLX8NoBbcTykD1Tm4s9api6K9zvoKSESUsA7aVxbZRunM5yrjZRNZnZckve98hxUorv2Uv" ], [ "80808080808080808080808080808080", "壤 对 据 人 三 谈 我 表 壤 对 据 不", "07b6eada2601141ef9748bdf5af296a134f0f9215a946813b84338dcfba93c8247b0c3429a91e0a1b85a93bd9f1275a9524acecadc9b516c3cf4c8990f44052c", "xprv9s21ZrQH143K2cgeQUKgCSmaRVXFjEGThqrnNFmH71qG8z3bWqYcbX9zakkRxmDp583tqf3cQzmxtn4C2XqinMNb2HkhXBDYhekCB8AwZWV" ], [ "ffffffffffffffffffffffffffffffff", "歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 逻", "08ac5d9bed9441013b32bc317aaddeb8310011f219b48239faa4adeeb8b79cb0a3e4d1cb460d2dd37888c0a19bef6edd90ced0fd613d48899eab9ee649d77fcd", "xprv9s21ZrQH143K3Zkkh1w8EbXYQWAS5ekbitA2WVrswJY9uEJzig2BtairT72n98ySwQUAhYBsLW9EBjJ1XUinrSb69Ty4mttMLnaUooJwsJ3" ], [ "000000000000000000000000000000000000000000000000", "的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 动", "b8fb8047e84951d846dbfbbce3edd0c9e316dc40f35b39f03a837db85f5587ac209088e883b5d924a0a43ad154a636fb65df28fdae821226f0f014a49e773356", "xprv9s21ZrQH143K36LufUjTLqXnTiY6ach28pUYMkJ63swx4FhjPkzqD9YRqDZ452whYcNzKpPC8yfBm1eomL2z3VLC4zcwU71oKvMQ5NnD4h1" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "枪 疫 霉 尝 俩 闹 饿 贤 枪 疫 霉 尝 俩 闹 饿 贤 枪 殿", "74187bbdce2dba25eed3b9aebdc65dcb7c61e74c58591451d47f9c7b7b17545a527880640bfb9cab36989eba1edddf57bfce7340697926de7f0b9ec1e0345c38", "xprv9s21ZrQH143K47jLpKzSgdpMLSKP2ZMLXHHUqYYGKbXNE4k3TA2czvJCx5JAJFNkWKZf2B1AbYoUBpc96YoiwM7yfxyr8gvfNNgL7sFNum6" ], [ "808080808080808080808080808080808080808080808080", "壤 对 据 人 三 谈 我 表 壤 对 据 人 三 谈 我 表 壤 民", "e3629a601f4b87101c4bb36496e3dbd146063351f5e47c048211faddab78efdb91910f0eea5c8e53cfb851aa3e156b0bb5c501b83baaf5f5d4a1679a5bb7d885", "xprv9s21ZrQH143K4RfeWihCeh1FJL9SobvinRW4z76RL2X1TB6xreXgaMvJGggUgagkaNr7zX47YHEDYdzJmig8SG3Scuet8smspn7HicCtwHa" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffff", "歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 裕", "013c8d6868537176fac7bfa966e6219830008f03b650b0f18a12fd67d9ebf871c400c5f980aa073ddd1b23d60846e357aee193ce7644b574bf65e04cf913e39c", "xprv9s21ZrQH143K2YiskWzQq8kpFFCoFKKU4L8D6Y593dS2sExuVQ4GjnS57RhibwTWjnD7NTCE7ye4cQbCK6Bw674SHb3xWaQYH3NBLFCGYJb" ], [ "0000000000000000000000000000000000000000000000000000000000000000", "的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 性", "1981c3e3ddfd80f6e9ee1c5ef27ba2697df3d1468496f1d56ae3d8e0b3f0677bbbdfca954e48eb86fe6a36fc0f597bf18ea00248757a01e82182badff94abbbd", "xprv9s21ZrQH143K25ttGBGbx6h9VBpa9ELbpw35XQqDR8deXRyVP2AbtgJ79Nq2cW8KaDizbwuoHUYR1o4tLPhYvSCTNMft4ZEfiDztmjXKPCj" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "枪 疫 霉 尝 俩 闹 饿 贤 枪 疫 霉 尝 俩 闹 饿 贤 枪 疫 霉 尝 俩 闹 饿 搭", "b1eb831927f1c488e233725f9c409dd9bdb9342324393fa56d958e8842623d222510c322f5ba2899428ae08ece8bd87788748c67bdfa73588669ab816c5f3555", "xprv9s21ZrQH143K4VNNDqCgnETDkPiihzHpxC9wGE6TBGXaeEd9VkQRHQPotwheeaNFGHGKaPWv5zTqfknzgdWiKFC6DqaqBFKjNSmxas968Vz" ], [ "8080808080808080808080808080808080808080808080808080808080808080", "壤 对 据 人 三 谈 我 表 壤 对 据 人 三 谈 我 表 壤 对 据 人 三 谈 我 五", "470e61f7e976fa18c7d559e842ba7f39849b2f72ef15428f4276c5160002f36416cd22c2a86bb686d69f6b91818538aa57ae1aab27b3181b92132c59be2b329b", "xprv9s21ZrQH143K3bUoGmLq8aXRKzvUhseqrXw1t7XYCirduP5XLJtVxCos3rYLDvW8V7pK3voZ4EWSdeXiKdbWNjxmiPRDfet23Av9VRaR3ej" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 佳", "8e6607a07fa664d6e4ead23fcc08caf72216d6f078c3b2e5be94e4b6e8d64c784d36bf9b70144fa05840e9a49899128111be5093a2b552b6ab76c0906e9b0e65", "xprv9s21ZrQH143K2ghKxX47TRr4GnQh3diJFN5rJfybjxuwr3xP6pafXrBhwXJsw4HwoiPZ1f6fFPR964eoXybV2su498Ant3kYuYKE3CszLsU" ], [ "9e885d952ad362caeb4efe34a8e91bd2", "蒙 台 脱 纪 构 硫 浆 霉 感 仅 鱼 汤", "decd71d2824a1bbadf8c3942f43504a648a8db5f1cac0ae1d0f787728353002a12644b1a6b725147c91682e7f33aec13493b9a779a7dd8ee15a5d10ab21d49e5", "xprv9s21ZrQH143K44Xrktko35a7gPGVo91Va79LNer1MzVokcrYKFP6GMLAcuJP3fBSdbRuG2DauFC48H6LmyZLfkUyjpm1R2AxYVbnT2P5tur" ], [ "6610b25967cdcca9d59875f5cb50b0ea75433311869e930b", "父 泥 炼 胁 鞋 控 载 政 惨 逐 整 碗 环 惯 案 棒 订 移", "ff66373b70b72b34842f936bf3bb44d661fdafaee7740d574fed6aa2ef07783cb6111f2862cbd3fc5528e322dfe054557a74a568a1b46c020cb88938e2293ca0", "xprv9s21ZrQH143K3JLu5XeRDQA5RwHh6gUXaQfRf7ihtVguJvd6EFoAzsoyotvNTDZfC6cciies7fhcqaMRTEsZUSbRYqBdaviWRHatRMoHX6s" ], [ "68a79eaca2324873eacc50cb9c6eca8cc68ea5d936f98787c60c7ebc74e6ce7c", "宁 照 违 材 交 养 违 野 悉 偷 梅 设 贵 帝 鲜 仰 圈 首 荷 钩 隙 抓 养 熟", "6ba622f907c61e29e44833b08441b7afa84889a48ca90ebf90f585e257662b2c1b0c35ad54088e745c73689921209fdd4b5b8ace5d850e366d7c2042a076e660", "xprv9s21ZrQH143K3dE2RQqFbapci6WBj47vZCkLVf4r14QsRZ6Ny2ck6s8tzZQzQaM55Tt4d2tRS9AuFrEJ4yBXsmP8yKeVGXT8E97iRVkDzCj" ], [ "c0ba5a8e914111210f2bd131f3d5e08d", "伐 旱 泡 口 线 揭 县 杨 断 芳 额 件", "7346996be5f2b02c67ec465c677197375b589b6e8871c842505b139c2d47feca75a2a941623d6486aff6b21c95193a8177960d123cf610f03f3224a9fa7d0eed", "xprv9s21ZrQH143K3A2p7cttKM5L39rutYgY4jqZ16z7hpAEdyiT8fr5eKdaHGLMM2ZmsUFNvGcSfyGMp1sz9nVyg3ZXop1hesUbgAvVBzx4rix" ], [ "6d9be1ee6ebd27a258115aad99b7317b9c8d28b6d76431c3", "福 惜 怀 叔 筋 酵 货 科 牙 冒 辈 罩 悬 耕 浇 呵 连 级", "09098e00fcc1bfa7d5b9f0c12dfe1993bbd5a0915200a53fb40b2d6d487b969a18463565c1e035569796a7d8b99f82a4c4b17002b0c582037da95bacfeb422b3", "xprv9s21ZrQH143K4LdjFgCrosa76XBrNQ4imGB7XNc5MhfkASrmAHVNWYLNGY6kNj8foXBLS9aUD8RDubyj3NKWarmXxRQ28AeWVPbLD3a1FEq" ], [ "9f6a2878b2520799a44ef18bc7df394e7061a224d2c33cd015b157d746869863", "仪 未 九 茶 队 梯 妇 孤 托 病 泉 贺 产 绘 吹 测 局 碳 征 墨 晶 帮 息 延", "6d55f2dd8d42f1cc5e0b4ef6e8a95200580ff4e29d2a3dfa7f9ddb1af0aa2e93780d84d952d39776a379ddc017847ea01aa01b85dc208e7f69891d5b7cbf2eb0", "xprv9s21ZrQH143K2tkCCjLXj2L9Ds9FttWwH6Eqt3uvihwUvpSpTm3RmRtSkapxASEUW5HXE6Qx2H1viBxXbLZVKxyfQ7fyFn6NcDspgJfdPaT" ], [ "23db8160a31d3e0dca3688ed941adbf3", "济 扶 块 言 穗 定 万 绘 姻 逃 颗 焰", "bf8dcc2fb4dc8fd2311943b527864feabfebd5fffb6641555519da3606265e895bab5aa1647f6e5afb0cb6ea4d0b27e8a9f2f49251b68ad6bf898937581351cb", "xprv9s21ZrQH143K2i53x2geCJi6A2QJpaHpxeGK8oeMxYs1tUrUwU3ddu9jHVucF3ePQ1koQ1TVFHnfP21ScWzp8xKnMinNUSW5itm7PicXWYW" ], [ "8197a4a47f0425faeaa69deebc05ca29c0a5b5cc76ceacc0", "虑 铺 目 祸 英 钩 尤 添 醇 嘛 触 独 起 赋 连 剪 邦 中", "07e1a2dc2eea79bb12be53d6fb662edf87796cad60e8d10a655ba39a95c5a68eb21f865a1b2f37d780286adbbddeccba3f7844c8a2b1a82029e6a855c713aecf", "xprv9s21ZrQH143K4V2oh58ZSb1CAbYkwB6ThJmTpRC51uKha9hy51R6RVzzbcEog3n6h4u7FtotS9arBvLofX7A3Apvcaedmeg1jkt7Vkt9TtA" ], [ "066dca1a2bb7e8a1db2832148ce9933eea0f3ac9548d793112d9a95c9407efad", "而 怕 夏 客 盖 古 松 面 解 谓 鲜 唯 障 烯 共 吴 永 丁 赤 副 醒 分 猛 埔", "0402ae511062cfacbd5e33637a95e57e2e14fde0c5dd471fe66fc1154b6373802aa8641a78b91658052bff0a5c5bd075f01fc74b0d73e95a890430ff6f0e728e", "xprv9s21ZrQH143K4LSoFcKBWtmUHjzuH56srzrkpPfGx3i36UXpVUEtGvCuZ3egRTyDkaqRN5Ec1HXvXGSGTXLyAKzCRnTspi1D9NdmQmWqM5x" ], [ "f30f8c1da665478f49b001d94c5fc452", "昏 途 所 够 请 乃 风 一 雕 缺 垫 阀", "aa7e38f64810007db63e31c479b9848cd5ffda839546749669bf53476dd036a33fd77d0a13d4418fb536ea78b028fc19533db4bc9e0e12a14a9432cb9fd112a2", "xprv9s21ZrQH143K31afj91bWiGw2aC2xHJwrWsMs9MuvEWZETkpWr15ZNF6LFjkHh53iD2bwJYEawvCCvDRaqDsr37fhapgGDkA7UATtwBsZu3" ], [ "c10ec20dc3cd9f652c7fac2f1230f7a3c828389a14392f05", "瓶 顾 床 圈 倡 励 炭 柄 且 招 价 紧 折 将 乎 硬 且 空", "2a6181cf2b069ba30a87228d54770ed5abf61e8151abdb0b27646a87a6100d4b7b496c3ca26f027d0b06724c6c5a469f43a7f1ffb7782e5afb01d143ca65973d", "xprv9s21ZrQH143K3ji6aQ9QQi4WkFhAqnrzRANJkYkRWkMqbr51mAV6JYUt85oR8Jt3D7DreQdsb9292ips6VKwpitAhLR7rfLdhYz7zgYei2F" ], [ "f585c11aec520db57dd353c69554b21a89b20fb0650966fa0a9d6f74fd989d8f", "柄 需 固 姆 色 斥 霍 握 宾 琴 况 团 抵 经 摸 郭 沙 鸣 拖 妙 阳 辈 掉 迁", "4dccb0a3578716975b840c51e279c2af728567ff42e98dd09b9e61742b41d9f30d411a501172cce9b7d5706a480dd4d4e7fb26021a36a74381156b09d251d65a", "xprv9s21ZrQH143K2hLNNA7KnimwonwFXCiGVM3K29DgZiTcVUJ8t8jkc2mXUzFZmoFgXWh9UhJFbyKM44Qm2KeGsrEevajZZfKyoLyFmyoDpUx" ] ], "chinese_traditional": [ [ "00000000000000000000000000000000", "的 的 的 的 的 的 的 的 的 的 的 在", "7f7c7f91ef81f0fb6a3b95b346c50e6472c1d554f8ba90637bad8afce4a4de87c322c1acafa2f6f5e9a8f9b2d2c40e9d389efdc2adbe4445c21a0939fb39e91f", "xprv9s21ZrQH143K2LTAgxJMxVMKie6n9HQHMUohP6x2cx1TVBr6dxnL3mnSLRiXjiCM7g2ZF3BHzpdbFuhdeh7ZRrzv2EEjg5Tv7kgKZrqbVLc" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "槍 疫 黴 嘗 倆 鬧 餓 賢 槍 疫 黴 卿", "f38af46f6bc3222b0f5aa14dd5b8b506e51131510f2450ec9fb52c28617cfa59d436055fe542e25dfa01415639d2171e41796f169f8bbc18516941dfdee8fb72", "xprv9s21ZrQH143K2HYJ8dR81cQGust8Gm4MeyfC6off5BvCfffAxE33WhiYxB4aLV6meXP6QmoKZkLX8UJgrZPcA4A2EKU4iaPWenb6Wg9kxzd" ], [ "80808080808080808080808080808080", "壤 對 據 人 三 談 我 表 壤 對 據 不", "33f373da1a6b4300dad5cc70d2329ed614512e3c8a423673c294110521326ca66753b9663bdd7c844f17d81609a410a61809dd5113823009f729e2f2f940cab9", "xprv9s21ZrQH143K4SV7MzxYhSQtxP5gWGCD75QiUsp7z1s7Kuc8b4V4F6wRqKvhdczy3qi2uNeN9Vw4PnKYJtoaFdHFX4qbxweuRDmQqgMjKRJ" ], [ "ffffffffffffffffffffffffffffffff", "歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 邏", "cfd5f4fa6f2a422811951739b1dad9f5291f9cbc977a14ae9dd35dc8ab17aeec9ee6f1455b20f881838f4f945850765dd002a9abcdbe7be002ffcdaf6f63fdaa", "xprv9s21ZrQH143K2BptXPaTm7CCWCs4v3tfG5jGAa9zLqSTKNL1ah8veMWc53hio5grKVriWhKjNKbCA2w6svkL4NC6pkiRwVkbwazVXtjdgEv" ], [ "000000000000000000000000000000000000000000000000", "的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 動", "717f4f70c7550da57e42c6b49ac47b5bad3249605ed2f869900596c2de7653a8528380e5c31709ed9c2d19b868bc530158712e97276886b4863d036177bcab33", "xprv9s21ZrQH143K39TvGFp5nfiw3zXib4v4waTbxFYoDNoD4pp4DMBneg9MgSqfK4xL7hK1YjDEa5BWMXKVgTxMiNXNSdT3Wv59pD4PB3LDDKP" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "槍 疫 黴 嘗 倆 鬧 餓 賢 槍 疫 黴 嘗 倆 鬧 餓 賢 槍 殿", "2b219a8be0a8e27a6b50d0a74eb42175bd23e22cf4081518c9a74cbfe2cbace46f0adad8d390f8a2ac30feb26226db14fbc545d18ba0e56a853cbf103c92539e", "xprv9s21ZrQH143K2wC9BUJ9F5CsmV7a6PJQkxc9TT8gUrkoTXurPztKKosq5REGzdEzEuKn221vm2A5KnjrDBC1KcLo4VeYGSkkwxXWYrqSrXW" ], [ "808080808080808080808080808080808080808080808080", "壤 對 據 人 三 談 我 表 壤 對 據 人 三 談 我 表 壤 民", "d29225f73231521784d98820ebf0ae4d827c5a9e0c0f8845fd63866cdc70b3a40a2281f3f6c6181c5a53e440528dbf83947a4b2056749cb9cc9c83dcd5c91b0f", "xprv9s21ZrQH143K2MQFKxX1ReLYY2rNunsfLpU8F5WRVWeLfauPhD5huvXEzxoPvmLhD3QtSj1Z5jnM51q9NrRjYBaHG5XJzfVsjXWYQop9pXz" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffff", "歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 裕", "013c8d6868537176fac7bfa966e6219830008f03b650b0f18a12fd67d9ebf871c400c5f980aa073ddd1b23d60846e357aee193ce7644b574bf65e04cf913e39c", "xprv9s21ZrQH143K2YiskWzQq8kpFFCoFKKU4L8D6Y593dS2sExuVQ4GjnS57RhibwTWjnD7NTCE7ye4cQbCK6Bw674SHb3xWaQYH3NBLFCGYJb" ], [ "0000000000000000000000000000000000000000000000000000000000000000", "的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 性", "1981c3e3ddfd80f6e9ee1c5ef27ba2697df3d1468496f1d56ae3d8e0b3f0677bbbdfca954e48eb86fe6a36fc0f597bf18ea00248757a01e82182badff94abbbd", "xprv9s21ZrQH143K25ttGBGbx6h9VBpa9ELbpw35XQqDR8deXRyVP2AbtgJ79Nq2cW8KaDizbwuoHUYR1o4tLPhYvSCTNMft4ZEfiDztmjXKPCj" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "槍 疫 黴 嘗 倆 鬧 餓 賢 槍 疫 黴 嘗 倆 鬧 餓 賢 槍 疫 黴 嘗 倆 鬧 餓 搭", "fd50ad67903b2046356e67e55d67309b6f0ccd7c23bfefd049a5b8a40d56c507d73a5517e2d2785f024a7794854594aaad845dd0fbd0432c25a96f2a7181a2cc", "xprv9s21ZrQH143K4TP9sQD1LnxuSy6WUe1hF7JMPo4qN6TMX5udfEcJh9x4PqbetYoC9c1hpx7RxP6VcgzdPxPCJ91De4R1TgGNVC9AFhxMwkX" ], [ "8080808080808080808080808080808080808080808080808080808080808080", "壤 對 據 人 三 談 我 表 壤 對 據 人 三 談 我 表 壤 對 據 人 三 談 我 五", "d029fc9737b801cb4f9aadf5feed02a117b76ead7058e055cc39cb44864023eb492e6a15c68569d6a03a5b11bf15a456c64e1781a553589b47ab569801239a00", "xprv9s21ZrQH143K4bYXrWpQYgiSHDM1iVkNVnyqbpjyZksLS2fmxKCbwQjz3sBFTD1aFY4xWrYdHTyeFYjnYWfKGLc5WCkpokdAZyP9XEGJCsa" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 歇 佳", "8e6607a07fa664d6e4ead23fcc08caf72216d6f078c3b2e5be94e4b6e8d64c784d36bf9b70144fa05840e9a49899128111be5093a2b552b6ab76c0906e9b0e65", "xprv9s21ZrQH143K2ghKxX47TRr4GnQh3diJFN5rJfybjxuwr3xP6pafXrBhwXJsw4HwoiPZ1f6fFPR964eoXybV2su498Ant3kYuYKE3CszLsU" ], [ "9e885d952ad362caeb4efe34a8e91bd2", "蒙 台 脫 紀 構 硫 漿 黴 感 僅 魚 湯", "27ca577f0318b6c6067acce7aefacd12bc9fbbc8e365fdc16bfc0ffd76379b0768dc56877f19eee4c1222dfb5a94a5516c5707e6a6ad070af9a0fe7f7799ac5e", "xprv9s21ZrQH143K3FtWQPZHP7Gpf5qgbvXqPNo5iCSfkGhWnATeqM5FuQ3YTx4sSciJx1MjVnbM3XQ16N83x5gNwcsVG7PTf1cRDhvyGZ45EY5" ], [ "6610b25967cdcca9d59875f5cb50b0ea75433311869e930b", "父 泥 煉 脅 鞋 控 載 政 慘 逐 整 碗 環 慣 案 棒 訂 移", "fcac6cdda6c67e46ea46e66d00df3cfb1e437aa05f1b280f5427c0ce521a94b5a01ab016d235b7944f36d76ba0a297968ae0d882fde95c96cae34e35f2433c82", "xprv9s21ZrQH143K4YANCnajhJxfsFsDEZGitTmP934osTHvUmTEtfSaYk8rmvj914uGUYaJH5ALjDgVyNYW5gRGPdQBFaqoSbGkHXhfdVkNVY2" ], [ "68a79eaca2324873eacc50cb9c6eca8cc68ea5d936f98787c60c7ebc74e6ce7c", "寧 照 違 材 交 養 違 野 悉 偷 梅 設 貴 帝 鮮 仰 圈 首 荷 鉤 隙 抓 養 熟", "969aaf00b9af97a1c3fd0b7b35480aebf51577658067df966caaf5cace472d2ecdaa2978470be83463262340527c0564d8c57f86764d48e9bebd1ce594955a6e", "xprv9s21ZrQH143K3aULbWnFhpGS2h19R5JdizbLLLQTDsGmKP5A1sqQop1Ff8Q7NEetRHRNFR8AAsPm1kr5hGU5VLYKURZeiVe9k5hqVmhZ5zF" ], [ "c0ba5a8e914111210f2bd131f3d5e08d", "伐 旱 泡 口 線 揭 縣 楊 斷 芳 額 件", "09c172005e7dd81fcd55b87d13f114207ce7726376ea74a1b9085a799b2afbd5ac5526059e722987a65f858e5301edd5f4c91deaf9d7b4f9bcc38919e5ec3725", "xprv9s21ZrQH143K2sMUzpWRrPMF1Xx29Yos3Kah6H4E9YaJqDm2yEMXypoKdX1ugkn1Vx3k9Pr2LsKNQnHqoDFP5Jepm2PCkUS1GrQZps1wxkD" ], [ "6d9be1ee6ebd27a258115aad99b7317b9c8d28b6d76431c3", "福 惜 懷 叔 筋 酵 貨 科 牙 冒 輩 罩 懸 耕 澆 呵 連 級", "3e09d89450ae45cc1a07ab308649f291ad5c1452da509d7269daef52ddd04db8bbb6bcb8a71322c4d25ed4686d910e84156fccfbac2838ba482bdd1e4b2ea693", "xprv9s21ZrQH143K4bLxh3ir6ziqU7t6URBK7uA8Md4tzAd3TAuBNyZREqEoZBevwu8Uw6tfMujFRWrZvCy47nbnKgDhsFaC2hvFJwRdkhnoM1v" ], [ "9f6a2878b2520799a44ef18bc7df394e7061a224d2c33cd015b157d746869863", "儀 未 九 茶 隊 梯 婦 孤 托 病 泉 賀 產 繪 吹 測 局 碳 徵 墨 晶 幫 息 延", "d687bb89cb435fe1de166e953b41500f3717a497ca35c78322f66cd63e675fe0c8aba92463544631cdd6a985db03bdfcbfd839002ec609879e8768a3ffdb5fea", "xprv9s21ZrQH143K2LB4bPuHTErkGLt8DV5BbRsS82ySFPdQr57fzBY5D7VadhJHruxFzVcYdEbDqK8QWPSqj6LCiyQgFFurfnWWm1v6N2nGovN" ], [ "23db8160a31d3e0dca3688ed941adbf3", "濟 扶 塊 言 穗 定 萬 繪 姻 逃 顆 焰", "806655cee21d12c952d6a11c12e742809c4452b6e07458c6ddc2cc2a8920e308476f3c6ba7fbbdab3de3a7bcecd4de5dd82dee7a217d0cd071eaa2313ca390da", "xprv9s21ZrQH143K3Kcz7sz3UyDYJhSjUYujBdxFwDHCbqmKWqN3hSf1pjnqoxuAKsQXbnvrxzRBLqPN9BKxHUiYgn1DjhwaStTfZQTCsaTEWxZ" ], [ "8197a4a47f0425faeaa69deebc05ca29c0a5b5cc76ceacc0", "慮 鋪 目 禍 英 鉤 尤 添 醇 嘛 觸 獨 起 賦 連 剪 邦 中", "b609a4e17fa8c3c0b4da704b1699631f0d85f5b7bcc7d1488270551670b5393a0dfcb4d8eba9860c2c211324bbf3b587763ad1ac6a9e61a4e2e015bb6cc6a58a", "xprv9s21ZrQH143K2Gmewuzc56mbdKTqPezqWqk7ih9AdnLc9A2865TYtywU9sZ547mKYFKnbVatAuUUGtqgAz1ENkv9FU85jARHkCmtAGLmExn" ], [ "066dca1a2bb7e8a1db2832148ce9933eea0f3ac9548d793112d9a95c9407efad", "而 怕 夏 客 蓋 古 松 面 解 謂 鮮 唯 障 烯 共 吳 永 丁 赤 副 醒 分 猛 埔", "8ce6b92bf95337a49bfd3d80774c9a73d05046eb2cb41789092a3bfbe7005ca668c427a42f1a93982d9076511330817b6d0bd49ba4f5a39e5756472b162f7ba0", "xprv9s21ZrQH143K41g7SsRpGA4g25xDiqjkhq8DNbJD7jgSksvt9kakaTzukN4SfVrUM2A9yGVPggP9eFAmuriRSpPLahm4ngaxvNHyQp82cee" ], [ "f30f8c1da665478f49b001d94c5fc452", "昏 途 所 夠 請 乃 風 一 雕 缺 墊 閥", "e62457aa7f30c24fa46b90aeba2cbb9e77c28fcafa0c10dab01f5323eb1cef22f23c0e52cb5dffa2b2911a29992213c2cb20564af268eed03ea11292fff1a737", "xprv9s21ZrQH143K3JPEGRnwbdy5xdTvVdXEDGJX8gc385oC3H4veWiCVDrdeeFPWrU7Pz3PNMHcZrbutLY1UGs5dE83U925xKXLUrXXpz2ihKw" ], [ "c10ec20dc3cd9f652c7fac2f1230f7a3c828389a14392f05", "瓶 顧 床 圈 倡 勵 炭 柄 且 招 價 緊 折 將 乎 硬 且 空", "6b5591c758a069d3425bf93399398e8ef3e1c32c27f46e0a5284976dcacf25895f5d7747b84f38596247557debd133576932d394ad24c7a00aa24555fa668c5b", "xprv9s21ZrQH143K2hh1em7CqtG7uL1bTNG5hfP35X6Y8uwnTDiS9Cm87WNcZvmFHLf3JwoP2W82VzaRejpqr7oPnFLguhVSr5pWnG9YSV4SdeH" ], [ "f585c11aec520db57dd353c69554b21a89b20fb0650966fa0a9d6f74fd989d8f", "柄 需 固 姆 色 斥 霍 握 賓 琴 況 團 抵 經 摸 郭 沙 鳴 拖 妙 陽 輩 掉 遷", "17ec1a79121f3541e2d78ece35c8cfe7f5763b39d93fa90492c4beca26ee69d3aa7f4b1e6a2ac5e8225e08dded19357ee44b852dca425792842ec8eae09ae43f", "xprv9s21ZrQH143K4RoVseL4UENdN7Ag1WmcK7Q6Pk329krQW4RifHJ5sNizkG1PiyRXAouyL7KDFJSQAD1VarGTPftD1yZZAni3QczW8V5gNVG" ] ], "czech": [ [ "00000000000000000000000000000000", "abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace agrese", "872501bed75c98fbf943a67907bf394995f337e9adfa23687282d1135c262421715a0bcccfe2d3f5f8b72c8e2fa12a7a7267f8047b744557f4a9d49d11ccc75f", "xprv9s21ZrQH143K3rnjkVvSaFkwgg1J2tnUAeqv8SCEWTWdLVZiJsjM6Z5ieeUnrR1Ws6sDb8Guqp43CXVRmPooUs2cjwefSXh3EyXx2vmzZ96" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "obrazec znak uznat zubovina zeman skupina zrcadlo vzchopit obrazec znak uznat zubr", "68e1bd31ed5f20c9ab108c03b524e85209b0b27af80cb5d48fa71d03dbb528b73c2349bb8576f9b68825272984061594f520e54605a4898ba61c433d06bf5de7", "xprv9s21ZrQH143K4JXKqKovjKKSb7zgQcgbuKNNjaWyYBjjdny1SyXiPbjzSNUR6uLmNmPJ1NcWzeHDLqmopeTTbZ3DbPobsm4pbDrNrqhEDbK" ], [ "80808080808080808080808080808080", "obvinit bageta doma amputace bidlo jedle arogance butik obvinit bageta doma akce", "067089f8edbbb8bc8ab6d0f3e29f250d136955745797a20b63fd4372627c51c4576ebd5fb6c6d4825d21f448cc24b342ce3b0117fedf41369cb5a6be77494aa7", "xprv9s21ZrQH143K4YKjBNHoBtUM2qhAvjVvXsBZJGAhogbqhBbgTvjRjPSgC5ShPUeGRCRTdRMYLZ7wWxRWwcvgQm9xX7b5udk9p5yfiekNMQK" ], [ "ffffffffffffffffffffffffffffffff", "zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zticha", "04d0a733d43c640a4492b670a9549c60a358a681891cc2337a01a3c8288cd2941b7e057dbcf2dffd1e614cf5fcc9d38d9228fbd3ea5ceb508b8aacac5f35ccd9", "xprv9s21ZrQH143K3pcHonm1bGBQvbLf6Ty3c7HKCyzFr4C4DnvLPaT1JUUJ4MxkWyNhPpCjVsLMJEndqUocNxhqZ3UfFwxAsn7zajkE7n3yXYq" ], [ "000000000000000000000000000000000000000000000000", "abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace balonek", "b5eb0b74cb5f2c616e7136182597ab61dd94594d22f15ce6c94e04eb7336a56d3e445ec1279c1f04b861de5f7c6b2fc95227db53be4996de3ba87d6d76b09098", "xprv9s21ZrQH143K2Edeaippdsom8CKbdVxcorYqTexQoxhdci7pVuv6K1yFYnGunPP3d6oKyE3ax354UgfNUu6Kes1hvjvJcoyHfyjxwbjhFqM" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "obrazec znak uznat zubovina zeman skupina zrcadlo vzchopit obrazec znak uznat zubovina zeman skupina zrcadlo vzchopit obrazec zmije", "93ff13dee31715a6568609df3f7ea295d58728a65611ea03620d2105a0efbbaa39d8b6541b3b5a57a25dbdfd5006f0c58779a7ed196e25a1a97d1442e3f080fa", "xprv9s21ZrQH143K3SW9C3X4jc47HaXuDHjRvpCDxoo7PgTpMG5EZoFkDCkCzhs2yMvaUQidKKXBDChe2ns524iFEbrJFqNCPFvR1bjyRmq5rxj" ], [ "808080808080808080808080808080808080808080808080", "obvinit bageta doma amputace bidlo jedle arogance butik obvinit bageta doma amputace bidlo jedle arogance butik obvinit bezinka", "1843be39a115dad287e10d256d2e9bb81244cefda2b7ead8a762f53033512abc7b6db26e2ebe8053fb82e313c24bcf62ae84ba4aa2900ca0fcdcb1affc38887a", "xprv9s21ZrQH143K3uYc2wzd6UfPLXqfQKsYJVyWL2HeCZ1YKhqd3jt5y4w9bfLTf4bAqvD3NbJ8ifa6vbTvHL2t87wsgi22RXd8c8Moknbzdcc" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffff", "zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zlehka", "43b7d9b1b25d046f8a89fb57ba10bed11b5273574bb820eb01cc0733a421f1c98ceb2db42d299e7e96aa2c58435e916821bc9d505525b3b5448ecd4c97babe0b", "xprv9s21ZrQH143K3LM3GwVcGcoMnK9UmQKxTaq1GiX1HsG5u76FmfUi5cTcH97WSXxVNLgURJCgL8RT1qDNsiQ9Sw1DDVAhiu4h4xMz6mtFDzL" ], [ "0000000000000000000000000000000000000000000000000000000000000000", "abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace abdikace branka", "dd2a9f662649585707dadc6e8b2df2c0e0e2691d53bacea2212aff4063ab4fdc79b703a7ce6744da31cd2ee12e56b9ee0f430a238b892fa660ed0ce879f2c472", "xprv9s21ZrQH143K3RHkXA6CEXUxT6nXGMM1zKuxgGQBD6k9gErraXywHoiqx4syweAftp5SCU7XSoFz5T3RbPs3HNZtZFa5JcR9ZD5TUmV15tB" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "obrazec znak uznat zubovina zeman skupina zrcadlo vzchopit obrazec znak uznat zubovina zeman skupina zrcadlo vzchopit obrazec znak uznat zubovina zeman skupina zrcadlo veskrze", "f4e4e2d8817cbb3925d6a0e8a2a466dbe1353a5885ec203030722607b8b5f229c71066c18681fda4291d0e323e4f6ba099b5b7efff442adfa14124fd07147fa8", "xprv9s21ZrQH143K4bgmXSbkNXn4ntJoQWUwRscM7yiZjzHbBFc5nMmgMeVcVJS6ZqXcWaTp6Phy8PAji336TDSNmiSWK7cmuzCSxkobg11RTN2" ], [ "8080808080808080808080808080808080808080808080808080808080808080", "obvinit bageta doma amputace bidlo jedle arogance butik obvinit bageta doma amputace bidlo jedle arogance butik obvinit bageta doma amputace bidlo jedle arogance cihla", "bb8b82baced0db7764e102d1d1f68035269e84ec6c1ed0e09b2a31094330967aff9e1a490a407fef736fb8719c60bfb8cb0be9b27fce97c3b619409c195e2f1d", "xprv9s21ZrQH143K2aufrtmAWe6Ppto9BA4jSHu3XmKbMemyWEJ37Zfwxie44JJi8pXDxfjkSv8LxdKKs9rmV1R9SxCfAtcttf6g2JK3mRwPyzM" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zvyk zavolat", "3991e1ccc78af78d58cae577b786f7c950e1f23311d0c5f6d51b884d6142a6b4fc91a227c895313bf3d35731682678653101f51546717d60438d54dead32f834", "xprv9s21ZrQH143K26BAmMqZUKy3rpA3bYvGiip1tjQ2gnLwKrm9zucVU6n5PSJ9FLWeW1JjQJyZJ52QAV3HtevGNQ3BnTh91mAWgaacd6UenQ7" ], [ "9e885d952ad362caeb4efe34a8e91bd2", "pokoj jogurt malovat kroupa holub malvice rachot uznat hnout kasa karamel potupa", "f3922b8086d559436ba2d04bc2aae4174e6504d7d4d451f7282d0b41a1b8cc958b45a896985e0b9316ad09c62f7d62dac85bc3d3e2e2423bcad3336412fd33f8", "xprv9s21ZrQH143K3gt3UuAosyvKpAmRpGfWuM19LVhrpWshTnv8o9Z2SPx7PxfgPQSZtm7U34cWo2NUrUtWCtXLhKDFZxg9pjM9KRde9dLwsZC" ], [ "6610b25967cdcca9d59875f5cb50b0ea75433311869e930b", "masakr odtok pijavice tajga upravit krmelec krvinka buditel zavinit lakomec flirt traktor kresba plevel kapitola tlupa paseka ladnost", "8c7c2b7767caa63139099cc5faf955cc582abc43494fc0f94b1f490ddfb7c221df55b663711755602c1354862c1da7a1241d17888f1be6f4ba7f58634758ea0b", "xprv9s21ZrQH143K4TFHpb3sbWvTgFjmH2b2r6TAWi1L9UxyL2hBXQeDwVgQmR7CG3agahDGRPWJZDWZjcAYwEGjRzycaRzTmbmxjaJxujKScF1" ], [ "68a79eaca2324873eacc50cb9c6eca8cc68ea5d936f98787c60c7ebc74e6ce7c", "migrace iluze pukavec kaktus drogerie hrobka pukavec onehdy suchar veterina rorejs cukr mihule koza makovice uvozovka oklika inzerce odhadce zprudka spousta namluvit hrobka obsluha", "4b315b6c57139dfd19187b6029ad8b2fc6165dd97a43e59c4606a11deb192b25df5ad4e8fc3b4c2da9b9e80eae48946d769bc7bc95786f93b934bbc842cb8002", "xprv9s21ZrQH143K2ro2PraMEHNWQX4w969ZUPVBZFY8pViiRNPhsRjFbj2exS12cg2YCa6kkYUCSJBhuHCicMAGqj1ZtSvKYXLjaErhCBve7XT" ], [ "c0ba5a8e914111210f2bd131f3d5e08d", "sledovat ticho potkan dotaz carevna pahorek ihned nikterak hematom pokrok neochota cvik", "ce64d48ded9f32127bc7ef66c829e32b576927ffa1f323f0020f58c3256fdeb5ee2ec7bc257bb492e4fa1ae1e7f41b8affd9f68a2143e2d54e443e54d866e6e0", "xprv9s21ZrQH143K24d38NZ3eGjiZ5cuqmVJjsC2piMq6ZPSsEfgPf6F9XZJvfsExo6M2P5NCgdaUYgeLchyBw8sAWkH8joq4yMeNF1i12zXWWN" ], [ "6d9be1ee6ebd27a258115aad99b7317b9c8d28b6d76431c3", "most uvolnit novota usmrtit terapie tehdy litovat filozof radon svrab surovina zdivo stanice pejsek ukrojit vymizet helma decibel", "8efd8d7625a41d02e53b8f363678acb389136ee9b19512381417e7f3295cc5bea28a7feeadf29ed8c2bd617e67feee3c736bed06f29ed3538777d58187458955", "xprv9s21ZrQH143K3Vd6GfvEYmC1ut3Z9uKS5weiaKT77zoz4uc4MaJMnQWsXYFLK2wp3DiARFbUyEv8yLqAirLmWMDmsXFhPioprwBiqQbTPb7" ], [ "9f6a2878b2520799a44ef18bc7df394e7061a224d2c33cd015b157d746869863", "poloha koruna dobytek makak domluvit svatba paluba utahovat orlice jakost sypat podvod barva technika pastelka kurt ikona obvod mokro recept napnout kabel lord nasadit", "e69afd8c8b83713ce327570ca2dd9d588dd1f266fde95d7848059fdcec016e8f9f587a8fcbdbd061ecd9a5e1e90f51f9453af914df7d8e9b5758f91a1963a413", "xprv9s21ZrQH143K2zXve6cknQXePKGSMLedfyGDpgQZ5oNB7YKgyJqjXoZeQ4qj1vd2HZpnF77g1nqihMeAi7wnYd3c3hrgczNAadCKdetb2tf" ], [ "23db8160a31d3e0dca3688ed941adbf3", "drak uniforma kuna kapka tmel bedna evoluce technika vypustit popadat rychlost vodstvo", "cb409aa4d44356187fc1f0777afc3f0057bad31090e589e1a8a13911a0604e9ebe976bbbd1633b3320049e58ae4939591150f1b84fc552975d4c7b5774efd20f", "xprv9s21ZrQH143K3S5abSGNCkH4QWovuVGtqjrufboCgkqDvPGUtnUgPFNqXwVyWMD45MmwRFDYUe7Ny89sqvCqxPMWtq2CDa14t1CYxLjefgT" ], [ "8197a4a47f0425faeaa69deebc05ca29c0a5b5cc76ceacc0", "ochladit silnice exkurze zrnitost jiskra zprudka pstruh tlukot vytasit valoun najisto kralovat bobek uklidnit helma ubytovna pysk andulka", "a295037a0335fc58e639e1eb4ad8c6679386cc0b6696c6c0947b9d4420083740c02a3c7e429c698b3650c5d370b87427ff094e17a18778d917cf5fa274c89b23", "xprv9s21ZrQH143K3se5sFVgT6vXcaaKoaHse8ATQJAgDHVBfdwAT2BDgm5YoEPJKR7NN7o5ukvzfKvjZ16NsLG6qngxkRfQRKuSsqyFmcyjpf9" ], [ "066dca1a2bb7e8a1db2832148ce9933eea0f3ac9548d793112d9a95c9407efad", "bavlna mozaika ofsajd kukla obliba kormidlo monarcha batoh chmura mdloba makovice obilnice popel pohnutka duchovno panika neuron okupant rukavice kouzlo stehno badatel sklenice rozchod", "a3314b5d32a47a746f1605029ef41e446e589ec3879b8509a93779bdb5df018c102dc93d3925b1bc04badc7b7e78ed3c79f05485a289d3a8f4731282f4b65f2e", "xprv9s21ZrQH143K2NiewxC1w9akTDfjsfRQ7yyv42HTukKMZ2qqx9zRrq4YYoHUnEeSR9kVa8hY8vHzCYhPxzK8VF4vKJhQNAjGpn94j9r7nEi" ], [ "f30f8c1da665478f49b001d94c5fc452", "zajet nutrie beton kobyla kriket sranda elektron abeceda uboze lump vzorek potvora", "a5fe5fd9fc7a02f2753029978da50e8c1af2a773977ecfda7147c184374376fc1780d4c2516d23eb1559e9cf46cc6f60d30418ba05fc789295adc483f26641ea", "xprv9s21ZrQH143K3Pg1Wcq1fLNYrSSbfioYAiYMqkY4bEN9JrUFnJNLsK2Z7b7stHtJae53w7GD7rrDjJ56CCMNYJzwpdC54pSFkCGV3VYwGbY" ], [ "c10ec20dc3cd9f652c7fac2f1230f7a3c828389a14392f05", "slezina navzdory odjinud oklika ucho ropucha rohovka zavalit graf panenka invalida katedra odebrat deska metoda ohryzek graf flotila", "73716db54d10471971852df2bda795452cfe9b38aaef918da7a2216a3b4249d76b4627b603a03537e5dc2152e54c709acba85d361f4978733af4b7366b13a61c", "xprv9s21ZrQH143K2YLLxKi6GZjifUEoqww1zAAUd26JY5T54Z6HgEip3hkFKUfAAeVqEmZrdoHoahhm71MvBwkMTZALYrJtZfe4eLqMyZE1op1" ], [ "f585c11aec520db57dd353c69554b21a89b20fb0650966fa0a9d6f74fd989d8f", "zavalit genetika kapusta tvrdost dopad ujmout zdobit mistr splav ptactvo fosfor hoch pocit beztak slon poplach mazivo tancovat pravda uvalit konkurs surovina nazvat vypadat", "dba03d22ab6f6963abff6d9f9433a6aa733490dab58b39e3eef635c9f4fd6ad8242c3eecc4db0f26a447af06a089d935b3225e36615a07babdf2177ea3fd1670", "xprv9s21ZrQH143K29UvdRPWan6npJHgHs7bmiduFR6qWzf5z7gFuqqcR7XoHpSBamvgTn1Qzy3JqMSuyxJEnFN5s2s9mbMna7WAiKheLFAA4x4" ] ], "french": [ [ "00000000000000000000000000000000", "abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abeille", "3bf3366c40256d7e2fca716fddf8673425c7c7e444af290ee1edf1bbf095e6e78a7190253f3e46f1e2069345d4b05ac17b242faa225c0a3e4d268976744e0698", "xprv9s21ZrQH143K4ZsEXSdGmcpsqn4YxjPgHqa4DFvMRmD4oTkiFuYia3srKewVsU75LN4jP6PeXPYFWYpgP8B74tQjwG1GoQ9T8eJxGDjzibF" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "implorer visage sonnette voyage véloce pourpre volaille tribunal implorer visage sonnette voyelle", "ab9180b7dfdde74e5cf8781e5692e2c0b55afa8bc1987fa8e14e3fb83c88b195c53e9f939f8febc33d2958f5fcd8add57843cb318d8886130ef9c9879c826357", "xprv9s21ZrQH143K3MCzhsD85FFZ2d8vDN2QdRTN63gbU3qHjZxn7utU1kwYGR5bxQkssS1Tji4Tuw8vpTzDWogXxhbWYDKuZveeRBe5wiNsuFJ" ], [ "80808080808080808080808080808080", "indexer acompte bolide abrasif agréable dédale abusif appuyer indexer acompte bolide abolir", "0c1ece83a464688d74744723d609e30e191d05ab8c082cf34bb2405bc4363dbcf6a9f83707b577d230728b3943920f876ec844e86dd0d117152c23802d25be3f", "xprv9s21ZrQH143K36u4b8J8pxUwCCnciUPZF3JjZsq5mPCDEpNWA1j4DnYDJ53NV7b6cmNTM6Je6DG11hJw8Fq1HXKEasrpxDC8WqaEsD5BPGq" ], [ "ffffffffffffffffffffffffffffffff", "zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie voter", "7d2f168ce71ba3e40e74baf47a072a94e49973c0dbdb33a62b3a285ab167c704a85d6ce0d15cc6a4dd3bf1311334ee0d290ae7d20115863d5f5633b8dfacf2d4", "xprv9s21ZrQH143K2AsqW9AAdu5C4zUaV45MgyzBQAYbEKtKusR83UzLwCZdqDwqJ59ebNryoNuVA5pEiY1eBYqr64UGkwZGezwaceCqxPWia7M" ], [ "000000000000000000000000000000000000000000000000", "abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser adéquat", "93d81d146eccb7c624cc25daa4cd52736d64bdc0fe020940157e73c108a87ee34d94d7e9554e02ea0f9a7ea5574426220bae7c4959c197a6c9e2318cb252683c", "xprv9s21ZrQH143K2iCVwUFixFL9fh5f6XrcBfaLgRzozbBgzj3dTo7fBTn4EsQ8ERgq9hTPxFf2hgE57vJDfEGKwsegQFoo2mEM6HEgFavJkQU" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "implorer visage sonnette voyage véloce pourpre volaille tribunal implorer visage sonnette voyage véloce pourpre volaille tribunal implorer vinaigre", "dcf42783150cdb92672c9ea7d13f145401661f10b89bfb012a803ca7713e97181ee28ac327a982060a7f8aaa6e8c649ca2c5b83c24458393fe41739ced31d987", "xprv9s21ZrQH143K2Lq1fbvL5nedyALbSBmmm4EbcVduaPFArtunM6azzNy96pcKbLvVBQcFFDa3Agp54eMhCBH5Ehtbxitv525n2SrhYvALPiD" ], [ "808080808080808080808080808080808080808080808080", "indexer acompte bolide abrasif agréable dédale abusif appuyer indexer acompte bolide abrasif agréable dédale abusif appuyer indexer agencer", "b039606212ccadb0d05c7a0c08605c5137028d0253d26b9ad6ee113f9595700d9834b2eec8b224975a6d9585d7ad39e962036edcf07d5b125b0fc225d519982f", "xprv9s21ZrQH143K3m5hJrQxzUdU4bDDvLSisrf1Cv5HQNCEzbUokwaVa8X1huTY2JaTPJug14EbopY3gtdfWjmVoo4CHLzuwjf5Jhdjgaqsh9n" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffff", "zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie viande", "e12d20a535ef5e9e2f87e05b5261bdb51451e052fe484feb87543f5cb7a8822c4aa0152492be1259fba00a28c1e95518a90f0645bdd0eb822516d37ac881f7e0", "xprv9s21ZrQH143K2woSZYBmSoRYygWNGUUrkLiy2i4FmReSqyc568kb1siagkBpHFj6MzLbfuh8TaWKDckfnfphrYyKTAG2rk5y4sGv4fjn5gD" ], [ "0000000000000000000000000000000000000000000000000000000000000000", "abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser abaisser anaphore", "0f3eec3279b55f3cacdbf1aef705a086078d7eb8048e402202572e7038e9487e39104b4794e88a42192af030a176b034fa36ca6641fb8128fd23c30806b96c23", "xprv9s21ZrQH143K4UeephsshHgatV7uj2D2DotKpGrWx6ShwxPdRxXtyQWxnadSvjT8Df7UDxmRuiFJa92evePgqwgJSG5pY8VPJ8hNiyGHr1C" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "implorer visage sonnette voyage véloce pourpre volaille tribunal implorer visage sonnette voyage véloce pourpre volaille tribunal implorer visage sonnette voyage véloce pourpre volaille studieux", "8f12b35fe92a7586dfbdab9721a91300d0dbe3185d0943021667e62fd5a643e0cf2443e544738c5234009aa50faac0dbb123ac847c31dc25d875c56fe39c6186", "xprv9s21ZrQH143K43qySSryByKtU1Df5foSz6kDEHUsR524HZJzxnKrrU3wTdeSvHVvpitC8nAb2kdeVWGREu22KaiaMF3YjEZQdb7htpY6CXP" ], [ "8080808080808080808080808080808080808080808080808080808080808080", "indexer acompte bolide abrasif agréable dédale abusif appuyer indexer acompte bolide abrasif agréable dédale abusif appuyer indexer acompte bolide abrasif agréable dédale abusif axiome", "53ab1d10dc8de3a80171b5f00495a3b49e2c5afd486f8111b1afd0ad24f43eb0aab4acab1d4c51126beea32405947924c237157b29dca69fcf64eb635708895f", "xprv9s21ZrQH143K31JiBbFJEViuVwAuWSD5X8PKzS4d2PoSCxHpBXpicCEMKndL8TURUZ2zeoA4vDGkECeJS9wMhrRcmW6ATmPmmwC3ziuBRdP" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie zoologie valable", "b5e96f552ba44ec827c1bc5ef362e8cea68dd6f36f2c8640aeb171cf9b66198fbdf155fdbcf7dc505431068f972a92442f33cda0065afc1e9a7f5f7097ea6c6a", "xprv9s21ZrQH143K2umcmDhRrUZ8wsZ7ACj6rvFCEuDK1coHWpo1RwYPvy3dpWmvPjstSMm9fm3igm9gjsAesjqAU6Tnejizy919FSmyofhRTyS" ], [ "9e885d952ad362caeb4efe34a8e91bd2", "monument dépenser féroce entasser comédie ferveur optique sonnette codifier discuter dioxyde nerveux", "d322acd69a849cce8719674eeb7cd76520de01ea35210012a44a5dcc19faf285202c3fb3c749a46d338ad54ddd398029ee308ee352a89f65180dbd3ff750dd50", "xprv9s21ZrQH143K4RswQfcyMEjx6Kc5tEBR43MNp7XJH5mWushqBryZTc97VNPNVfRop62sGwu7Tg3vsd559P1G8h6M2N9j1Zj1vVn1919uvmb" ], [ "6610b25967cdcca9d59875f5cb50b0ea75433311869e930b", "fiasco ivoire mardi révulsif signal enlever envahir anormal vaisseau essayer céleste sagesse engager mener différer ruisseau lutter esprit", "3c0c90b30e1a8bd7aafda95f92fb09bae64988e2431d6c3896c8502f76203652f0db1d4640417d8d3f00ea4de59f1719513f1c01145eb8ee4b0fd73d4c4f706a", "xprv9s21ZrQH143K3eSdUPkhpFZamFuu35iaZqRwFWijYkE54fvUKoSNBHkXetNx56yvcJSFoeHT9y4AFuWTcFFzezPuk6D6LqnNscjFnvdGYDt" ], [ "68a79eaca2324873eacc50cb9c6eca8cc68ea5d936f98787c60c7ebc74e6ce7c", "flatteur cultiver oisillon destrier brusque crainte oisillon labourer remède substrat parfumer banquier flèche enclave fémur sombre jongler damier insigne voguer rasage gomme crainte incendie", "7363c9fd3127cb683ad39697f3a7282a06f1fd1ab1ceae8e2e0d7ab2766f3b8fb29162bf46e0d6a4917a0085b763f7f6f36adfdde742b6aa4ff1973149b5d239", "xprv9s21ZrQH143K3YEnEhMfv1Mwoc91DekvEqXxL85fFtRKtfFk3Jsqu72bUd35jHsTA7aBShvTmhhBrHhqGZ1uVg7RTwzTpnarDUoGU8ZXQ9D" ], [ "c0ba5a8e914111210f2bd131f3d5e08d", "prélude routine négation brasier arlequin logique cuivre hiberner cirque moqueur halte barque", "c46b545d5e7398d0b5344ecbcc20769fb0fbf674848eef1591725a1113f5bed0edf6d78925798cf87994157f43bd9d0eb5e6f3de7959e2e88f6a586e7499b79a", "xprv9s21ZrQH143K4U7WubDzyDun3RrpuVsFECM9u9tNxjhJhZFCJL5DJvGhKkUAbmmhqpwUV7UvgPPG2QFoDq7jYY6Neb6MnQmQYTo3RF57ZXS" ], [ "6d9be1ee6ebd27a258115aad99b7317b9c8d28b6d76431c3", "froid soluble horde sinistre rouge rocheux exiler causer orbite résineux renfort vaste récolter maison serrure tonique cirer bélier", "93856e02d3ab2e6738958350f2a96a18183c0c02aa7cf50e4e6877b1d4f9eb4be1806b034e4a4a271390b7b6ba6b4209f5e293840e93a41a2ecb16ad47936c03", "xprv9s21ZrQH143K2wjyyXXC3Cra6k8WJ3CPEWc1EgwEyUNjLAxGVoegrni9eMik71k4L6wWxLtqcwgD9TzKLLiaSddwLFp4F6hJ4LuDBWqVJcq" ], [ "9f6a2878b2520799a44ef18bc7df394e7061a224d2c33cd015b157d746869863", "mouche embryon bison femme bondir renvoi louer social largeur déborder rétablir miracle adresse rivière machine époque culminer indice frégate ouvrage gourmand déposer exulter grappin", "08cd47b905df56e3bfbca6d1ddb7ee7ae75d45f6e5928d337bacf34754d392c7225c611136148e130dc516cdc7ade8e8a95ba62ccfdac01a107875ce3e2cefd2", "xprv9s21ZrQH143K3BFxuNuyFSUgQQ3f4tv6HLktHoVxvMfBKVBow3i9GqeTF9oBbG87rZBX79QTCQqgPbn3ywWc8G4ZiUdhdY3xDAciXLtE9aJ" ], [ "23db8160a31d3e0dca3688ed941adbf3", "brochure sextuple épisode digérer ruser affecter cantine rivière torse muscle permuter talisman", "8e4635efc7352a6fa18723aff498fa297c1ed1997c0f3e77a11e65155b25934cf90e74ac66d207175507887068a5c85d24b825d06a31ce75651fc9893e509869", "xprv9s21ZrQH143K2CpRxCahnStujg79zUscDimXKHemoY4A1Kep85cPai2e8wJ4Y5R4uhrG76merXXjSuukqjVrzJMBPsGC8apQqHymDsBPf9e" ], [ "8197a4a47f0425faeaa69deebc05ca29c0a5b5cc76ceacc0", "informer poivre capable volcan dénicher voguer offenser ruiner tragique sortir glace enduire allouer serein cirer semaine opportun abriter", "ed4ed89acf10eb53fd67c9f81f4e8cbe39dafe42c27e942e67559a825c6083d3373a3e98215c37318f0f28c13546895e76a080521222f6d70a9528a582dcdcef", "xprv9s21ZrQH143K3N7dvQS9PoT9BemrTHWfp4qzUPT7hbGdZ5uMn6RgMwKerbmrrAqjrMGUskpGJaaorTXnbgtidgEbboJVjH18qDMkLFPf36V" ], [ "066dca1a2bb7e8a1db2832148ce9933eea0f3ac9548d793112d9a95c9407efad", "adverbe fuite jaune épaule imbiber éluder frémir adulte attentif filou fémur idylle muséum mobile bureau loyal hélium jugement péplum encadrer rédiger acier posséder pavillon", "81ecca7ce712963df79d6611d2510e9fa31d307557a5eeea9513a9a940c2531472fec2c6988b70f649b8a3416f8f90f5c9c8f0ac4897f4a5a1304c651226f330", "xprv9s21ZrQH143K2ZnKtKjoyhEcsuEzLEzq5oC8sGegz59C3vf4T8VjvRN2UQQsHw2ndFj1UMNo1uuVtxKzjmNLvVAd2SURTgkVXKykFc1S8jG" ], [ "f30f8c1da665478f49b001d94c5fc452", "ultrason hublot agacer éclore englober ravin caféine abandon séduire farfelu tropical nettoyer", "2efa119637c044ba28eb610178d7de49dabed93fc16f5af675aa661b731567ed3ad7aeb36a04adfbfb694bbd065f6f840ab80369ec3c253ca122deb208ef9f7d", "xprv9s21ZrQH143K4NWbtgfxvJK1Us782vFXDdb2bTK839KWEUZFnQTXXt85hAHXML9xkKyuiaiKgD1n6ytUZdgT8hirdn4SQ4DR4T4MPiNQz3K" ], [ "c10ec20dc3cd9f652c7fac2f1230f7a3c828389a14392f05", "prétexte grogner instinct jongler sembler paresse papier vaillant chenille louve cynique dissiper inoculer besogne flairer jeunesse chenille cellule", "887a87c38340befd47d650b73849907b5892a0db26e17ab55601e4e789ae1d0dd4bc3e7fcae0fae25c3e0d3315456fe8a5d84944d2b799cb63fb9544fbd0e568", "xprv9s21ZrQH143K4G36f6wnN8JWRYHdbvANd8fF6c1pjb6T11LKxw3Xch5iacc9vyGQDcf51GrF7kknKumq5csscAByQiC1gaY7vFygMghGtJ4" ], [ "f585c11aec520db57dd353c69554b21a89b20fb0650966fa0a9d6f74fd989d8f", "vaillant chance dimanche sécable bonus séparer vecteur forcer raideur officier censurer cohésion meuble agiter prison mutation filière rincer novice solitude élargir renfort gronder tornade", "e59bf24814adb55cfc2399e03d94e81df4a906ca5e75f36f2e297623ffc418b8202e9b1444e0e97234e2d55e194d45f89491dc9533a1c799fbb86c5838cc3454", "xprv9s21ZrQH143K2gBerhfhuxyfCEXGiLW3sxY1scEJUtvroAtxPqqatzqTzDmkgxDsL7C7MMbBk1ZKBXHpYiJziBM2VFbTbA3G1qjDkTt8PU5" ] ], "italian": [ [ "00000000000000000000000000000000", "abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abete", "d2ae4bbd4efc4aba345b66dc2bfa4ea280d85810945ba4e100707694d5731c5a42ac0d0308ba9ad176966879328f1aa014fbcbeb46d671d9475c38254bf1eeb7", "xprv9s21ZrQH143K3ZxfinfrsmnuKNwdvRtypJ1TEs8JuE6MEmAMDwsSZApCyBFopme4iR7RnRt9XKFprfLKs9vooFuFK6h2a2hzHuXTmE9md1a" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "mimosa vita sussurro zinco vero saltare zattera ulisse mimosa vita sussurro zircone", "f8c609647319a50116e9b7d1a0ec5535c6d08d6c958911fd2c8b2dfd55a61e63e9c6c60c22b5c3aec725acb41980e63cb3ed75fb80648092dee1bbbeab476a6d", "xprv9s21ZrQH143K3yxi91AAWZvT8797G7kL34h3453QNFSiQybwss1gmx2zYCmbg4tiZdYSEsd7arPWYd5MQh28VBvcEqvXSBRu1zYajyJnzFD" ], [ "80808080808080808080808080808080", "misurare afoso bravura accadere alogeno dottore acrilico arazzo misurare afoso bravura abisso", "4025269bc4f7550bbc3c61592944946b0d4ac855a5e4582bf86069cc0c9429455cc40d84ba215ed1cec28e27ffc88460c38b9c4e8c486ae878d7c85e95b222bf", "xprv9s21ZrQH143K4Hh5BqryXtMu7QLbJC7yDh9kscJ4h3PuxA382w6YyjMMkiFVyfmdYFwfP8sVWR1eLygHmczccbzH7pTGXbeqAy54fNVA13M" ], [ "ffffffffffffffffffffffffffffffff", "zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zerbino", "24182cf43f956410b5def9df90e3db0d6f3199c2ebd26e7ddef888ee3bece9101d132e449bb9e1c23dd9ccc6131d2f649c021ee591e88cef8d17cb434ef69efb", "xprv9s21ZrQH143K2hiPzq8SzzER9TQDFYpnYbfg1hE8wUYwcb7JNRyM4aDB14WfoUghRrBKFGffUx5YsTZvPbdCbuVMJG7egUZVsRTJCviSror" ], [ "000000000000000000000000000000000000000000000000", "abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco agitare", "2161a4b869f98778b6321714e2502adb11ea120c12163b46fa34e36442ad1981b911a2f9ec82b497e7cd206fa7af2f21a94bb6e4a90159965854784e1558658b", "xprv9s21ZrQH143K48ZSAvHY5BjAyPXxL3pREwQPZ9DxPagzRuK8f5TcKnDr3z2MSjB58uC871CjjjsNTaUa9BxEzEwraQutT42co4mfFGusE2B" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "mimosa vita sussurro zinco vero saltare zattera ulisse mimosa vita sussurro zinco vero saltare zattera ulisse mimosa virulento", "d9a6205a985fde8c2337f6cc6acf77a93d6ec7dc792551c01400f5d9aaa86aa943416c99fe60be141ca27ab333d9f96648b40b266d6b2d6a6e5b07c8939568be", "xprv9s21ZrQH143K2wPR9TuAQcWLNSM8X9oRjUCC3GN6aGevV1zfm8cwi2JtrzS21GzAaqd2MJDszoka7xiduQrDc666Wk27qYhUTagEfr4E218" ], [ "808080808080808080808080808080808080808080808080", "misurare afoso bravura accadere alogeno dottore acrilico arazzo misurare afoso bravura accadere alogeno dottore acrilico arazzo misurare allievo", "cfb1f800cd5a0f7a8cffb12231fc61739f5f87c963ead5e205dd48221c3417eb1173d3209d9a8ffc4f00ab291bc22c1480b4a0a4fdeef9a1f3916d0ccbed5591", "xprv9s21ZrQH143K2EQGrM2arQhKSEhd4DwraP86UrUKsVcLvM2NujY9rPJK78rGUCD4Z3AG8tz8brxcSaDQYDw18jZz8FuT1H6ZdwFyUQVERus" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffff", "zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa vile", "05a43b9c258f6e83f4073fe4a66d6309e94610fe12dd5d598f4725e4e85ff1fde5ff5b1e61b40e09a481a98953f9dc818342172a460e5e6d17d9ab14874447e2", "xprv9s21ZrQH143K39Y9dY1q4sf3Bv7dkFfDasdSbWUKNx7GCsMp1JTo8KFDRq5TNkGr1wQYm3QZaALpFhcHWhPV67oVZQFMRFu51yVxeL9KDMF" ], [ "0000000000000000000000000000000000000000000000000000000000000000", "abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco abaco angelo", "84055239f41c182bbfe6ede6db2e8bc4a97cf86746643b7ea6910c71d67bb2a678a97ecd378cfbf59e30db720b1cfde0faaee73afd3c5deef2188e307d04442c", "xprv9s21ZrQH143K2b5TRb8ReAEzasjVej3ttSzyy5YRu91SdQKP4XUZtgeUipuJx6YoArxkiRSBU5eP2wu6dmgLhgBQJ8Bx5UXmwFudc423DdN" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "mimosa vita sussurro zinco vero saltare zattera ulisse mimosa vita sussurro zinco vero saltare zattera ulisse mimosa vita sussurro zinco vero saltare zattera tarpare", "f0e226efcd929216020a9e8f879f06b146d28fecd2856bd401a62ecc0ece8bc6ea717e3f9df523a6a00bd4ca8965e0498d63e779e3156dbf174ebac74ad7be31", "xprv9s21ZrQH143K2dys2Z5k2tZoxJuBENLaf3cTEpb7JUeXDp9i63vbPMqVNqHqx5bGJ5tdNug3JFWJCC4amzYLoFRi3YS55MiHnnUN6w1V57h" ], [ "8080808080808080808080808080808080808080808080808080808080808080", "misurare afoso bravura accadere alogeno dottore acrilico arazzo misurare afoso bravura accadere alogeno dottore acrilico arazzo misurare afoso bravura accadere alogeno dottore acrilico baco", "ef549c1e44a7b183031b41f9f692795406de605e43ecc628911a38d7c92f392660c48313a08cf1a055a420d4a8c6b12bef7ff354c903303bc3a5dc12948ff5be", "xprv9s21ZrQH143K2mWU418GviWbPrYTveuukEHsYJRn8aUxV5PrE4XacaDX74amiRkH3m3Qmnz7YPRRXkF33z5472Trb39RksWRmcJitkT5uJx" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa zuppa vedetta", "5089f33aee7852d86a01e8afbfdc8a0ad5af51538e62e3f007d098fa4fc9817ddc990fa87b7235273798e2df52228b62738df923bc2d711fed9cc0558b3ebfec", "xprv9s21ZrQH143K2VqjZNjnyCMUrTw6XhLt2BsaPVpHD8MKpKq5mq9S5SLyMSv58y7nCofNGZSgQQpky6aujCURjVuAM9jCcN6xjzbeRQYYACi" ], [ "9e885d952ad362caeb4efe34a8e91bd2", "pesista educare imballo formica curvo imbevuto raddoppio sussurro croce eppure epilogo poligono", "4ffd8b7879c0c6d7eee14682a26465d6429b8b921d6ea3299fb8a448d84d19b47ead5b23fd14449539cbd358abd19a23560dbd8c4bf6c153d98ea0fce7f474de", "xprv9s21ZrQH143K2bsiFmYu4jzf5fjcHrrEarDgY3NYhmUEU5bxz3eS3NwS924WYnioF6rf6Fij6XQdmCNjcCJwqdFJ1AKKLMxa4obLnbdFgA6" ], [ "6610b25967cdcca9d59875f5cb50b0ea75433311869e930b", "immolato mummia oviparo sigla stirpe fonetico fosso appetito vasca galoppo cigno solubile foderato pargolo enduro sociale ormeggio galateo", "188305ae9b45e400f6a3ad839061265f36e6050118283b85a3ea842aae1cca29c808978b3b0e297dbd794b74916fc43da57172e90c9fdab930638863c3472522", "xprv9s21ZrQH143K4RNJpMYxxAuHtA77jzNEAjh3MznXe6FejAGGUPHTDUFL3z6LB1FioxHnMirHNcHyV4QVsXs8rZACW8YSJcNo3Wqjg7dNoUC" ], [ "68a79eaca2324873eacc50cb9c6eca8cc68ea5d936f98787c60c7ebc74e6ce7c", "infatti dire pudica elica camola deposito pudica nobile servire taverna restauro baritono inflitto flacone ilare suonare nastrare dito montato vulcano scrutinio lisca deposito mirtillo", "093ef04fe24f1c45148f3d4d9a54fb033638011507418cd7cbd91a8fa12157e1cbd9d095b2a660db26e8d674cbf6033a384954fdeadcd7c20cbbd3da46d90f1a", "xprv9s21ZrQH143K2ZBg22DZJyspAmZcVMa1efjpsz89Hmcsu7dPZ39sH5RCCNr2kBRNFQUUmcwsNUTyZ6UGk7zjZKgCdXrmxg8gJ7FBCEeE5Au" ], [ "c0ba5a8e914111210f2bd131f3d5e08d", "sarto smottato podismo burlone aria omissione dipolo marmo coricato peso malto basso", "d9e2a2e18ca8173859b0030186941149f630483cc9fcf3b189e5752d4f8b7dce2b285008f52ff1301dd2e2a673a4c76f8ffec9f8617fd577173b90c6af95631f", "xprv9s21ZrQH143K2FR5gEkuFMhmYGVyUKiSrZspfn52HonhhbvwWrn5fL7aST1yxtAfd8cQSyWVGH9TamV4SPvyKRZbSV2U7ZTurX1Zoe86ngE" ], [ "6d9be1ee6ebd27a258115aad99b7317b9c8d28b6d76431c3", "italia sultano meccanico strappo smeraldo sipario gommone chimera raffica sforzato sfamato vendemmia segnalato oscurare staffa trio cordata benda", "c40130a2db00d82c2dfb127c768724c522cbf7f47b464061198c65e9bf4e3879262dd112cb7a526bf4450785e9f7f7e7511f05985d9104d9e75e1baf038c91e6", "xprv9s21ZrQH143K3QTUdUYC375Cvtyea83NqatsgA5z3BMp95Fbd7QfQRvzqgjuCMU9zhSgiVtAYuDoR1GK9gQRP8juxnFR2Hd4v3mNgfMySGq" ], [ "9f6a2878b2520799a44ef18bc7df394e7061a224d2c33cd015b157d746869863", "piacere feudo bisonte ignorato brevetto sfida onorevole stufo nulla docente sfuso perbene albo sinusoide orologio fulmine diradare mitezza iride rata londra egoismo gravoso luce", "e384b6486328949618978c6d2607df3e7a9db9acc94ab24183aa4e7c1af0107ecbcee2dcead27d7f20acaa427d3d6eeac620ff24ae4ac2ba3b6ef01585418f25", "xprv9s21ZrQH143K32TYshJvJnEHVnwukKyvaQauzBPx42JYyGT1FfyUvjT5iEfYuaETkYiAUJE434hs5Qkh7FRSqK7kwy5GwjsfS4S5txFKwbL" ], [ "23db8160a31d3e0dca3688ed941adbf3", "calmo statuto fucsia energia sodale aliante cedibile sinusoide trovare pila rinnovo tiro", "5d5faba1d0db08a9f0cdb602e571a9b73565707429d2482e4fcde5a9bac1728b053c65853199fbdba73716bcb8da0616820fc817a309c99607dc56dddb34c344", "xprv9s21ZrQH143K2h5d8kmFvaQT4xHzXrAVwmwAMyF1p7jBg2QoE8RGGFWe1NyqcNPhy18CJ6UKcvHTXkijihhLE18yrpec1DxggywYDVWGiUo" ], [ "8197a4a47f0425faeaa69deebc05ca29c0a5b5cc76ceacc0", "modulo rubizzo cefalo zavorra economia vulcano prudente soccorso tuta svedese limitare fluente amico srotolato cordata sportivo querela accusato", "7f7bd54b8bf5c99a949d3ddc1d4baeec78e503f14ddd20500e307be89e940e5ead97530c014c33053a9b0c942094ea1bad649b2d23d6288dea8fcfe2e3a83c52", "xprv9s21ZrQH143K4AwqRHE1Swki4WW3ok7NF5cCs57wYAEhcaDhw9oVh1xwSbCeofP9GMZkTmZo6kSjj5Xh36tuuPebZhDBQRcgRnzLaSgrpL7" ], [ "066dca1a2bb7e8a1db2832148ce9933eea0f3ac9548d793112d9a95c9407efad", "alcolico lacrima muto frigo michele fessura irrigato alce ateismo incendio ilare metallo pilifero pergamena canotto opposto manovra nemmeno rimorchio fisico selettivo aforisma sabotato riciclato", "197457046ab546a171b247c54bb8392aa2ee2d40f07831019776745f17aee46fe9f1611f86f9d7f0cbcacc03ce696082fc13529ba0cab0d57f76934383be0f3c", "xprv9s21ZrQH143K416VC54NFDGXsQeXLSAf2JaUD8jQR4SDqAFq2S3BdcSRW66avfcoRK5FsPPCuBKaShrskgoGchxdAeBzVMPFHrJkCwAWgiE" ], [ "f30f8c1da665478f49b001d94c5fc452", "utopia melodia allegro evoluto folata scuola carisma abbaglio spillato guanto unificato pollice", "53c4c5de8a16381908e397fcb8ce5dcd8c90911d9b538afe83862468816889768d94d040bd249f4eb25d915b05b31addfa0b06d89fe15f521fbf3c8545bbb434", "xprv9s21ZrQH143K3u8cCFUJiaxUCKdGZ9Z2u76hUbKNMoCy51gq982aahsMbN5ArmhR1VHFJSMKLsFLkTsSX2gwjrEfj31QsDqCh3nE6FmcV4e" ], [ "c10ec20dc3cd9f652c7fac2f1230f7a3c828389a14392f05", "satira lusinga mordere nastrare sposo responso replica varcato colza opinione distanza erario monetario bici india narice colza cilindro", "5c8c80b1e440dad220a295b282fad7e8a44bfee5210d853fd52d26e8a006787ac7bf4b0a4f81d029e2ae9cdf71814f193bbb23e4b3e149d2f99b03e2417b39a0", "xprv9s21ZrQH143K2gMABxA98Be2P18eaj1zxU5qV6sCiMT42cuvLQ3dM2VBnEAvpFwWEDtDcbSkteNAF8nUuCyBETqpAeKmqV6niTPFEECGcLx" ], [ "f585c11aec520db57dd353c69554b21a89b20fb0650966fa0a9d6f74fd989d8f", "varcato codice enzima spessore brillante squillo vento insieme scoprire prugna circa cruciale peccato allusivo savio pilota inarcare simulato precluso sugo fegato sfamato lusso trono", "e89b83bd1a5fa859922e0045acc84cd04edeb4bf6b5352d197fbed50af0938b17bca7ab9beb8c882d0e0a67597d9e14e88c10e63b824e9206d2848fbb8a55b64", "xprv9s21ZrQH143K42yTQvEavGhekzrzpxHY1nspnh5qcgThCuNVAyJPWRMeznMV9FnChg5f7k51DBMawNZKWTFCLy2az1CnyGgCJ2Jk5PGb6Qv" ] ], "japanese": [ [ "00000000000000000000000000000000", "あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あおぞら", "5a6c23b5abdd5c3e1f7d77ad25ecd715647bdafb44dab324c730a76a45d7421daccee1a4ff0739715a2c56a8a9f1e527a5e3496224d91293bfcd9b5393bfff83", "xprv9s21ZrQH143K2TDo8AAss7eUkUqLFzBnypFpqjQUMVUrSMvrrgLiRxQPrYnhfoS9NPp3rex725rcuN8pkDL6pwqWfdPtiqa9ib1B37vZwfy" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "そつう れきだい ほんやく わかす りくつ ばいか ろせん やちん そつう れきだい ほんやく わかめ", "9d269b22155b3c915b09abfefd4e1104573c528f6977cde89c6a68152c3c714dc6c7e0e62f221c322f3f76e4d0bcca66c06e3d2f6a8d70d612c87dd6dee63976", "xprv9s21ZrQH143K3kavBMu7K49k18vjQHhNL1ciMgn7S9kDMKdyK1vEpF46UWyoXCvdBLEp8U2bhissPkC6iwXjMgRXyQ6SHbyYYGcnFqNXTW1" ], [ "80808080808080808080808080808080", "そとづら あまど おおう あこがれる いくぶん けいけん あたえる いよく そとづら あまど おおう あかちゃん", "17914bd3fe4b9e1224c968ec6b967fc6144a5795adbb2636a17f77da9b6b118200ad788672fd06096ca62683940523f5178f6ce3845c967cbd4ad2b3643cc660", "xprv9s21ZrQH143K2NAPUK7UVbLB4Dd7Hvb7fqysvFyKES5iujX4BfrwUmy1wvWJb3kBc1Zs2jxTTBxBPHuHziB1ZWWUxELrn8g8VLrbjaWDmRe" ], [ "ffffffffffffffffffffffffffffffff", "われる われる われる われる われる われる われる われる われる われる われる ろんぶん", "4bd21b75de4f262b0771a97d6fc877ee19329236ced6e974c4c81a094a5f896758033f7eae270216d727539eee3bc9ba5cad21132a1c6e41a50820e0ac928e83", "xprv9s21ZrQH143K43f5tXeZRJ2RMiS6nLhxcqvopg9mc84xTiX1UjLjVQDBHrwmypY45SPscFqT7zJet5b3riay95fJMM4dfZXtoBTcKKkKEao" ], [ "000000000000000000000000000000000000000000000000", "あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あらいぐま", "a59401a14bb821cce86ec32add8f273a3e07e9c8b1ed430d5d1a06dbf3c083ff2ffb4bb26a384b8faecb58f6cb4c07cfbf2c91108385f6773f2fefd1581926b5", "xprv9s21ZrQH143K3VMwP9nGq47t86uaVENmykbCRuUDKFDSfgDFjJUFuF88JfPPMzwgwFPoaJaAD3YeqrCQBFY5S2jaCXXuc5Vg7u9jb6iB6XF" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "そつう れきだい ほんやく わかす りくつ ばいか ろせん やちん そつう れきだい ほんやく わかす りくつ ばいか ろせん やちん そつう れいぎ", "809861f80877e3adc842b0204e401d5aeac1d16d24072f387107f9cf95b639d0a76141ab25d3dc90752472787307a7d8b1a534bea237c2bb348faac973e17488", "xprv9s21ZrQH143K29NaQCx2DxPkszvvbYj5FmZ7RMMAoCE932mUkfzaAYFf18JiaFC4bJujA7XAsm7TFddxdkXfn6U34te59Bp27CWp71mw55c" ], [ "808080808080808080808080808080808080808080808080", "そとづら あまど おおう あこがれる いくぶん けいけん あたえる いよく そとづら あまど おおう あこがれる いくぶん けいけん あたえる いよく そとづら いきなり", "01187da93480d0369fff3fc5331284ad6a60cd3ce1f60dbec60899191afa2a2b807cd030038a93ddaf14d4f75d6de4a0e049ee58c92197eb9ca995770b558486", "xprv9s21ZrQH143K312KY5MRB74dWa9BDHG7rV4oK7VAfA1eVKPDddPEUTXRZ5ShDzVQJp7d8q8xQLPYVcHYVuxb7sUo6EQpJUytZRHxyytSYbV" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffff", "われる われる われる われる われる われる われる われる われる われる われる われる われる われる われる われる われる りんご", "a1385ef66f20a905bbfc70f8be6ecfec341ff76d208e89e1a400ccea34313c99e93f4fba9c6f0729397b9002972af93179dc9dd8af7704fa3d28e656248274dc", "xprv9s21ZrQH143K2LmZMWVM3JxKTHZEDZg1ZEUZH6hx9yJhBWRSgGGYD8TAaPa6MYto1t1bBXgPYFMLx1Gidw8fJADdFNzvqrAcXiadUPfTTVh" ], [ "0000000000000000000000000000000000000000000000000000000000000000", "あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん いってい", "c91afc204a8b098524c5e2134bf4955b9a9ddd5d4bb78c2184bb4378a306e851b60f3e4032fc910ecb48acfb9e441dd3ceaaab9e14700b11396b94e27e8ac2da", "xprv9s21ZrQH143K2WD9BSegbAkGzg4XbqeY7gzCYGWaWfmRifMJJtmDo1pjXmyuEwPnKcLwTZ1uqosvTRBAcPdUUvdHxY6rKj6R28vWVWGLKuu" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "そつう れきだい ほんやく わかす りくつ ばいか ろせん やちん そつう れきだい ほんやく わかす りくつ ばいか ろせん やちん そつう れきだい ほんやく わかす りくつ ばいか ろせん まんきつ", "79aff5bc7868b9054f6c35bb3fa286c72a6931d5999c6c45a029ad31da550b71c8db72e594875e1d61788371b31a03b70fe1d9484840d403e56a1a2783bf9d7e", "xprv9s21ZrQH143K3ZPQiQ24sxzu5PsqazSLn1W48saAFWiDhugDPp7dKB3v5JLfMqzTbqjdwE8P2UxFSKwnFc5CpgMaH2dSmoWDRuaAbrZbJF2" ], [ "8080808080808080808080808080808080808080808080808080808080808080", "そとづら あまど おおう あこがれる いくぶん けいけん あたえる いよく そとづら あまど おおう あこがれる いくぶん けいけん あたえる いよく そとづら あまど おおう あこがれる いくぶん けいけん あたえる うめる", "0f46c02350b3f1227c3566dea2ff0f2caf716495a95725b320a31a3058d5d62596fdb816be75909d2c5f7094beb171dc504ea8ea60f5e2e40bd8aa0d9339aab0", "xprv9s21ZrQH143K2TSJ2oumYNzqQGKmvehh1NKNzAjpu6Ue5yPvtzFvX8aCvBk2eTg8TJfwjiGLfA2KCiajZ1VXBvtQXqk7Wryxgps4BYyNmZt" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "われる われる われる われる われる われる われる われる われる われる われる われる われる われる われる われる われる われる われる われる われる われる われる らいう", "a0705c2feebefb61509dcc49c57586c35379c1981c688fc1d452da44443d9a651a374f1ad2ee3d7847b50655cf9241d7e607be436c0df7c8bac42f2a82985a79", "xprv9s21ZrQH143K2k4V9TkTiFB2LviDq1oSHbRha8AmnPvBtRRVAnf9WJERojPPdki6sbiuNbxv91VhhdreJnaZh29Ay892Mj6KB2aZnysqfvR" ], [ "9e885d952ad362caeb4efe34a8e91bd2", "ておくれ げざん しねま こりる きぼう しねん ななおし ほんやく きない けむり けまり てんない", "b80f83f27ec3a6cbe804be0661e9bcc30583484dbbd37f689d4952bdf4ad29d9b9f5774fc4c87b733169416418b81f272a3eab37feb22f5c8f6deea6bb08f8c1", "xprv9s21ZrQH143K3VLugmPmzLDwfFeo8cgoZ2ajCQwWhGKfXut8C1XhdSNuAnXjz5W2bbbNPmr87yMHAaPMaUhE6MNnfGc21WRc5Lj94Tbbnnh" ], [ "6610b25967cdcca9d59875f5cb50b0ea75433311869e930b", "しはつ たいちょう ちめいど ひりつ ほくろ こやく こんかい いひん よろしい さくら がはく ふっかつ こまる つごう けぬき ふすま ちから さくし", "926ce4647a8f91552ae00efa8880ed7e43b6f8e9cf51c38851b0e242569ea96d77a19c777d28dc33d8912c3e3bc6c59f7a82b6daa25add2c39a492fdebae79da", "xprv9s21ZrQH143K3eVmFcDa4FcZCGeNryYBv99mdgidpSeFBt6ppQQjE6MXegs3xmT4arCDXvtg6dGpr7vFY8A9bzzeJ7E9jyzWLPDSrixwqub" ], [ "68a79eaca2324873eacc50cb9c6eca8cc68ea5d936f98787c60c7ebc74e6ce7c", "しやくしょ くちこみ どんぶり けつじょ おとしもの くうぐん どんぶり たずさわる ひたむき みうち にほん うわさ しゃけん このよ じどう ほめる たいよう くふう そんちょう ろくが はんこ せあぶら くうぐん そっこう", "94308a93dc1bc12f8e917b2445581240d83cd82ad3c52f9ba4125aa6ce5490a3624fb3dfd7e22923ef7ff3b778157e8bec76392b122bf465fcc56ab4f5a73401", "xprv9s21ZrQH143K3ResRww4txupLREzrNjYYi6X5FKpKvFUoCwhJS1HtSn21gDkXcBYxQBd9RngafHfWqktMmLgPrVJTisEQbRn4strGawHGpQ" ], [ "c0ba5a8e914111210f2bd131f3d5e08d", "はいち ふかい てんすう おさない いろえんぴつ だんち くださる せんちょう きさらぎ てきとう せもたれ うんどう", "5fae92448afda85f10a50236144cee3068ce21e20a34447a9a4b6e9d5b000a4347a151d7024c2068c4d3c29c46a6f541a94b98624cc25b2c8ff42cafe6a3087b", "xprv9s21ZrQH143K3PD5fc3CCepnLDsenZAqyKpcbquY3BR9sfosi7rbjXMo5nL9qUb91FwYUFdN9wJt9v95YoKJJFm9V7a2Xb1sZgstQkZ54cL" ], [ "6d9be1ee6ebd27a258115aad99b7317b9c8d28b6d76431c3", "すいえい ほとんど せんやく ほしい ふうふ ひんそう ざんしょ がちょう なにわ ひはん ひつじゅひん られつ はんぼうき ちそう ほいく めだつ きさま えがお", "a49ff09e55b62b8fd3d4b88b4fae2c9062e18c06105c796505fde3cc7655cfb9c922c02817d18dd40832ecd19d80a71fd62d915c34cd8d95fc55591d12b6f677", "xprv9s21ZrQH143K4AKun3sek391JX1qnWpxriP3eyJviCUq6ouiH3RDzJ1f7Gm6c7dgAkxn18EcaZ6CBNvVkmLxVvB1fdBdLiGeHXf69j4eCR1" ], [ "9f6a2878b2520799a44ef18bc7df394e7061a224d2c33cd015b157d746869863", "てそう こつこつ えんちょう じてん おおや ぴっちり だんねつ ほそく たなばた くらべる ひまん ていき あんい ひんしゅ ちきん ざいげん くたびれる そなえる しんか にいがた せきむ けしょう しあさって せたい", "55d101db3cb8872853a3e84ec97fdeac63fdab33d92def4dc4694beff0f504da29f953bb463d9cbaf0c4d442672d40c5a58d6aed35d5fdbb2768dcc482b59bc0", "xprv9s21ZrQH143K2dmFtHdM2tu7mDdKwsbeU7ekYU2dsFDBt7dNbXcsLTnN2MNi3hQssGdcPgEfiXNJcgnoo76t1nAHaoyVBXZ1z6hP8L2UGTs" ], [ "23db8160a31d3e0dca3688ed941adbf3", "おたく ほうりつ さいかい げねつ ふせい いいだす かいてん ひんしゅ もえる てのひら ねいき むいか", "1b0fca340ccf977258987a793b3e61b0e20291f8c27645e74621e87c01d0e881cd601bbb0ed98388d22dea341498ed74aea32975a56bd3bdc6027196b7a21640", "xprv9s21ZrQH143K3Z6vsGR17YLtiGF2gTkCm9Z7XnJm1ffrLQ9ah7AVye6NyACmsWLZBoREcdCRS7tq4Hrx1NDWqHj3MctxWixcH7XBuigtJri" ], [ "8197a4a47f0425faeaa69deebc05ca29c0a5b5cc76ceacc0", "そむく のぞく かいふく ろてん げきやく ろくが ともだち ふじみ やおや まかせる すらすら こぼれる いぜん へんたい きさま へきが なたでここ あさひ", "d7919c8a5458fa4ff55431021938b15bf39b7542df902f371625d9f064a37b1d06a34cba920a9c8b8d6bf34514f542f5ee91b9eab81a063f9acfad932b43c62b", "xprv9s21ZrQH143K462YnNY39Q7Pq8ZXzCXs9k9GexnGbyjVvu3QhrNLCkPxNUtaKZBzqffnmiuU4ZiA5UQKtwVqr1WmXyM3QjVaVg8Cc93xMDQ" ], [ "066dca1a2bb7e8a1db2832148ce9933eea0f3ac9548d793112d9a95c9407efad", "あんぜん すうじつ たいふう こんぽん そこそこ こたつ しんせいじ あんこ うしなう しまる じどう そうり てはい ていし おめでとう たんまつ せんげん たおる ぬめり このまま ひいき あまい のらねこ にんそう", "1003a30a516cfa1c30de2a53fe6c5936dcb8ae893f944f459ea4e1f2202716320350dc2ee5d92289dae3c5b1771fec863fbbc40146fed04d0855c6af70b0c7aa", "xprv9s21ZrQH143K24jAnV3a4K7xAoD486pMXSvAj41fkB61DopHqcyznUX1zmkFgEGBpNkXi6dckNcpcwXB65i71eBwP25t24QZHVRGJYURZ2Y" ], [ "f30f8c1da665478f49b001d94c5fc452", "ようきゅう そあく いきおい こうつう こもじ はんだん おんしゃ あいさつ へいたく しすう ゆうびんきょく てんぷら", "17593d396c66d776bc15c06e5348bdfa38927daf92402c335041dc500d7c8ea9eccf4f4d1c187785b8c9128d06bd7048a1706006fab82abece74185448caa811", "xprv9s21ZrQH143K3P24yRmaXsA2pntRyM375Kb6cF4P73bMQNKyXUPPR86X5o83UmTi4iyQWaCL48EoJUVqC7KxsPXbrAC4nKxjMh7FZJcucRE" ], [ "c10ec20dc3cd9f652c7fac2f1230f7a3c828389a14392f05", "はえる せっさたくま そんみん たいよう へこむ になう にっさん よゆう きあつ だんぼう くねくね けらい そんけい えほうまき しゃうん たいむ きあつ かぶか", "2567b4dc469b5d1d7c4aece40e642dea3d5cebd80a577b5a4d72fc2b60da6ca657d3a01270c47530ac71f812e648bac01aaadc62c444749fddec8982430fce7c", "xprv9s21ZrQH143K2UfZfzss5CkDCtkRJvLN7DmM4sWjUaYMF4rfeWDERACvg7jGSSkGeFLrcHdpXUFty7wJ5yzyzcbRDqv7b9H6usZ16PnKy2c" ], [ "f585c11aec520db57dd353c69554b21a89b20fb0650966fa0a9d6f74fd989d8f", "よゆう かんけい けぶかい へいこう おかず べんごし りえき じゆう はんい ともる かほご きぬごし つみき いきる はかる てふだ しほう ひろう とくてん ほったん こさめ ひつじゅひん せつぞく めんどう", "909c8c992019adde332a11f0ebd1b0c0fbc9dd96e4d3d30ca4ecb0d06f743841cd25380f87b3a538f46dfa3fb3a5ab330487f99d128b1c6bcdbe476d3bbe2af2", "xprv9s21ZrQH143K3a5iyuaeKiPGQbhQLUaBhzfd7inUA5ndrmcYEc7zZzTLGM37Du2M11nXChrzXyZ8ZYtH2dG1CkWE39R749XhcKUcVs9avTR" ] ], "korean": [ [ "00000000000000000000000000000000", "가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가능", "a253d07f616223e337b6fa257632a2cc37e1ba36ff0bc7cf5a943366fa1b9ef02d6aa0333da51c17902951634b8aa81b6692a194b07f4f8c542335d73c96aad3", "xprv9s21ZrQH143K2EgqD4YCzE4rJ8rojXAMzqftKGS7694ApSkSoLgheNMawZYv2sArwHhLq4AaJfV6WWtGLjFWdFBT47wsjnq9v6iMXojWZ1V" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "실장 활동 큰절 흔적 형제 제대로 훈련 한글 실장 활동 큰절 흔히", "e6995bf885f5c64932ca28bbb00bc100a6b89cb6edc987bb05f05f99ae7caf78329029c189834c1cca938000bcf08423da011558a60cf3d90c9035eaaf241b9e", "xprv9s21ZrQH143K3CgBqqMtQxnP4VvSCjaTs2GfqHadwo4ddmKkvzasAHRwAsSDqjvJQu8jmAdEgBrLkVYhHdyZKWkZbyfuwPQG84PrWjEuCLQ" ], [ "80808080808080808080808080808080", "실현 감소 기법 가상 걱정 무슨 가족 공간 실현 감소 기법 가득", "1bb52039a6cc288cf806740836002abce493724edac3d3b9458e3581427df76414b422171ef115d823a01c6b39fa68bd0fed20bf5e64dec008fcb22e4b7f26bb", "xprv9s21ZrQH143K3v6uaDUdZX7Cr8uC3hCE6gJ1MiGsnmRojRtUN6Y8nBiWVfMUc1skLwuUb3NshkJSdCuFew5G2y6YTDCRsSWNxYsJgZCpRxL" ], [ "ffffffffffffffffffffffffffffffff", "힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 흑백", "b6eb986d6aaf7d0cd0eae2a667ff8bde68c8780fb5a728cf500e29119ce99c9b079a4217836879c1e73b8a85422a85b564d819699a4310a1d007b5be24c24b6d", "xprv9s21ZrQH143K2P5vpGbzebpVw9pZzmHHyuoTFDAFCR5UTVwQPdkuKPJB5fP4a6YgAT6seAuv9uGsMcnoyVFkVxoKZxQgB1SXjy89nHvvSHx" ], [ "000000000000000000000000000000000000000000000000", "가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 강도", "f40a8db48df9a7fdd73a7b3ceb45f668e4eff098f275a0a5cd739d31572c90aa92bc08b9043d0adf059a945e47e2fdbc26c89dcc15b3893a2a705e4539523ae3", "xprv9s21ZrQH143K4FQh3Y65u7oFeQhimhg8fjRV12vp7kYxB1EnjiBVFY1B7AdjQgLcfzK8qLjaZKFq4gfPC5pQtFtDnHi6Y988Skm2oRr758w" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "실장 활동 큰절 흔적 형제 제대로 훈련 한글 실장 활동 큰절 흔적 형제 제대로 훈련 한글 실장 환갑", "3162bc17e0f2f01ee571022444d2c5fbddf6a68dedfe734c319fb574592e9c0328f6526116b3b0b025b23391781d0bef8f43bc8ddc2b054b9f52e1fd6a88e3d2", "xprv9s21ZrQH143K2cE8CZ9tqfnmvNZcEJpwnyRRcsqDPokupVqx1hecEjQF2zrM6amGPiDiEKGZdNWrps6DdEcP83UABBjV7yJSkAFUWcP1FDF" ], [ "808080808080808080808080808080808080808080808080", "실현 감소 기법 가상 걱정 무슨 가족 공간 실현 감소 기법 가상 걱정 무슨 가족 공간 실현 거액", "9fa92e4524e0f7412935b2deea23593c0955f9679d3285e3b955f5cdd2a659ee005ee99bd385f63d82cbdb54a3849229fc9a700e198b65a1452b511884b543eb", "xprv9s21ZrQH143K2XL77upQ6FjJr8a9oDGHakG1HQozxUzHJ1aVbv6JLPuX2nXdbopUnxBoKgVBHiZphPg4Krqm1xxUm6YPcZg9NeAiqT1MAcK" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffff", "힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 화살", "2543a88c8a31570dc9ee868a7b153f7f2e42700778bae7a3aba7017357e708b5cea97e0d9753c9226abc90b83c76ae369d74515ac64102c51a5fd0f809cf8b92", "xprv9s21ZrQH143K3AK2RE2fUZyLssNUUJPyAYjXGDGE7Ysq8hTx7MG43NG7KDALxx6TaVjXCmxFwB2wZnNtSBM2asDYC4YcDMEc9sbCyPPYjdo" ], [ "0000000000000000000000000000000000000000000000000000000000000000", "가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 가격 계단", "edb71011bc0c227103ba8a769cc36ba609e5407a771727fc0c8cba1b5a44d21ab9163d9deaa37427ccc579864e21f08d0fdd3a53a6be258d3c73b898a01ce2b2", "xprv9s21ZrQH143K2vZcddzTch42FzN5kcvsdtyMNR6QfEgZy1JEor4wzwFKj4JGq8kJEyC4zMQHhN7Q9mhRZJdYceTALfwxmpUAD6AtSzU3n7L" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "실장 활동 큰절 흔적 형제 제대로 훈련 한글 실장 활동 큰절 흔적 형제 제대로 훈련 한글 실장 활동 큰절 흔적 형제 제대로 훈련 통로", "dbd640cc9d3e99939bb0fc4473738571e314c29468f01fa85f57e296cf6e8e269d6e32434e46aaa63384930cae83728623195a932a48ccb71a9ea247720d9371", "xprv9s21ZrQH143K38C9hPGqNHuxsvKmNVwY2gRiRjjbzuBNme4PgfyLzkhYEt4fGm73xs6c9QDh2GxxkntMiFyeDsMDPkLDa9TkubnWZFCsJP9" ], [ "8080808080808080808080808080808080808080808080808080808080808080", "실현 감소 기법 가상 걱정 무슨 가족 공간 실현 감소 기법 가상 걱정 무슨 가족 공간 실현 감소 기법 가상 걱정 무슨 가족 구속", "9a0ec04a48287ae628d61428f921de5f40fc1035f21883798e05c36f9705b2525a00ebd6bb89fcae9b8af8e9861d0083de331199d6b85b24cff598609a49b305", "xprv9s21ZrQH143K3PRHhckbBdnb1HMFJWXd2oPh4sXWWP8iMrH5fkxKnDucKqdWFv895Z7BRWKmbHj5gRvB6QddHeMUrk7wzSRzf7ZqkkVCipS" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 힘껏 허용", "340bd57209e54e8bde6ca750147933f7e44995047da87b61f64f70f26f289a377e25a65f5efb11f9e651917ec9866d54846516ae0fba956f5f536422bb47d91c", "xprv9s21ZrQH143K4Cr2Z2NiQPe5Xz6W92ZCE6SpW5NVmfvjtJgJUAG6WwkQ4iZ1AyfbUDb3yoiQsdoGHSSXNEMtAX3xPdtD38n5JeD8Lx7XNR9" ], [ "9e885d952ad362caeb4efe34a8e91bd2", "원고 물질 생일 부산 마요네즈 생활 일찍 큰절 동화책 반성 반드시 의식", "8d148c7f8ed529d7a88fe2bc8bff574b56406f9928ab5426df793f4d3a5121c7c6974c856ad20f66ecf04fbecd3bc025912b3e41d500f1e5be896505e01d08d6", "xprv9s21ZrQH143K3t9XU9hQ1sEMc3LTT3MZ4Ar51RchXDvo5sjxDF7bFNaLfz7DttnvUqKAThXzv99QKccqpLQB6DdgR3NJV58AixcCdbw6ZTu" ], [ "6610b25967cdcca9d59875f5cb50b0ea75433311869e930b", "서비스 알코올 오로지 착각 카운터 부근 부정 고양이 허락 비디오 단맛 체온 본인 완전 바람 철학 영하 비닐", "3b67b06a2386240f75abe8f7905fd0fdb4cc2baa88c090eb9bca3cf144e6e33bbf3dd9085addfa52cd0ff9f2f9cd63ca69e7e77ce903ace942ec7f5b451148a2", "xprv9s21ZrQH143K315xG5w3u3mrnhSMVsNVdKmA9VZVXeV3fAcLX94k4N9oDEgSAxsMi3RhACEKFfgWkFex6T1uHSjSeHPxnnVF7muEAVNycgE" ], [ "68a79eaca2324873eacc50cb9c6eca8cc68ea5d936f98787c60c7ebc74e6ce7c", "설렁탕 모범 일곱 민간 낙엽 매스컴 일곱 언어 지진 통장 잠시 국제 설문 복도 생방송 큰딸 약수 목소리 아직 횡단보도 중독 수필 매스컴 실컷", "06b321dd10cd2d0dec17212163c5d31f5ebda67027c0159380348d31ec5c5e7914ec75a44d4e225bbe5ce3db967e2f1ae2c9d463a638951b3e16d75ecb92cb17", "xprv9s21ZrQH143K4TY4YjtQLxBPerqUshALn696njp6gNVkBTYWWZ5jrQPZRuqxiMoJ6RjQpVgVZFqKBRsWnGcci6UNgPdHbRBuVn93aKdCD1n" ], [ "c0ba5a8e914111210f2bd131f3d5e08d", "제주도 처음 의견 김밥 공부 연출 모델 시장 대합실 원래 시금치 군인", "5e68ec0b343b62e221ede6dd5d6f33dcf8b5b4f4925ce6a30f49b17182ed0a40f7c7f3248463843f1999dd671a2e9c2abf4e5443a4e88f2bbf10b79524cab827", "xprv9s21ZrQH143K4B4gzTqVD1szP9igPch2u3xqQZ2gBsYe4u9kunYh5smSB3Md8EXktwjWafLwMasGuLPiSGXPCwNTgdcEPBsgtq6MiGMscje" ], [ "6d9be1ee6ebd27a258115aad99b7317b9c8d28b6d76431c3", "소음 큰길 식당 커튼 책임 창구 사흘 다양성 일행 질병 진급 혈액 증가 예산 치약 하룻밤 대한민국 그날", "c8a07b4a163c3cf4ef400a96bdb7edc012dacb957326de185e66f7804e912c02329ab07520ef05dba38b2b3f6ded8a8691e1b17a38658aaddaed7ca95ff1588b", "xprv9s21ZrQH143K2h4eVKk7zbdHmjz5U5poyBbddPTS38xb7rjA9NMdUjYC3Dy2X7top1kVw51cFuJ2UHmFU3WGAzb5Hz4imvuz3ZKWy2R7gAP" ], [ "9f6a2878b2520799a44ef18bc7df394e7061a224d2c33cd015b157d746869863", "월급 보너스 금고 생물 기분 진리 열매 콘서트 에어컨 몸무게 집중 우체국 강제 창고 영혼 분필 모든 심리 소나기 자랑 순서 미디어 삼십 술집", "683d1f6324fa54a4c4efa9b0573fae573ebc1c8b373890eb9b1e6f760f586126af2a3a39e0494f653ce6dbb954353023c304dd42d80aa939eb5a31acaaa3a60b", "xprv9s21ZrQH143K48a2XvjEnkvM3ry54SZdbERB51GvtK6S5hbSwV5SbBkqa2KNW7b3gwY7hC2JMgiNMD45aMhABCDvXUoZTvrq6typLaUAz6k" ], [ "23db8160a31d3e0dca3688ed941adbf3", "나들이 침대 분야 바이러스 첫날 개선 논문 창고 하필 윗사람 저고리 팩스", "f767f63c4febb5c832890f6129d0c3721555de40c28ac11093d23447f507b98f134cfef190cf0f12f1e41278fae5334f460c24c69cadc9aacc5d98efb3903f06", "xprv9s21ZrQH143K3K9kkX6aq8Tmqp5RjoDwbrEbqStVfNmSWBofcYA3wYA2MQsDsTZjkfkeu7gz9yJB4foKXE1mveXDf48vdA7L5mPZfC8aYdW" ], [ "8197a4a47f0425faeaa69deebc05ca29c0a5b5cc76ceacc0", "씨름 정도 놀이 훨씬 물결 횡단보도 인천 철저히 학비 킬로 수염 본격적 결심 취업 대한민국 출연 일정 가운데", "739584c55ab1c8053a44ca3fb50237e066590c92043cf3f45748768df65778bb79175d511543d96112f0a0e7960df081f74e6e477b953a1681cb5331de8abc3e", "xprv9s21ZrQH143K3XQJtWHu2YWz62N1SFBLpbweVNpCUoeFEWdukPL2rXvQ7HoDBwPWCnBc5otLQnHomemkmZ19m49YjQTqZY6uvjbDQaWpS5B" ], [ "066dca1a2bb7e8a1db2832148ce9933eea0f3ac9548d793112d9a95c9407efad", "개구리 속담 액수 북한 실내 병아리 소망 같이 관찰 선물 생방송 신용 유난히 운반 남대문 열차 시설 양주 재판 보편적 증세 감기 정오 장미", "068f3943d3b3ba61b74e7900d936fcf4d73fc74852bc011e7405213edebed9f1d6b9a25db10c3ad5552b779225321a36304c757d0479e8b591655d0188961120", "xprv9s21ZrQH143K4ameDhGSneS8UaxoYBfQ547c6eDEBvDJJ2cqzFHCCfqcoybLTVreVRjQo6SUDKzoHeNtR9bCQY2qF3iWCJTheeDYTUSGdTs" ], [ "f30f8c1da665478f49b001d94c5fc452", "해결 식초 거실 백성 볼펜 중세 냄새 가끔 출근 상인 한번 의심", "5f7125457857a8870d1ace1eb0f87479385d08ab8827998f57cb0cab5289d31a360310cdffaf4e8d1202a13fd8bba2ed9bc240a59b6d486d418647c55c7bca44", "xprv9s21ZrQH143K2fhpmAA6AkCVJWY7je61aLnS882ga5H3cMuoSp4G4SCzg47MRUjVFQYVytFdSu3M1hYyhW3xkuGqxnUXx1K6jFTg4C5gmst" ], [ "c10ec20dc3cd9f652c7fac2f1230f7a3c828389a14392f05", "제한 스위치 아프리카 약수 출입 잠수함 잔디 향상 당장 열정 목록 반장 아시아 그토록 선풍기 약간 당장 단순", "8c6f94c633c8752381e7bb207083025d7cef6c448695393fc21553e1ac269991a3ace1a2562a6129bdc34494c7a6c01d19f600da9af985eb001d71d2fb9e1480", "xprv9s21ZrQH143K2b5dBGtut1we5Wz9S2L2XAXfj6xftmT2omNHimaPwbTWszDvwSLfpjpQCjXKfqW827u8a4ADhCQEnTiiFj4dtbc2DZJRucn" ], [ "f585c11aec520db57dd353c69554b21a89b20fb0650966fa0a9d6f74fd989d8f", "향상 담배 박수 추측 기술 충분히 협력 성적 줄무늬 인체 단위 딸아이 왼손 거짓 조깅 유명 석사 참석 이야기 크림 변동 진급 스케이트 하지만", "0ecef71bd6f0948d9186c2786086a00f7140a00d37c836d01567077aac0dbc69f62189c02a9138dcc79a74dbb676b74aad4959fdbbf1d06a7798385f8eec97b0", "xprv9s21ZrQH143K3zjSpKnVTgqBrJfMK5iZXLrGb5Z4zcWKo9URusFq4n7YjnLR3RCqD8Mytzk4qjHnk52PfdQUHCCJUnKnZxqhMXGGVVe1NXZ" ] ], "portuguese": [ [ "00000000000000000000000000000000", "abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abater", "ab9742b024a1e8bd241b76f8b3a157e9d442da60277bc8f36b8b23afe163de79414fb49fd1a8dd26f4ea7f0dc965c760b3b80727557bdca61e1f0b0f069952f2", "xprv9s21ZrQH143K4ayH97er9xirrbGL9hEywmMfh1LdQjwtrsnrvENN7c2yKs82HypXo4GAMt4wpnna9doa1FDFYXQTSFReWDY4XAf4imN5m6s" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "imitador vinheta sogro xerife veleiro pomar volumoso tratador imitador vinheta sogro xingar", "298d1614ff06ae803709f5be5331135cb74e6cc77fa09e07a3e887c2e370401f9a73a409dadf58b5a5197b27ffb3fa5dd528aad9a1a8750d7669ce950ee60c2c", "xprv9s21ZrQH143K3H4uYufypQuRqf28rLoZpLTwjpeCiPBpcZtJpupYd2oS39oGnrHd7fPAgU5d8bfTpYd97MShp4f9fBGj5K1F9NqgZFpmbVj" ], [ "80808080808080808080808080808080", "inalador acirrar barulho abotoar afivelar coruja abutre amostra inalador acirrar barulho abduzir", "800fd4e7691fbc3ceed246c211a38949c3607fe269a35829e40ca9d3e26515a4ebd64d8bfe9b66b49543fe9dab78bde7cb7102968ce669f55293bcc02e26ba0e", "xprv9s21ZrQH143K2qEuVaHnXDY1HbcQ9nMyNoi5tgGyFxfYXVxHipQ9hcmS2QitJxsNFatCZk4EYoyyNdWamAjJiMLhuimpjiWHPvJCw28EMSr" ], [ "ffffffffffffffffffffffffffffffff", "zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido xeque", "7fb404372815ea28ef97a64249acd71a293ea0437b3dac8f7e193a10f3584e2055753cc8d6f025229f65e61318fc4e10d4017bd3cc3496f535eca3247d26acd6", "xprv9s21ZrQH143K3tfxkHq74PSrq4HqTjs5sHHxBpjoP26GnJ5Q8w7tEn5kmPESuqN5TQb9Lu4LysqMAcXHWNsr3DKSnvuu3vx6sK7V6Hhv2iD" ], [ "000000000000000000000000000000000000000000000000", "abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate acumular", "81c66b6789e8b91c169335be4436fd9736ca9c06425acd09b0525e1d6836383130f7f7d31378aaef8b7109503972f40d42f6c6b9f99765827bea762515d3404d", "xprv9s21ZrQH143K4LsdmZ3NinpZHGbQ6n7aQr5uV8Rv7Fq8yNPdAzsyrezon8NZ3ZCzode5jS2PXzN1C68amwDmp2bgAEF4jDG7NUbdRYCjR8r" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "imitador vinheta sogro xerife veleiro pomar volumoso tratador imitador vinheta sogro xerife veleiro pomar volumoso tratador imitador viga", "17040704dd985478b7d0666c7078201e3cd7d1fd1aca0d7d47c98a91ec7845500c611d987339a1d4c12bc506feb7c486eef0aa8ce679b1d184db5ca40fe8ef67", "xprv9s21ZrQH143K3XAGBJxF36qFzxkFaSEsNjqKvCtT3s7WfzgMBRcv8G9K2CRGXXhLYPWKSipBrd9dyLSRuTzQWbAJkhghki7Nn13QfHqCSBq" ], [ "808080808080808080808080808080808080808080808080", "inalador acirrar barulho abotoar afivelar coruja abutre amostra inalador acirrar barulho abotoar afivelar coruja abutre amostra inalador afastar", "0f637bf3a487c26fb73f6a464f62ef1f6ca73a6ae083e220374c82881bf4ed2dafd874956ce368c4441e6269759c5864197e87421fbcdb7f6d63df17b4f7df81", "xprv9s21ZrQH143K25VJsZdwtDCmzZ5C2LkJyNDKrHiFfHHBEmtvn77g7qrBRGHTum98TqU7sWCGFZ8vjtcPVAfgGcV51vi2BrPR66KC7wNxb3z" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffff", "zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido viaduto", "042e40dacea1df76335445c37171e5c0fde334236abe1b5d69378548875d157968dfff5889641f16690dca9baa4d9e5fbf56e3aaf0765144ba96b819f37fd0ae", "xprv9s21ZrQH143K3xAXH3i9VReyK3HSyzSmN11DXikYFTA3senE3iWDCdYTFXL9JkBM7CeCS31NBBHNu2tH5T1iDWCBEu1TeWLfELH4CaGAiRR" ], [ "0000000000000000000000000000000000000000000000000000000000000000", "abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate abacate alinhar", "8fe67c9f53a30f75513830e18f6bd0950354297a4977393fae3577363393e679cc13452bcfc9460b28a913ab8de9efc55f5901d1ba77e5eec791afd967768607", "xprv9s21ZrQH143K3UVmtSkznKJCHUGjkjoHkUd6dxdfo91K8sdpEVmzjyRMB3Sf2WC7WKzmZLw2cfJ43LAEENq2v1gASK4TmMUTkbWVoJaZLge" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "imitador vinheta sogro xerife veleiro pomar volumoso tratador imitador vinheta sogro xerife veleiro pomar volumoso tratador imitador vinheta sogro xerife veleiro pomar volumoso sucata", "feac9ad4e1a4a4399a7d57fe47bf64b404a7588eca1025abfa299365f7a75639317e2c89a94812db33405aa0213846bfd6d53dfd02743e2cf3b6984eb9fcf19f", "xprv9s21ZrQH143K2Syz6ZuTcKmPtPee4Xn5HMEnuZcNZ1s7hJdgjRLFJ8f4d8DnoBBTUchCBjBnjubsz3wum7zbhdp5h9hm4g6DVDo2LaHGJ2a" ], [ "8080808080808080808080808080808080808080808080808080808080808080", "inalador acirrar barulho abotoar afivelar coruja abutre amostra inalador acirrar barulho abotoar afivelar coruja abutre amostra inalador acirrar barulho abotoar afivelar coruja abutre asilado", "32c8feae6a0bee33166468a770cb28459727e10f4f5ffef64977d5ef52a68ec51d832751a10c025058612ab256052cdfa9d8c5c87560de0453efe5a7d4597771", "xprv9s21ZrQH143K4XMzpdgrkDGxnU31ezynvtw3iBEfRB8sriHpEwyu2Gb65ao9YLcTTWTyxNh2g2AdtYmZ4wpTaAxLpJBzWY7jAvG1HyotoEt" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido zumbido validade", "739a6edd208d09e28fa97f8e8709aaf185e173125b1b427c04d1539173c88b78e81610a759e14f97a2038dcdc2c466a072788e3d7c88cc9bf36b96cb29510e77", "xprv9s21ZrQH143K45qUnDL5tCHKGpht6amXS4d278iTXWRJXthNTufwnbnvr6rU8kd4Nb5s9aBWdYFtfcdGkg4GdL91jRhGRtP8mZbjtTvpGsy" ], [ "9e885d952ad362caeb4efe34a8e91bd2", "mexicano crosta farpa empolgar chatice fartura olaria sogro centeio defesa dedal multar", "1f0397e6d2aaf8d6867d648e9bc27b12a4ee1b61a47fb63c6676c153c472d708f02344ac56fd1a8e135e18cce4eef711e7e88529bd6c54b90715e9b3d9fb8467", "xprv9s21ZrQH143K2ynvNymKuhxopGpKrkH5skB2FqBYXP3N4goobBbXfYS8Vqhr6QAZQqxxr5caCjvSC3P3itpqqbntU9jTmmEdoM1E8Z5f1GU" ], [ "6610b25967cdcca9d59875f5cb50b0ea75433311869e930b", "fazenda invasor magreza repolho separado emenda enchente amassar valente enxerto cachorro roteiro eliminar marinho deboche rodovia locutor envolver", "1335d5a679638f63a494f1b71f6c6c448ccb0384167f3ef3ad07456f0b70f13b8f6097c1315186543a09325ca3581f329cdb66674d0f97c4474950e3aef3b9e9", "xprv9s21ZrQH143K4MHxCTSXTFPDppSnKcW22kjYEg7NMCcHEobe5G337nzsfnuud8asiYwnyMQMG9WkAwPW78E1otspYE4T5t2AU2cArUhhQGg" ], [ "68a79eaca2324873eacc50cb9c6eca8cc68ea5d936f98787c60c7ebc74e6ce7c", "filho comentar obrigado cunhado biologia clone obrigado julgador rebolar sufixo pacote atingir filtrar edital fardado siri janta conhecer inibido vogal quiosque genoma clone impor", "ca0462775b11a28cb36c497a36da8e46c1ab618facf7640b42fd4974085e1d682a6ca660560a3b72dc602ff56e4027b53a8ffb691a96e4c827ef4e6d665565bf", "xprv9s21ZrQH143K4B1eibfqLNQbrVycyNgNCgQvDFtBLDYbEPtVXRBn44GPmw8fasfeCrV5tc8BFhzSnbg3pHdafof5rrXHm4XUK6EBrpoZni5" ], [ "c0ba5a8e914111210f2bd131f3d5e08d", "pote ringue muda benzer andaime levitar comando guloso carreira micro grilo atracar", "556b77fc49cd57f7c9c92fafedac1c8341598666721b874db50da261c7cded491c22ecd3235e508822507212698f645bb198f0bb1aecd50d22339e77619a765e", "xprv9s21ZrQH143K2NhKv3Pg9xyGsPMDwukoomCFE74Fk4w4K6pe8hetKjNrSWEmzPSr482zkiZ73aE5wTYY8jvLN4Wruv83p6mmxnxkF7qkUBM" ], [ "6d9be1ee6ebd27a258115aad99b7317b9c8d28b6d76431c3", "frieza sirene hibernar setembro rigidez retalho exagero cabana oliveira refugiar recrutar vazar ramal lousa segmento tocha carpete autoria", "3059ded790eac1a5bb614c2a88989a4b5d7d4db20acc95f2a9eee1a5889012fa2b7ad2c0b0c5b81abe94d3e4c6c58265058fb257bb051552fe5f82fc45389132", "xprv9s21ZrQH143K2EN6vqxgJ2XMXNZx6GWcdcFXajpxqDfWvsrYFETHVWUEZr34sP49GinmReyfUgpakD6xT99vcV7yiAvPnf8BbEJ2PsWf8EH" ], [ "9f6a2878b2520799a44ef18bc7df394e7061a224d2c33cd015b157d746869863", "mimado drible baioneta fantoche bastante redonda ligeiro simpatia lamber copeiro reitor mensagem adeus resumir lombo enraizar combinar inapto fosco orfanato gincana cubano exibir global", "f26d817eb6474c6ac3358737afd31a4b4be74ba268cb7dd0bab44f959c9b4be5ef7d65245bd0da8f21694bf380e3e4a9fe7f82777b4d59a8c738fc460b0c3210", "xprv9s21ZrQH143K4QArHuoZ7djwjgsdKRekuqKqFEBZbYpAQJU2a1mDMm4z8iG28oBs2kAEaGQDPjLu3kiNz3BV5Lio26Zt1z5KzEBxtSJGtCR" ], [ "23db8160a31d3e0dca3688ed941adbf3", "bifocal semanal enlatar debulhar roedor adquirir branco resumir tora modular patrono tangente", "fccd6ccf9cad7af20eaaba21e9f4fbb149907c41b5e000ce398e8956c15a5436e04091402d4851c4cc8cccf9e8a90dc8219f3104698d1022064538c6303dcdef", "xprv9s21ZrQH143K25Rf7o8uUBtDjSZkJ4S2Cspm3JN9USxBAXmmUYvw9n7W3qsxbkkptFhejjufMUtKx5QhCMG8Z6RjT58F9kVrRGKMQhatmtb" ], [ "8197a4a47f0425faeaa69deebc05ca29c0a5b5cc76ceacc0", "indeciso pires braveza vontade criada vogal nutrir rodeio toxina soletrar gelo elaborar ajudar sediado carpete sarjeta oficina abreviar", "c22c6e716250a3b98b0f342f77d4f1fe9a4eab81304fbcc9eb9f9852db769b4164daf2aecf72e6d9879713768628780d0b9900ece13c75aa1f433d48ea5c9839", "xprv9s21ZrQH143K4UsyxJK2nxQFmMtrqR5QUuHaK1KiZkp1LZKMqPuUCCe3xqVWDycrKjDSctxm2sPQ72MBM3yZx6tX7Jvemccncy4nw3HEjFb" ], [ "066dca1a2bb7e8a1db2832148ce9933eea0f3ac9548d793112d9a95c9407efad", "adjetivo fugir irritado engenho iluminar dourado fralda aditivo aprovar ferrugem fardado ignorado moeda mesada bisneto linda guache jejum pastel ecologia rapel acionado pneu palmada", "6fc110cbcad37d6a43aadf52643ca9172f51c6fac45bf0a17e60e0fc24b5d1cffc73dd0606c427ef789f9e96c1d05af88a806005a21a4f2f93a5e41ab19fd7d6", "xprv9s21ZrQH143K2VBbZdEtqReQrWkiSUvySRGbPbyP9sm8vHAWDwXc1GwsBHc8LQU82gydYVQ2YCDGZKKzKPX8SaWCf2jrQRC7hVAgb2GYZuD" ], [ "f30f8c1da665478f49b001d94c5fc452", "turbo hoje aeronave diagrama embargo rachar bochecha abaixo sanidade extinto tridente mundial", "d666e6f21c3f8934aa38e45db96ee64eb490156655c2be5d4da4359fc9b11cf9ffda5802ef0eedcc154fb790c41f50ec0cb40b4236972538d8a6e27e54115706", "xprv9s21ZrQH143K4CtpNWJhUqGJ7sMBw5MfYzKSNUmFABS3NwoqGtdAXUMyci5F11H9Vbx3kbiEqjDPMvTj84nMVZM9PF7u8ouNEruefbPFc9G" ], [ "c10ec20dc3cd9f652c7fac2f1230f7a3c828389a14392f05", "povoar gorjeta injetar janta saturar paciente ovelha vaidoso cancelar limpador confuso degelo inflamar avisar ficheiro italiano cancelar cacique", "cb72a39ca9d39c4283398a9995754bdff1785ccc0d96f842d748f4fe904f9dc9a963b7e89ca8070154edbc7d1efc90e1554ac4dc34646c38d6950ffaabeee350", "xprv9s21ZrQH143K2GgN5EwWK5f6MXbTAvTvN4uiu5pZSgb4MxBAy8VTabQfb7Dc3kp1VmEuKTWJbUtM2Hu8KpFUKWPm48ubQ5JHUHg5PeLwz2m" ], [ "f585c11aec520db57dd353c69554b21a89b20fb0650966fa0a9d6f74fd989d8f", "vaidoso calota decote sambar batida seda vazio flora queda nuvem cadeado certeiro matinal afetivo praxe moinho feno resgatar nervoso sintonia dobrador recrutar gorro tonel", "8c6d156ba11fbc606a92071e7230fda2446333510ef5f9bed4712b2d737ab43d2e06c4fb3929dfd072ccc8b9003c6bfa62d5b8fcf04396508c54215357f6f8cf", "xprv9s21ZrQH143K3fnoXd9pUHy7b6hH79o9bMW45Zc9486jaN1KKJVZrm1XosHw3sduFw58ADzqLZR1TvaB7enqXZoB8hyptgcijczutBxqKNB" ] ], "spanish": [ [ "00000000000000000000000000000000", "ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco abierto", "29a2ee16de47d07025de37e7d9c596869439f9bcd26a702d2bae64db2bf0f68383841c5444b5b3bd39dd720d2ebe59969e110e5955c8e6d32c6c3294fd87439b", "xprv9s21ZrQH143K49iYfUTNyLe6mVRHvYSg58nfiLkcSREsu5QefrsvQ9KWsMtX7SXsXwvs6J1esWdna2weySpUFZNN6qiXuHcobEMWGLfyaHG" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "ligero vista talar yogur venta queso yacer trozo ligero vista talar zafiro", "1580aa5d5d67057b3a0a12253c283b93921851555529d0bbe9634349d641029216f791ddce3527819d44d833a0df3500b15fd8ba4cae7ca24e1464b9167de633", "xprv9s21ZrQH143K27g7EMkgY2F1fuyqSEKq6n1iJCHuiUX5F3oGESmJSS6DcKW5JZ6qWWJ7x8wS1FCrd1NhRS4xCWDn9Bb1HzBuNpitD7FeYGv" ], [ "80808080808080808080808080808080", "lino admitir bolero abrir álbum dejar acelga aprender lino admitir bolero abogado", "a89366f7f9c4bd98afca8edf1242507506562b8eb8a3a60468cafcb6f3037aba1e4d9a7497f6d49fa94aca87c95703873741441a719325af371f8eda9b59dc83", "xprv9s21ZrQH143K2dG5ptughpsWSbdXdRVg6ZZtF8RehVMaDNM2TJ6NZAtorTDm2EVpt5nwpsgtjgYW3GD6oP8Nk3ZhibRQFRJ4f5JoDrunY1m" ], [ "ffffffffffffffffffffffffffffffff", "zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo yodo", "a9d1f751178872cc53fc5433e9b2a97526448adc4b824cedeadd8a127c2416481345dfbef2bfc78275f3498e40b4e8e2e00560100e543aba3f324e752f032bc9", "xprv9s21ZrQH143K4TU3oETVCyPLTqmC8C7zqqSR7L8JpMiR68YNhyvfEmXpRh6pP8gPghpFbvNSQCQppPDf55iNnZhT9iza6HRpTvKeLSDNFCg" ], [ "000000000000000000000000000000000000000000000000", "ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco afición", "6c9f21d46c56f723cd734e308f10ebf44b5b92a2e0d80fd66a2952b8d37af5219e0b93c59e1d8e63b47ac657ec2c524e5fb951d87cac824f84a3ac6264b7aaac", "xprv9s21ZrQH143K3AjqVTqs8gbpkEoSkCVEM6dAGvRm2TJgxTLih4TuPPSp6gheAkXpPRhG63Fb9Cr5MEto2j6hGJ4ZVPa3C1GHXUyPPwMRXCV" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "ligero vista talar yogur venta queso yacer trozo ligero vista talar yogur venta queso yacer trozo ligero violín", "f73b28d7e180e0a92c57276a29489c10a992c8a465ab61be0ade4708543436a682b2a3c22de57c48736ae6f29bebf3e506779c74bc1a835ad6b9f4e174126ca8", "xprv9s21ZrQH143K4PEMCi1dMq3ZwveC5um6cXR3tp4Z6LUGLhz4pmkaDU44UoSTiMQHv5icYPjH5EooZNorbDB7fLMDa531HHrKKnEEqCT5Tfs" ], [ "808080808080808080808080808080808080808080808080", "lino admitir bolero abrir álbum dejar acelga aprender lino admitir bolero abrir álbum dejar acelga aprender lino alacrán", "f799e5c2782b50d0eb1d25b5f94984c5b4037ade236c6aa3b48b3df01b703d8ede5f94555f4e78f87a642a9676ba052865418c469c5739b3e93acc528fad30b7", "xprv9s21ZrQH143K2UeG5FGYFmkW7oTy35ZFgQ7qdR5tzBdKxGLCEfVJPPA98e2wUpfD3Eg6GS4833dFVVKafB3RNGMSZtxoWc56Yxo7PaBgYds" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffff", "zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo viejo", "2fd3964ac77c52232dc0eb2ab237fea2de9b7509005214101ecbbaeb40f34bce7735e848fca6339f76f289904c6db959fa573fc0aa607d969ac256693b4fb7af", "xprv9s21ZrQH143K3zwjASrAazc9EGeoVcQXA3unTmgxG9ZS7nc75inZw19oktj1y3n2Y7yetBatSN3v2UpS9ms3PvmrgQEMC4jox4ZV1ZrW6Qz" ], [ "0000000000000000000000000000000000000000000000000000000000000000", "ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ábaco ancla", "f600536eca941ed937318828e9ebab24b3b571558250e7a8342fc3cf16c458b2d7b36c36155a86cc308f7bef6d87b05d5dbe347f1a83c3dfbabd89e9c45b7883", "xprv9s21ZrQH143K2J842VWEPWH3ssnSvZYhRCzPoEcifAN4UgETeYkTdvnMUgnuftLyeGttvdvec8F1YJCmQz5mS956jsb2m8yDXZtnxRgiYgX" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "ligero vista talar yogur venta queso yacer trozo ligero vista talar yogur venta queso yacer trozo ligero vista talar yogur venta queso yacer teatro", "3d2a3aec779195f2628e800879d600cfaf2d7fcfa998657068db53906a00608fcc94fc78ceab8c97d6191389c4e468815ea0d11ffa4280c34c3cf17721a27c73", "xprv9s21ZrQH143K2WBRPum95TFxfz8niK5sbiDpQjyr915SjEJc99BrYoRhPuYvfzFhPwqUNAFtEdw4khqQMK4ge8EnTZZASbv7oy8t6SMzVSM" ], [ "8080808080808080808080808080808080808080808080808080808080808080", "lino admitir bolero abrir álbum dejar acelga aprender lino admitir bolero abrir álbum dejar acelga aprender lino admitir bolero abrir álbum dejar acelga aumento", "dd095dddb50de059f5cb6932d529ad37dd32d40f72da3d0c7671ffc6bd967b4392fe233e5e9a4d9e5e60413160ae215e34375db85e95ccbab4fd4712f32216ab", "xprv9s21ZrQH143K3SQcqhHXxwZ793d4RXPpUQJQm8Bpf799AZPzicBxB87hu4Sm2DvWBqFvmxEjN3bY6EVzUxhJbHKdtV2k6u4c3ZNRFGhZDma" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo zurdo varón", "deea21c6902df5ef4a8efab8e14de53004c68817ea3de421cdd184f4159a6e9947376ed794c3ce67534f37f80b46674e85335555b5c53f44fdfef27991fedc0e", "xprv9s21ZrQH143K4TyBobPSoDLEze5gKjiTZXzaJaND1QHqmrnx6kULMJhGvQkraSHgUsjmisepryPQqTfWyM3ETLjusTsW35KumQ3w3RyusSM" ], [ "9e885d952ad362caeb4efe34a8e91bd2", "obra diadema gorila farmacia colgar gorra pausa talar cocina duda dragón optar", "fcf6ebfc7d9eebab56ca868cbd2d5d05a6f2142ba903c52855dad4ab8c0c2cf6b4e047a2dd97cf382ae717dc18d155a45fc798e6f0a0b89971a4224e2a285701", "xprv9s21ZrQH143K3pxsjjkbjzEu1f9qaeGb9wTLZ39rUF4CoP125zApXELXDspSNV1Cn8vjvXKNQymm8iwSRpJr9AZyKvHTVVbg1Tq6kY48iTV" ], [ "6610b25967cdcca9d59875f5cb50b0ea75433311869e930b", "gráfico madera muro rutina suelo falso favor añadir variar firma casco semana fácil neón don sección morder fingir", "5b48222ce814960e3b2f507ba58e96b4fa655f76060943b47c7a1396d431c570849e6f1595add9474934a72110bd3da06824428650be819f8d093e0023fccee6", "xprv9s21ZrQH143K3JpnkDoEPYdCo6QEBW4eUfKe1CCweKfHF5DkonVNPQRkDcYEva6pBBfGLeRt56UB6oSnhemWzbSBXCpdefk3hBDWqUAPb2E" ], [ "68a79eaca2324873eacc50cb9c6eca8cc68ea5d936f98787c60c7ebc74e6ce7c", "guion culebra parcela diluir buitre crecer parcela marzo roce tejado picar azafrán guitarra exilio goloso tabla mando curar loco voto reparto insecto crecer lince", "5dd9ecc2a8f504413ee001e4f27f25ad14533a35b3986b4ad505a9774740d0c0a6bbac6953a1ee47104357f4a5bc4acbc0f71813f9532fa667f3d3b6f2d6dd6d", "xprv9s21ZrQH143K4XB8BVsQ9TsrC12DWTkizmcY3X6kVqycT1pAVLhx3EHfWow3H27QV4YH8kMLum7nzjSexrAxh8tKZzHRYPPexmAaaM1KEYQ" ], [ "c0ba5a8e914111210f2bd131f3d5e08d", "ración sapo opción brinco árbol mismo cueva lamer cigarro obrero júpiter azufre", "49b0de91db6c84527afe1bccb2525b93dbdae0306bd3ea8a1f629ea1704195d450a0a3211894c417f586fde217f024b4159a4f6ac7f5d18bb8b7bbf72c4f4d20", "xprv9s21ZrQH143K3W9fk6GQj1oNT2gYszJhNBhZjPmkTsR2jmoE89oRHHknYt8WLWREtopcnPs1ZWoJjV3A5QxrW5crBA5s6bWgp2DCfLUDA5Y" ], [ "6d9be1ee6ebd27a258115aad99b7317b9c8d28b6d76431c3", "honor tabique lata sultán sanidad salón gafas carga payaso rostro rojizo vena retrato móvil soplar trabajo cifra balde", "484af722d01c9cdc9ac50f3fdfeec010c7f713fb90dbfe84dae21d8215b683e660ddeec44d685faf3e653f396ef8ce0d341097c50bffcf67ea094ebb44294df4", "xprv9s21ZrQH143K2ouVUYDQXJpeurwoTTmfvUThuo1vRhuSXrVrKgsxAtaet1U9M5WZDpqaiLAPz17LLSuHmQG4eMMAy48Zt4AMzUwgNnEXY1Q" ], [ "9f6a2878b2520799a44ef18bc7df394e7061a224d2c33cd015b157d746869863", "océano eterno bestia golfo bomba ron moda sur médula danza rueda núcleo agrio salmón morir ficha cuidar linterna higiene pensar iris diario ganso jamón", "8cc9507c9ccafaf341a243e5b82c348e374b24c8c594131add8684cfc1e61ab51e5476a4006d4d780bd2b82e9d9581ae1af67c8845e40246d5b1110814a88088", "xprv9s21ZrQH143K3rpBRE8Wy6o6fZ6P6SX9ZrPCATgfgMHBHK4y9vbkj3VW19wRGR6tAeT7td2iB5bvwRXqXZ2FkBCmeCsJD4Uxf363BEuBwtx" ], [ "23db8160a31d3e0dca3688ed941adbf3", "bucle sótano fibra donar seco aire campo salmón trato odio poco tierra", "55b603a9cd15a9769e21fd22a384d12de9afe0b9c0af0f07aee688cddd792b2863064767a6df9e8aebb4bf10d4482de07ffe6d7f7440df73f04fc544236fee06", "xprv9s21ZrQH143K31JznDuVnKRYfF538PE1GSe5W75rLGwpSuDFWaQrW48bSuzvkD7cPWqLHcjxi1AjQYFjzCEVkwpU8sq4XScgZigY4TQrSEk" ], [ "8197a4a47f0425faeaa69deebc05ca29c0a5b5cc76ceacc0", "llaga pudor candil yate detalle voto papá saxofón tribu talla infiel exponer altivo sonoro cifra solapa pata abuso", "b63a7651d8655add895fd8a45f0fd4c0c71bd8863a8e0fd72782b2f36d43ef2fa8830ab46647afc8c437e701aed41b0bc6b2df9f11887c44457aefe2c11d413d", "xprv9s21ZrQH143K3CSbDbXN4ckMcyDHyLwkrQqvXL4xBRATernArEtGvZG8eFhxLbbRBZqaBnRc3ZyrN349dRxUeAozveLohZ5AWRKsDuk6XT1" ], [ "066dca1a2bb7e8a1db2832148ce9933eea0f3ac9548d793112d9a95c9407efad", "águila hoyo maldad fértil libertad estilo historia agudo asilo grosor goloso leopardo odisea nueve butaca molde lacio mañana plomo exento rey adicto puño piña", "e4df51858246fe7a1f5b7e0045704ba76ff9d2b099707ea1d8b731dc3216c3de4edc63bad0911179d818b20e2c2a4e8da9e62dac242f6369221802e25abd0ceb", "xprv9s21ZrQH143K381uk3B2rYMvPGDjn8oqzxK2tGqoNmB9eN2puxmZtB3BximsnfUd6u3eKP58aVTrUmKW4xA4ckETJwd6YPVa7G8nLkdBknC" ], [ "f30f8c1da665478f49b001d94c5fc452", "urbe lección ajuste enero faena reptil caimán abdomen sobre genio túnel óptica", "f5e417f1f68c479cd3058e836ce47aaa52629ac4cb93e99e8025ab38e76a6fab56f6b5a6c1f20637bf29e108f41bca76a1a061d8f8ea40f7c0e5a15552c23ae2", "xprv9s21ZrQH143K3sNRU3fx6SQaMRXAAJPHtmBFpXF5MhZ6AEURc2zE2gmVexqAA6EFyTBUBfxv982cwPLR2fM81SivaJXcN2FdbmgzrFbEdqs" ], [ "c10ec20dc3cd9f652c7fac2f1230f7a3c828389a14392f05", "rama jeringa logro mando soldado pezuña pésimo vampiro cerrar mojar cupón dueño llover barro guerra mambo cerrar casero", "0ae0e69a6ab7c290e1319018a36a7481b6969f73745db1fe56ed4b928b17458bd86e580b6925ec6b64558e4a1431b4761d0928928b689c37efad8122edd7762c", "xprv9s21ZrQH143K2VwsYAPzaKfUBfB8WtQXQux4e5R2cnLhipQ7zQfwWqg2Hozhrh44r1ZtMDzxVDA2PyUqEBtu9o2BidJjQ2psh8QspU8siVK" ], [ "f585c11aec520db57dd353c69554b21a89b20fb0650966fa0a9d6f74fd989d8f", "vampiro célula dos simio bono sondeo vencer haz remar papel castor codo nivel alarma rapaz ofensa gripe sagaz otro tabaco esfuerzo rojizo jinete traje", "c87970357a0faf4ebf604d9c486726e1af8d2874d40f3ba30e5774d615c6eb7ecc6cc04d85d6be4e3e36cf4771f8e15350152351f918bf4a555a33d57f90d61c", "xprv9s21ZrQH143K4UfkWbEcDPVrme1ea7d9BcQR6XtJ1VJucg1haNWCKCxqkXBshF3QkTSq3HHX2V3qiZmob9bJTnnj6ny5SbvwMp26v6HwxTd" ] ], "russian": [ [ "00000000000000000000000000000000", "абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац авангард", "b4992d0492476a6f8ddef9704b1a34718b7be7df7c6977c456cdc36c1e999d9f2e61837e74ef499b828bfbce54af229f60cb15630c331df7b0e4bcb637f1718a", "xprv9s21ZrQH143K2giFszsMo3JcaECAq2BVNdfYzBScYQrgC5oQaEaTbJfbmBhvckkBUftJeWV7Z5FrKBYnU6NLxdQMkVJwHXaQEokWM34EqNx" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "обед эпизод уважение якорь шланг скот юстиция хутор обед эпизод уважение январь", "b918bd21a3d4bc9ad48fbf554c1b2170899bdfd6ec116b537d341c1225a9b2acf2f9672363be0041d73d7c648252b42032275fe8f6e185776fc71f87abdd48ae", "xprv9s21ZrQH143K4BUbYRa7N1sVZmEGzZF45eQr8aptdLiPLfZhz5vDSDy5B2fCfiR68g6gNRZ6PpaLxRr5AbjgbUbvbeyYMH3Aa6s1VzedHqz" ], [ "80808080808080808080808080808080", "обложка антенна время агент бандит заново академия бунт обложка антенна время авария", "d0c56ec1f3c77a8258eff821c03751bf33c7e5a79e6077eb266d5189c637f70c44767406e0cf45f155e1776d54f8d38d44713e79b8be7962beb987be49656922", "xprv9s21ZrQH143K4RsygSRYGV6FTZGUF7762ZihgxxLwJYuj1ZEbk2co5LJ32ZaGZxauCmLhjYGvwpQj4TXiZXBZnsgmZB42QjdDj5YXKsCbLm" ], [ "ffffffffffffffffffffffffffffffff", "ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик яйцо", "57ca8a8f55680bffef79708cbd65140021b7e221b2846befb056d90883cc3e9c074b841289742e521a85354c18ae7cb7315b1aa7bde6dd9d1ec5b584e60d9d43", "xprv9s21ZrQH143K2HeiRMaLyPjxTxXhUU1hTeCBdfm9TGvct4gqtupxDQ3LsMUDm4uwS61UxqkU73WBB6nmbkNzKWDQpfjXE7SaCGdtcatLBJK" ], [ "000000000000000000000000000000000000000000000000", "абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац аргумент", "5c4f8e125883d9f11d9b6f8bb9ab55ded2a5282df1c8bc4daa46bd7a6649bfecf2b6e9560a336db719534d0c57609baca1d49bc522280d2044791736bfb1a171", "xprv9s21ZrQH143K2YdWwtmHMfsmGuPrmbRcXWeEj8yM5A6vi8x5nkCcEh7sHQn2PK6FvGq8sjii9WUhvMcPPPEvygriynjHVD8Y6AEdqChjX5f" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "обед эпизод уважение якорь шланг скот юстиция хутор обед эпизод уважение якорь шланг скот юстиция хутор обед экран", "5d2f8d26d13deaf9b18dcdd757c02d18aa180e8ab5c02a1b977a3ac57996f59aa7338d44ffb740ace2122750f99c1da2a236c60a113882e93d99175a36521bbd", "xprv9s21ZrQH143K3DAEtUMX7ZRKfT2mGkE231EFFYrtnsRBLgqqKy8DXWtU7Q4vnvCgU1EWc3AQDkz27fpW2MDrzGmkuVNTtD9eHFEDmBSu34Y" ], [ "808080808080808080808080808080808080808080808080", "обложка антенна время агент бандит заново академия бунт обложка антенна время агент бандит заново академия бунт обложка бактерия", "46031966bcb1de4496e85fb3cabbf538e0319b4621498e9dd49e77d271e5dd9dba8ada21a20a1ca2037225efa3bb69e256fe59f48186acaa8dc70730bbd401db", "xprv9s21ZrQH143K4TAkYZVDxfRTcK1ev8turDKM86xykq7qgeAt77MHkqA7Gsf671T1mJnu4Vq3iuDa2tW6infg3cBz3G9WbHA92PjdGGT3CLa" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffff", "ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик шутить", "ed0f6a5dd6a5585a5a76fb2dcdff3075beb0f65ac9b91012f331b17e1efc9d4d8221f1a9f99c7662c07e742ccc9d77ed24c5d1c131bdad99dc1e9c67a02cd9f1", "xprv9s21ZrQH143K3XeENAs3xCce1rx93vXYrMms6mCig5j8YFcXxPPoFHGevpcRaMs6sdCFS6QBHSKD6FKZMsXeusjTCCD7FFGbDEd47pjmNyq" ], [ "0000000000000000000000000000000000000000000000000000000000000000", "абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац абзац большой", "320ad7214b5174a3b49bf7525a5c4bb6de96ff2f10b73c6f30130ba66fb4bdad9676ae540a56ffd08ea405d13a3a8e7cc26285da3d8d6bfff36fe202fbe7575d", "xprv9s21ZrQH143K48cthZX5fnGtX8agLdraF3zKwcfo56TTHNg34r33U9VTaPZ9MHGB5y5uQRbxBkELM2BgndH9VQwXC9St7kLUmKTSHq5MUu7" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "обед эпизод уважение якорь шланг скот юстиция хутор обед эпизод уважение якорь шланг скот юстиция хутор обед эпизод уважение якорь шланг скот юстиция улыбка", "a14eaf06487df7ebc49779f1393dda273fce4be5799e8b9ac8550687e4111c6825fd49c920a42c0947f80c6e3a3ed2ef7e75af7de43591d01641606b4d80691d", "xprv9s21ZrQH143K4VvixRuJc3AgrdUNB5kG91kzA8UdjknRSKTS7JNr9w14NAWuQZcQGjmThGi8MiKNAe1bXGiE4TLuxiT2HKXhGZ7XbW5vwcz" ], [ "8080808080808080808080808080808080808080808080808080808080808080", "обложка антенна время агент бандит заново академия бунт обложка антенна время агент бандит заново академия бунт обложка антенна время агент бандит заново академия вздох", "4d8ff971ca6f1f5294dd3153de7176c5634f1c70f8445072c79f8c5e6ba36a9729ac2831b53a5babe23f0e1dd0180437bdc559e6c44d338162be0930074c5ed3", "xprv9s21ZrQH143K2h71y4su2ffL4NQR8ZdsZ21WPKHdsH9YjTgBMAWaqQxcR4WXUBt5NSRqfqbn7N6UP44cUct6FPhAkCb8dwnUJHcyKFDCUjW" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик ящик шанс", "421c7e6f3365b41ed491814e2c4724f4ee09761857e4f7e5a03f67b6e29a32e4af774b3ef8bbbf3bb192b2906ad8319f88645031180956f38c9c295e6d8940d3", "xprv9s21ZrQH143K4HrLURDc1BhtYRSDs3cQDRo9yv4sMPHurQLcXo6JQ9A4hXmZbZ7Jz7XMkrAq4AN7iTyeifMGsevRKiFurNWc7NGTNGjTrbV" ], [ "bb54aac4b89dc868ba37d9cc21b2cece", "сесть пугать роспись монета трогать директор физика экран степень бояться рюкзак порыв", "4156db1656dfece6891335740f11dd29d5b9edcb896e2728db9ea8c58ba13e3400d3559a9e5dc031b0c40acec2f1a8d98c3cc0280d6b6782e0b5fcace23b9298", "xprv9s21ZrQH143K31Y2PwmSdNGeyfKT3iGy9dbQ7xdNoqcEJykKCGZw2zQFNugPaqqpbL4G8QSAPajyYGn2KPLReU7F6LZrbABLG8pww1CVSYC" ], [ "9f09b43ceb7e57a0ea8766221624d01b086464359164e7a0", "поцелуй калитка будка тесный условие супруг ракета химия вывод роспись динамика должен оптимизм дефект терзать грудь факел атомный", "f467318ffc53cf0b7d81fb6ee12a120f50e58568215a395691912c3be11eac41864a9d101bd2ea61759732ae0ab99059271e9a4484fbafe9429297dacd9d9b40", "xprv9s21ZrQH143K3Y4mrcPNQ6umuqdkXr1hZLbAyti18xGkyuSUd3xqP2t5PdEVrAuobwiuPfGF7dqzQxfq5gjAmiAMvuASg2ohUQV9RmavcV7" ], [ "06aadd75179d6d5c5e19fde90cf9b4838622421e57a12862e1811b4cdab215dc", "аукцион комиссия круг дача терять репортаж натура залп философ лягушка мечтать бабочка легенда вспышка негодяй чистый глупый вечно куртка досада стоянка корабль компания палуба", "bd4593253ad99e8aaffd90d517c33b75b0aede40006f4f60f1cf302aeba27e5aedcf50d856f369c59e64dd696ae1127748b29067f9f46dc23528dae65fb22e48", "xprv9s21ZrQH143K2Q7td5VztniaTJ1CH13BFYZRSEJFatqUo3bzmEYG1Ls8YNY3k45Z2o5144jtxP9zgpKf88vCpbaemKQ7FUUnNpr36LjhKqA" ], [ "934f1cecb1c2236ab4866d6245f7c8db", "пешком небо жареный лестница выгнать сарай сыграть стоянка легкий двигать чашка свой", "24a97ab44257cfa0ba99a0417e755d5470d97f376795e4393dad4298febea8b3e44f15ed8c4e1526bd2b520cf77116d29bf52479bd15ab8995849c3821b085c4", "xprv9s21ZrQH143K4c7VXaAyRDpTKoxkNGaPzmaYd6CYcXvptVYieNuSkdv3WLvkkki5Uy8TsL31oSkcc5ZU9kFZqAuYhvb6G7iqnVCnrwh68iR" ], [ "815171aac963d551f0a4140f62df9da1ceb7739ce1c2c249", "оборона оттого медаль петух забрать развитие смелый объект будущее вечер фабрика звонить фуражка семья мужество дружба слюна интуиция", "15620497c365d1411d731172309a186e9ac3e585a57c5e3d0d6238139d22c52c6a3e83e3014ed7b60b3e1773920ae55a5238b10bf83aa6adcd6b9fa6fb85316b", "xprv9s21ZrQH143K2J7CmPPcF7JqzphYz5XBVVnbZ53cwkkfQPQCFotjgPosemTxgyF3rCDVzYYNVKLYxqRp4Ftz6Jp8bN2moAeTVUzeUSNrs7w" ], [ "8d79c52beb01af2b8cfbc74713c164e33a7c9a1afb6cb6a88d344e16fe97084c", "падать струя иногда тепло внешний плоский дилер небо избить после корень соленый пятно кавалер менять миграция сверху злой кавалер помидор могучий интуиция встреча почва", "e57e5f3e9e5d8048817c57ab4893379834e6387fe3f8e546d8ee50b3c3184bbfbbd60255e3fb0fc19465f6f11bfca5db58174bed2002ae5be0fe9c4ad30db848", "xprv9s21ZrQH143K2jsuXtR8fxubVRgj7oebLhyTi7hHXAmLHfqKSJ8ebm93G2WhFp7ctDi7yyEXGrv5o6cC11MDZ128jbsBVbu59T8YwBSVhTd" ], [ "4bee29faea0a596253797215e1eccf9d", "ирония монитор нуль тарелка пузырь роспись камин давно вершина будущее дилер жадный", "659aa5e40fcc2d2bda5feb4df9b4b237c8fcb0daaba65ee58dfc4776bd71907816d3ed2811eab37952a9c677b5ea603125d29d8e1797efe1ce39665ce379bf47", "xprv9s21ZrQH143K2we3aRVJzfB8Hp58inWapdTbW44A4jCy4kvT2b1t4FfHFkAKo5zNHozyvPxwgmPD6Whc3pXmdzxXKsS7GK9zs4z2S9jYrrK" ], [ "a00cdab43456290799635064362851cf7d1edc74d4a8ecf2", "практика лучший резной мало лежать одежда ловить матч лидер рост вексель похожий съезд миля такси пласт хирург паук", "23affb7f9a5f64ab2b5fbba57df4d280b1f0222a8cb6dbcd9ea240ea37bd088d956ff3e712bf6ebb328185e29259e399076da5667852c84e5f9f5183de92a157", "xprv9s21ZrQH143K4a31ef7tRvwRY6f8zttbGLfnjTzJRssfEvjFjxDA7kMEk9R8zQYDyYU2LNo3fcyT2DmKAhufNi1i5g44cTgKUM6Qfu3SVHF" ], [ "6325252245b88bc10e007d1e3acb8e924f03d499f8be13a5061c2d1bbfdfd7cb", "лента гнилой изредка оттенок отвлечь угроза дрожать букет волчий терзать унижать вялый цветок форма магазин взнос ведро глоток орган котел сигнал хутор культура наглый", "baf6c06e3c917c623ef26b7750ec63d85017d60e6e4d8c7e49ec53dcf6a4d6bf606f2fa55e3dcd860b6adf58033d21fc58b093a6dcf24e7604dcfcf0844329b1", "xprv9s21ZrQH143K32a1ZKWu8NpmX55JAejQmV5tUgDDL52dkfZzTNXYF2qyKfUkZSjrLJicaiLMTUvjxpvUU55HjwUQFuf1gB2LSJHMcjhovXC" ], [ "f25806fe5e6125d9602d50d57129725f", "человек слабый скосить симфония ванная хвост обмен ракета темнота отец кричать скорый", "f38baf015700f685d1c1f26f9ab52db8700b27ee640f1ba2bde81149dace30415d4411795323eb61cd30d07d149dc0ee3ea33d99e4f52ee0235489d52b9f04d8", "xprv9s21ZrQH143K2JUoSW56YcVVgrPj3FP31H8jCX6aSimFw8xmgWFG8dtcKf5AVsxtRMibDde1q6CNCzjMSvetMGp6ywHSYW4QKJKuJJM3r9n" ], [ "df0ad99c35a4901afbbba60cb8a96e340d1fcdcb13cc0014", "тысяча комедия льгота мелкий изящный ботинок хребет мыться болтать совесть кредит магия съезд учесть грош неделя абзац профиль", "36f72aef7f6af7f2a687fba3a5e785ab171f6e08f7b7f077e24c4b8b49ac6e026bec1402031a128d11d02a9681711ca2b8ef09d34ae770a1577335d1b59a3b67", "xprv9s21ZrQH143K3647uZ91pci7dmAb9tbDYmNmntYV51kDRd5Qg4odoJd4jYh5qAWGAZXvkjaJGGuYawysxeUeYy35QfUrDLD1WemPa5d9uza" ], [ "dee92aa4e56d2debb9be104a4a3774d153456787c5f7ad23bf6e53f1892b8ff7", "туча икра раздел ссора сюрприз шагать учесть случай инвалид кепка трубка приют директор рядом восемь скелет рейс вокзал трепет пятый видимо плоский замок хаос", "79f63bcebeb97e95586fb6814b8be4781df00139917075fdf22018f61f547e1b66add4b63264326ec2f46542bcf748104c92b4f9f73705fe8769c0b3897eeb88", "xprv9s21ZrQH143K3qEhb6NQP35AFEguHn4iAVEJnfAVgd8pmRQVZnATZwnNACGmeg73XFU6szbt1LkrNgyfLkgJGNtdXLYE4aNfgzpvFssQcAj" ] ], "turkish": [ [ "00000000000000000000000000000000", "abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abdal", "4c14199a1b8df442bb96586e3c3d43305884a05e643fd89ba9d0a18775d80d4a91be22719f0e6ad42a7ad293872f6af429377e4b35863435b4647c617ab4ab4c", "xprv9s21ZrQH143K2ugGhLVYL5dCJkVLLSqfQqgYH6WNRVxqurmbLMR16tC7FY6HSH3fir8R7yx5LsAyKtbdqSrXj23ZZicU75g389hf4QJrvUY" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "meziyet yüzyıl tosbağa zindan yoğurt silecek zılgıt vokal meziyet yüzyıl tosbağa zirzop", "823d592ed10291fc25837c58bc122b2b37c0d20ea67530349270bcdb92e4892e13a7443eca530e9544694c8fb91d2fb7e8c29caeb598f627f90858e9fda408a0", "xprv9s21ZrQH143K3yg9nmyHAJvPDjBzGrWW2r8hqsGGTRrhVGEqvj4dWzwDfX9r9Pj8QWrCmnkdSgtAHJzxfxwRy9GnZvhfsHq2fGGwpDRLd3o" ], [ "80808080808080808080808080808080", "milat aidat cazibe absorbe alperen fıldır adezyon astsubay milat aidat cazibe abdest", "8529df63b2fb01db07df4f519d1e0c9066326ee1b7d699499af8a980de371c06e54a33d8788f19811c1b25c326cef643ba4bdd23c790e259a6e109b01e440e0d", "xprv9s21ZrQH143K3BV2UQMgVeVKsHWDof76rfWSWtDMvYy6HcCkTzVujez6vEL9o2zCXPAy52nQqU8uyRxmZu21AbRrqyqJe2S7N4aLXmSrTPc" ], [ "ffffffffffffffffffffffffffffffff", "zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zihniyet", "f154669700ee53ef119f7bcbbe62b2bec8296109a4359228e9d6200bf39b33eff7ed443ed92ee28af3504a31d92d12a595eda36f6dd2ab34bb2916ed5a9beaa7", "xprv9s21ZrQH143K4Z5Li8i6VfgWhfh5Yf5myQgwD2XQn21pMzn3LdrAQHEXe1WUrpnsfWr661XzBefNRanUfQ1uLgC9GTGiDZzkX1HU2b2Eu3M" ], [ "000000000000000000000000000000000000000000000000", "abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur akdeniz", "c11c692fc712c924732c0ea93d1eb38de8e53c591cc1117fc3f957046b9518c7e8eeb0bd156b1c23031557b712f9b6ba4f59b831ab2f35a35e06bca5d1584631", "xprv9s21ZrQH143K4U9eG6arRqDzwPxtvPY97cKPPtvsBuYXg3bQFS8sKvxf6z3PLRjER5d11XJaH9J4f9aBcP32QeNsEg2MucvdHQAdf1r6zCW" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "meziyet yüzyıl tosbağa zindan yoğurt silecek zılgıt vokal meziyet yüzyıl tosbağa zindan yoğurt silecek zılgıt vokal meziyet yürek", "7d070c17f6421b76ea23f91cda3373f6b87f137643d8117007ca9046c523f61a0f5b824fae61d76ba34505d3a06532c41279957a695b535651702df7688bb765", "xprv9s21ZrQH143K3ESh22bdZvgwnjv1rfUBhhqW7MmFe3gCvgssaQMEWZmw3wJasgMbfyjtZ9PtbM4c18Tdw9EFmuVHaWRdE9zmKP1tBnxQZ6G" ], [ "808080808080808080808080808080808080808080808080", "milat aidat cazibe absorbe alperen fıldır adezyon astsubay milat aidat cazibe absorbe alperen fıldır adezyon astsubay milat alıngan", "67eda05205e79bb0aea25640c85dec7a6e090df121113cfb8528df87288144a777a12365fc5ea26d78dc4f063894fe1f5692c1cd20b6528cb2dd1fff4aed8c74", "xprv9s21ZrQH143K4UxdxPUHqDx1TbUa5ymqrGT4LpxPTokXfjvWg1LwJ6kPrFjtnWQ6AJ4LhMgGJvjpfr93GgkCdsY4bCFveCAqjoG7aL1PMkB" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffff", "zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre yukarı", "527598540e10421e68a749ef0f2c6f8c874aff96d5aa885703bdd324dc691bd5edc5aa055adf5582017e32315e8c7d2a059c77928e15acce814765295fe442ad", "xprv9s21ZrQH143K3oTbjcF7aPkGaGbu1XWBbJmpFWRe6u4m871jzcuxe9UJwuTfPPDqy8sahH6pX3choSBAtJsKYKw9fQAQy6gykuBgGDXH4Af" ], [ "0000000000000000000000000000000000000000000000000000000000000000", "abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur abajur araba", "28c310afd7368bcd8c0b0b85f2ea8fdaabde393b603f0ef4c457f6b14d8ec2a2b9520dbaf775686d75e786ffd016a6373c956e3a96d726c6f1a5e604c14b8941", "xprv9s21ZrQH143K2AWncG5V4X2SYmfNGNTJadWjzCgiwhfS9QVvAu8RHAvtMnQX7KGFvdZwuPMSjuwycA51FDezqbvEDVuAQtwewnzSbYvZvkC" ], [ "7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f", "meziyet yüzyıl tosbağa zindan yoğurt silecek zılgıt vokal meziyet yüzyıl tosbağa zindan yoğurt silecek zılgıt vokal meziyet yüzyıl tosbağa zindan yoğurt silecek zılgıt tuzlu", "b37520e13cbd00a4f3f1d9bed02d6dd01668f51204d2cddbf0fb28815567882d79daf30b3971c55ac96ea4b35569f05f9bb4d827de366b4304bdb2c23d595be0", "xprv9s21ZrQH143K38tD64zHfNMTLQyszcLiZfsEqx3PKotFEusJJpAzV1LNGrDkKQ2kZyGUcNYkpwJET6xRihooefwYnU8sDc1AVEB8CAmYbSS" ], [ "8080808080808080808080808080808080808080808080808080808080808080", "milat aidat cazibe absorbe alperen fıldır adezyon astsubay milat aidat cazibe absorbe alperen fıldır adezyon astsubay milat aidat cazibe absorbe alperen fıldır adezyon benzer", "5d92ee9efcd9cc3f19b8644dc72741caebf4c15d77aec6ab066d5ac3544b942616b567bbdc5eb25b20072d7082cdd7692c369d7575db53fbcdb4be2a8ae0b097", "xprv9s21ZrQH143K4TFEM9Dy2iDjmdDijpn3K1HRV5WMfpoaS3Hyt8GNoC3RRDb4MZTKfcckmmazJ5YLtYuxXCM3TZZvrg3uG5ptxrabr6cbbT3" ], [ "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre zümre yeniçeri", "2822919551b434114e51a2c00824cdc2dbaf1b567bb71d56c3e388ffedccd5a4054d7f71fc4149ed73f376fc9fad629bc40d2af89f4d61b6292153b73ee5a54d", "xprv9s21ZrQH143K2YKCt9cmi7pXRoXpX2AjXR5ydny2pDSbVueGZdwSNN7B1HnTQRf5RtZMtnFghHgH9PRCVAeZUHA4o8wb3anoyAjvtURAB4h" ], [ "bb54aac4b89dc868ba37d9cc21b2cece", "sentez pirinç rota lamba tıknaz edat üçbudak yürek şelale arena saçma parsel", "15a94bd53a53df03882bfe746ec24f5349dd8d7c3de8884b032b6cac37cb9771526e2b656e94137b190399e70e6b7e7d08219aa1ba965e58e1c139533362b2a6", "xprv9s21ZrQH143K2qNy54d9ktxsVXsrtgmW7nePreUeHV7nTvc2hm5Pyu16xzWrAUE3XAZjnD6rtLALGJRrqWgknVdGbL6TQ72fArknZe9xxCn" ], [ "9f09b43ceb7e57a0ea8766221624d01b086464359164e7a0", "patlıcan havuç asfalt tekdüze ulema taktik pusula varyemez cilt rota ecnebi ekose müstesna duvak teftiş derman uyuşma akustik", "f04f5a4067b689cee057321f6bf400a25d96f4be59559d09446c1669595d6b856f79495609d2a1f933ab5f128f3d84cbbe8a471b613fd1e6354383c57ae0cd74", "xprv9s21ZrQH143K2M1c94zNSatufZPKm7r9ZvbQBb5XsTv32QbNanqRhY1FcPGXpvFtKu12gzFxaicf8i4x9aRVymXtfBMYWm4SBC7kqx4c2gg" ], [ "06aadd75179d6d5c5e19fde90cf9b4838622421e57a12862e1811b4cdab215dc", "albüm iletişim kahkaha divriği tehlike rehin masmavi fesih üçkağıt kolye kupkuru aleni kenar cepken mavra yatak çuval belge karmaşa elastik şirin irfan ilkokul odun", "29cbaa235e2205e406ebe495999f850b309ef442d2a091a2b750d5431bf5c6d308e1a4852172c9558430049b6036ccfed3789da2367e70efe1a8bd701208435c", "xprv9s21ZrQH143K3uxUFEhXpHvTZhgDnmDs18GkJkswLP27qQZTDUVF8PiNieqwRR5uCsX2y7ZkMKgi1THaHgeR7q4VcMxHcNRvGeavrrzpzJ2" ], [ "934f1cecb1c2236ab4866d6245f7c8db", "otopark materyal eski kılavuz cisim sakız tapan şirin kerkenez doğalgaz yanıt sarkık", "325bf129f10c4b4fc66663958fb09bae1df60a8dd37d219cfbf8c776891889d0e918b1dbe66bf78191687694897bc94a2b2c1b84ab1865eef60a2c03438afa29", "xprv9s21ZrQH143K35KwmVQGSrd7X58mMCqKqpSLRSMYnTWzdYTDgPKJnHz6A7PXBvCLJj4vXVfmSNKwraCYm6Cwqd2uGk7J8TLDchDUQMPUjG3" ], [ "815171aac963d551f0a4140f62df9da1ceb7739ce1c2c249", "minyon nilüfer köprücük otoban ezber prim somut morötesi asil bekle uykusuz gariban üzüm sefer lütfen empati solfej hafız", "42839d70ad42ad51716b6c30ad29cb7a256fc6e9c6865470e9b302a3bec99be6754714d647870ee02cc75b6e2b46f11c4d4a63009b1ae44aba3f4c1015b846e9", "xprv9s21ZrQH143K3tRHyXhqsWfrZ7JT11sMZyYiwkC5Eo4WvRPXLCEHRYP6BcisHLWKNdwQywHet8Fpbzz4t44Db5TcTEYZrpUKZY4iTpLsbrx" ], [ "8d79c52beb01af2b8cfbc74713c164e33a7c9a1afb6cb6a88d344e16fe97084c", "nüfus şöhret güzel tedarik boğaz ölümsüz ecel materyal göçebe pasaport irmik suhulet portakal hapşırık kudurma kurdele sanatçı gemi hapşırık pansuman külçe hafız cerrah patolog", "05d2850b6d5b32ca9f9d8345a40362d6f3be8fcc65dc77542e8ca50efaf940ee11cf91594c64c7b511def83fcd5ef3eb4b8c8d6ae3cb10b946f1aa2c0a1f12dd", "xprv9s21ZrQH143K4GVKptAzKSVqEsJiG4NpdudPYfqNxBMRhdt4Bf7xXoCeRorRc5pD9VvdgbMNQZHJrDPPCiZSuQUQ2WpufLN2JD1Z5pD9JNf" ], [ "4bee29faea0a596253797215e1eccf9d", "hakan lansman metre taşınmaz pist rota haysiyet dinozor başlık asil ecel ertesi", "332a44ae607176fbf85941af7bcd9685b84c2a3d200058e82e099e7b20b799c2619bc85a6c4115be91ed3796546b9a9a1364f862ae156d0f923b96f21d37fcff", "xprv9s21ZrQH143K2d1M8F9uPvNEd5QfuvGPCJE8XBh6wf96Arz6CEzs1Hag7WFaUedyzvMXT7HQEN67V2k5RYEo2tc7hVqPpTxaEYDNLzHhPPy" ], [ "a00cdab43456290799635064362851cf7d1edc74d4a8ecf2", "peçete koçbaşı rasyonel konak kesirli musluk kızak koşul kırsal rozet bakteri patika tansiyon kurultay tarumar öğrenci vasıta olay", "feece1c9aba98740471e6025b53f6e071815f2302b5d9cdb1796f791cb27dc5d0149c9dd6f7cc1178bfb471fe622eed7f67b85519a609cf336bc986e18c8cbad", "xprv9s21ZrQH143K4WQDYJVHrxMNZPzGACWvtgSEN82CCAtE91pJwMrGCnHbqRAb1YUKk4AsZMmy1vPZbDEAV7v81LZMKp75LyAgVbwE8YhuaWF" ], [ "6325252245b88bc10e007d1e3acb8e924f03d499f8be13a5061c2d1bbfdfd7cb", "keyfiyet dalga gövde nicel nasıl transfer emisyon askı burun teftiş tünel çayhane vurma üslup kombine berjer bağlantı çubuk müzik işlem seremoni vokal kanun mahrum", "6e51f41ff64b1cf5b464e1ee4d65346652fbc455db859faec1adffe64f1c3e0153bf223a514591a31f7a35f2c1edf8112d01b488c347771cb689791b0c5fca47", "xprv9s21ZrQH143K36WkoNrtpfR2W31M9zfoS9b6m8TiVArdY59tzh6RraoaRj6Nid9kcPG1eZWKvjAosoKHziqBUtpkNR4X73JwoXjcK9mJGQc" ], [ "f25806fe5e6125d9602d50d57129725f", "yankı simit silah serüven avukat varsayım milli pusula tazminat nazik kadın sihirbaz", "6ec0dea6dae649330517c17ba129179d1f5ec5ae7ed0d4a6f05caa8aff580c88404bbfd55ccd1f4e7408bc75fa3490aaf4523cd853679cfb82eb2797c7302be5", "xprv9s21ZrQH143K26t84vvKN1EqXrpVzKCJmv2CkZQVKBXGVdLoCW1bdFKeVTbTxbhMHRfv7S5qc9Z8cLURAW5HtVa2WvLFNLH3M6tHRr8EpfE" ], [ "df0ad99c35a4901afbbba60cb8a96e340d1fcdcb13cc0014", "toplum ileri koğuş köşegen gözleme arefe vestiyer mağdur apse sprey jakoben komedyen tansiyon uyarı dere mayhoş abajur pırasa", "e584247a087153923e5b00bf14d179714f151d1064e74dc6dd19905fc37d7bb6fa2fd7757d6d3ca157e01fe517671693ab514eed7d449d160cbbbd0d90ac3468", "xprv9s21ZrQH143K2vRvkt63VCpuem6vXLt1pqtVBm7YSuxZbm4G2LihmCfAcbKXJc9E5LnEKngDHqo7oF2YDB17EBFQrYFgxJaqmcyTJbREMct" ], [ "dee92aa4e56d2debb9be104a4a3774d153456787c5f7ad23bf6e53f1892b8ff7", "topaç grup profil şaşırma tarım yengeç uyarı sohbet gündüz hudut tırmanış pervane edat sade bütçe sırtüstü razı burçak teşrif posa beyin ölümsüz festival vakıf", "bbdb82c9d5e188f792a6ffa189b3f0fda5aa289f918adf34817918891510e312d351f945e74da91855d1432369344a3094c523d129bad0520951aab542e07b75", "xprv9s21ZrQH143K3opfxeLxFyAKr1ufr9qK8crqeht2XaHqsnZ6FbtoovHsocVDjfWXA9PS44CS4NkZ76CKCQhhw489dx9RAN9JXQbj3Ta5UpT" ] ] } ================================================ FILE: testAddressTxtLineTest.bat ================================================ mvn clean verify -Dtest=net.ladenthin.bitcoinaddressfinder.AddressTxtLineTest ================================================ FILE: update.bat ================================================ call mvn versions:display-dependency-updates call mvn versions:display-plugin-updates