Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Generic discrete_log

I've been struggling with discrete_log function. The docs say it is the generic BSGS algorithm that is supposed to work in any group. The function works e.g. if I write

discrete_log(Mod(9, 17), Mod(2, 17), 16, operation='*')

However it keeps returning 0 when I put operation='other', e.g.

discrete_log(9, 2, 16, operation='other', op=lambda x, y: (x * y) % 17)

The op function is not even called once. Is there something that I'm doing wrong or is discrete_log not really generic?

click to hide/show revision 2
retagged

Generic discrete_log

I've been struggling with discrete_log function. The docs say it is the generic BSGS algorithm that is supposed to work in any group. The function works e.g. if I write

discrete_log(Mod(9, 17), Mod(2, 17), 16, operation='*')

However it keeps returning 0 when I put operation='other', e.g.

discrete_log(9, 2, 16, operation='other', op=lambda x, y: (x * y) % 17)

The op function is not even called once. Is there something that I'm doing wrong or is discrete_log not really generic?