When
This file contains 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
#!/usr/bin/python3 | |
from pwn import * | |
def p64(n): | |
return struct.pack("<Q", n) | |
def gen_xorbyte(byteoffset, value, bitwidth, selfstart, jumpthen): | |
code = b"" | |
for i in range(bitwidth): | |
if value & (1 << i): |
This file contains 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 pwn import * | |
PROMPT = b'> ' | |
DONE = b'Done!\n' | |
if __name__ == '__main__': | |
with process('./sice_supervisor') as tube: | |
#with remote('mc.ax', 30283) as tube: |
This file contains 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
diff --git a/sample.py b/sample.py | |
index 6ff0ea2..00daada 100644 | |
--- a/sample.py | |
+++ b/sample.py | |
@@ -7,10 +7,11 @@ from contextlib import nullcontext | |
import torch | |
import tiktoken | |
from model import GPTConfig, GPT | |
+import time | |
This file contains 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 galois | |
from itertools import chain | |
import numpy as np | |
class SymbolicByte: | |
def __init__(self, bit_vars): | |
self.bit_vars = [ | |
self._xor_vars(vs) for vs in bit_vars | |
] |
This file contains 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
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <time.h> | |
#include <dlfcn.h> | |
#include <err.h> | |
#define NSYMS 1000000 |
This file contains 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
.global _d2i | |
.align 4 | |
_d2i: | |
fcvtzs x0, d0 | |
ret |
This file contains 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
#include <stdio.h> | |
#include <stdint.h> | |
#include <math.h> | |
int32_t d2i(double); | |
int main(int argc, char* argv[]) { | |
for (int sign = -1; sign <= 1; sign += 2) { | |
for (int p = 0; p <= 7; ++p) { | |
double d = (double)sign * pow(133.7, (double)p); |
This file contains 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
#!/usr/bin/env python3 | |
from Crypto.Util.number import * | |
import sys | |
from flag import flag | |
def diff(a, b): | |
assert a.bit_length() == b.bit_length() | |
w, l = 0, a.bit_length() | |
for _ in range(l): |
Example AMD output:
$ lscpu | grep 'Model name'
Model name: AMD Ryzen Threadripper 3970X 32-Core Processor
$ gcc -DFAST puzzle.S -o puzzle && ./puzzle
1000000000 iterations, 2758479060 cycles, 2.76 cycles/iteration
1651816810 106000000000
$ gcc -DSLOW puzzle.S -o puzzle && ./puzzle
1000000000 iterations, 6551777517 cycles, 6.55 cycles/iteration