Open this in zkREPL →
This file can be included into other zkREPLs with include "gist:4149b97a72b4f51714620ecfaaf139fc";
// run on https://zkrepl.dev/ | |
pragma circom 2.1.6; | |
include "circomlib/poseidon.circom"; | |
template SumLargerThanTen() { | |
signal input a; | |
signal output b; |
include "circomlib/bitify.circom"; | |
include "circomlib/gates.circom"; | |
// CalculateTotal and QuinSelector taken from | |
// https://github.com/darkforest-eth/circuits/tree/master/perlin | |
template CalculateTotal(n) { | |
signal input in[n]; | |
signal output out; | |
signal sums[n]; |
pragma circom 2.1.6; | |
template IsEqual () { | |
signal input in[2]; | |
signal output out; | |
signal tmp; | |
tmp <-- in[0] == in[1] ? 1 : 0; | |
out <== tmp; |
pragma circom 2.1.8; | |
include "./node_modules/circomlib/circuits/multiplexer.circom"; | |
include "./node_modules/circomlib/circuits/comparators.circom"; | |
// checks if the second array is a | |
// permutation of the first based on | |
// the advice | |
template ForceIsPermutation(n) { | |
signal input in1[n]; | |
signal input in2[n]; |
Open this in zkREPL →
This file can be included into other zkREPLs with include "gist:4149b97a72b4f51714620ecfaaf139fc";
Please comment below if you have an update, e.g., with another networking-related dataset.
import torch | |
def projected_gradient_descent(model, x, y, loss_fn, num_steps, step_size, step_norm, eps, eps_norm, | |
clamp=(0,1), y_target=None): | |
"""Performs the projected gradient descent attack on a batch of images.""" | |
x_adv = x.clone().detach().requires_grad_(True).to(x.device) | |
targeted = y_target is not None | |
num_channels = x.shape[1] | |
for i in range(num_steps): |
以下転載:
公式リファレンス: pwntools
最新版を降らせる
pip install "git+https://github.com/Gallopsled/pwntools#egg=pwntools"