This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ruby:2.4 | |
WORKDIR /usr/src/app | |
ENV RAILS_ENV=production \ | |
RUBY_GC_MALLOC_LIMIT=90000000 \ | |
RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 \ | |
DISCOURSE_DB_HOST=postgres \ | |
DISCOURSE_REDIS_HOST=redis \ | |
DISCOURSE_SERVE_STATIC_ASSETS=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.4' | |
services: | |
wildfly: | |
image: skymatic/defendor:0.4.0 | |
environment: | |
- POSTGRES_USER=defendor | |
- POSTGRES_PASSWORD=notASecurePassword | |
- POSTGRES_DB=defendor | |
- SYSLOG_HOST=syslog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jdk.incubator.foreign.MemoryAccess; | |
import jdk.incubator.foreign.MemorySegment; | |
import org.openjdk.jmh.annotations.Benchmark; | |
import org.openjdk.jmh.annotations.BenchmarkMode; | |
import org.openjdk.jmh.annotations.Fork; | |
import org.openjdk.jmh.annotations.Mode; | |
import org.openjdk.jmh.annotations.OutputTimeUnit; | |
import org.openjdk.jmh.annotations.Warmup; | |
import org.openjdk.jmh.infra.Blackhole; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* KDF as defined in <a href="https://doi.org/10.6028/NIST.SP.800-56Ar2">NIST SP 800-56A Rev. 2 Section 5.8.1</a> using SHA-256 | |
* | |
* @param z A shared secret | |
* @param keyDataLen Desired key length (in bytes) | |
* @param otherInfo Concatenated form of AlgorithmID || PartyUInfo || PartyVInfo {|| SuppPubInfo }{|| SuppPrivInfo } | |
* @returns key data | |
*/ | |
public static async concatKDF(z: Uint8Array, keyDataLen: number, otherInfo: Uint8Array): Promise<Uint8Array> { | |
const hashLen = 32; // output length of SHA-256 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.crypto.Cipher; | |
import javax.crypto.spec.IvParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.nio.ByteBuffer; | |
import java.security.GeneralSecurityException; | |
/** | |
* This demonstrates a memory allocation problem in com.sun.crypto.provider.CipherCore. | |
* <p> | |
* To reproduce the issue, run this class using: |
OlderNewer