def rsadp(self, c): if not (0 <= c <= self.n - 1): raise exceptions.CiphertextRepresentativeOutOfRange R = 1 m = 0 if self.blind: c = (c * self.blind) % self.n for prime, exponent, crt in zip(self.primes, self.exponents, self.crts): m_i = primitives._pow(c, exponent, prime) h = ((m_i - m) * crt) % prime m += R * h R *= prime if self.blind_inv: m = (m * self.blind_inv) % self.n return m
def rsadp(self, c): if not (0 <= c <= self.n-1): raise exceptions.CiphertextRepresentativeOutOfRange R = 1 m = 0 if self.blind: c = (c * self.blind) % self.n for prime, exponent, crt in zip(self.primes, self.exponents, self.crts): m_i = primitives._pow(c, exponent, prime) h = ((m_i - m) * crt) % prime m += R * h R *= prime if self.blind_inv: m = (m * self.blind_inv) % self.n return m
def rsadp(self, c): if not (0 <= c <= self.n - 1): raise exceptions.CiphertextRepresentativeOutOfRange return primitives._pow(c, self.d, self.n)
def rsaep(self, m): if not (0 <= m <= self.n - 1): raise exceptions.MessageRepresentativeOutOfRange return primitives._pow(m, self.e, self.n)
def rsadp(self, c): if not (0 <= c <= self.n-1): raise exceptions.CiphertextRepresentativeOutOfRange return primitives._pow(c, self.d, self.n)
def rsaep(self, m): if not (0 <= m <= self.n-1): raise exceptions.MessageRepresentativeOutOfRange return primitives._pow(m, self.e, self.n)