Utility functions for keyczar package.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string
|
|
tuple
|
|
|
MakeEmsaMessage(msg,
modulus_size)
Algorithm EMSA_PKCS1-v1_5 from PKCS 1 version 2 |
source code
|
|
|
BinToBytes(bits)
Convert bit string to byte string. |
source code
|
|
|
BytesToBin(bytes)
Convert byte string to bit string. |
source code
|
|
|
_PadByte(bits)
Pad a string of bits with zeros to make its length a multiple of 8. |
source code
|
|
|
|
|
BigIntToBytes(n)
Return a big-endian byte string representation of an arbitrary length
n. |
source code
|
|
|
IntToBytes(n)
Return byte string of 4 big-endian ordered bytes representing n. |
source code
|
|
|
|
|
Xor(a,
b)
Return a ^ b as a byte string where a and b are byte strings. |
source code
|
|
|
_PadBytes(bytes,
n)
Prepend a byte string with n zero bytes. |
source code
|
|
|
|
|
|
|
Hash(*inputs)
Return a SHA-1 hash over a variable number of inputs. |
source code
|
|
string
|
|
string
|
|
|
|
string
|
|
string
|
MGF(seed,
mlen)
Mask Generation Function (MGF1) with SHA-1 as hash. |
source code
|
|
|
HLEN = 20
|
|
RSA_OID = ObjectIdentifier('1.2.840.113549.1.1.1')
|
|
RSA_PARAMS = [ ' n ' , ' e ' , ' d ' , ' p ' , ' q ' , ' dp ' , ' dq ' , ' invq ' ]
|
|
DSA_OID = ObjectIdentifier('1.2.840.10040.4.1')
|
|
DSA_PARAMS = [ ' p ' , ' q ' , ' g ' ]
|
|
SHA1RSA_OID = ObjectIdentifier('1.2.840.113549.1.1.5')
|
|
SHA1_OID = ObjectIdentifier('1.3.14.3.2.26')
|