コード例 #1
0
ファイル: sample_lsag.py プロジェクト: np/Py-EC
def get_signature_size( signature ):
    public_keys, message, c_0, ss, Y_tilde = signature
    # Each public key is 64 bytes (32 bytes per coordinate)
    size = 64 * len( public_keys )
    size += len( ECHelper.int2bin( c_0 ) )
    size += sum( map( lambda s: len( ECHelper.int2bin( s ) ), ss ) )
    # Y_tilde is also a point, which again requires 64 bytes
    size += 64
    return size
コード例 #2
0
ファイル: sample_lsag.py プロジェクト: nambiar/Py-EC
def get_signature_size( signature ):
    public_keys, message, c_0, ss, Y_tilde = signature
    # Each public key is 64 bytes (32 bytes per coordinate)
    size = 64 * len( public_keys )
    size += len( ECHelper.int2bin( c_0 ) )
    size += sum( map( lambda s: len( ECHelper.int2bin( s ) ), ss ) )
    # Y_tilde is also a point, which again requires 64 bytes
    size += 64
    return size
コード例 #3
0
 def __init__(self, os_bn=None,decval=None,binval=None):
     """
     Constructs a new BN object
     and fills it with the value given.
     """
     if os_bn is not None:
         self.bn = os_bn
         self.__created_bn = False
     else:
         self.bn = OpenSSL.BN_new()
         self.__created_bn = True
         if decval is None and binval is None:
             decval = 0
             
         if decval is not None:
             binval = ECHelper.int2bin( decval )
             
         if binval is not None:
             OpenSSL.BN_bin2bn( binval, len( binval ), self.bn )
コード例 #4
0
ファイル: bignum.py プロジェクト: votesapp/PyBitmessageVote
    def __init__(self, os_bn=None, decval=None, binval=None):
        """
        Constructs a new BN object
        and fills it with the value given.
        """
        if os_bn is not None:
            self.bn = os_bn
            self.__created_bn = False
        else:
            self.bn = OpenSSL.BN_new()
            self.__created_bn = True
            if decval is None and binval is None:
                decval = 0

            if decval is not None:
                binval = ECHelper.int2bin(decval)

            if binval is not None:
                OpenSSL.BN_bin2bn(binval, len(binval), self.bn)
コード例 #5
0
ファイル: point.py プロジェクト: votesapp/PyBitmessageVote
 def encode_binary(self):
     return ECHelper.int2bin(self.x) + ECHelper.int2bin(self.y)
コード例 #6
0
 def encode_binary(self):
     return ECHelper.int2bin( self.x ) + ECHelper.int2bin( self.y )