| 1 | #cxx . . $ `<file>/ref10/crypto_sign/open.c`/include <string.h> |
| 2 | #include "crypto_sign.h"cxx . . $ `<file>/ref10/crypto_sign/crypto_sign.h`/ |
| 3 | #include "crypto_hash_sha512.h"cxx . . $ `<file>/ref10/crypto_hash/crypto_hash_sha512.h`/ |
| 4 | #include "crypto_verify_32.h"cxx . . $ `<file>/ref10/crypto_verify/crypto_verify_32.h`/ |
| 5 | #include "ge.h"cxx . . $ `<file>/ref10/crypto_sign/ge.h`/ |
| 6 | #include "sc.h"cxx . . $ `<file>/ref10/crypto_sign/sc.h`/ |
| 7 | |
| 8 | int crypto_sign_opencxx . . $ `ref10/crypto_sign/crypto_sign.h:7:9`!( |
| 9 | unsigned char *m,unsigned long long *mlen, |
| 10 | const unsigned char *sm,unsigned long long smlen, |
| 11 | const unsigned char *pk |
| 12 | ) |
| 13 | { |
| 14 | unsigned char pkcopy[32]; |
| 15 | unsigned char rcopy[32]; |
| 16 | unsigned char scopy[32]; |
| 17 | unsigned char h[64]; |
| 18 | unsigned char rcheck[32]; |
| 19 | ge_p3cxx . . $ ge_p3# A; |
| 20 | ge_p2cxx . . $ ge_p2# R; |
| 21 | |
| 22 | if (smlen < 64) goto badsig; |
| 23 | if (sm[63] & 224) goto badsig; |
| 24 | if (ge_frombytes_negate_vartimecxx . . $ `ref10/crypto_sign/ge.h:55:9`!(&A,pk) != 0) goto badsig; |
| 25 | |
| 26 | memmovecxx . . $ memmove(cc817cb175f282d).(pkcopy,pk,32); |
| 27 | memmovecxx . . $ memmove(cc817cb175f282d).(rcopy,sm,32); |
| 28 | memmovecxx . . $ memmove(cc817cb175f282d).(scopy,sm + 32,32); |
| 29 | |
| 30 | memmovecxx . . $ memmove(cc817cb175f282d).(m,sm,smlen); |
| 31 | memmovecxx . . $ memmove(cc817cb175f282d).(m + 32,pkcopy,32); |
| 32 | crypto_hash_sha512cxx . . $ `ref10/crypto_hash/crypto_hash_sha512.h:16:9`!(h,m,smlen); |
| 33 | sc_reducecxx . . $ `ref10/crypto_sign/sc.h:11:9`!(h); |
| 34 | |
| 35 | ge_double_scalarmult_vartimecxx . . $ `ref10/crypto_sign/ge.h:74:9`!(&R,h,&A,scopy); |
| 36 | ge_tobytescxx . . $ `ref10/crypto_sign/ge.h:56:9`!(rcheck,&R); |
| 37 | if (crypto_verify_32cxx . . $ `ref10/crypto_verify/crypto_verify_32.h:16:9`!(rcheck,rcopy) == 0) { |
| 38 | memmovecxx . . $ memmove(cc817cb175f282d).(m,m + 64,smlen - 64); |
| 39 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(m + smlen - 64,0,64); |
| 40 | *mlen = smlen - 64; |
| 41 | return 0; |
| 42 | } |
| 43 | |
| 44 | badsig: |
| 45 | *mlen = -1; |
| 46 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(m,0,smlen); |
| 47 | return -1; |
| 48 | } |