mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-07 00:46:17 +08:00
Conv from UTF-8 to ASCII
`file *.c` to see file types (ASCII or UTF-8), convert UTF-8 (with BOM) to ASCII ```sh sed '1s/^\xEF\xBB\xBF//' sm4.c | iconv -f UTF-8 -t ASCII//TRANSLIT > temp.c mv temp.c sm4.c ```
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
(uint64_t)(p)[7])
|
||||
|
||||
|
||||
// 注意:PUTU32(buf, val++) 会出错!
|
||||
// WARNING: must not write PUTU32(buf, val++)
|
||||
#define PUTU16(p,V) \
|
||||
((p)[0] = (uint8_t)((V) >> 8), \
|
||||
(p)[1] = (uint8_t)(V))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2014-2023 The GmSSL Project. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
|
||||
@@ -147,7 +147,7 @@ enum {
|
||||
OID_aes192_cbc,
|
||||
OID_aes256_cbc,
|
||||
|
||||
OID_aes128, // 没有OID
|
||||
OID_aes128, // No OID
|
||||
|
||||
OID_ecdsa_with_sha1,
|
||||
OID_ecdsa_with_sha224,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2014-2022 The GmSSL Project. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
@@ -34,7 +34,7 @@ PBKDF2-params ::= SEQUENCE {
|
||||
otherSource AlgorithmIdentifier {{PBKDF2-SaltSources}}
|
||||
},
|
||||
iterationCount INTEGER (1..MAX),
|
||||
keyLength INTEGER (1..MAX) OPTIONAL, -- 这个参数可以由函数指定
|
||||
keyLength INTEGER (1..MAX) OPTIONAL,
|
||||
prf AlgorithmIdentifier {{PBKDF2-PRFs}} DEFAULT algid-hmacWithSHA1
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2014-2024 The GmSSL Project. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
@@ -45,7 +45,7 @@ from RFC 5915
|
||||
|
||||
ECPrivateKey ::= SEQUENCE {
|
||||
version INTEGER, -- value MUST be (1)
|
||||
privateKey OCTET STRING, -- big endian encoding of integer 这里不是以INTEGER编码的,因此长度固定
|
||||
privateKey OCTET STRING, -- big endian encoding of integer, fixed length
|
||||
parameters [0] EXPLICIT ECParameters OPTIONAL,
|
||||
-- ONLY namedCurve OID is permitted, by RFC 5480
|
||||
-- MUST always include this field, by RFC 5915
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2014-2022 The GmSSL Project. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2014-2022 The GmSSL Project. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2014-2022 The GmSSL Project. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
|
||||
@@ -75,7 +75,7 @@ typedef enum {
|
||||
TLS_cipher_sm4_ccm_sm3 = 0x00c7,
|
||||
|
||||
// TLCP, GB/T 38636-2020, GM/T 0024-2012
|
||||
TLS_cipher_ecdhe_sm4_cbc_sm3 = 0xe011, // 可以让TLSv1.2使用这个
|
||||
TLS_cipher_ecdhe_sm4_cbc_sm3 = 0xe011, // TODO: let TLSv1.2 use this as default cipher suite
|
||||
TLS_cipher_ecdhe_sm4_gcm_sm3 = 0xe051,
|
||||
TLS_cipher_ecc_sm4_cbc_sm3 = 0xe013,
|
||||
TLS_cipher_ecc_sm4_gcm_sm3 = 0xe053,
|
||||
@@ -253,8 +253,6 @@ typedef enum {
|
||||
const char *tls_curve_type_name(int type);
|
||||
|
||||
|
||||
// 与其支持v2,还不如直接修改v2,让v2和v3兼容
|
||||
|
||||
typedef enum {
|
||||
TLS_curve_secp256k1 = 22,
|
||||
TLS_curve_secp256r1 = 23,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2014-2023 The GmSSL Project. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2014-2023 The GmSSL Project. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
|
||||
Reference in New Issue
Block a user