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
attacker[active] | |
principal Alice [ | |
knows private a | |
ga = G^a | |
] | |
principal Bob [ | |
knows private b | |
gb = G^b |
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 math | |
N = 10000000 | |
def check_bm(n, r): | |
lhs = (n*(n-1))//2 | |
rhs = n*r + (r*(r+1))//2 | |
return lhs == rhs | |
def list_bm(): |
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 u/42IsHoly: | |
# https://www.reddit.com/r/math/comments/nt4o10/a_pretty_cool_but_completely_useless_function_i/ | |
# | |
# > we can define a “pseudo-base function” which we’ll call B. B(x) = Sum (xn * | |
# > nth digit of x) Where the ones digit is the 0th, the tens digit is the 1st, | |
# > the 1/10s digit the -1st the hundreds digit the 2nd, etc. | |
# | |
# This function assumes conversion from the decimal base, but we should be able to generalize that. | |
# | |
# Script by u/toppletwist. 2021, public domain. |