Skip to content

请教SM9实现上的一些细节问题(***from_hex类函数及SM9_Z256_HEX_SEP) #1824

@mentalfl0w

Description

@mentalfl0w

你好,在使用SM9系列函数的过程中,有几个疑问想咨询一下。

  1. sm9_z256_point_from_hexsm9_z256_twist_point_from_hex之类的函数,为何需要每64个HEX字符(即转化后32个字节)插入一个SM9_Z256_HEX_SEP?为何不直接处理64个字符呢?我看国标中似乎没有写。
  2. sm9_z256_point_from_hex的输入参数有const char hex[64 * 4 + 3]64 * 4是点参数的HEX形式,3是3个SM9_Z256_HEX_SEP 但如果用户真的按照这样来设定字符串的大小就会用掉字符串结尾的\0,导致一些C语言字符串处理函数如strlen等工作不正常,建议多加1位,方便入门用户知晓需要多大的存储空间(同理sm9_z256_point_from_hex也存在这一情况)。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions