README: c/openssl

This commit is contained in:
xushiwei
2024-07-30 21:56:19 +08:00
parent 1bc7e5e0a5
commit ee3d11cb53
5 changed files with 68 additions and 31 deletions

View File

@@ -218,6 +218,7 @@ The currently supported libraries include:
* [c/llama2](https://pkg.go.dev/github.com/goplus/llgo/c/llama2)
* [c/lua](https://pkg.go.dev/github.com/goplus/llgo/c/lua)
* [c/neco](https://pkg.go.dev/github.com/goplus/llgo/c/neco)
* [c/openssl](https://pkg.go.dev/github.com/goplus/llgo/c/openssl)
* [c/raylib](https://pkg.go.dev/github.com/goplus/llgo/c/raylib)
* [c/sqlite](https://pkg.go.dev/github.com/goplus/llgo/c/sqlite)
* [c/zlib](https://pkg.go.dev/github.com/goplus/llgo/c/zlib)

View File

@@ -1,31 +0,0 @@
package openssl
import "github.com/goplus/llgo/c"
const (
SHA_DIGEST_LENGTH = 20
SHA_LBLOCK = 16
SHA_CBLOCK = (SHA_LBLOCK * 4)
SHA_LAST_BLOCK = (SHA_CBLOCK - 8)
SHA256_CBLOCK = (SHA_LBLOCK * 4)
SHA256_192_DIGEST_LENGTH = 24
SHA224_DIGEST_LENGTH = 28
SHA256_DIGEST_LENGTH = 32
SHA384_DIGEST_LENGTH = 48
SHA512_DIGEST_LENGTH = 64
SHA512_CBLOCK = (SHA_LBLOCK * 8)
)
/*
# if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
# define SHA_LONG64 unsigned __int64
# elif defined(__arch64__)
# define SHA_LONG64 unsigned long
# else
# define SHA_LONG64 unsigned long long
# endif
*/
type SHA_LONG64 = c.UlongLong
type SHA_LONG = c.Uint

View File

@@ -1,3 +1,19 @@
/*
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package openssl
import (
@@ -6,6 +22,25 @@ import (
"github.com/goplus/llgo/c"
)
const (
SHA_DIGEST_LENGTH = 20
SHA_LBLOCK = 16
SHA_CBLOCK = (SHA_LBLOCK * 4)
SHA_LAST_BLOCK = (SHA_CBLOCK - 8)
SHA256_CBLOCK = (SHA_LBLOCK * 4)
SHA256_192_DIGEST_LENGTH = 24
SHA224_DIGEST_LENGTH = 28
SHA256_DIGEST_LENGTH = 32
SHA384_DIGEST_LENGTH = 48
SHA512_DIGEST_LENGTH = 64
SHA512_CBLOCK = (SHA_LBLOCK * 8)
)
type SHA_LONG64 = c.UlongLong
type SHA_LONG = c.Uint
type SHA_CTX struct {
H0, H1, H2, H3, H4 SHA_LONG
Nl, Nh SHA_LONG

View File

@@ -1,3 +1,19 @@
/*
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package openssl
import (

View File

@@ -1,3 +1,19 @@
/*
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package openssl
import (