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
public static class BigIntegerExtensionMethods | |
{ | |
public static BigInteger Sum(this IEnumerable<BigInteger> source) | |
{ | |
return source.Aggregate((accumulator, current) => accumulator + current); | |
} | |
public static BigInteger Product(this IEnumerable<BigInteger> source) | |
{ | |
return source.Aggregate((accumulator, current) => accumulator * current); |
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
public static class HashCodeHelper | |
{ | |
public static int Combine(int h1, int h2) | |
{ | |
uint num = (uint)((h1 << 5) | (int)((uint)h1 >> 27)); | |
return ((int)num + h1) ^ h2; | |
} | |
} |
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
#!/usr/bin/env python3 | |
from Cryptodome.PublicKey import RSA | |
# A proof of concept demo showing the multiplicative limited | |
# homomorphic qualities of unpadded RSA | |
# (Unpadded RSA is not secure by modern standards) | |
def gen_key(size): | |
key = RSA.generate(size) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder