22 lines
465 B
Text
22 lines
465 B
Text
#include <pari/pari.h>
|
|
|
|
#define PARI_SECRET "s=\"Urer V nz\";Strchr(Vecsmall(apply(k->if(k>96&&k<123,(k-84)%26+97,if(k>64&&k<91,(k-52)%26+65,k)),Vec(Vecsmall(s)))))"
|
|
|
|
int Query(char *Data, size_t *Length)
|
|
{
|
|
int rc = 0;
|
|
GEN result;
|
|
|
|
pari_init(1000000, 2);
|
|
|
|
result = geval(strtoGENstr(PARI_SECRET)); /* solve the secret */
|
|
|
|
if (result) {
|
|
strncpy(Data, GSTR(result), *Length); /* return secret */
|
|
rc = 1;
|
|
}
|
|
|
|
pari_close();
|
|
|
|
return rc;
|
|
}
|