Example #1
0
def t(A):
    l = len(A)
    k = ((l + 8) >> 6) + 1
    B = [0] * (k * 16)
    for z in range(l):
        B[z >> 2] |= ord(A[z]) << (24 - (z & 3) * 8)
    z += 1
    B[z >> 2] |= 128 << (24 - (z & 3) * 8)
    B[z >> 2] = int32(B[z >> 2]).value
    B[- 1] = l * 8
    return B
Example #2
0
def t(A):
    l = len(A)
    k = ((l + 8) >> 6) + 1
    B = [0] * (k * 16)
    for z in range(l):
        B[z >> 2] |= ord(A[z]) << (24 - (z & 3) * 8)
    z += 1
    B[z >> 2] |= 128 << (24 - (z & 3) * 8)
    B[z >> 2] = int32(B[z >> 2]).value
    B[-1] = l * 8
    return B
Example #3
0
def u(k, B):
    k = int32(k).value
    B = int32(B).value

    A = int32(k & 65535).value + int32(B & 65535).value
    A = int32(A).value

    z = int32(k >> 16).value + int32(B >> 16).value + int32(A >> 16).value
    z = int32(z).value
    return int32(z << 16).value | int32(A & 65535).value
Example #4
0
def x(z, k, B, A):
    z = int32(z).value
    k = int32(k).value
    B = int32(B).value
    A = int32(A).value
    if z < 20:
        return int32(k & B).value | int32(int32(~k).value & A).value
    if z < 40:
        return int32(k ^ B ^ A).value
    if z < 60:
        return int32(k & B).value | int32(k & A).value | int32(B & A).value
    return int32(k ^ B ^ A).value
Example #5
0
import random
from ctypes import c_int32 as int32, c_uint32 as uint32


i = lambda k: h(g(t(k)))
l = lambda k: k < 20 and 1518500249 or (k < 40 and 1859775393 or (k < 60 and -1894007588 or -899497514))
o = lambda k, z: int32(k << z).value | int32(uint32(k).value >> (32 - z)).value


def t(A):
    l = len(A)
    k = ((l + 8) >> 6) + 1
    B = [0] * (k * 16)
    for z in range(l):
        B[z >> 2] |= ord(A[z]) << (24 - (z & 3) * 8)
    z += 1
    B[z >> 2] |= 128 << (24 - (z & 3) * 8)
    B[z >> 2] = int32(B[z >> 2]).value
    B[- 1] = l * 8
    return B


def g(N):
    K = N
    L = [0] * 80
    J = 1732584193
    I = -271733879
    H = -1732584194
    G = 271733878
    F = -1009589776
    for C in range(0, len(K), 16):
Example #6
0
def u(k, B):
    k = int32(k).value
    B = int32(B).value

    A = int32(k & 65535).value + int32(B & 65535).value
    A = int32(A).value

    z = int32(k >> 16).value + int32(B >> 16).value + int32(A >> 16).value
    z = int32(z).value
    return int32(z << 16).value | int32(A & 65535).value
Example #7
0
def x(z, k, B, A):
    z = int32(z).value
    k = int32(k).value
    B = int32(B).value
    A = int32(A).value
    if z < 20:
        return int32(k & B).value | int32(int32(~k).value & A).value
    if z < 40:
        return int32(k ^ B ^ A).value
    if z < 60:
        return int32(k & B).value | int32(k & A).value | int32(B & A).value
    return int32(k ^ B ^ A).value
Example #8
0
import random
from ctypes import c_int32 as int32, c_uint32 as uint32

i = lambda k: h(g(t(k)))
l = lambda k: k < 20 and 1518500249 or (k < 40 and 1859775393 or
                                        (k < 60 and -1894007588 or -899497514))
o = lambda k, z: int32(k << z).value | int32(uint32(k).value >> (32 - z)).value


def t(A):
    l = len(A)
    k = ((l + 8) >> 6) + 1
    B = [0] * (k * 16)
    for z in range(l):
        B[z >> 2] |= ord(A[z]) << (24 - (z & 3) * 8)
    z += 1
    B[z >> 2] |= 128 << (24 - (z & 3) * 8)
    B[z >> 2] = int32(B[z >> 2]).value
    B[-1] = l * 8
    return B


def g(N):
    K = N
    L = [0] * 80
    J = 1732584193
    I = -271733879
    H = -1732584194
    G = 271733878
    F = -1009589776
    for C in range(0, len(K), 16):