MCPcopy Create free account
hub / github.com/TheAlgorithms/Java / g

Method g

src/main/java/com/thealgorithms/maths/PollardRho.java:50–52  ·  view source on GitHub ↗

This method returns a polynomial in x computed modulo n @param base Integer base of the polynomial @param modulus Integer is value which is to be used to perform modulo operation over the polynomial @return Integer (((base base) - 1) % modulus)

(int base, int modulus)

Source from the content-addressed store, hash-verified

48 * @return Integer (((base * base) - 1) % modulus)
49 */
50 static int g(int base, int modulus) {
51 return ((base * base) - 1) % modulus;
52 }
53
54 /**
55 * This method returns a non-trivial factor of given integer number

Callers 9

pollardRhoMethod · 0.95
testKeyGenerationMethod · 0.80
testSemanticSecurityMethod · 0.80
testEncryptDecryptMethod · 0.80
testMessageZeroMethod · 0.80
testMessageMaxBoundMethod · 0.80
testMessageTooLargeMethod · 0.80
testHomomorphismMethod · 0.80

Calls

no outgoing calls

Tested by 8

testKeyGenerationMethod · 0.64
testSemanticSecurityMethod · 0.64
testEncryptDecryptMethod · 0.64
testMessageZeroMethod · 0.64
testMessageMaxBoundMethod · 0.64
testMessageTooLargeMethod · 0.64
testHomomorphismMethod · 0.64