summaryrefslogtreecommitdiffstats
path: root/factor
Commit message (Collapse)AuthorAgeFilesLines
* Use PREFIX nowCameron Katri2021-03-281-2/+2
|
* Get all the games compiling for iOSCameron Katri2021-02-221-10/+14
|
* - remove duplicate commentchristos2020-10-121-3/+3
| | | | - flush after printing the number (from kre@)
* more clarifications.christos2020-10-121-4/+8
|
* mention hex numberschristos2020-10-111-2/+5
|
* Remove is_hex_str() (trying to guess if a number was hex or not). It is notchristos2020-10-111-27/+3
| | | documented and can lead to unexpected behavior.
* From gson@christos2020-10-111-31/+42
| | | | - don't assume -h is always on for large factors - fix saved large factors printing when -h
* - for readability when the exponent < 10 don't prefix it with 0x (from kre)christos2020-10-071-8/+19
| | | | - fix usage - merge printing code.
* PR/55695: Andreas Gustafsson: factor(6) -h option doesn't always workchristos2020-10-051-3/+41
| | | Handle -h for factors greater than the primes table.
* revert previous and don't parse octalchristos2020-10-051-7/+4
|
* factor: usage(): mark __deadtnn2020-10-051-3/+3
|
* - Accept octal input.christos2020-10-041-5/+6
| | | - Don't play with the original string so we can print it.
* Fix a typo (s/int/in/)kre2020-10-041-2/+2
|
* PR/55693: Andreas Gustafsson: factor(6) lists factors in wrong orderchristos2020-10-032-188/+231
| | | | Sync with FreeBSD and change their -h (that printed hex) to -x because we were already using -h.
* fix for OpenSSL-1.1christos2018-02-061-8/+8
|
* Add -h option to factor(6): duplicate factors are printed inrin2017-11-112-20/+55
| | | "human-readable" form of x^n.
* Remove MKCRYPTO option.riastradh2017-05-211-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally, MKCRYPTO was introduced because the United States classified cryptography as a munition and restricted its export. The export controls were substantially relaxed fifteen years ago, and are essentially irrelevant for software with published source code. In the intervening time, nobody bothered to remove the option after its motivation -- the US export restriction -- was eliminated. I'm not aware of any other operating system that has a similar option; I expect it is mainly out of apathy for churn that we still have it. Today, cryptography is an essential part of modern computing -- you can't use the internet responsibly without cryptography. The position of the TNF board of directors is that TNF makes no representation that MKCRYPTO=no satisfies any country's cryptography regulations. My personal position is that the availability of cryptography is a basic human right; that any local laws restricting it to a privileged few are fundamentally immoral; and that it is wrong for developers to spend effort crippling cryptography to work around such laws. As proposed on tech-crypto, tech-security, and tech-userlevel to no objections: https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html P.S. Reviewing all the uses of MKCRYPTO in src revealed a lot of *bad* crypto that was conditional on it, e.g. DES in telnet... That should probably be removed too, but on the grounds that it is bad, not on the grounds that it is (nominally) crypto.
* Imported and adapted from FreeBSD svn r272166 and r272207; this fixesast2014-10-022-20/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | false positives for products of primes larger than 2^16. For example, before this commit: $ /usr/games/primes 4295360521 4295360522 4295360521 but $ /usr/games/factor 4295360521 4295360521: 65539 65539 or $ /usr/games/primes 3825123056546413049 3825123056546413050 3825123056546413049 yet $ /usr/games/factor 3825123056546413049 3825123056546413049: 165479 23115459100831 or $ /usr/games/primes 18446744073709551577 18446744073709551577 although $ /usr/games/factor 18446744073709551577 18446744073709551577: 139646831 132095686967 Incidentally, the above examples show the smallest and largest cases that were erroneously stated as prime in the range 2^32 .. 3825123056546413049 .. 2^64; the primes(6) program now stops at 3825123056546413050 as primality tests on larger integers would be by brute force factorization. In addition, special to the NetBSD version: . for -d option, skip first difference when start is >65537 as it is incorrect . corrected usage to mention both the existing -d as well as the new -h option For original FreeBSD commit message by Colin Percival, see: http://svnweb.freebsd.org/base?view=revision&revision=272166
* remove duplicated #defines (in a usually unused part of the code)drochner2011-11-091-5/+2
|
* Properly print string.joerg2011-05-231-3/+3
|
* Follow the Fundamental Theory of Algebra. Disallow factorising ofjoerg2010-05-152-14/+10
| | | | | | | | numbers less than 2 as it is not - naturally unique (negative numbers) - finite (0) - non-empty (1) Discussed with the kristaps and wiz
* cast isblank(3)'s argument to unsigned char.tnozaki2010-05-131-3/+3
|
* rename pollard_pminus1->pollard_rho for consistencydrochner2010-04-281-8/+6
|
* -Fix an old bug in the "pollard" code: it gets its argument passeddrochner2010-04-271-28/+59
| | | | | | | | | | | | by reference, and changes the value behind the pointer under some circumstances (basically if it finds more than 2 different factors). It also calls itself if it finds a factor which is not considered prime (by openssl's miller-rabin check) and uses the call argument afterwards. This doesn't work -- we need to copy the argument into its own storage. -Modify the code to do the "rho" algorithm as was initially announced. It takes somewhat longer in rare cases, but still works in cases where the "p-1" algorithm is unusable. This might fix PR misc/43192 by Luiz Henrique de Figueiredo. -Add some optional debug support, minor cleanup.
* fix an obvious flaw in bounds check: the array of precomputed primesdrochner2010-04-221-4/+5
| | | | | could be overrun if its last entry (65537) was a factor of the input (this does not affect PR misc/43192 -- the factors are much larger here: 7742394596501*159455563099482401)
* Add backslash before a dash to get a minus.wiz2010-04-221-3/+3
|
* Sync with reality. Bump date.dholland2010-04-221-11/+27
|
* sprinkle staticdholland2009-08-121-16/+15
|
* Remove the \n and tabs from the __COPYRIGHT() strings.lukem2008-07-201-4/+4
|
* convert __attribute__s to applicable cdefs.h macrosperry2007-12-151-3/+3
|
* Fixed a comment that said the factors in the output would be strictlyrillig2005-06-271-3/+3
| | | ascending.
* Add -lcrypt where -lcrypto is specified.christos2005-03-091-3/+3
|
* Separate primes manpage from that of factor. Correct DIAGNOSTICSjsm2004-02-082-46/+7
| | | information.
* Check large factor for being prime before applying Pollard'sjsm2004-02-081-6/+14
| | | | | | algorithm; fixes "factor 2147483647111311". Correct comment; algorithm is Pollard p-1, not Pollard rho. Increase base if p-1 algorithm reaches 1; fixes "factor 99999999999991". Testcases from David A Bagley <bagleyd@tux.org>.
* Move UCB-licensed code from 4-clause to 3-clause licence.agc2003-08-072-13/+5
| | | Patches provided by Joel Baker in PR 22269, verified by myself.
* Lots of minor fixes resulting from reading these man pages in detail.wiz2002-09-261-9/+6
|
* use NETBSDSRCDIR as appropriatelukem2002-09-191-3/+5
|
* Provide a BN_dec2bn() shim for the non-openssl case that reports an errorsimonb2002-06-181-3/+21
| | | if strtoul() fails.
* Fix a logic botch where if a number smaller than the square of the seivesimonb2002-06-171-12/+25
| | | | | | | | was prime to still called the Pollard Rho function when it didn't have to. Problem report by Nathan Williams. Unfortunately this one can't be picked up by a simple regression test since the broken way still produced the correct output, but just took far longer...
* make factor work with and without openssl.itojun2002-06-162-4/+55
|
* Use libcrypto's bignum support to implement a Pollard Rho factoringsimonb2002-06-152-40/+111
| | | algorithm so we can factorise numbers larger than a host long.
* Whitespace and/or punctuation fixes.wiz2001-04-021-5/+5
|
* Add use of `const' where appropriate to the games.jsm1999-09-081-5/+5
| | | | | | | | | This merges in all such remaining changes from the Linux port of the NetBSD games, except in hunt (where substantial changes from OpenBSD need to be looked at). Some such changes were previously covered in PRs bin/6041, bin/6146, bin/6148, bin/6150, bin/6151, bin/6580, bin/6660, bin/7993, bin/7994, bin/8039, bin/8057 and bin/8093.
* mark non-returning functions (PR#6144 by Joseph Myers <jsm28@cam.ac.uk>)hubertf1998-09-131-3/+3
|
* use CPPFLAGS instead of CFLAGSlukem1997-10-221-2/+2
|
* WARNSifylukem1997-10-102-13/+14
|
* Back out the .PATH.c changes. The .depend problem (and others)gwr1997-05-081-2/+2
| | | will be fixed using the new .NOPATH make feature instead.
* Use .PATH.c: ...gwr1997-05-061-2/+2
|
* Sync to 4.4BSD-Lite2tls1997-01-071-3/+4
|
* merge with Lite, new RCS id conventions, etc.cgd1995-03-233-243/+103
|