gmsm icon indicating copy to clipboard operation
gmsm copied to clipboard

ShangMi (SM) cipher suites for golang (Go语言商用密码软件)

Results 9 gmsm issues
Sort by recently updated
recently updated
newest added

1. change interface{} to any gofmt -w -r 'interface{} -> any' ./... 1. remove "+build" tag go fix -fix=buildtag

enhancement

https://github.com/golang/go/commit/2de2f6df64a8fff36fe9752f893a7cfff4590762 Adds a new, cryptobyte based, CRL parser, which returns a x509.RevocaitonList, rather than a pkix.CertificateList. This allows us to return much more detailed information, as well as leaving open...

sync sdk

这个语言特性是**golang 1.17**引入的,目前只能用以下代码代替: ```golang // toElementArray, convert slice of bytes to pointer to [32]byte. // This function is required for low version of golang, can type cast directly // since golang...

enhancement

amd64/arm64使用指针: ```golang //go:noescape func xorBytes(dst, a, b *byte, n int) ``` 而generic实现使用切片: ```golang // fastXORBytes xors in bulk. It only works on architectures that // support unaligned read/writes. // n...

enhancement

以下是一个含有扩展填充2个字节0x00的ASN1 SM2 加密密文 C1C3C2 ``` 3081980220298ED52AE2A0EBA8B7567D54DF41C5F9B310EDFA4A8E15ECCB44EDA94F9F1FC20220116BE33B0833C95D8E5FF9483CD2D7EFF7033C92FE5DEAB6197D809FF1EEE05F042097A90979A6FCEBDE883C2E07E9C286818E694EDE37C3CDAA70E4CD481BE883E00430D62160BB179CB20CE3B5ECA0F5A535BEB6E221566C78FEA92105F71BD37F3F850AD2F86F2D1E35F15E9356557DAC026A0000 ``` ![image](https://user-images.githubusercontent.com/17817790/198237073-756c36f5-7b65-4bde-be6f-d54082f439db.png) ASN1 是 TLV - Tag - Lenght - Value 的方式,理论上来说应该能够解析上述密文,忽略额外填充的0x00 目前该密文在使用在解析时 https://github.com/emmansun/gmsm/blob/9ba3e69efc44cd27ec5f70dd5980131dcf1e8ad2/sm2/sm2.go#L452-L469 将会出现错误 **sm2: invalid asn1 format ciphertext"** 在TLCP应用过程中我发现由于厂家不规范这样的问题频出,作者是否考虑 放宽对格式的校验?

Creates x509.RevocationListEntry, a new type representing a single revoked certificate entry in a CRL. Like the existing Certificate and RevocationList types, this new type has a field for its Raw...

sync sdk

This specifically doesn't add support for X25519 certificates. Refactored parsePublicKey not to depend on the public PublicKeyAlgorithm values, and ParseCertificate/ParseCertificateRequest to ignore keys that don't have a PublicKeyAlgorithm even if...

sync sdk

crypto/x509: introduce new robust OID type & use it for certificate policies

sync sdk

共享哈希Z的中间结果 https://github.com/emmansun/gmsm/wiki/SM2%E5%8A%A0%E8%A7%A3%E5%AF%86%E6%80%A7%E8%83%BD

enhancement