first step of v2 final release

This commit is contained in:
Zhi Guan
2017-11-05 21:00:36 +08:00
parent 480b9e8d88
commit 27bde477a5
395 changed files with 26341 additions and 31364 deletions

View File

@@ -15,8 +15,30 @@ import (
"unsafe"
)
func GetMacs(aliases bool) []string {
return []string{"hello", "world"}
func GetMacNames(aliases bool) []string {
return []string{
"HMAC-BLAKE2b512",
"HMAC-BLAKE2s256",
"HMAC-MD4",
"HMAC-MD5",
"HMAC-MD5-SHA1",
"HMAC-MDC2",
"HMAC-RIPEMD160",
"HMAC-rmd160",
"HMAC-SHA1",
"HMAC-SHA224",
"HMAC-SHA256",
"HMAC-SHA384",
"HMAC-SHA512",
"HMAC-SM3",
"HMAC-SHA1",
"HMAC-SHA224",
"HMAC-SHA256",
"HMAC-SHA384",
"HMAC-SHA512",
"HMAC-SM3",
"HMAC-whirlpool",
}
}
func GetMacKeyLength(name string) (int, error) {
@@ -31,7 +53,7 @@ type MACContext struct {
hctx *C.HMAC_CTX
}
func NewMACContext(name string, args map[string]string, key []byte) (*MACContext, error) {
func NewMACContext(name string, eng *Engine, key []byte) (*MACContext, error) {
cname := C.CString(name)
defer C.free(unsafe.Pointer(cname))
md := C.EVP_get_digestbyname(cname)