Code Duplication    Length = 13-13 lines in 2 locations

server/lib/rsa/pkcs1.py 1 location

@@ 376-388 (lines=13) @@
373
__all__ = ['encrypt', 'decrypt', 'sign', 'verify',
374
           'DecryptionError', 'VerificationError', 'CryptoError']
375
376
if __name__ == '__main__':
377
    print 'Running doctests 1000x or until failure'
378
    import doctest
379
380
    for count in range(1000):
381
        (failures, tests) = doctest.testmod()
382
        if failures:
383
            break
384
385
        if count and count % 100 == 0:
386
            print '%i times' % count
387
388
    print 'Doctests done'
389

server/lib/rsa/prime.py 1 location

@@ 136-148 (lines=13) @@
133
    d = gcd(a, b)
134
    return (d == 1)
135
136
if __name__ == '__main__':
137
    print 'Running doctests 1000x or until failure'
138
    import doctest
139
140
    for count in range(1000):
141
        (failures, tests) = doctest.testmod()
142
        if failures:
143
            break
144
145
        if count and count % 100 == 0:
146
            print '%i times' % count
147
148
    print 'Doctests done'
149