"wuchangsheng (C)" <[email protected]> writes: > When we look into the realization of sm4 codes, we found that there is > no check of input ctx and key in sm4_set_encrypt_key and > sm4_set_decrypt_key, also the problem exist in sm4_crypt. So we wonder > if there is necessary to check if the input pointer is NULL. We would > like to hear your reply.
This is similar to other ciphers (and many other functions) in Nettle. There's no return value for reporting errors. When used corectly the functions can't fail, and if passed invalid pointers, including NULL, they will crash. > By the way, we are realizing sm2 in nettle, and as you known it's a > y^2 = x^3 + ax + b curve ,we wonder, if you are planning to provide > more ecc curves support, is there any plan to add a parameter 'a' in > struct ecc_curve ? It's possible to add more parameters to the internal struct ecc_curve as needed. Existing functions for point addition and duplication on Weierstrass curves are specialized to the case a = -3, so probably needs new code for other values. I imagine some of the variants with Jacobian coordinates (https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html) are appropriate. Choice also depends a on the value of a, if it's a special, small or large number. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance. _______________________________________________ nettle-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected]
