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
IDENTIFICATION DIVISION. | |
PROGRAM-ID. KECCAK-Wrapper-struct. | |
ENVIRONMENT DIVISION. | |
DATA DIVISION. | |
WORKING-STORAGE SECTION. | |
LINKAGE SECTION. | |
01 LNK-KECCAK. |
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
// load C Code | |
var cobol = Polyglot.evalFile("llvm", "KECCAK.so"); | |
(function SHA3_256(sha_input, sha_input_length, sha_output) { | |
cobol.KECCAK__Wrapper__struct({ | |
LNK_KECCAK_RATE: 1088, | |
LNK_KECCAK_CAPACITY: 512, | |
LNK_KECCAK_INPUT: sha_input, | |
LNK_KECCAK_INPUT_BYTE_LEN: sha_input_length, |
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
CALL WS-SHA3-256-JS-POINTER USING WS-INPUT | |
WS-INPUT-BYTE-LEN | |
WS-SHA3-256-OUTPUT | |
END-CALL |
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
*> interoperability fields | |
01 WS-SHA3-256-JS-POINTER PROGRAM-POINTER. | |
01 WS-JS PIC X(3). | |
01 WS-SHA3-256-JS-FILENAME PIC X(50). | |
MOVE Z'js' TO WS-JS. | |
MOVE Z'SHA3-256.js' TO WS-SHA3-256-JS-FILENAME. | |
*> get javascript function | |
CALL STATIC "polyglot_eval_file" using |
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
CALL "SHA3-256" USING WS-INPUT | |
WS-INPUT-BYTE-LEN | |
WS-SHA3-256-OUTPUT | |
END-CALL |
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
package org.example; | |
import javafx.application.Application; | |
import javafx.scene.Scene; | |
import javafx.scene.control.Button; | |
import javafx.stage.Stage; | |
import java.lang.reflect.Method; | |
public class Sensitive extends Application { |
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 java.net.MalformedURLException; | |
import java.net.URL; | |
import java.security.cert.Certificate; | |
import java.io.*; | |
import javax.net.ssl.HttpsURLConnection; | |
import javax.net.ssl.SSLPeerUnverifiedException; | |
public class Curl { |
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 java.util.List; | |
import java.util.Arrays; | |
import org.graalvm.polyglot.*; | |
public class MyClass { | |
public static void main(String[] args) { | |
try (Context context = Context.newBuilder().allowAllAccess(true).build()) { | |
context.eval("python", |
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
#define WASM_EXPORT __attribute__((visibility("default"))) | |
WASM_EXPORT | |
int main() { | |
return 42; | |
} |
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
get_local 0 | |
i64.eqz | |
if (result i64) | |
i64.const 1 | |
else | |
get_local 0 | |
get_local 0 | |
i64.const 1 | |
i64.sub | |
call 0 |