def METHOD_NAME(self,sk, M, salt=None):
    #apply encoding
    modbits = int(sk['N']).bit_length()
    k = int(ceil(modbits / 8.0))
    emLen = int(ceil((modbits -1) / 8.0))
    em = self.paddingscheme.encode(M, modbits - 1, salt)
    m = Conversion.OS2IP(em)
    m = integer(m) % sk['N']  #ERRROR m is larger than N
    s =  (m ** sk['d']) % sk['N']
    S = Conversion.IP2OS(s, k)
    if debug:
        print("Signing")
        print("k     =>", k)
        print("emLen =>", emLen) 
        print("m     =>", m)
        print("em    =>", em)
        print("s     =>", s)
        print("S     =>", S)
    return S