mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-23 23:11:58 -04:00
Update WolfSSL library to the latest version.
This commit is contained in:
parent
8af1ad9bac
commit
5a6242fbd0
45
FreeRTOS-Plus/Source/WolfSSL/INSTALL
Normal file
45
FreeRTOS-Plus/Source/WolfSSL/INSTALL
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
0. Building on *nix from git repository
|
||||||
|
|
||||||
|
Run the autogen script to generate configure, you'll need the autoconf tools
|
||||||
|
installed, then proceed to step 1.
|
||||||
|
|
||||||
|
$ ./autogen.sh
|
||||||
|
|
||||||
|
1. Building on *nix from a release
|
||||||
|
|
||||||
|
$ ./configure
|
||||||
|
$ make
|
||||||
|
$ make check # (optional, but highly recommended)
|
||||||
|
$ sudo make install
|
||||||
|
|
||||||
|
2. Building on iOS
|
||||||
|
|
||||||
|
Use on the xcode project in IDE/iOS/wolfssl.xcodeproj
|
||||||
|
There is a README in IDE/iOS with more information
|
||||||
|
|
||||||
|
3. Building on Windows
|
||||||
|
|
||||||
|
Use the 32bit Visual Studio Solution wolfssl.sln
|
||||||
|
For a 64bit solution please use wolfssl64.sln
|
||||||
|
|
||||||
|
4. Building with IAR
|
||||||
|
|
||||||
|
Please see the README in IDE/IAR-EWARM for detailed instructions
|
||||||
|
|
||||||
|
5. Building with Keil
|
||||||
|
|
||||||
|
Please see the Keil Projects in IDE/MDK5-ARM/Projects
|
||||||
|
|
||||||
|
6. Building with Microchip tools
|
||||||
|
|
||||||
|
Please see the README in mplabx
|
||||||
|
|
||||||
|
7. Building with Freescale MQX
|
||||||
|
|
||||||
|
Please see the README in mqx
|
||||||
|
|
||||||
|
8. Porting to a new platform
|
||||||
|
|
||||||
|
Please see section 2.4 in the manual:
|
||||||
|
http://www.wolfssl.com/yaSSL/Docs-cyassl-manual-2-building-cyassl.html
|
||||||
|
|
11
FreeRTOS-Plus/Source/WolfSSL/LICENSING
Normal file
11
FreeRTOS-Plus/Source/WolfSSL/LICENSING
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
CyaSSL and wolfCrypt are either licensed for use under the GPLv2 or a
|
||||||
|
standard commercial license. For our users who cannot use CyaSSL under
|
||||||
|
GPLv2, a commercial license to CyaSSL and wolfCrypt is available.
|
||||||
|
Please contact wolfSSL Inc. directly at:
|
||||||
|
|
||||||
|
Email: licensing@wolfssl.com
|
||||||
|
Phone: +1 425 245-8247
|
||||||
|
|
||||||
|
More information can be found on the wolfSSL website at www.wolfssl.com.
|
||||||
|
|
1194
FreeRTOS-Plus/Source/WolfSSL/README.md
Normal file
1194
FreeRTOS-Plus/Source/WolfSSL/README.md
Normal file
File diff suppressed because it is too large
Load diff
Binary file not shown.
|
@ -1,13 +1,13 @@
|
||||||
Certificate:
|
Certificate:
|
||||||
Data:
|
Data:
|
||||||
Version: 3 (0x2)
|
Version: 3 (0x2)
|
||||||
Serial Number: 10163970144298616102 (0x8d0dacfec6984526)
|
Serial Number: 16417767964199037690 (0xe3d7a0fa76df2afa)
|
||||||
Signature Algorithm: sha1WithRSAEncryption
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
Issuer: C=US, ST=Oregon, L=Portland, O=yaSSL, OU=Programming, CN=www.yassl.com/emailAddress=info@yassl.com
|
Issuer: C=US, ST=Montana, L=Bozeman, O=wolfSSL_1024, OU=Programming-1024, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Validity
|
Validity
|
||||||
Not Before: Jan 18 21:42:49 2013 GMT
|
Not Before: May 7 18:21:01 2015 GMT
|
||||||
Not After : Oct 15 21:42:49 2015 GMT
|
Not After : Jan 31 18:21:01 2018 GMT
|
||||||
Subject: C=US, ST=Oregon, L=Portland, O=yaSSL, OU=Programming, CN=www.yassl.com/emailAddress=info@yassl.com
|
Subject: C=US, ST=Montana, L=Bozeman, O=wolfSSL_1024, OU=Programming-1024, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Subject Public Key Info:
|
Subject Public Key Info:
|
||||||
Public Key Algorithm: rsaEncryption
|
Public Key Algorithm: rsaEncryption
|
||||||
Public-Key: (1024 bit)
|
Public-Key: (1024 bit)
|
||||||
|
@ -27,33 +27,40 @@ Certificate:
|
||||||
81:69:0F:F8:DF:DD:CF:34:29:D5:67:75:71:85:C7:75:10:69:59:EC
|
81:69:0F:F8:DF:DD:CF:34:29:D5:67:75:71:85:C7:75:10:69:59:EC
|
||||||
X509v3 Authority Key Identifier:
|
X509v3 Authority Key Identifier:
|
||||||
keyid:81:69:0F:F8:DF:DD:CF:34:29:D5:67:75:71:85:C7:75:10:69:59:EC
|
keyid:81:69:0F:F8:DF:DD:CF:34:29:D5:67:75:71:85:C7:75:10:69:59:EC
|
||||||
|
DirName:/C=US/ST=Montana/L=Bozeman/O=wolfSSL_1024/OU=Programming-1024/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
|
serial:E3:D7:A0:FA:76:DF:2A:FA
|
||||||
|
|
||||||
X509v3 Basic Constraints:
|
X509v3 Basic Constraints:
|
||||||
CA:TRUE
|
CA:TRUE
|
||||||
Signature Algorithm: sha1WithRSAEncryption
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
72:66:0f:6a:a1:85:95:06:e6:87:1a:ed:2b:da:ed:84:90:89:
|
1d:b7:d5:7c:e1:b1:d8:c0:67:5d:b5:d3:88:e7:50:29:71:63:
|
||||||
a6:31:4d:60:f2:7b:63:0c:dc:9b:44:4c:d6:62:41:24:74:30:
|
8f:cc:26:1f:33:09:55:43:9b:ab:c6:1b:bc:c7:01:95:1a:fa:
|
||||||
70:4e:07:10:05:12:5e:14:b3:dd:cf:58:27:93:cf:aa:4f:85:
|
65:e0:fd:9c:eb:6f:0a:0f:14:ec:b5:2f:dc:1c:30:dd:52:97:
|
||||||
2c:35:0e:ff:5b:a8:6b:b5:95:32:d5:cc:73:68:5b:1b:c4:f8:
|
d4:1c:09:00:33:38:5f:cb:a8:16:8f:11:b7:b8:d0:66:e1:54:
|
||||||
89:5e:3d:f8:02:39:32:7d:06:a4:32:e9:b3:ef:62:a0:43:5d:
|
28:f3:3f:bf:6a:6f:76:48:2a:5e:56:a7:ce:1c:f0:04:dd:17:
|
||||||
4f:fb:ce:3d:08:33:af:3d:7f:12:cb:8a:5a:c2:63:db:3e:dd:
|
bd:06:78:21:6d:d6:b1:9b:75:31:92:c1:fe:d4:8d:d4:67:2f:
|
||||||
ea:5b:67:10:49:9f:5b:96:1b:4e:5d:bc:4e:9a:7c:1f:ab:56:
|
03:1b:27:8d:ab:ff:30:3b:c3:7f:23:e4:ab:5b:91:e1:1b:66:
|
||||||
47:4a
|
e6:ed
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIIC7DCCAlWgAwIBAgIJAI0NrP7GmEUmMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYD
|
MIIDxTCCAy6gAwIBAgIJAOPXoPp23yr6MA0GCSqGSIb3DQEBCwUAMIGeMQswCQYD
|
||||||
VQQGEwJVUzEPMA0GA1UECAwGT3JlZ29uMREwDwYDVQQHDAhQb3J0bGFuZDEOMAwG
|
VQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjEVMBMG
|
||||||
A1UECgwFeWFTU0wxFDASBgNVBAsMC1Byb2dyYW1taW5nMRYwFAYDVQQDDA13d3cu
|
A1UECgwMd29sZlNTTF8xMDI0MRkwFwYDVQQLDBBQcm9ncmFtbWluZy0xMDI0MRgw
|
||||||
eWFzc2wuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0xMzAx
|
FgYDVQQDDA93d3cud29sZnNzbC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29s
|
||||||
MTgyMTQyNDlaFw0xNTEwMTUyMTQyNDlaMIGOMQswCQYDVQQGEwJVUzEPMA0GA1UE
|
ZnNzbC5jb20wHhcNMTUwNTA3MTgyMTAxWhcNMTgwMTMxMTgyMTAxWjCBnjELMAkG
|
||||||
CAwGT3JlZ29uMREwDwYDVQQHDAhQb3J0bGFuZDEOMAwGA1UECgwFeWFTU0wxFDAS
|
A1UEBhMCVVMxEDAOBgNVBAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xFTAT
|
||||||
BgNVBAsMC1Byb2dyYW1taW5nMRYwFAYDVQQDDA13d3cueWFzc2wuY29tMR0wGwYJ
|
BgNVBAoMDHdvbGZTU0xfMTAyNDEZMBcGA1UECwwQUHJvZ3JhbW1pbmctMTAyNDEY
|
||||||
KoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
|
MBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdv
|
||||||
gYkCgYEAvHMOqEnzdKKp7xil2lWZIfnI7LNtSOU1NXV3N+zRYZBfPtnk1d+UysGp
|
bGZzc2wuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8cw6oSfN0oqnv
|
||||||
1xnahsnoTcRhNoL+q61+dyW7jRGlvGI6qDjMOaIEZrT39/Oq2k0CDrtejWlI3HfJ
|
GKXaVZkh+cjss21I5TU1dXc37NFhkF8+2eTV35TKwanXGdqGyehNxGE2gv6rrX53
|
||||||
KA4i6WukJrpM6MH9Sm8rH++KrvaQYuVkHusrPGfI3CcA9pFoZakCAwEAAaNQME4w
|
JbuNEaW8YjqoOMw5ogRmtPf386raTQIOu16NaUjcd8koDiLpa6Qmukzowf1Kbysf
|
||||||
HQYDVR0OBBYEFIFpD/jf3c80KdVndXGFx3UQaVnsMB8GA1UdIwQYMBaAFIFpD/jf
|
74qu9pBi5WQe6ys8Z8jcJwD2kWhlqQIDAQABo4IBBzCCAQMwHQYDVR0OBBYEFIFp
|
||||||
3c80KdVndXGFx3UQaVnsMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEA
|
D/jf3c80KdVndXGFx3UQaVnsMIHTBgNVHSMEgcswgciAFIFpD/jf3c80KdVndXGF
|
||||||
cmYPaqGFlQbmhxrtK9rthJCJpjFNYPJ7Ywzcm0RM1mJBJHQwcE4HEAUSXhSz3c9Y
|
x3UQaVnsoYGkpIGhMIGeMQswCQYDVQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQ
|
||||||
J5PPqk+FLDUO/1uoa7WVMtXMc2hbG8T4iV49+AI5Mn0GpDLps+9ioENdT/vOPQgz
|
MA4GA1UEBwwHQm96ZW1hbjEVMBMGA1UECgwMd29sZlNTTF8xMDI0MRkwFwYDVQQL
|
||||||
rz1/EsuKWsJj2z7d6ltnEEmfW5YbTl28Tpp8H6tWR0o=
|
DBBQcm9ncmFtbWluZy0xMDI0MRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20xHzAd
|
||||||
|
BgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb22CCQDj16D6dt8q+jAMBgNVHRME
|
||||||
|
BTADAQH/MA0GCSqGSIb3DQEBCwUAA4GBAB231XzhsdjAZ12104jnUClxY4/MJh8z
|
||||||
|
CVVDm6vGG7zHAZUa+mXg/ZzrbwoPFOy1L9wcMN1Sl9QcCQAzOF/LqBaPEbe40Gbh
|
||||||
|
VCjzP79qb3ZIKl5Wp84c8ATdF70GeCFt1rGbdTGSwf7UjdRnLwMbJ42r/zA7w38j
|
||||||
|
5KtbkeEbZubt
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
|
|
Binary file not shown.
|
@ -1,40 +1,12 @@
|
||||||
-----BEGIN CERTIFICATE-----
|
|
||||||
MIIEqjCCA5KgAwIBAgIJAJpBR82hFGKMMA0GCSqGSIb3DQEBBQUAMIGUMQswCQYD
|
|
||||||
VQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8G
|
|
||||||
A1UECgwIU2F3dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3
|
|
||||||
dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTAe
|
|
||||||
Fw0xNDA3MTEwMzIwMDhaFw0xNzA0MDYwMzIwMDhaMIGUMQswCQYDVQQGEwJVUzEQ
|
|
||||||
MA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8GA1UECgwIU2F3
|
|
||||||
dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3dy53b2xmc3Ns
|
|
||||||
LmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZI
|
|
||||||
hvcNAQEBBQADggEPADCCAQoCggEBAL8Myi0Ush6EQlvNOB9K8k11EPG2NZ/fyn0D
|
|
||||||
mNOs3gNm7irx2LB9bgdUCxCYIU2AyxIg58xP3kV9yXJ3MurKkLtpUhADL6jzlcXx
|
|
||||||
i2JWG+9nb6QQQZWtCpvjpcCw0nB2UDBbqOgILHztp6J6jTgpHKzH7fJ8lbCVgn1J
|
|
||||||
XDjNdyXvvYB1U5Q8PcpjW58VtdMdEy8Z0TzbdjrMuH3J5cLX2kBv2CHccxtCLVOc
|
|
||||||
/hr8fat6Nj+Y3oR8BWfOahQ4h6nxjLVoy2h/cSAr9aBj9VYvoybSt2+xWhfXOJkI
|
|
||||||
/pNYb/7DE0kIFgunTWcAUjFnI06Y7VFFHbkE2Qvs2CizS73tNnkCAwEAAaOB/DCB
|
|
||||||
+TAdBgNVHQ4EFgQUJ45nEXTDJh0/7TNjs6TYHTDl6NUwgckGA1UdIwSBwTCBvoAU
|
|
||||||
J45nEXTDJh0/7TNjs6TYHTDl6NWhgZqkgZcwgZQxCzAJBgNVBAYTAlVTMRAwDgYD
|
|
||||||
VQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMREwDwYDVQQKDAhTYXd0b290
|
|
||||||
aDETMBEGA1UECwwKQ29uc3VsdGluZzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29t
|
|
||||||
MR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tggkAmkFHzaEUYowwDAYD
|
|
||||||
VR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAeXgMbXmIkfw6FZz5J2IW8CEf
|
|
||||||
+n0/oqgyHvfyEal0FnRe3BjK8AAq1QMGJjDxR4P9Mm787apPfQxjYDEvfAy/mWaH
|
|
||||||
7ScIhi3EM+iYIxz+o9uaSU78WkLvccM/rdxKqNKjHQmsMwR7hvNtAFmjyNvRPHP2
|
|
||||||
DpDWXkngvzZjCHulsI81O1aMETVJBBzQ57pWxQ0KkY3Wt2IZNBJSTNJtfMU9DxiB
|
|
||||||
VMv2POWE0tZxFewaNAvwoCF0Q8ijsN/ZZ9rirZNI+KCHvXkU4GIK3/cxLjF70TIq
|
|
||||||
Cv5dFO/ZZFDkg5G8cA3XiI3ZvIQOxRqzv2QCTlGRpKKFFYOv8FubKElfsrMD2A==
|
|
||||||
-----END CERTIFICATE-----
|
|
||||||
Certificate:
|
Certificate:
|
||||||
Data:
|
Data:
|
||||||
Version: 3 (0x2)
|
Version: 3 (0x2)
|
||||||
Serial Number:
|
Serial Number: 15672591315981621815 (0xd9803ac3d2f4da37)
|
||||||
9a:41:47:cd:a1:14:62:8c
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
Signature Algorithm: sha1WithRSAEncryption
|
|
||||||
Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Validity
|
Validity
|
||||||
Not Before: Jul 11 03:20:08 2014 GMT
|
Not Before: May 7 18:21:01 2015 GMT
|
||||||
Not After : Apr 6 03:20:08 2017 GMT
|
Not After : Jan 31 18:21:01 2018 GMT
|
||||||
Subject: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
Subject: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Subject Public Key Info:
|
Subject Public Key Info:
|
||||||
Public Key Algorithm: rsaEncryption
|
Public Key Algorithm: rsaEncryption
|
||||||
|
@ -65,23 +37,50 @@ Certificate:
|
||||||
X509v3 Authority Key Identifier:
|
X509v3 Authority Key Identifier:
|
||||||
keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
|
keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
|
||||||
DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
serial:9A:41:47:CD:A1:14:62:8C
|
serial:D9:80:3A:C3:D2:F4:DA:37
|
||||||
|
|
||||||
X509v3 Basic Constraints:
|
X509v3 Basic Constraints:
|
||||||
CA:TRUE
|
CA:TRUE
|
||||||
Signature Algorithm: sha1WithRSAEncryption
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
79:78:0c:6d:79:88:91:fc:3a:15:9c:f9:27:62:16:f0:21:1f:
|
7a:af:44:3b:aa:6f:53:42:b2:33:aa:43:5f:56:30:d3:b9:96:
|
||||||
fa:7d:3f:a2:a8:32:1e:f7:f2:11:a9:74:16:74:5e:dc:18:ca:
|
0b:9a:55:5a:39:2a:0b:4e:e4:2e:f1:95:66:c9:86:36:82:8d:
|
||||||
f0:00:2a:d5:03:06:26:30:f1:47:83:fd:32:6e:fc:ed:aa:4f:
|
63:7c:4d:a2:ee:48:ba:03:c7:90:d7:a7:c6:74:60:48:5f:31:
|
||||||
7d:0c:63:60:31:2f:7c:0c:bf:99:66:87:ed:27:08:86:2d:c4:
|
a2:f9:5e:3e:c3:82:e1:e5:2f:41:81:83:29:25:79:d1:53:00:
|
||||||
33:e8:98:23:1c:fe:a3:db:9a:49:4e:fc:5a:42:ef:71:c3:3f:
|
69:3c:ed:0a:30:3b:41:1d:92:a1:2c:a8:9d:2c:e3:23:87:79:
|
||||||
ad:dc:4a:a8:d2:a3:1d:09:ac:33:04:7b:86:f3:6d:00:59:a3:
|
e0:55:6e:91:a8:50:da:46:2f:c2:20:50:3e:2b:47:97:14:b0:
|
||||||
c8:db:d1:3c:73:f6:0e:90:d6:5e:49:e0:bf:36:63:08:7b:a5:
|
7d:04:ba:45:51:d0:6e:e1:5a:a2:4b:84:9c:4d:cd:85:04:f9:
|
||||||
b0:8f:35:3b:56:8c:11:35:49:04:1c:d0:e7:ba:56:c5:0d:0a:
|
28:31:82:93:bc:c7:59:49:91:03:e8:df:6a:e4:56:ad:6a:cb:
|
||||||
91:8d:d6:b7:62:19:34:12:52:4c:d2:6d:7c:c5:3d:0f:18:81:
|
1f:0d:37:e4:5e:bd:e7:9f:d5:ec:9d:3c:18:25:9b:f1:2f:50:
|
||||||
54:cb:f6:3c:e5:84:d2:d6:71:15:ec:1a:34:0b:f0:a0:21:74:
|
7d:eb:31:cb:f1:63:22:9d:57:fc:f3:84:20:1a:c6:07:87:92:
|
||||||
43:c8:a3:b0:df:d9:67:da:e2:ad:93:48:f8:a0:87:bd:79:14:
|
26:9e:15:18:59:33:06:dc:fb:b0:b6:76:5d:f1:c1:2f:c8:2f:
|
||||||
e0:62:0a:df:f7:31:2e:31:7b:d1:32:2a:0a:fe:5d:14:ef:d9:
|
62:9c:c0:d6:de:eb:65:77:f3:5c:a6:c3:88:27:96:75:b4:f4:
|
||||||
64:50:e4:83:91:bc:70:0d:d7:88:8d:d9:bc:84:0e:c5:1a:b3:
|
54:cd:ff:2d:21:2e:96:f0:07:73:4b:e9:93:92:90:de:62:d9:
|
||||||
bf:64:02:4e:51:91:a4:a2:85:15:83:af:f0:5b:9b:28:49:5f:
|
a3:3b:ac:6e:24:5f:27:4a:b3:94:70:ff:30:17:e7:7e:32:8f:
|
||||||
b2:b3:03:d8
|
65:b7:75:58
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIEqjCCA5KgAwIBAgIJANmAOsPS9No3MA0GCSqGSIb3DQEBCwUAMIGUMQswCQYD
|
||||||
|
VQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8G
|
||||||
|
A1UECgwIU2F3dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3
|
||||||
|
dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTAe
|
||||||
|
Fw0xNTA1MDcxODIxMDFaFw0xODAxMzExODIxMDFaMIGUMQswCQYDVQQGEwJVUzEQ
|
||||||
|
MA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8GA1UECgwIU2F3
|
||||||
|
dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3dy53b2xmc3Ns
|
||||||
|
LmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZI
|
||||||
|
hvcNAQEBBQADggEPADCCAQoCggEBAL8Myi0Ush6EQlvNOB9K8k11EPG2NZ/fyn0D
|
||||||
|
mNOs3gNm7irx2LB9bgdUCxCYIU2AyxIg58xP3kV9yXJ3MurKkLtpUhADL6jzlcXx
|
||||||
|
i2JWG+9nb6QQQZWtCpvjpcCw0nB2UDBbqOgILHztp6J6jTgpHKzH7fJ8lbCVgn1J
|
||||||
|
XDjNdyXvvYB1U5Q8PcpjW58VtdMdEy8Z0TzbdjrMuH3J5cLX2kBv2CHccxtCLVOc
|
||||||
|
/hr8fat6Nj+Y3oR8BWfOahQ4h6nxjLVoy2h/cSAr9aBj9VYvoybSt2+xWhfXOJkI
|
||||||
|
/pNYb/7DE0kIFgunTWcAUjFnI06Y7VFFHbkE2Qvs2CizS73tNnkCAwEAAaOB/DCB
|
||||||
|
+TAdBgNVHQ4EFgQUJ45nEXTDJh0/7TNjs6TYHTDl6NUwgckGA1UdIwSBwTCBvoAU
|
||||||
|
J45nEXTDJh0/7TNjs6TYHTDl6NWhgZqkgZcwgZQxCzAJBgNVBAYTAlVTMRAwDgYD
|
||||||
|
VQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMREwDwYDVQQKDAhTYXd0b290
|
||||||
|
aDETMBEGA1UECwwKQ29uc3VsdGluZzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29t
|
||||||
|
MR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tggkA2YA6w9L02jcwDAYD
|
||||||
|
VR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAeq9EO6pvU0KyM6pDX1Yw07mW
|
||||||
|
C5pVWjkqC07kLvGVZsmGNoKNY3xNou5IugPHkNenxnRgSF8xovlePsOC4eUvQYGD
|
||||||
|
KSV50VMAaTztCjA7QR2SoSyonSzjI4d54FVukahQ2kYvwiBQPitHlxSwfQS6RVHQ
|
||||||
|
buFaokuEnE3NhQT5KDGCk7zHWUmRA+jfauRWrWrLHw035F6955/V7J08GCWb8S9Q
|
||||||
|
fesxy/FjIp1X/POEIBrGB4eSJp4VGFkzBtz7sLZ2XfHBL8gvYpzA1t7rZXfzXKbD
|
||||||
|
iCeWdbT0VM3/LSEulvAHc0vpk5KQ3mLZozusbiRfJ0qzlHD/MBfnfjKPZbd1WA==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
Binary file not shown.
|
@ -1,14 +1,13 @@
|
||||||
Certificate:
|
Certificate:
|
||||||
Data:
|
Data:
|
||||||
Version: 3 (0x2)
|
Version: 3 (0x2)
|
||||||
Serial Number:
|
Serial Number: 12260966172072242701 (0xaa27b3c5a9726e0d)
|
||||||
b6:63:af:8f:5d:62:57:a0
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
Signature Algorithm: sha1WithRSAEncryption
|
Issuer: C=US, ST=Montana, L=Bozeman, O=wolfSSL_2048, OU=Programming-2048, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Issuer: C=US, ST=Montana, L=Bozeman, O=wolfSSL, OU=Programming, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
|
||||||
Validity
|
Validity
|
||||||
Not Before: Jul 11 17:39:44 2014 GMT
|
Not Before: May 7 18:21:01 2015 GMT
|
||||||
Not After : Apr 6 17:39:44 2017 GMT
|
Not After : Jan 31 18:21:01 2018 GMT
|
||||||
Subject: C=US, ST=Montana, L=Bozeman, O=wolfSSL, OU=Programming, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
Subject: C=US, ST=Montana, L=Bozeman, O=wolfSSL_2048, OU=Programming-2048, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Subject Public Key Info:
|
Subject Public Key Info:
|
||||||
Public Key Algorithm: rsaEncryption
|
Public Key Algorithm: rsaEncryption
|
||||||
Public-Key: (2048 bit)
|
Public-Key: (2048 bit)
|
||||||
|
@ -37,51 +36,52 @@ Certificate:
|
||||||
33:D8:45:66:D7:68:87:18:7E:54:0D:70:27:91:C7:26:D7:85:65:C0
|
33:D8:45:66:D7:68:87:18:7E:54:0D:70:27:91:C7:26:D7:85:65:C0
|
||||||
X509v3 Authority Key Identifier:
|
X509v3 Authority Key Identifier:
|
||||||
keyid:33:D8:45:66:D7:68:87:18:7E:54:0D:70:27:91:C7:26:D7:85:65:C0
|
keyid:33:D8:45:66:D7:68:87:18:7E:54:0D:70:27:91:C7:26:D7:85:65:C0
|
||||||
DirName:/C=US/ST=Montana/L=Bozeman/O=wolfSSL/OU=Programming/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
DirName:/C=US/ST=Montana/L=Bozeman/O=wolfSSL_2048/OU=Programming-2048/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
serial:B6:63:AF:8F:5D:62:57:A0
|
serial:AA:27:B3:C5:A9:72:6E:0D
|
||||||
|
|
||||||
X509v3 Basic Constraints:
|
X509v3 Basic Constraints:
|
||||||
CA:TRUE
|
CA:TRUE
|
||||||
Signature Algorithm: sha1WithRSAEncryption
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
85:10:90:c5:5d:de:25:8c:f2:57:7b:2d:14:1c:05:f9:71:63:
|
51:96:a7:1c:26:5d:1c:90:c6:32:9f:96:15:f2:1d:e7:93:9c:
|
||||||
40:b0:e3:c1:c1:2e:13:2a:7a:b7:d6:24:58:87:eb:03:fb:0d:
|
ac:75:56:95:fd:20:70:ab:45:6a:09:b0:f3:f2:03:a8:db:dc:
|
||||||
af:e0:f4:d0:c8:bc:51:36:10:4f:79:cc:4f:66:7d:af:99:cb:
|
2f:bc:1f:87:7a:a3:d4:8f:d5:49:97:7e:3c:54:ac:b1:e3:f0:
|
||||||
7b:ce:68:94:c6:36:aa:42:6e:8c:78:5b:b2:85:ca:d1:e1:a8:
|
39:0d:fe:09:9a:23:f6:32:a6:41:59:bd:60:e8:bd:de:00:36:
|
||||||
31:d1:81:d9:f9:c1:a3:9e:34:43:ef:0a:79:7d:3e:83:61:fc:
|
6f:3e:e9:41:6f:a9:63:c7:aa:d5:7b:f3:e4:39:48:9e:f6:60:
|
||||||
14:5c:d1:dd:bc:0e:d7:51:b7:71:6e:41:7e:8b:2c:5a:9a:cb:
|
c6:c6:86:d5:72:86:23:cd:f5:6a:63:53:a4:f8:fc:51:6a:cd:
|
||||||
77:4b:6a:f5:06:ff:02:af:1e:e6:63:4f:bc:44:d9:3f:56:9e:
|
60:74:8e:a3:86:61:01:34:78:f7:29:97:b3:a7:34:b6:0a:de:
|
||||||
09:9c:43:f9:55:21:32:46:82:09:86:a9:7b:74:1c:9e:5a:2a:
|
b5:71:7a:09:a6:3e:d6:82:58:89:67:9c:c5:68:62:ba:06:d6:
|
||||||
bf:03:79:91:cb:f2:29:7f:c9:15:82:89:b9:53:cd:7e:07:90:
|
39:bb:cb:3a:c0:e0:63:1f:c7:0c:9c:12:86:ec:f7:39:6a:61:
|
||||||
a9:5d:76:e1:19:5e:0d:58:b8:59:d5:0d:df:23:ab:6b:63:76:
|
93:d0:33:14:c6:55:3b:b6:cf:80:5b:8c:43:ef:43:44:0b:3c:
|
||||||
19:9e:9c:df:b0:57:49:6c:d0:86:97:c3:6c:3c:fa:e0:56:c2:
|
93:39:a3:4e:15:d1:0b:5f:84:98:1d:cd:9f:a9:47:eb:3b:56:
|
||||||
1b:e3:a1:42:1a:58:62:85:9d:74:19:83:08:af:59:90:f8:99:
|
30:b6:76:92:c1:48:5f:bc:95:b0:50:1a:55:c8:4e:62:47:87:
|
||||||
bd:67:d3:4a:ea:0e:c9:ca:61:8a:0d:8a:42:cc:90:e9:2e:c2:
|
54:64:0c:9b:91:fa:43:b3:29:48:be:e6:12:eb:e3:44:c6:52:
|
||||||
54:73:7f:5e:af:8d:e2:32:cb:45:20:d6:19:4d:5b:77:31:cc:
|
e4:40:c6:83:95:1b:a7:65:27:69:73:2f:c8:a0:4d:7f:be:ea:
|
||||||
0f:2d:c0:7e
|
9b:67:b2:7b
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIIEqjCCA5KgAwIBAgIJALZjr49dYlegMA0GCSqGSIb3DQEBBQUAMIGUMQswCQYD
|
MIIEyjCCA7KgAwIBAgIJAKons8Wpcm4NMA0GCSqGSIb3DQEBCwUAMIGeMQswCQYD
|
||||||
VQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjEQMA4G
|
VQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjEVMBMG
|
||||||
A1UECgwHd29sZlNTTDEUMBIGA1UECwwLUHJvZ3JhbW1pbmcxGDAWBgNVBAMMD3d3
|
A1UECgwMd29sZlNTTF8yMDQ4MRkwFwYDVQQLDBBQcm9ncmFtbWluZy0yMDQ4MRgw
|
||||||
dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTAe
|
FgYDVQQDDA93d3cud29sZnNzbC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29s
|
||||||
Fw0xNDA3MTExNzM5NDRaFw0xNzA0MDYxNzM5NDRaMIGUMQswCQYDVQQGEwJVUzEQ
|
ZnNzbC5jb20wHhcNMTUwNTA3MTgyMTAxWhcNMTgwMTMxMTgyMTAxWjCBnjELMAkG
|
||||||
MA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjEQMA4GA1UECgwHd29s
|
A1UEBhMCVVMxEDAOBgNVBAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xFTAT
|
||||||
ZlNTTDEUMBIGA1UECwwLUHJvZ3JhbW1pbmcxGDAWBgNVBAMMD3d3dy53b2xmc3Ns
|
BgNVBAoMDHdvbGZTU0xfMjA0ODEZMBcGA1UECwwQUHJvZ3JhbW1pbmctMjA0ODEY
|
||||||
LmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZI
|
MBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdv
|
||||||
hvcNAQEBBQADggEPADCCAQoCggEBAMMD0Sv+OaQyRTtTyIQrKnx0mr2qKlIHR9am
|
bGZzc2wuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwwPRK/45
|
||||||
NrIHMo7Quml7xsNEntSBSP0taKKLZ7uhdcg2LErSG/eLus8N+e/s8YEee5sDR5q/
|
pDJFO1PIhCsqfHSavaoqUgdH1qY2sgcyjtC6aXvGw0Se1IFI/S1oootnu6F1yDYs
|
||||||
Zcx/ZSRppugUiVvkNPfFsBST9Wd7Onp44QFWVpGmE0KN0jxAnEzv0YbfN1EbDKE7
|
StIb94u6zw357+zxgR57mwNHmr9lzH9lJGmm6BSJW+Q098WwFJP1Z3s6enjhAVZW
|
||||||
9fGjSjXk4c6W3xt+v06X0BDoqAgwga8gC0MUxXRntDKCb42GwohAmTaDuh5AciIX
|
kaYTQo3SPECcTO/Rht83URsMoTv18aNKNeThzpbfG36/TpfQEOioCDCBryALQxTF
|
||||||
11JlJHOwzu8Zza7/eGx7wBID1E5yDVBtO6M7o5lencjZDIWz2YrZVCbbbfqsu/8l
|
dGe0MoJvjYbCiECZNoO6HkByIhfXUmUkc7DO7xnNrv94bHvAEgPUTnINUG07ozuj
|
||||||
TMTRefRx04ZAGBOwY7VyTjDEl4SGLVYv1xX3f8Cu9fxb5fuhutMCAwEAAaOB/DCB
|
mV6dyNkMhbPZitlUJttt+qy7/yVMxNF59HHThkAYE7BjtXJOMMSXhIYtVi/XFfd/
|
||||||
+TAdBgNVHQ4EFgQUM9hFZtdohxh+VA1wJ5HHJteFZcAwgckGA1UdIwSBwTCBvoAU
|
wK71/Fvl+6G60wIDAQABo4IBBzCCAQMwHQYDVR0OBBYEFDPYRWbXaIcYflQNcCeR
|
||||||
M9hFZtdohxh+VA1wJ5HHJteFZcChgZqkgZcwgZQxCzAJBgNVBAYTAlVTMRAwDgYD
|
xybXhWXAMIHTBgNVHSMEgcswgciAFDPYRWbXaIcYflQNcCeRxybXhWXAoYGkpIGh
|
||||||
VQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMRAwDgYDVQQKDAd3b2xmU1NM
|
MIGeMQswCQYDVQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96
|
||||||
MRQwEgYDVQQLDAtQcm9ncmFtbWluZzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29t
|
ZW1hbjEVMBMGA1UECgwMd29sZlNTTF8yMDQ4MRkwFwYDVQQLDBBQcm9ncmFtbWlu
|
||||||
MR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tggkAtmOvj11iV6AwDAYD
|
Zy0yMDQ4MRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20xHzAdBgkqhkiG9w0BCQEW
|
||||||
VR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAhRCQxV3eJYzyV3stFBwF+XFj
|
EGluZm9Ad29sZnNzbC5jb22CCQCqJ7PFqXJuDTAMBgNVHRMEBTADAQH/MA0GCSqG
|
||||||
QLDjwcEuEyp6t9YkWIfrA/sNr+D00Mi8UTYQT3nMT2Z9r5nLe85olMY2qkJujHhb
|
SIb3DQEBCwUAA4IBAQBRlqccJl0ckMYyn5YV8h3nk5ysdVaV/SBwq0VqCbDz8gOo
|
||||||
soXK0eGoMdGB2fnBo540Q+8KeX0+g2H8FFzR3bwO11G3cW5BfossWprLd0tq9Qb/
|
29wvvB+HeqPUj9VJl348VKyx4/A5Df4JmiP2MqZBWb1g6L3eADZvPulBb6ljx6rV
|
||||||
Aq8e5mNPvETZP1aeCZxD+VUhMkaCCYape3QcnloqvwN5kcvyKX/JFYKJuVPNfgeQ
|
e/PkOUie9mDGxobVcoYjzfVqY1Ok+PxRas1gdI6jhmEBNHj3KZezpzS2Ct61cXoJ
|
||||||
qV124RleDVi4WdUN3yOra2N2GZ6c37BXSWzQhpfDbDz64FbCG+OhQhpYYoWddBmD
|
pj7WgliJZ5zFaGK6BtY5u8s6wOBjH8cMnBKG7Pc5amGT0DMUxlU7ts+AW4xD70NE
|
||||||
CK9ZkPiZvWfTSuoOycphig2KQsyQ6S7CVHN/Xq+N4jLLRSDWGU1bdzHMDy3Afg==
|
CzyTOaNOFdELX4SYHc2fqUfrO1YwtnaSwUhfvJWwUBpVyE5iR4dUZAybkfpDsylI
|
||||||
|
vuYS6+NExlLkQMaDlRunZSdpcy/IoE1/vuqbZ7J7
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
Certificate:
|
Certificate:
|
||||||
Data:
|
Data:
|
||||||
Version: 3 (0x2)
|
Version: 3 (0x2)
|
||||||
Serial Number:
|
Serial Number: 16108595702940209934 (0xdf8d3a71e022930e)
|
||||||
bf:cc:cb:7a:0a:07:42:82
|
Signature Algorithm: ecdsa-with-SHA256
|
||||||
Signature Algorithm: ecdsa-with-SHA1
|
Issuer: C=US, ST=Oregon, L=Salem, O=Client ECC, OU=Fast, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Issuer: C=US, ST=Oregon, L=Salem, O=Client ECC, OU=Fast, CN=www.yassl.com/emailAddress=info@yassl.com
|
|
||||||
Validity
|
Validity
|
||||||
Not Before: May 1 23:51:33 2012 GMT
|
Not Before: May 7 18:21:01 2015 GMT
|
||||||
Not After : Jan 26 23:51:33 2015 GMT
|
Not After : Jan 31 18:21:01 2018 GMT
|
||||||
Subject: C=US, ST=Oregon, L=Salem, O=Client ECC, OU=Fast, CN=www.yassl.com/emailAddress=info@yassl.com
|
Subject: C=US, ST=Oregon, L=Salem, O=Client ECC, OU=Fast, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Subject Public Key Info:
|
Subject Public Key Info:
|
||||||
Public Key Algorithm: id-ecPublicKey
|
Public Key Algorithm: id-ecPublicKey
|
||||||
EC Public Key:
|
Public-Key: (256 bit)
|
||||||
pub:
|
pub:
|
||||||
04:55:bf:f4:0f:44:50:9a:3d:ce:9b:b7:f0:c5:4d:
|
04:55:bf:f4:0f:44:50:9a:3d:ce:9b:b7:f0:c5:4d:
|
||||||
f5:70:7b:d4:ec:24:8e:19:80:ec:5a:4c:a2:24:03:
|
f5:70:7b:d4:ec:24:8e:19:80:ec:5a:4c:a2:24:03:
|
||||||
|
@ -24,31 +23,32 @@ Certificate:
|
||||||
EB:D4:4B:59:6B:95:61:3F:51:57:B6:04:4D:89:41:88:44:5C:AB:F2
|
EB:D4:4B:59:6B:95:61:3F:51:57:B6:04:4D:89:41:88:44:5C:AB:F2
|
||||||
X509v3 Authority Key Identifier:
|
X509v3 Authority Key Identifier:
|
||||||
keyid:EB:D4:4B:59:6B:95:61:3F:51:57:B6:04:4D:89:41:88:44:5C:AB:F2
|
keyid:EB:D4:4B:59:6B:95:61:3F:51:57:B6:04:4D:89:41:88:44:5C:AB:F2
|
||||||
DirName:/C=US/ST=Oregon/L=Salem/O=Client ECC/OU=Fast/CN=www.yassl.com/emailAddress=info@yassl.com
|
DirName:/C=US/ST=Oregon/L=Salem/O=Client ECC/OU=Fast/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
serial:BF:CC:CB:7A:0A:07:42:82
|
serial:DF:8D:3A:71:E0:22:93:0E
|
||||||
|
|
||||||
X509v3 Basic Constraints:
|
X509v3 Basic Constraints:
|
||||||
CA:TRUE
|
CA:TRUE
|
||||||
Signature Algorithm: ecdsa-with-SHA1
|
Signature Algorithm: ecdsa-with-SHA256
|
||||||
30:44:02:20:26:08:44:95:35:2e:fa:9d:20:01:a6:79:60:ed:
|
30:44:02:20:74:7b:ae:7e:9c:c8:69:95:8a:0b:ad:7f:c9:37:
|
||||||
35:a7:0a:dd:7a:0e:75:c5:80:d2:0b:9f:6a:90:d6:31:76:75:
|
3d:3c:7f:b7:ef:f3:da:9b:ea:d0:a7:76:0a:a4:77:12:f7:a8:
|
||||||
02:20:2d:87:a2:bb:d5:e2:42:61:35:19:59:40:1d:fd:71:4f:
|
02:20:71:95:87:89:b7:a8:8b:bb:fa:9f:84:dc:2b:71:dc:4a:
|
||||||
28:65:96:99:e6:85:1b:09:ad:d4:58:71:56:63:0b:c7
|
c5:5a:65:b2:fc:33:c4:ce:36:4f:ab:c6:38:36:6c:88
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIIC+jCCAqKgAwIBAgIJAL/My3oKB0KCMAkGByqGSM49BAEwgYkxCzAJBgNVBAYT
|
MIIDCDCCAq+gAwIBAgIJAN+NOnHgIpMOMAoGCCqGSM49BAMCMIGNMQswCQYDVQQG
|
||||||
AlVTMQ8wDQYDVQQIEwZPcmVnb24xDjAMBgNVBAcTBVNhbGVtMRMwEQYDVQQKEwpD
|
EwJVUzEPMA0GA1UECAwGT3JlZ29uMQ4wDAYDVQQHDAVTYWxlbTETMBEGA1UECgwK
|
||||||
bGllbnQgRUNDMQ0wCwYDVQQLEwRGYXN0MRYwFAYDVQQDEw13d3cueWFzc2wuY29t
|
Q2xpZW50IEVDQzENMAsGA1UECwwERmFzdDEYMBYGA1UEAwwPd3d3LndvbGZzc2wu
|
||||||
MR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0xMjA1MDEyMzUxMzNa
|
Y29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tMB4XDTE1MDUwNzE4
|
||||||
Fw0xNTAxMjYyMzUxMzNaMIGJMQswCQYDVQQGEwJVUzEPMA0GA1UECBMGT3JlZ29u
|
MjEwMVoXDTE4MDEzMTE4MjEwMVowgY0xCzAJBgNVBAYTAlVTMQ8wDQYDVQQIDAZP
|
||||||
MQ4wDAYDVQQHEwVTYWxlbTETMBEGA1UEChMKQ2xpZW50IEVDQzENMAsGA1UECxME
|
cmVnb24xDjAMBgNVBAcMBVNhbGVtMRMwEQYDVQQKDApDbGllbnQgRUNDMQ0wCwYD
|
||||||
RmFzdDEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEdMBsGCSqGSIb3DQEJARYOaW5m
|
VQQLDARGYXN0MRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20xHzAdBgkqhkiG9w0B
|
||||||
b0B5YXNzbC5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARVv/QPRFCaPc6b
|
CQEWEGluZm9Ad29sZnNzbC5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARV
|
||||||
t/DFTfVwe9TsJI4ZgOxaTKIkA2Ism9rvojUSQ4R2FsZWlQbMAam99nUaQve9qbI2
|
v/QPRFCaPc6bt/DFTfVwe9TsJI4ZgOxaTKIkA2Ism9rvojUSQ4R2FsZWlQbMAam9
|
||||||
Il/HXX+0o4HxMIHuMB0GA1UdDgQWBBTr1EtZa5VhP1FXtgRNiUGIRFyr8jCBvgYD
|
9nUaQve9qbI2Il/HXX+0o4H1MIHyMB0GA1UdDgQWBBTr1EtZa5VhP1FXtgRNiUGI
|
||||||
VR0jBIG2MIGzgBTr1EtZa5VhP1FXtgRNiUGIRFyr8qGBj6SBjDCBiTELMAkGA1UE
|
RFyr8jCBwgYDVR0jBIG6MIG3gBTr1EtZa5VhP1FXtgRNiUGIRFyr8qGBk6SBkDCB
|
||||||
BhMCVVMxDzANBgNVBAgTBk9yZWdvbjEOMAwGA1UEBxMFU2FsZW0xEzARBgNVBAoT
|
jTELMAkGA1UEBhMCVVMxDzANBgNVBAgMBk9yZWdvbjEOMAwGA1UEBwwFU2FsZW0x
|
||||||
CkNsaWVudCBFQ0MxDTALBgNVBAsTBEZhc3QxFjAUBgNVBAMTDXd3dy55YXNzbC5j
|
EzARBgNVBAoMCkNsaWVudCBFQ0MxDTALBgNVBAsMBEZhc3QxGDAWBgNVBAMMD3d3
|
||||||
b20xHTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tggkAv8zLegoHQoIwDAYD
|
dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbYIJ
|
||||||
VR0TBAUwAwEB/zAJBgcqhkjOPQQBA0cAMEQCICYIRJU1LvqdIAGmeWDtNacK3XoO
|
AN+NOnHgIpMOMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDRwAwRAIgdHuufpzI
|
||||||
dcWA0gufapDWMXZ1AiAth6K71eJCYTUZWUAd/XFPKGWWmeaFGwmt1FhxVmMLxw==
|
aZWKC61/yTc9PH+37/Pam+rQp3YKpHcS96gCIHGVh4m3qIu7+p+E3Ctx3ErFWmWy
|
||||||
|
/DPEzjZPq8Y4NmyI
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
|
|
|
@ -1,12 +1,30 @@
|
||||||
-----BEGIN RSA PRIVATE KEY-----
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
Proc-Type: 4,ENCRYPTED
|
Proc-Type: 4,ENCRYPTED
|
||||||
DEK-Info: DES-EDE3-CBC,BDE979D13CCC0ABD
|
DEK-Info: DES-CBC,45B763473154576D
|
||||||
|
|
||||||
N7yz2JV13EmQ7MZPL5wamid5+G1V1gp8FKqMemAC5JDxonS/W9oViMLUcxbfPTDx
|
8ZSASs14Oqtc8p2nx5sx8oqPsgZmf0IfZTCzXLFivaA0UXdCQLxtsthQRQ07xRrH
|
||||||
FznKdYSVTIQ7vv3ofmDG4MEyV/2C568N2kdtAw+jTfrZFN+IU9CI+W+In/nacirF
|
if96wh11dWuxW0dkSLKna9HguzNQ96ybbw5CwCCkYrfjef7sxoEUe9D6j3UMXZ/F
|
||||||
02sAcvDMofustnooKNOO7/iyb5+3vRvEt5vSSRQn5WuSQ9sUKjuzoLs/lbf7fyAt
|
iaVPMmbHTcf9gn1ozkkxPSlsts/5f8AKFloHRXUE1jAih4wLB3mbIyDG9iKm45ck
|
||||||
4NeqfI3rYBZXxiUOLITOGXzGNRuFoY+o2uDCfelLAJ8uhiVG6ME3LeJEo1dT5lZ8
|
Rn7+u6Fe3hDG/9JWtbLW3ePh5L455U6zP5hlneodDZEabUguUef7EMzXE01LqPAy
|
||||||
CSJOLPasKg0iG4V7olM4j9FvAfZr48RRsSfUen756Jo2HpI4bad8LKhFYIdNs2Au
|
qeatI7t54cAGkUVgGbZrsKcXtiDtRNUefa9hb90tugY29LAt1ls5K68kR1x9U+TM
|
||||||
WwKLmjpo6QB9hBmRshR04rEXPdrgTqLBExCE08PyaGYnWU8ggWritCeBzDQFj/n4
|
kWgjMzmhab5e7Alh+yMfDg2WplI2EHTDuLvcX9Vh1OHe7akN67EN/0IYcpGCryfe
|
||||||
sI+NO0Mymuvg98e5RpO52lg3Xnqv9RIK3guLFOmI6aEHC0PS4WwOEQ==
|
RHLYvNNjXyJWfMKuo0XVqMY1JyBDebYJTlEafwNcjSBWSo5U4uihnVXvj8NfU36Z
|
||||||
|
JIeGGo6fyq5D0pPjvtRpk3XwbzQlvAQSDxbFp9dIX7m46Ji7YaeQO8Fgg1L5ENfm
|
||||||
|
wTx6xdPPdFb3ux0ksiU8QoF7190kjmS4SbeSLvpLjGh1f3dz6suJ+7+KN0ZwQd4e
|
||||||
|
Ki+IDuaKhYR1vn0ROVvUQ0+nmkunblcO6HyhcTgWiSCBIWhTwrRJIV4tmiQYS5bc
|
||||||
|
G7PqGIIOsFwwOwY4IWYt57YS0DGJsbdBuXToZgnnpG0yvnsIkeasEc5h4KCslQ0o
|
||||||
|
lztCFZxGITjDtt+b8acnCEN2calYBkKZfc1LV1u/Fh2no1CnDtjHqk0E0tcjuU6M
|
||||||
|
sZ3NSiiI0puvG91LtwidHP7x0okR2voG8joN3XmBDigUo/6SazjPoWwhOFIuE/MY
|
||||||
|
aXnPMFxgZ/KV5DcPWa3lOTMIfOzY84aMs4q4q4huCX9/MVe4ZjcuI1T8RCoSSvTu
|
||||||
|
jOV+eJL7N2uZi40BWVPMwFOIkgVn3oK99L/FtTJUzYDXqVb0Cmi6bg0FrwGQOJMV
|
||||||
|
M+ETvTW89k+Zy/RLXiFvdGeCHQXwkUJYlQGJkrkC5fWevEDmdH2qZbcgs/o8X5tg
|
||||||
|
lFOGoXRvmMLrNXLQVt5SGKsTjRxMbbSmNY3J+e2hFVkc8oslQZqtacDlZ29D0enQ
|
||||||
|
6me7+n2Qy6QOeTJ1pQOY5jHiJwsub2OCx1oML6lKBpn7g0taUGZauSIr+R14F/R7
|
||||||
|
YhgO2QTydUrbs7jOwaIitdiwNuaHlFIujB8tqo1xAjPE18QL4NbqV/CUzLDuyiB+
|
||||||
|
3hHmzRJ1aQTGO0/2ucbUqf6MUWvNuc6zFg5AETSg1or8A7gqi8/HdlBR6wUo+rug
|
||||||
|
IvJ2OkR9vyR8QJDOM9Pn8TS0e0B7TVqb8rUltzRtXOcbtLL3Xvy00+wlVyyiLRPz
|
||||||
|
u/u355ZoMDZLVhOoVoLGlXhA+St91qrELpe1O8aNrqOQy3pyhybiPOh9lgtqyr1C
|
||||||
|
QMQLcBGdoyMCsSiuDFbV+7thd/rQPE1Qqy06rStv1OEv9Y+hzZxrzF8HSfSLuNPd
|
||||||
|
UCDn9SSzZwGU9odLJNrzSNfz8GDVc72lKHlIR4bHMw0FW2QPsJR8NrN6ch4oYmfw
|
||||||
|
17R/cQ9CfWA0cEcSiAKIthbP7NHWw4SAhJ6sqwpDK4Vh8PrDF3U6WCEEshaokm+H
|
||||||
-----END RSA PRIVATE KEY-----
|
-----END RSA PRIVATE KEY-----
|
||||||
|
|
|
@ -1,39 +1,39 @@
|
||||||
Certificate Revocation List (CRL):
|
Certificate Revocation List (CRL):
|
||||||
Version 2 (0x1)
|
Version 2 (0x1)
|
||||||
Signature Algorithm: sha1WithRSAEncryption
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
Issuer: /C=US/ST=Montana/L=Bozeman/O=wolfSSL/OU=Programming/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
Issuer: /C=US/ST=Montana/L=Bozeman/O=wolfSSL_2048/OU=Programming-2048/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Last Update: Jul 11 20:39:48 2014 GMT
|
Last Update: May 7 18:21:01 2015 GMT
|
||||||
Next Update: Jul 11 20:39:48 2015 GMT
|
Next Update: Jan 31 18:21:01 2018 GMT
|
||||||
CRL extensions:
|
CRL extensions:
|
||||||
X509v3 CRL Number:
|
X509v3 CRL Number:
|
||||||
2
|
3
|
||||||
No Revoked Certificates.
|
No Revoked Certificates.
|
||||||
Signature Algorithm: sha1WithRSAEncryption
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
35:c1:34:91:04:d9:88:99:83:40:ef:09:ee:04:28:91:be:7a:
|
a2:15:f0:cf:70:85:49:b9:5b:c1:af:2b:22:14:9d:ee:11:8d:
|
||||||
b1:84:48:f4:f8:c5:9d:50:6c:67:56:4c:ee:b2:3a:32:5c:1d:
|
93:2d:58:17:d8:f6:b6:1a:1a:25:a2:27:c9:6b:4f:b3:31:c7:
|
||||||
1c:49:ef:58:72:a7:69:71:9a:d8:a6:68:0c:3e:ff:48:15:c7:
|
2c:52:c4:53:59:19:ef:cf:91:ee:b5:19:28:37:49:9e:b6:e0:
|
||||||
44:28:67:6b:34:9d:c0:dc:c5:1b:d1:2f:e6:90:0f:45:7c:aa:
|
41:62:4c:9f:f1:34:bf:88:aa:ae:24:38:8d:29:0a:64:08:a8:
|
||||||
0c:f9:3c:19:dd:55:a0:92:8a:a0:fe:93:1d:1f:42:ae:5f:7c:
|
68:f4:b5:28:73:d6:94:b9:0a:3f:7c:c1:22:72:be:14:ba:c9:
|
||||||
48:a5:de:61:89:94:bf:43:d3:c1:2d:e8:8b:f9:c5:6e:b9:8a:
|
1b:9d:26:af:78:c2:cf:5f:ff:1e:cc:25:c0:63:f1:9b:97:85:
|
||||||
40:0e:6e:32:5e:39:83:cb:9b:76:6b:de:6e:6c:da:4e:1e:5c:
|
5c:c0:4d:14:ed:f9:ad:cb:02:7d:05:c7:5c:c1:7c:89:72:35:
|
||||||
69:d6:8c:08:0e:9f:de:4e:77:9d:f5:e9:97:29:b3:4c:e0:cb:
|
49:70:a8:b1:ae:91:96:77:9a:c6:cb:38:27:88:3f:f4:c8:ba:
|
||||||
ed:46:68:ed:e1:89:ac:d7:b9:11:ca:5a:ed:fe:e3:73:20:6e:
|
c9:08:7f:dd:a6:41:82:62:65:a0:f2:0c:36:5a:d9:15:57:5e:
|
||||||
01:e6:77:a8:48:c7:01:83:40:25:a5:ee:d7:ef:2f:af:b8:e2:
|
66:c3:a2:ff:5e:4d:7c:bc:4b:7c:30:84:44:e3:06:34:a8:42:
|
||||||
2d:85:37:2a:80:8f:7f:6a:a7:32:29:86:42:66:40:d7:eb:87:
|
3b:d9:6a:04:4a:0b:e5:59:66:63:b9:7a:80:48:68:31:1c:aa:
|
||||||
44:66:54:5f:04:5f:7b:22:14:6c:4c:5d:f0:57:ac:33:e0:da:
|
98:bc:09:0e:a7:83:5f:a7:00:f1:fb:78:bc:08:86:73:ef:53:
|
||||||
53:d6:13:52:ea:85:b2:89:de:41:e6:a6:f5:0d:34:47:37:75:
|
25:b8:1b:5e:7c:77:a8:12:7b:52:7f:1e:63:bc:db:60:99:46:
|
||||||
26:b8:c4:f3:e0:1b:c6:32:3f:3b:65:0a:20:08:8e:c7:7e:6d:
|
ab:e1:2e:48:d1:28:40:68:1e:9e:a0:2f:14:04:66:b3:b1:b1:
|
||||||
61:f1:aa:eb
|
3b:d0:46:64
|
||||||
-----BEGIN X509 CRL-----
|
-----BEGIN X509 CRL-----
|
||||||
MIIB7jCB1wIBATANBgkqhkiG9w0BAQUFADCBlDELMAkGA1UEBhMCVVMxEDAOBgNV
|
MIIB+DCB4QIBATANBgkqhkiG9w0BAQsFADCBnjELMAkGA1UEBhMCVVMxEDAOBgNV
|
||||||
BAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xEDAOBgNVBAoMB3dvbGZTU0wx
|
BAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xFTATBgNVBAoMDHdvbGZTU0xf
|
||||||
FDASBgNVBAsMC1Byb2dyYW1taW5nMRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20x
|
MjA0ODEZMBcGA1UECwwQUHJvZ3JhbW1pbmctMjA0ODEYMBYGA1UEAwwPd3d3Lndv
|
||||||
HzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20XDTE0MDcxMTIwMzk0OFoX
|
bGZzc2wuY29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tFw0xNTA1
|
||||||
DTE1MDcxMTIwMzk0OFqgDjAMMAoGA1UdFAQDAgECMA0GCSqGSIb3DQEBBQUAA4IB
|
MDcxODIxMDFaFw0xODAxMzExODIxMDFaoA4wDDAKBgNVHRQEAwIBAzANBgkqhkiG
|
||||||
AQA1wTSRBNmImYNA7wnuBCiRvnqxhEj0+MWdUGxnVkzusjoyXB0cSe9YcqdpcZrY
|
9w0BAQsFAAOCAQEAohXwz3CFSblbwa8rIhSd7hGNky1YF9j2thoaJaInyWtPszHH
|
||||||
pmgMPv9IFcdEKGdrNJ3A3MUb0S/mkA9FfKoM+TwZ3VWgkoqg/pMdH0KuX3xIpd5h
|
LFLEU1kZ78+R7rUZKDdJnrbgQWJMn/E0v4iqriQ4jSkKZAioaPS1KHPWlLkKP3zB
|
||||||
iZS/Q9PBLeiL+cVuuYpADm4yXjmDy5t2a95ubNpOHlxp1owIDp/eTned9emXKbNM
|
InK+FLrJG50mr3jCz1//HswlwGPxm5eFXMBNFO35rcsCfQXHXMF8iXI1SXCosa6R
|
||||||
4MvtRmjt4Yms17kRylrt/uNzIG4B5neoSMcBg0Alpe7X7y+vuOIthTcqgI9/aqcy
|
lneaxss4J4g/9Mi6yQh/3aZBgmJloPIMNlrZFVdeZsOi/15NfLxLfDCEROMGNKhC
|
||||||
KYZCZkDX64dEZlRfBF97IhRsTF3wV6wz4NpT1hNS6oWyid5B5qb1DTRHN3UmuMTz
|
O9lqBEoL5VlmY7l6gEhoMRyqmLwJDqeDX6cA8ft4vAiGc+9TJbgbXnx3qBJ7Un8e
|
||||||
4BvGMj87ZQogCI7Hfm1h8arr
|
Y7zbYJlGq+EuSNEoQGgenqAvFARms7GxO9BGZA==
|
||||||
-----END X509 CRL-----
|
-----END X509 CRL-----
|
||||||
|
|
|
@ -1,39 +1,39 @@
|
||||||
Certificate Revocation List (CRL):
|
Certificate Revocation List (CRL):
|
||||||
Version 2 (0x1)
|
Version 2 (0x1)
|
||||||
Signature Algorithm: sha1WithRSAEncryption
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
Issuer: /C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
Issuer: /C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Last Update: Jul 11 20:36:35 2014 GMT
|
Last Update: May 7 18:21:01 2015 GMT
|
||||||
Next Update: Jul 11 20:36:35 2015 GMT
|
Next Update: Jan 31 18:21:01 2018 GMT
|
||||||
CRL extensions:
|
CRL extensions:
|
||||||
X509v3 CRL Number:
|
X509v3 CRL Number:
|
||||||
1
|
1
|
||||||
No Revoked Certificates.
|
No Revoked Certificates.
|
||||||
Signature Algorithm: sha1WithRSAEncryption
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
b4:54:84:e9:f8:c3:5c:e4:c4:a1:9a:71:eb:bc:46:96:09:bd:
|
96:e2:b9:11:e0:e5:25:be:ab:69:e5:fa:8a:5c:7f:fc:6f:1d:
|
||||||
84:9d:4c:ac:29:a8:23:12:9d:80:8e:18:30:85:92:94:72:04:
|
8f:4a:54:70:f8:2e:87:fa:b0:f6:fd:3f:8f:9c:75:8a:eb:62:
|
||||||
6d:74:05:31:e0:1b:20:b1:ef:6f:44:98:e8:d4:20:74:b1:ec:
|
cc:dd:2c:0a:8c:31:9e:30:3f:22:9b:91:50:6b:43:fd:32:8a:
|
||||||
9f:fe:ad:74:14:66:ad:6f:5b:7a:45:02:b5:6f:a8:d3:bd:dc:
|
79:ea:0b:6b:68:6c:82:9c:79:da:20:95:83:25:5e:09:fc:57:
|
||||||
88:94:d1:e2:78:e1:11:44:95:57:7d:d9:8c:7e:09:dc:aa:4f:
|
2d:19:f9:bc:5a:67:95:98:65:dc:2d:91:13:2a:81:c2:6d:ff:
|
||||||
07:e0:59:f2:09:30:d5:7c:a0:6c:54:88:d0:76:88:33:11:61:
|
12:48:6f:a4:ce:8a:b2:d3:19:b8:c2:86:e0:ba:91:3f:bb:ec:
|
||||||
20:9d:3d:89:49:3b:85:be:e7:c0:38:f1:08:be:44:7a:1d:4c:
|
c6:79:83:50:95:19:95:28:eb:ef:ff:bb:16:8f:3c:7d:4c:d1:
|
||||||
e4:84:7a:40:23:6f:85:bd:67:7b:77:7e:00:78:d2:3c:e2:a8:
|
3e:c3:82:22:8f:c5:e8:0e:b3:64:8f:5d:53:32:d5:98:64:9c:
|
||||||
47:ba:5c:21:c4:78:15:81:a2:9e:a6:9c:c4:47:4c:ee:97:81:
|
36:c4:6a:cf:68:21:4f:a8:4e:90:37:76:dc:05:70:66:2d:bc:
|
||||||
18:91:5e:18:2b:92:e8:06:1f:dc:f2:51:e1:b3:14:bf:c3:c5:
|
a0:d8:19:5c:96:90:d6:b9:09:56:46:07:be:3c:ae:08:bb:26:
|
||||||
9c:78:ce:41:2e:61:0b:71:ad:ea:9e:2d:bb:2e:e4:98:a9:14:
|
26:21:2c:d1:48:01:88:28:bc:21:a4:97:b7:3b:f0:7e:67:73:
|
||||||
47:3f:00:65:4e:09:17:82:ee:be:ea:48:1e:2e:a5:92:64:ce:
|
84:cf:21:43:e7:dd:53:9d:6a:59:c3:e5:98:c9:69:71:c3:e3:
|
||||||
e9:b1:ee:ce:01:5b:e8:e3:fe:ba:dd:8c:eb:ad:34:32:15:00:
|
70:28:ba:f9:69:0a:af:78:e5:83:02:13:7e:08:70:8c:f3:8b:
|
||||||
56:4d:fe:9d:60:bf:a1:cd:9e:1b:61:94:21:0a:b1:98:4f:ec:
|
5d:96:b0:78:b9:d9:99:c5:1e:b7:45:dc:28:32:1a:d0:50:4b:
|
||||||
c1:af:b3:dc
|
f4:41:92:19
|
||||||
-----BEGIN X509 CRL-----
|
-----BEGIN X509 CRL-----
|
||||||
MIIB7jCB1wIBATANBgkqhkiG9w0BAQUFADCBlDELMAkGA1UEBhMCVVMxEDAOBgNV
|
MIIB7jCB1wIBATANBgkqhkiG9w0BAQsFADCBlDELMAkGA1UEBhMCVVMxEDAOBgNV
|
||||||
BAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xETAPBgNVBAoMCFNhd3Rvb3Ro
|
BAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xETAPBgNVBAoMCFNhd3Rvb3Ro
|
||||||
MRMwEQYDVQQLDApDb25zdWx0aW5nMRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20x
|
MRMwEQYDVQQLDApDb25zdWx0aW5nMRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20x
|
||||||
HzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20XDTE0MDcxMTIwMzYzNVoX
|
HzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20XDTE1MDUwNzE4MjEwMVoX
|
||||||
DTE1MDcxMTIwMzYzNVqgDjAMMAoGA1UdFAQDAgEBMA0GCSqGSIb3DQEBBQUAA4IB
|
DTE4MDEzMTE4MjEwMVqgDjAMMAoGA1UdFAQDAgEBMA0GCSqGSIb3DQEBCwUAA4IB
|
||||||
AQC0VITp+MNc5MShmnHrvEaWCb2EnUysKagjEp2AjhgwhZKUcgRtdAUx4Bsgse9v
|
AQCW4rkR4OUlvqtp5fqKXH/8bx2PSlRw+C6H+rD2/T+PnHWK62LM3SwKjDGeMD8i
|
||||||
RJjo1CB0seyf/q10FGatb1t6RQK1b6jTvdyIlNHieOERRJVXfdmMfgncqk8H4Fny
|
m5FQa0P9Mop56gtraGyCnHnaIJWDJV4J/FctGfm8WmeVmGXcLZETKoHCbf8SSG+k
|
||||||
CTDVfKBsVIjQdogzEWEgnT2JSTuFvufAOPEIvkR6HUzkhHpAI2+FvWd7d34AeNI8
|
zoqy0xm4wobgupE/u+zGeYNQlRmVKOvv/7sWjzx9TNE+w4Iij8XoDrNkj11TMtWY
|
||||||
4qhHulwhxHgVgaKeppzER0zul4EYkV4YK5LoBh/c8lHhsxS/w8WceM5BLmELca3q
|
ZJw2xGrPaCFPqE6QN3bcBXBmLbyg2BlclpDWuQlWRge+PK4IuyYmISzRSAGIKLwh
|
||||||
ni27LuSYqRRHPwBlTgkXgu6+6kgeLqWSZM7pse7OAVvo4/663YzrrTQyFQBWTf6d
|
pJe3O/B+Z3OEzyFD591TnWpZw+WYyWlxw+NwKLr5aQqveOWDAhN+CHCM84tdlrB4
|
||||||
YL+hzZ4bYZQhCrGYT+zBr7Pc
|
udmZxR63RdwoMhrQUEv0QZIZ
|
||||||
-----END X509 CRL-----
|
-----END X509 CRL-----
|
||||||
|
|
|
@ -1,13 +1,41 @@
|
||||||
|
Certificate Revocation List (CRL):
|
||||||
|
Version 2 (0x1)
|
||||||
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
|
Issuer: /C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
|
Last Update: May 7 18:21:01 2015 GMT
|
||||||
|
Next Update: Jan 31 18:21:01 2018 GMT
|
||||||
|
CRL extensions:
|
||||||
|
X509v3 CRL Number:
|
||||||
|
2
|
||||||
|
Revoked Certificates:
|
||||||
|
Serial Number: 01
|
||||||
|
Revocation Date: May 7 18:21:01 2015 GMT
|
||||||
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
|
b7:34:2b:1c:09:6b:a2:9c:12:4f:fd:ef:69:4c:a4:1d:f2:39:
|
||||||
|
52:29:98:78:b2:86:ea:54:9b:29:e5:c2:88:0e:2f:f9:d2:5b:
|
||||||
|
9d:49:37:68:26:6c:45:61:d4:9d:05:ef:2d:ca:78:0a:d0:28:
|
||||||
|
c1:25:f2:f7:6a:ad:df:1d:eb:8a:66:64:4d:0c:02:91:fb:ff:
|
||||||
|
70:b4:36:b6:e4:79:17:d5:18:6a:72:17:e1:8b:31:49:04:98:
|
||||||
|
96:88:42:ea:8c:fe:91:40:5a:c5:ad:3b:da:9a:47:43:d6:e9:
|
||||||
|
f6:59:75:49:91:a9:e4:8b:c8:03:60:6b:36:69:87:71:f1:5b:
|
||||||
|
92:00:51:bb:fe:d5:4f:0d:0e:f2:56:38:e3:b6:cb:76:11:7b:
|
||||||
|
17:ad:a5:da:37:87:f2:49:af:73:42:56:ed:6c:a1:8d:46:5c:
|
||||||
|
dd:00:a7:8f:1f:5a:dd:d7:87:89:43:30:32:fe:e2:d4:b1:29:
|
||||||
|
12:11:ef:22:0d:8f:7f:c5:33:3b:a9:a7:52:0c:25:b8:0c:e6:
|
||||||
|
8a:8b:68:8f:55:84:65:04:c7:44:48:36:02:4d:4e:43:09:1d:
|
||||||
|
1f:3b:f9:4a:0e:ff:59:42:ca:be:0e:a7:79:89:19:31:73:5a:
|
||||||
|
45:6c:70:56:4d:1b:8a:59:c4:6d:ca:bc:f7:41:c4:f6:f0:fd:
|
||||||
|
9c:7e:f1:7e
|
||||||
-----BEGIN X509 CRL-----
|
-----BEGIN X509 CRL-----
|
||||||
MIICBDCB7QIBATANBgkqhkiG9w0BAQsFADCBlDELMAkGA1UEBhMCVVMxEDAOBgNV
|
MIICBDCB7QIBATANBgkqhkiG9w0BAQsFADCBlDELMAkGA1UEBhMCVVMxEDAOBgNV
|
||||||
BAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xETAPBgNVBAoMCFNhd3Rvb3Ro
|
BAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xETAPBgNVBAoMCFNhd3Rvb3Ro
|
||||||
MRMwEQYDVQQLDApDb25zdWx0aW5nMRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20x
|
MRMwEQYDVQQLDApDb25zdWx0aW5nMRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20x
|
||||||
HzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20XDTE0MDcxMTEyMzUyN1oX
|
HzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20XDTE1MDUwNzE4MjEwMVoX
|
||||||
DTE1MDcxMTEyMzUyN1owFDASAgEBFw0xNDA3MTExMjM1MjdaoA4wDDAKBgNVHRQE
|
DTE4MDEzMTE4MjEwMVowFDASAgEBFw0xNTA1MDcxODIxMDFaoA4wDDAKBgNVHRQE
|
||||||
AwIBOzANBgkqhkiG9w0BAQsFAAOCAQEAB+ao48FzCAbRKKPkFJX8Ho5SZl44YhNW
|
AwIBAjANBgkqhkiG9w0BAQsFAAOCAQEAtzQrHAlropwST/3vaUykHfI5UimYeLKG
|
||||||
Uy/JxMkonyjyaMwp7GSwd2hNpv3geC6tHO7YLSRcyvyKu1BQVbeoa6FpultQSv5+
|
6lSbKeXCiA4v+dJbnUk3aCZsRWHUnQXvLcp4CtAowSXy92qt3x3rimZkTQwCkfv/
|
||||||
twk6mmeSenzhzNhfJmzSEhJicXOgBoLAh4aBXkixQis9dAVg16/nNSS2DAJwEKMW
|
cLQ2tuR5F9UYanIX4YsxSQSYlohC6oz+kUBaxa072ppHQ9bp9ll1SZGp5IvIA2Br
|
||||||
kXcJpuBLt6XLL0aM71+NDqB8HAUUPyuNWLiYEb4NlScIWNh7lI6ZWmsv8vb1PMmn
|
NmmHcfFbkgBRu/7VTw0O8lY447bLdhF7F62l2jeH8kmvc0JW7WyhjUZc3QCnjx9a
|
||||||
2hn4CVJIkHkfEHYnikek55iE31QMUyobCXzro+cR9jGR1iPZSQu9dxstRHF5bXai
|
3deHiUMwMv7i1LEpEhHvIg2Pf8UzO6mnUgwluAzmiotoj1WEZQTHREg2Ak1OQwkd
|
||||||
eBYWZIblBVCSJ896a5TJ5uaA1RKk6ZZbAG43oQTB/hupaEPjTTXysw==
|
Hzv5Sg7/WULKvg6neYkZMXNaRWxwVk0bilnEbcq890HE9vD9nH7xfg==
|
||||||
-----END X509 CRL-----
|
-----END X509 CRL-----
|
||||||
|
|
|
@ -1,26 +1,24 @@
|
||||||
Certificate Revocation List (CRL):
|
Certificate Revocation List (CRL):
|
||||||
Version 2 (0x1)
|
Version 2 (0x1)
|
||||||
Signature Algorithm: ecdsa-with-SHA1
|
Signature Algorithm: ecdsa-with-SHA256
|
||||||
Issuer: /C=US/ST=Oregon/L=Salem/O=Client ECC/OU=Fast/CN=www.yassl.com/emailAddress=info@yassl.com
|
Issuer: /C=US/ST=Oregon/L=Salem/O=Client ECC/OU=Fast/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Last Update: Feb 7 20:14:06 2014 GMT
|
Last Update: May 7 18:21:01 2015 GMT
|
||||||
Next Update: Feb 7 20:14:06 2015 GMT
|
Next Update: Jan 31 18:21:01 2018 GMT
|
||||||
CRL extensions:
|
CRL extensions:
|
||||||
X509v3 CRL Number:
|
X509v3 CRL Number:
|
||||||
4
|
4
|
||||||
Revoked Certificates:
|
No Revoked Certificates.
|
||||||
Serial Number: 02
|
Signature Algorithm: ecdsa-with-SHA256
|
||||||
Revocation Date: Feb 7 20:14:06 2014 GMT
|
30:44:02:20:62:9b:53:ee:21:52:bc:61:e8:ec:7b:f8:28:35:
|
||||||
Signature Algorithm: ecdsa-with-SHA1
|
43:98:b8:57:9c:c7:73:cc:a0:45:e8:b9:96:2e:1c:c6:62:ff:
|
||||||
30:44:02:20:10:95:f9:c8:20:bc:7d:ce:79:6d:35:23:4c:82:
|
02:20:2b:64:b8:3a:30:2c:15:7f:cf:57:99:60:9d:51:82:82:
|
||||||
8c:f5:8b:d1:4f:69:a9:5e:70:97:dd:bb:c2:67:13:46:b0:47:
|
ef:b6:13:cc:86:93:a2:19:41:12:a0:ec:7e:1e:07:09
|
||||||
02:20:4f:1f:43:c2:cc:63:1c:6e:26:89:2d:e7:ce:69:45:6d:
|
|
||||||
fb:8f:53:cd:1f:84:0f:93:fe:83:91:69:f2:91:c6:f9
|
|
||||||
-----BEGIN X509 CRL-----
|
-----BEGIN X509 CRL-----
|
||||||
MIIBNTCB3gIBATAJBgcqhkjOPQQBMIGJMQswCQYDVQQGEwJVUzEPMA0GA1UECBMG
|
MIIBJTCBzQIBATAKBggqhkjOPQQDAjCBjTELMAkGA1UEBhMCVVMxDzANBgNVBAgM
|
||||||
T3JlZ29uMQ4wDAYDVQQHEwVTYWxlbTETMBEGA1UEChMKQ2xpZW50IEVDQzENMAsG
|
Bk9yZWdvbjEOMAwGA1UEBwwFU2FsZW0xEzARBgNVBAoMCkNsaWVudCBFQ0MxDTAL
|
||||||
A1UECxMERmFzdDEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEdMBsGCSqGSIb3DQEJ
|
BgNVBAsMBEZhc3QxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3
|
||||||
ARYOaW5mb0B5YXNzbC5jb20XDTE0MDIwNzIwMTQwNloXDTE1MDIwNzIwMTQwNlow
|
DQEJARYQaW5mb0B3b2xmc3NsLmNvbRcNMTUwNTA3MTgyMTAxWhcNMTgwMTMxMTgy
|
||||||
FDASAgECFw0xNDAyMDcyMDE0MDZaoA4wDDAKBgNVHRQEAwIBBDAJBgcqhkjOPQQB
|
MTAxWqAOMAwwCgYDVR0UBAMCAQQwCgYIKoZIzj0EAwIDRwAwRAIgYptT7iFSvGHo
|
||||||
A0cAMEQCIBCV+cggvH3OeW01I0yCjPWL0U9pqV5wl927wmcTRrBHAiBPH0PCzGMc
|
7Hv4KDVDmLhXnMdzzKBF6LmWLhzGYv8CICtkuDowLBV/z1eZYJ1RgoLvthPMhpOi
|
||||||
biaJLefOaUVt+49TzR+ED5P+g5Fp8pHG+Q==
|
GUESoOx+HgcJ
|
||||||
-----END X509 CRL-----
|
-----END X509 CRL-----
|
||||||
|
|
|
@ -1,26 +1,24 @@
|
||||||
Certificate Revocation List (CRL):
|
Certificate Revocation List (CRL):
|
||||||
Version 2 (0x1)
|
Version 2 (0x1)
|
||||||
Signature Algorithm: ecdsa-with-SHA1
|
Signature Algorithm: ecdsa-with-SHA256
|
||||||
Issuer: /C=US/ST=Washington/L=Seattle/O=Eliptic/OU=ECC/CN=www.yassl.com/emailAddress=info@yassl.com
|
Issuer: /C=US/ST=Washington/L=Seattle/O=Eliptic/OU=ECC/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Last Update: Feb 7 20:14:06 2014 GMT
|
Last Update: May 7 18:21:01 2015 GMT
|
||||||
Next Update: Feb 7 20:14:06 2015 GMT
|
Next Update: Jan 31 18:21:01 2018 GMT
|
||||||
CRL extensions:
|
CRL extensions:
|
||||||
X509v3 CRL Number:
|
X509v3 CRL Number:
|
||||||
5
|
5
|
||||||
Revoked Certificates:
|
No Revoked Certificates.
|
||||||
Serial Number: 02
|
Signature Algorithm: ecdsa-with-SHA256
|
||||||
Revocation Date: Feb 7 20:14:06 2014 GMT
|
30:45:02:20:0d:fe:b7:79:fb:66:6c:cb:36:0a:1a:f3:6d:73:
|
||||||
Signature Algorithm: ecdsa-with-SHA1
|
ea:68:ab:fc:46:7e:49:bd:15:2a:9f:a1:17:50:56:82:cf:1f:
|
||||||
30:44:02:20:2a:2a:2c:ff:8a:0f:6a:74:57:b8:41:a8:5a:5c:
|
02:21:00:ff:13:85:80:29:a4:60:54:10:93:fb:20:13:b8:9c:
|
||||||
8c:7d:c1:7d:b1:76:a3:db:ff:22:1a:69:cd:80:8d:d5:e4:2a:
|
25:48:53:5e:4b:33:ef:5c:aa:9e:98:74:e0:c8:c3:ef:df
|
||||||
02:20:2d:51:3e:01:5b:79:6c:f4:89:89:63:46:0b:65:44:46:
|
|
||||||
59:2d:42:3e:ba:a8:6d:08:4a:20:1f:9a:06:cc:a9:65
|
|
||||||
-----BEGIN X509 CRL-----
|
-----BEGIN X509 CRL-----
|
||||||
MIIBNzCB4AIBATAJBgcqhkjOPQQBMIGLMQswCQYDVQQGEwJVUzETMBEGA1UECBMK
|
MIIBKDCBzwIBATAKBggqhkjOPQQDAjCBjzELMAkGA1UEBhMCVVMxEzARBgNVBAgM
|
||||||
V2FzaGluZ3RvbjEQMA4GA1UEBxMHU2VhdHRsZTEQMA4GA1UEChMHRWxpcHRpYzEM
|
Cldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxEDAOBgNVBAoMB0VsaXB0aWMx
|
||||||
MAoGA1UECxMDRUNDMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJKoZIhvcN
|
DDAKBgNVBAsMA0VDQzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZI
|
||||||
AQkBFg5pbmZvQHlhc3NsLmNvbRcNMTQwMjA3MjAxNDA2WhcNMTUwMjA3MjAxNDA2
|
hvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tFw0xNTA1MDcxODIxMDFaFw0xODAxMzEx
|
||||||
WjAUMBICAQIXDTE0MDIwNzIwMTQwNlqgDjAMMAoGA1UdFAQDAgEFMAkGByqGSM49
|
ODIxMDFaoA4wDDAKBgNVHRQEAwIBBTAKBggqhkjOPQQDAgNIADBFAiAN/rd5+2Zs
|
||||||
BAEDRwAwRAIgKios/4oPanRXuEGoWlyMfcF9sXaj2/8iGmnNgI3V5CoCIC1RPgFb
|
yzYKGvNtc+poq/xGfkm9FSqfoRdQVoLPHwIhAP8ThYAppGBUEJP7IBO4nCVIU15L
|
||||||
eWz0iYljRgtlREZZLUI+uqhtCEogH5oGzKll
|
M+9cqp6YdODIw+/f
|
||||||
-----END X509 CRL-----
|
-----END X509 CRL-----
|
||||||
|
|
4
FreeRTOS-Plus/Source/WolfSSL/certs/ecc-key-comp.pem
Normal file
4
FreeRTOS-Plus/Source/WolfSSL/certs/ecc-key-comp.pem
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
-----BEGIN EC PRIVATE KEY-----
|
||||||
|
MFcCAQEEIEW2aQJznGyFoThbcujox6zEA41TNQT6bCjcNI3hqAmMoAoGCCqGSM49
|
||||||
|
AwEHoSQDIgACuzOsTCdQSsZKpQTDPN6fNttyLc6U6iv6yyAJOSwW6GE=
|
||||||
|
-----END EC PRIVATE KEY-----
|
|
@ -9,6 +9,7 @@ EXTRA_DIST += \
|
||||||
certs/client-keyEnc.pem \
|
certs/client-keyEnc.pem \
|
||||||
certs/client-key.pem \
|
certs/client-key.pem \
|
||||||
certs/ecc-key.pem \
|
certs/ecc-key.pem \
|
||||||
|
certs/ecc-key-comp.pem \
|
||||||
certs/ecc-keyPkcs8.pem \
|
certs/ecc-keyPkcs8.pem \
|
||||||
certs/ecc-client-key.pem \
|
certs/ecc-client-key.pem \
|
||||||
certs/client-ecc-cert.pem \
|
certs/client-ecc-cert.pem \
|
||||||
|
@ -16,14 +17,15 @@ EXTRA_DIST += \
|
||||||
certs/dh2048.pem \
|
certs/dh2048.pem \
|
||||||
certs/server-cert.pem \
|
certs/server-cert.pem \
|
||||||
certs/server-ecc.pem \
|
certs/server-ecc.pem \
|
||||||
|
certs/server-ecc-comp.pem \
|
||||||
certs/server-ecc-rsa.pem \
|
certs/server-ecc-rsa.pem \
|
||||||
certs/server-keyEnc.pem \
|
certs/server-keyEnc.pem \
|
||||||
certs/server-key.pem \
|
certs/server-key.pem \
|
||||||
certs/server-keyPkcs8Enc12.pem \
|
certs/server-keyPkcs8Enc12.pem \
|
||||||
certs/server-keyPkcs8Enc2.pem \
|
certs/server-keyPkcs8Enc2.pem \
|
||||||
certs/server-keyPkcs8Enc.pem \
|
certs/server-keyPkcs8Enc.pem \
|
||||||
certs/server-keyPkcs8.pem
|
certs/server-keyPkcs8.pem \
|
||||||
|
certs/wolfssl-website-ca.pem
|
||||||
EXTRA_DIST += \
|
EXTRA_DIST += \
|
||||||
certs/ca-key.der \
|
certs/ca-key.der \
|
||||||
certs/ca-cert.der \
|
certs/ca-cert.der \
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIIEzzCCA7egAwIBAgIIAXf7v+vECVkwDQYJKoZIhvcNAQEFBQAwgZQxCzAJBgNV
|
MIIEzzCCA7egAwIBAgIIAazu2er3DUMwDQYJKoZIhvcNAQEFBQAwgZQxCzAJBgNV
|
||||||
BAYTAlVTMRAwDgYDVQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMREwDwYD
|
BAYTAlVTMRAwDgYDVQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMREwDwYD
|
||||||
VQQKDAhTYXd0b290aDETMBEGA1UECwwKQ29uc3VsdGluZzEYMBYGA1UEAwwPd3d3
|
VQQKDAhTYXd0b290aDETMBEGA1UECwwKQ29uc3VsdGluZzEYMBYGA1UEAwwPd3d3
|
||||||
LndvbGZzc2wuY29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tMCIY
|
LndvbGZzc2wuY29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tMCIY
|
||||||
DzIwMTQwNzEwMjMyMDM5WhgPMjAxNTExMjMyMjIwMzlaMIGKMQswCQYDVQQGEwJV
|
DzIwMTUwMjA0MDYzMzI5WhgPMjAxNjA2MTkwNzMzMjlaMIGKMQswCQYDVQQGEwJV
|
||||||
UzELMAkGA1UECAwCT1IxETAPBgNVBAcMCFBvcnRsYW5kMQ4wDAYDVQQKDAV5YVNT
|
UzELMAkGA1UECAwCT1IxETAPBgNVBAcMCFBvcnRsYW5kMQ4wDAYDVQQKDAV5YVNT
|
||||||
TDEUMBIGA1UECwwLRGV2ZWxvcG1lbnQxFjAUBgNVBAMMDXd3dy55YXNzbC5jb20x
|
TDEUMBIGA1UECwwLRGV2ZWxvcG1lbnQxFjAUBgNVBAMMDXd3dy55YXNzbC5jb20x
|
||||||
HTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMIICTTAaBgsrBgEEAcEWAQEB
|
HTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMIICTTAaBgsrBgEEAcEWAQEB
|
||||||
AQYLKwYBBAHBFgEBAi4DggItAASCAijYe+JeNLXR6gSUtCr6lgMmeCQqvDRCb8wp
|
AQYLKwYBBAHBFgEBAi4DggItAASCAiifDYOsBu8WQqIuom5HpD+jF7bvqvyO7LN4
|
||||||
bzUt/kqyRU7K0eMTSMv40ThD6jriU3p8uQQ92OkfbNwtWfB3VyScTpyr4INIvS3D
|
p7dOUfyBBX2zFc7fbhVoLcLw62Ye0i54UXMI/rglgOxEisVXPo0//Cs2rl3zwjho
|
||||||
gB6Y4uH+kDlWVQutqiPNvNSn0AxBnTEBOsBqqyDqzAXujcoSOxTbU9GLv5jk08iU
|
fnEvEMpDU4mvqYTV8+N7FYoaUSEhMWTS0GMCJdK9aTvAz8l7F8gKP6MtgIv7Ght/
|
||||||
Q9H4EkGMQgUr0VsPSBjrxK0VrQY9StpyObUM2z6LfRNjI5SGDvR6FBRdKUBdmUWw
|
r6JclP7fh12KMy9hiM/Tv3wqr+KhR8xFRfpL+paEIroidfpExFWbFB+xxA6KxGk4
|
||||||
EMvUhB39MbFebvXHNkyFeFaTbc6hgCRgzLNHpb2xzq7YCb+F5CsLFD8WuWKLn/Fn
|
OEs/nus4rQl4w+6z5uf1cYfxKVRMFWLScEDQ3TdPcHz0+7fl/L7LYyCbK9z9LYVZ
|
||||||
61MSLvP99mIUM5MBBqacfrJSFzBWL8LX/NpEAO4SRbnKUJRr3e8cjfALU9oZnCgr
|
5qZR1V27Iwx4H3d2w2D/3GGZpML/Uv8eBBHtODBbJC54U+bVh1ned28N1Y8I/bm8
|
||||||
2TY91lnlJcfPTeHLckkYVacz+l0E8zJpge7PViYGK2Zdune7EJZ2QZ/EnhV7mrjc
|
xRRCppfCJ3o+WxlsqHtyjIo/hi75SgUHknnbZ4hEuye1XhBBhUVhN2zybADMi1bv
|
||||||
GVwK6PZQ/l0UpzSz0yYyAzsb9OW7AlGOnH6u6lCP0sYwMDRdr1fPvq5Cu0ZkVzy+
|
S1RL/HAWsOO8qzBx5vkbVlDShsF+EccNUaNQyM98VE3FrUBbk4JxnyHBK5pA7aQ5
|
||||||
sfVD5kOyy35WEJQVmyuTu8ifos0QcmbqCNF5IrZtfZL7m/4Msg+GePL6x20A1TMF
|
7LOm83WkX2uR+ucR5en2TZIGVL+cJiTly+W7W8J83KEf5HJIUqnxFlgsre/0pMfe
|
||||||
rZ//+1gNbcxaeZZVG7Jw7RfW461SMbTuypt3Qp2eNHox6OrF+6A96t5vfOwqYa8W
|
7RqGer5Q4itWE+XWaPsDCUZnHy8a/CGdWlmdiGuw/0UvDqKQ4NRerbMgpo2Fl182
|
||||||
GMMobFVQR8lH4qsBt/km0iQVjkvIjoSaPSSBcIgBxzXJwU2XCzVsj8tFW9IXP1SG
|
fIQxfohhnm7iM0dAroIglkNBLM89A30d+73ZnUKgg4mRaqC5C29Me6LqpXjEUCiT
|
||||||
4ouMty6qbFb73k9EwliEQkLBjXfINp5/wlR1nv4dAA66rZNtysktWah8t8jXtSAw
|
/s3g24IooqTj+8i8osRY5Zp4MQTmb3NrWVAWoOTtbFxDkhkwgqALupC8opUSIwAw
|
||||||
DQYJKoZIhvcNAQEFBQADggEBAGCcqiwYrVUdQ7t4CvuPkuD7NFIAlVFNdwKaiJSp
|
DQYJKoZIhvcNAQEFBQADggEBAHPi6MLfKV3ILr4wVgktXWNrPVgbqzUfoHhZhuhU
|
||||||
moCCNL3sBWW1UjGKTLLRvn08oPAmrOQ8OkK1rusw+G7hxWjicEypp/WcaVCQv4or
|
OgoT1KjiGQTpMrszGXyNKWTV+TpL2RmsBsXwI+lCl9nQMk5nkHAELShwXmgBpR+r
|
||||||
M+BtWOUZ+fgIn6gHt4JRLMqt/R/t70AvONhIESL/XEjgQCP+GDuz+UDiwIxhzdcn
|
2dQTUy6C5xze8ZqPhsIjUjHyaagX8QY42SlSGOCChOEYshqO+QouPL2XOf2Hp4nJ
|
||||||
pSFU7APxKbeKIrFxiMaH8fB8fwPY60IH/LRTX7jA5ixXQWOm6r3u5ocmMW4naHd4
|
fgx4Mo2APTxGJ8TLYBCu4QzglCkKl7g1JRKBVA8Q4bkb1NWOnTgRQfIVv3N9DMn0
|
||||||
qAWB5wGmU/rmvrSw+v0mHjwvI66DiCeZl9Y9i4mOKk+7eOTdOsKR1VifBtEg/+Qj
|
ELw4uHkS2bXlzzbKRpwIMms0MIdWrVKFycQIp9Z2/7RsrIidZdGgsDeJLpItMZB8
|
||||||
UHiltbupX9fkm5ncvaRS/stAYywBheGYbEMYMaatndvMuzw=
|
UM5Fz1UyZTy54Keoto4nBsU9ZJxzsTihT+Oq+/n1WaMEn+I=
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -2,11 +2,11 @@ Certificate:
|
||||||
Data:
|
Data:
|
||||||
Version: 3 (0x2)
|
Version: 3 (0x2)
|
||||||
Serial Number: 1 (0x1)
|
Serial Number: 1 (0x1)
|
||||||
Signature Algorithm: sha1WithRSAEncryption
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Validity
|
Validity
|
||||||
Not Before: Jul 11 17:20:14 2014 GMT
|
Not Before: May 7 18:21:01 2015 GMT
|
||||||
Not After : Apr 6 17:20:14 2017 GMT
|
Not After : Jan 31 18:21:01 2018 GMT
|
||||||
Subject: C=US, ST=Montana, L=Bozeman, O=wolfSSL, OU=Support, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
Subject: C=US, ST=Montana, L=Bozeman, O=wolfSSL, OU=Support, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Subject Public Key Info:
|
Subject Public Key Info:
|
||||||
Public Key Algorithm: rsaEncryption
|
Public Key Algorithm: rsaEncryption
|
||||||
|
@ -37,32 +37,32 @@ Certificate:
|
||||||
X509v3 Authority Key Identifier:
|
X509v3 Authority Key Identifier:
|
||||||
keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
|
keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
|
||||||
DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
serial:9A:41:47:CD:A1:14:62:8C
|
serial:D9:80:3A:C3:D2:F4:DA:37
|
||||||
|
|
||||||
X509v3 Basic Constraints:
|
X509v3 Basic Constraints:
|
||||||
CA:TRUE
|
CA:TRUE
|
||||||
Signature Algorithm: sha1WithRSAEncryption
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
3d:8c:70:05:5b:62:4b:bf:6c:b6:48:61:01:10:1d:5e:05:ba:
|
67:c0:2c:a9:43:47:e7:11:14:77:ae:cc:d8:e0:6b:23:82:91:
|
||||||
55:94:2c:ae:59:6f:97:80:5d:6c:86:ec:9a:eb:15:45:44:e4:
|
63:e8:a8:0d:21:c5:c8:47:97:2f:d5:f3:86:fb:6c:ce:25:f9:
|
||||||
56:f8:75:ca:8a:45:32:f4:c7:e1:fa:f2:98:1c:91:d3:3f:e8:
|
7c:78:c8:3a:22:68:f2:16:1e:d2:d2:3f:24:04:87:f2:b7:c1:
|
||||||
0e:c9:1b:fa:e1:79:99:67:0e:0d:6b:8a:ec:1a:2c:59:c4:34:
|
62:63:ba:c5:fa:ae:d2:20:81:1a:d2:0c:ae:26:6b:1b:2b:10:
|
||||||
04:8d:39:77:cd:b5:e9:60:5b:82:bf:34:ce:ed:c6:4f:3f:b4:
|
d3:e1:9a:4e:64:6c:97:db:36:a8:8f:f8:05:63:bf:ba:0d:88:
|
||||||
5c:4d:8a:b4:f4:0a:04:12:a0:56:c1:e1:33:37:a1:54:87:48:
|
0b:87:46:c9:e4:64:e3:d7:bd:b8:2d:d5:c1:c3:c4:db:55:68:
|
||||||
e9:81:c2:0f:8f:6f:d3:52:4c:4c:32:4c:6b:9f:3a:04:8f:77:
|
dc:a3:7a:40:b9:a9:f6:04:4a:22:cf:98:76:1c:e4:a3:ff:79:
|
||||||
5d:ad:dc:3d:2b:f2:c9:df:3c:60:5d:d8:fc:86:72:7c:3d:d0:
|
19:96:57:63:07:6f:f6:32:77:16:50:9b:e3:34:18:d4:eb:be:
|
||||||
84:4b:8c:df:26:43:fe:c0:cc:5b:e1:36:b3:3d:32:28:a3:ef:
|
fd:b6:6f:e3:c7:f6:85:bf:ac:32:ad:98:57:be:13:92:44:10:
|
||||||
0c:20:d6:b1:50:39:d6:67:a9:8b:84:bc:92:34:eb:19:23:e8:
|
a5:f3:ae:e2:66:da:44:a9:94:71:3f:d0:2f:20:59:87:e4:5a:
|
||||||
10:8f:ea:bd:18:8c:93:27:3c:74:75:8e:58:04:fa:2a:74:44:
|
40:ee:d2:e4:0c:ce:25:94:dc:0f:fe:38:e0:41:52:34:5c:bb:
|
||||||
7d:fc:4d:39:df:54:17:ba:78:e1:5d:6a:70:d3:7c:a2:80:81:
|
c3:db:c1:5f:76:c3:5d:0e:32:69:2b:9d:01:ed:50:1b:4f:77:
|
||||||
e6:19:51:91:c3:44:51:ec:bb:88:a9:53:e1:d7:a9:8c:28:f4:
|
a9:a9:d8:71:30:cb:2e:2c:70:00:ab:78:4b:d7:15:d9:17:f8:
|
||||||
21:1c:42:51:09:b4:12:6d:a0:d6:25:09:85:c6:2a:0c:af:a7:
|
64:b2:f7:3a:da:e1:0b:8b:0a:e1:4e:b1:03:46:14:ca:94:e3:
|
||||||
58:e6:52:8b
|
44:77:d7:59
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIIEnjCCA4agAwIBAgIBATANBgkqhkiG9w0BAQUFADCBlDELMAkGA1UEBhMCVVMx
|
MIIEnjCCA4agAwIBAgIBATANBgkqhkiG9w0BAQsFADCBlDELMAkGA1UEBhMCVVMx
|
||||||
EDAOBgNVBAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xETAPBgNVBAoMCFNh
|
EDAOBgNVBAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xETAPBgNVBAoMCFNh
|
||||||
d3Rvb3RoMRMwEQYDVQQLDApDb25zdWx0aW5nMRgwFgYDVQQDDA93d3cud29sZnNz
|
d3Rvb3RoMRMwEQYDVQQLDApDb25zdWx0aW5nMRgwFgYDVQQDDA93d3cud29sZnNz
|
||||||
bC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20wHhcNMTQwNzEx
|
bC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20wHhcNMTUwNTA3
|
||||||
MTcyMDE0WhcNMTcwNDA2MTcyMDE0WjCBkDELMAkGA1UEBhMCVVMxEDAOBgNVBAgM
|
MTgyMTAxWhcNMTgwMTMxMTgyMTAxWjCBkDELMAkGA1UEBhMCVVMxEDAOBgNVBAgM
|
||||||
B01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xEDAOBgNVBAoMB3dvbGZTU0wxEDAO
|
B01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xEDAOBgNVBAoMB3dvbGZTU0wxEDAO
|
||||||
BgNVBAsMB1N1cHBvcnQxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqG
|
BgNVBAsMB1N1cHBvcnQxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqG
|
||||||
SIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP
|
SIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP
|
||||||
|
@ -76,24 +76,23 @@ sxEyyZKYhOLJ+NA7bgNCyh8OjjwwgckGA1UdIwSBwTCBvoAUJ45nEXTDJh0/7TNj
|
||||||
s6TYHTDl6NWhgZqkgZcwgZQxCzAJBgNVBAYTAlVTMRAwDgYDVQQIDAdNb250YW5h
|
s6TYHTDl6NWhgZqkgZcwgZQxCzAJBgNVBAYTAlVTMRAwDgYDVQQIDAdNb250YW5h
|
||||||
MRAwDgYDVQQHDAdCb3plbWFuMREwDwYDVQQKDAhTYXd0b290aDETMBEGA1UECwwK
|
MRAwDgYDVQQHDAdCb3plbWFuMREwDwYDVQQKDAhTYXd0b290aDETMBEGA1UECwwK
|
||||||
Q29uc3VsdGluZzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZIhvcN
|
Q29uc3VsdGluZzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZIhvcN
|
||||||
AQkBFhBpbmZvQHdvbGZzc2wuY29tggkAmkFHzaEUYowwDAYDVR0TBAUwAwEB/zAN
|
AQkBFhBpbmZvQHdvbGZzc2wuY29tggkA2YA6w9L02jcwDAYDVR0TBAUwAwEB/zAN
|
||||||
BgkqhkiG9w0BAQUFAAOCAQEAPYxwBVtiS79stkhhARAdXgW6VZQsrllvl4BdbIbs
|
BgkqhkiG9w0BAQsFAAOCAQEAZ8AsqUNH5xEUd67M2OBrI4KRY+ioDSHFyEeXL9Xz
|
||||||
musVRUTkVvh1yopFMvTH4frymByR0z/oDskb+uF5mWcODWuK7BosWcQ0BI05d821
|
hvtsziX5fHjIOiJo8hYe0tI/JASH8rfBYmO6xfqu0iCBGtIMriZrGysQ0+GaTmRs
|
||||||
6WBbgr80zu3GTz+0XE2KtPQKBBKgVsHhMzehVIdI6YHCD49v01JMTDJMa586BI93
|
l9s2qI/4BWO/ug2IC4dGyeRk49e9uC3VwcPE21Vo3KN6QLmp9gRKIs+Ydhzko/95
|
||||||
Xa3cPSvyyd88YF3Y/IZyfD3QhEuM3yZD/sDMW+E2sz0yKKPvDCDWsVA51mepi4S8
|
GZZXYwdv9jJ3FlCb4zQY1Ou+/bZv48f2hb+sMq2YV74TkkQQpfOu4mbaRKmUcT/Q
|
||||||
kjTrGSPoEI/qvRiMkyc8dHWOWAT6KnREffxNOd9UF7p44V1qcNN8ooCB5hlRkcNE
|
LyBZh+RaQO7S5AzOJZTcD/444EFSNFy7w9vBX3bDXQ4yaSudAe1QG093qanYcTDL
|
||||||
Uey7iKlT4depjCj0IRxCUQm0Em2g1iUJhcYqDK+nWOZSiw==
|
LixwAKt4S9cV2Rf4ZLL3OtrhC4sK4U6xA0YUypTjRHfXWQ==
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
Certificate:
|
Certificate:
|
||||||
Data:
|
Data:
|
||||||
Version: 3 (0x2)
|
Version: 3 (0x2)
|
||||||
Serial Number:
|
Serial Number: 15672591315981621815 (0xd9803ac3d2f4da37)
|
||||||
9a:41:47:cd:a1:14:62:8c
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
Signature Algorithm: sha1WithRSAEncryption
|
|
||||||
Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Validity
|
Validity
|
||||||
Not Before: Jul 11 03:20:08 2014 GMT
|
Not Before: May 7 18:21:01 2015 GMT
|
||||||
Not After : Apr 6 03:20:08 2017 GMT
|
Not After : Jan 31 18:21:01 2018 GMT
|
||||||
Subject: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
Subject: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Subject Public Key Info:
|
Subject Public Key Info:
|
||||||
Public Key Algorithm: rsaEncryption
|
Public Key Algorithm: rsaEncryption
|
||||||
|
@ -124,32 +123,32 @@ Certificate:
|
||||||
X509v3 Authority Key Identifier:
|
X509v3 Authority Key Identifier:
|
||||||
keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
|
keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
|
||||||
DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
serial:9A:41:47:CD:A1:14:62:8C
|
serial:D9:80:3A:C3:D2:F4:DA:37
|
||||||
|
|
||||||
X509v3 Basic Constraints:
|
X509v3 Basic Constraints:
|
||||||
CA:TRUE
|
CA:TRUE
|
||||||
Signature Algorithm: sha1WithRSAEncryption
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
79:78:0c:6d:79:88:91:fc:3a:15:9c:f9:27:62:16:f0:21:1f:
|
7a:af:44:3b:aa:6f:53:42:b2:33:aa:43:5f:56:30:d3:b9:96:
|
||||||
fa:7d:3f:a2:a8:32:1e:f7:f2:11:a9:74:16:74:5e:dc:18:ca:
|
0b:9a:55:5a:39:2a:0b:4e:e4:2e:f1:95:66:c9:86:36:82:8d:
|
||||||
f0:00:2a:d5:03:06:26:30:f1:47:83:fd:32:6e:fc:ed:aa:4f:
|
63:7c:4d:a2:ee:48:ba:03:c7:90:d7:a7:c6:74:60:48:5f:31:
|
||||||
7d:0c:63:60:31:2f:7c:0c:bf:99:66:87:ed:27:08:86:2d:c4:
|
a2:f9:5e:3e:c3:82:e1:e5:2f:41:81:83:29:25:79:d1:53:00:
|
||||||
33:e8:98:23:1c:fe:a3:db:9a:49:4e:fc:5a:42:ef:71:c3:3f:
|
69:3c:ed:0a:30:3b:41:1d:92:a1:2c:a8:9d:2c:e3:23:87:79:
|
||||||
ad:dc:4a:a8:d2:a3:1d:09:ac:33:04:7b:86:f3:6d:00:59:a3:
|
e0:55:6e:91:a8:50:da:46:2f:c2:20:50:3e:2b:47:97:14:b0:
|
||||||
c8:db:d1:3c:73:f6:0e:90:d6:5e:49:e0:bf:36:63:08:7b:a5:
|
7d:04:ba:45:51:d0:6e:e1:5a:a2:4b:84:9c:4d:cd:85:04:f9:
|
||||||
b0:8f:35:3b:56:8c:11:35:49:04:1c:d0:e7:ba:56:c5:0d:0a:
|
28:31:82:93:bc:c7:59:49:91:03:e8:df:6a:e4:56:ad:6a:cb:
|
||||||
91:8d:d6:b7:62:19:34:12:52:4c:d2:6d:7c:c5:3d:0f:18:81:
|
1f:0d:37:e4:5e:bd:e7:9f:d5:ec:9d:3c:18:25:9b:f1:2f:50:
|
||||||
54:cb:f6:3c:e5:84:d2:d6:71:15:ec:1a:34:0b:f0:a0:21:74:
|
7d:eb:31:cb:f1:63:22:9d:57:fc:f3:84:20:1a:c6:07:87:92:
|
||||||
43:c8:a3:b0:df:d9:67:da:e2:ad:93:48:f8:a0:87:bd:79:14:
|
26:9e:15:18:59:33:06:dc:fb:b0:b6:76:5d:f1:c1:2f:c8:2f:
|
||||||
e0:62:0a:df:f7:31:2e:31:7b:d1:32:2a:0a:fe:5d:14:ef:d9:
|
62:9c:c0:d6:de:eb:65:77:f3:5c:a6:c3:88:27:96:75:b4:f4:
|
||||||
64:50:e4:83:91:bc:70:0d:d7:88:8d:d9:bc:84:0e:c5:1a:b3:
|
54:cd:ff:2d:21:2e:96:f0:07:73:4b:e9:93:92:90:de:62:d9:
|
||||||
bf:64:02:4e:51:91:a4:a2:85:15:83:af:f0:5b:9b:28:49:5f:
|
a3:3b:ac:6e:24:5f:27:4a:b3:94:70:ff:30:17:e7:7e:32:8f:
|
||||||
b2:b3:03:d8
|
65:b7:75:58
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIIEqjCCA5KgAwIBAgIJAJpBR82hFGKMMA0GCSqGSIb3DQEBBQUAMIGUMQswCQYD
|
MIIEqjCCA5KgAwIBAgIJANmAOsPS9No3MA0GCSqGSIb3DQEBCwUAMIGUMQswCQYD
|
||||||
VQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8G
|
VQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8G
|
||||||
A1UECgwIU2F3dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3
|
A1UECgwIU2F3dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3
|
||||||
dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTAe
|
dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTAe
|
||||||
Fw0xNDA3MTEwMzIwMDhaFw0xNzA0MDYwMzIwMDhaMIGUMQswCQYDVQQGEwJVUzEQ
|
Fw0xNTA1MDcxODIxMDFaFw0xODAxMzExODIxMDFaMIGUMQswCQYDVQQGEwJVUzEQ
|
||||||
MA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8GA1UECgwIU2F3
|
MA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8GA1UECgwIU2F3
|
||||||
dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3dy53b2xmc3Ns
|
dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3dy53b2xmc3Ns
|
||||||
LmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZI
|
LmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZI
|
||||||
|
@ -163,11 +162,11 @@ XDjNdyXvvYB1U5Q8PcpjW58VtdMdEy8Z0TzbdjrMuH3J5cLX2kBv2CHccxtCLVOc
|
||||||
J45nEXTDJh0/7TNjs6TYHTDl6NWhgZqkgZcwgZQxCzAJBgNVBAYTAlVTMRAwDgYD
|
J45nEXTDJh0/7TNjs6TYHTDl6NWhgZqkgZcwgZQxCzAJBgNVBAYTAlVTMRAwDgYD
|
||||||
VQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMREwDwYDVQQKDAhTYXd0b290
|
VQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMREwDwYDVQQKDAhTYXd0b290
|
||||||
aDETMBEGA1UECwwKQ29uc3VsdGluZzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29t
|
aDETMBEGA1UECwwKQ29uc3VsdGluZzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29t
|
||||||
MR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tggkAmkFHzaEUYowwDAYD
|
MR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tggkA2YA6w9L02jcwDAYD
|
||||||
VR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAeXgMbXmIkfw6FZz5J2IW8CEf
|
VR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAeq9EO6pvU0KyM6pDX1Yw07mW
|
||||||
+n0/oqgyHvfyEal0FnRe3BjK8AAq1QMGJjDxR4P9Mm787apPfQxjYDEvfAy/mWaH
|
C5pVWjkqC07kLvGVZsmGNoKNY3xNou5IugPHkNenxnRgSF8xovlePsOC4eUvQYGD
|
||||||
7ScIhi3EM+iYIxz+o9uaSU78WkLvccM/rdxKqNKjHQmsMwR7hvNtAFmjyNvRPHP2
|
KSV50VMAaTztCjA7QR2SoSyonSzjI4d54FVukahQ2kYvwiBQPitHlxSwfQS6RVHQ
|
||||||
DpDWXkngvzZjCHulsI81O1aMETVJBBzQ57pWxQ0KkY3Wt2IZNBJSTNJtfMU9DxiB
|
buFaokuEnE3NhQT5KDGCk7zHWUmRA+jfauRWrWrLHw035F6955/V7J08GCWb8S9Q
|
||||||
VMv2POWE0tZxFewaNAvwoCF0Q8ijsN/ZZ9rirZNI+KCHvXkU4GIK3/cxLjF70TIq
|
fesxy/FjIp1X/POEIBrGB4eSJp4VGFkzBtz7sLZ2XfHBL8gvYpzA1t7rZXfzXKbD
|
||||||
Cv5dFO/ZZFDkg5G8cA3XiI3ZvIQOxRqzv2QCTlGRpKKFFYOv8FubKElfsrMD2A==
|
iCeWdbT0VM3/LSEulvAHc0vpk5KQ3mLZozusbiRfJ0qzlHD/MBfnfjKPZbd1WA==
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
|
|
52
FreeRTOS-Plus/Source/WolfSSL/certs/server-ecc-comp.pem
Normal file
52
FreeRTOS-Plus/Source/WolfSSL/certs/server-ecc-comp.pem
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
Certificate:
|
||||||
|
Data:
|
||||||
|
Version: 3 (0x2)
|
||||||
|
Serial Number: 17764616133298603308 (0xf6889840946fc52c)
|
||||||
|
Signature Algorithm: ecdsa-with-SHA256
|
||||||
|
Issuer: C=US, ST=Montana, L=Bozeman, O=Elliptic - comp, OU=Server ECC-comp, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
|
Validity
|
||||||
|
Not Before: May 7 18:21:01 2015 GMT
|
||||||
|
Not After : Jan 31 18:21:01 2018 GMT
|
||||||
|
Subject: C=US, ST=Montana, L=Bozeman, O=Elliptic - comp, OU=Server ECC-comp, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
|
Subject Public Key Info:
|
||||||
|
Public Key Algorithm: id-ecPublicKey
|
||||||
|
Public-Key: (256 bit)
|
||||||
|
pub:
|
||||||
|
02:bb:33:ac:4c:27:50:4a:c6:4a:a5:04:c3:3c:de:
|
||||||
|
9f:36:db:72:2d:ce:94:ea:2b:fa:cb:20:09:39:2c:
|
||||||
|
16:e8:61
|
||||||
|
ASN1 OID: prime256v1
|
||||||
|
X509v3 extensions:
|
||||||
|
X509v3 Subject Key Identifier:
|
||||||
|
8C:38:3A:6B:B8:24:B7:DF:6E:F4:59:AC:56:4E:AA:E2:58:A6:5A:18
|
||||||
|
X509v3 Authority Key Identifier:
|
||||||
|
keyid:8C:38:3A:6B:B8:24:B7:DF:6E:F4:59:AC:56:4E:AA:E2:58:A6:5A:18
|
||||||
|
DirName:/C=US/ST=Montana/L=Bozeman/O=Elliptic - comp/OU=Server ECC-comp/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
|
serial:F6:88:98:40:94:6F:C5:2C
|
||||||
|
|
||||||
|
X509v3 Basic Constraints:
|
||||||
|
CA:TRUE
|
||||||
|
Signature Algorithm: ecdsa-with-SHA256
|
||||||
|
30:46:02:21:00:9c:f8:3e:f6:5e:cd:da:b1:08:fe:e2:bd:78:
|
||||||
|
14:b5:33:b3:29:69:d0:a0:de:19:05:ec:c3:46:29:01:8c:4c:
|
||||||
|
56:02:21:00:e2:e7:ea:37:c1:08:f6:15:73:0c:92:4f:25:63:
|
||||||
|
f6:53:96:31:4c:9f:1d:1a:1f:c0:a0:a3:48:bd:71:ce:13:11
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIDJTCCAsqgAwIBAgIJAPaImECUb8UsMAoGCCqGSM49BAMCMIGgMQswCQYDVQQG
|
||||||
|
EwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjEYMBYGA1UE
|
||||||
|
CgwPRWxsaXB0aWMgLSBjb21wMRgwFgYDVQQLDA9TZXJ2ZXIgRUNDLWNvbXAxGDAW
|
||||||
|
BgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xm
|
||||||
|
c3NsLmNvbTAeFw0xNTA1MDcxODIxMDFaFw0xODAxMzExODIxMDFaMIGgMQswCQYD
|
||||||
|
VQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjEYMBYG
|
||||||
|
A1UECgwPRWxsaXB0aWMgLSBjb21wMRgwFgYDVQQLDA9TZXJ2ZXIgRUNDLWNvbXAx
|
||||||
|
GDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3
|
||||||
|
b2xmc3NsLmNvbTA5MBMGByqGSM49AgEGCCqGSM49AwEHAyIAArszrEwnUErGSqUE
|
||||||
|
wzzenzbbci3OlOor+ssgCTksFuhho4IBCTCCAQUwHQYDVR0OBBYEFIw4Omu4JLff
|
||||||
|
bvRZrFZOquJYploYMIHVBgNVHSMEgc0wgcqAFIw4Omu4JLffbvRZrFZOquJYploY
|
||||||
|
oYGmpIGjMIGgMQswCQYDVQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UE
|
||||||
|
BwwHQm96ZW1hbjEYMBYGA1UECgwPRWxsaXB0aWMgLSBjb21wMRgwFgYDVQQLDA9T
|
||||||
|
ZXJ2ZXIgRUNDLWNvbXAxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqG
|
||||||
|
SIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbYIJAPaImECUb8UsMAwGA1UdEwQFMAMB
|
||||||
|
Af8wCgYIKoZIzj0EAwIDSQAwRgIhAJz4PvZezdqxCP7ivXgUtTOzKWnQoN4ZBezD
|
||||||
|
RikBjExWAiEA4ufqN8EI9hVzDJJPJWP2U5YxTJ8dGh/AoKNIvXHOExE=
|
||||||
|
-----END CERTIFICATE-----
|
|
@ -2,12 +2,12 @@ Certificate:
|
||||||
Data:
|
Data:
|
||||||
Version: 3 (0x2)
|
Version: 3 (0x2)
|
||||||
Serial Number: 1 (0x1)
|
Serial Number: 1 (0x1)
|
||||||
Signature Algorithm: sha1WithRSAEncryption
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Validity
|
Validity
|
||||||
Not Before: Jul 11 17:25:56 2014 GMT
|
Not Before: May 7 18:21:01 2015 GMT
|
||||||
Not After : Apr 6 17:25:56 2017 GMT
|
Not After : Jan 31 18:21:01 2018 GMT
|
||||||
Subject: C=US, ST=Montana, L=Bozeman, O=wolfSSL, OU=Support, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
Subject: C=US, ST=Montana, L=Bozeman, O=Elliptic - RSAsig, OU=ECC-RSAsig, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Subject Public Key Info:
|
Subject Public Key Info:
|
||||||
Public Key Algorithm: id-ecPublicKey
|
Public Key Algorithm: id-ecPublicKey
|
||||||
Public-Key: (256 bit)
|
Public-Key: (256 bit)
|
||||||
|
@ -24,46 +24,46 @@ Certificate:
|
||||||
X509v3 Authority Key Identifier:
|
X509v3 Authority Key Identifier:
|
||||||
keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
|
keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
|
||||||
DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
serial:9A:41:47:CD:A1:14:62:8C
|
serial:D9:80:3A:C3:D2:F4:DA:37
|
||||||
|
|
||||||
X509v3 Basic Constraints:
|
X509v3 Basic Constraints:
|
||||||
CA:TRUE
|
CA:TRUE
|
||||||
Signature Algorithm: sha1WithRSAEncryption
|
Signature Algorithm: sha256WithRSAEncryption
|
||||||
61:a8:c1:b3:39:c8:f6:77:e7:cc:58:ed:15:25:44:81:47:ac:
|
ac:2b:a9:d9:15:3b:9a:42:fb:86:2b:c1:f2:18:7c:a6:ca:27:
|
||||||
09:58:37:ab:5f:1d:2d:a7:78:70:96:c4:7f:98:cf:56:80:a3:
|
0b:48:81:64:20:3b:d3:4f:ee:95:d4:c5:fd:5f:c7:d6:ab:a1:
|
||||||
0f:ce:e1:80:fa:80:f6:96:04:97:50:4e:08:04:30:97:64:e7:
|
41:85:cc:e1:16:e1:fd:ce:8a:af:95:27:f2:f0:7a:3d:59:5d:
|
||||||
0d:c2:16:a3:ab:a8:d4:11:f2:70:10:65:6c:b6:65:4d:bc:9a:
|
3a:5d:03:99:cb:4c:5c:19:35:9c:b2:6e:7e:2b:10:e2:7f:ef:
|
||||||
40:20:a3:6c:e7:93:6d:fa:ab:a5:e0:82:9a:30:e6:0c:82:6c:
|
14:35:79:ca:67:eb:51:a9:e9:bb:5f:52:af:9d:79:80:b5:31:
|
||||||
1c:7f:76:cc:78:a1:9c:3d:56:67:37:58:6c:e2:ab:8a:ae:c9:
|
5c:f0:20:ca:c7:e9:9b:29:82:c4:a4:74:0a:2a:76:ea:ad:59:
|
||||||
b2:83:d5:a5:79:74:e5:c9:bb:f3:39:5a:45:ca:ad:54:65:06:
|
a2:f9:a2:cf:53:40:11:ac:1a:de:fc:ab:28:96:9f:cf:ff:b9:
|
||||||
1b:bf:c5:d4:16:33:f2:10:6b:2a:07:fe:a7:ef:47:c6:df:02:
|
74:31:95:c4:6d:d2:76:c1:93:97:75:a6:9f:69:a3:7d:92:75:
|
||||||
4d:28:35:a5:ed:1b:86:d8:82:3b:4a:cb:76:fe:98:62:d4:bd:
|
b8:27:a2:bd:4d:4b:54:11:b4:8a:43:f2:fc:10:a5:82:fb:51:
|
||||||
98:28:aa:86:b5:02:3b:24:4e:ad:bb:63:f7:e3:dc:e5:12:41:
|
45:57:86:00:85:71:91:21:37:5c:9f:f3:68:06:ae:9e:86:46:
|
||||||
ca:ee:93:b3:33:1e:a1:26:82:ce:ff:66:8d:c5:51:5f:b0:1f:
|
8d:4b:e3:d0:42:a4:cf:c1:5d:95:bc:1a:92:f8:44:1e:a0:1b:
|
||||||
0f:03:df:e2:c5:66:82:9a:42:ab:36:ef:3e:cf:44:d9:39:e3:
|
c8:98:41:af:8e:94:41:60:69:b1:7c:8e:70:ce:88:42:44:3a:
|
||||||
59:63:f2:9c:24:13:6f:9a:cb:3c:78:be:4b:c6:be:c8:e7:11:
|
2d:3f:de:6e:3a:aa:d1:64:be:03:68:60:b6:ac:e5:44:c1:bb:
|
||||||
31:8b:de:5f:c5:de:50:d0:87:c5:5b:6e:1e:d6:cf:68:39:b1:
|
f1:c9:40:90:c2:c9:8f:ec:32:9d:e0:b4:4b:1a:e7:da:99:94:
|
||||||
e1:f2:a3:d6
|
fe:e2:b6:2a
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIID0zCCArugAwIBAgIBATANBgkqhkiG9w0BAQUFADCBlDELMAkGA1UEBhMCVVMx
|
MIID4DCCAsigAwIBAgIBATANBgkqhkiG9w0BAQsFADCBlDELMAkGA1UEBhMCVVMx
|
||||||
EDAOBgNVBAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xETAPBgNVBAoMCFNh
|
EDAOBgNVBAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xETAPBgNVBAoMCFNh
|
||||||
d3Rvb3RoMRMwEQYDVQQLDApDb25zdWx0aW5nMRgwFgYDVQQDDA93d3cud29sZnNz
|
d3Rvb3RoMRMwEQYDVQQLDApDb25zdWx0aW5nMRgwFgYDVQQDDA93d3cud29sZnNz
|
||||||
bC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20wHhcNMTQwNzEx
|
bC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20wHhcNMTUwNTA3
|
||||||
MTcyNTU2WhcNMTcwNDA2MTcyNTU2WjCBkDELMAkGA1UEBhMCVVMxEDAOBgNVBAgM
|
MTgyMTAxWhcNMTgwMTMxMTgyMTAxWjCBnTELMAkGA1UEBhMCVVMxEDAOBgNVBAgM
|
||||||
B01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xEDAOBgNVBAoMB3dvbGZTU0wxEDAO
|
B01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xGjAYBgNVBAoMEUVsbGlwdGljIC0g
|
||||||
BgNVBAsMB1N1cHBvcnQxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqG
|
UlNBc2lnMRMwEQYDVQQLDApFQ0MtUlNBc2lnMRgwFgYDVQQDDA93d3cud29sZnNz
|
||||||
SIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEH
|
bC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20wWTATBgcqhkjO
|
||||||
A0IABLszrEwnUErGSqUEwzzenzbbci3OlOor+ssgCTksFuhhAumvTdMCk5oxW5eS
|
PQIBBggqhkjOPQMBBwNCAAS7M6xMJ1BKxkqlBMM83p8223ItzpTqK/rLIAk5LBbo
|
||||||
IX/wzxjakRECNIboIFgzC4A0idijgfwwgfkwHQYDVR0OBBYEFF1dJu+sfjb5m3YV
|
YQLpr03TApOaMVuXkiF/8M8Y2pERAjSG6CBYMwuANInYo4H8MIH5MB0GA1UdDgQW
|
||||||
K0olAiPvsokwMIHJBgNVHSMEgcEwgb6AFCeOZxF0wyYdP+0zY7Ok2B0w5ejVoYGa
|
BBRdXSbvrH42+Zt2FStKJQIj77KJMDCByQYDVR0jBIHBMIG+gBQnjmcRdMMmHT/t
|
||||||
pIGXMIGUMQswCQYDVQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwH
|
M2OzpNgdMOXo1aGBmqSBlzCBlDELMAkGA1UEBhMCVVMxEDAOBgNVBAgMB01vbnRh
|
||||||
Qm96ZW1hbjERMA8GA1UECgwIU2F3dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcx
|
bmExEDAOBgNVBAcMB0JvemVtYW4xETAPBgNVBAoMCFNhd3Rvb3RoMRMwEQYDVQQL
|
||||||
GDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3
|
DApDb25zdWx0aW5nMRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20xHzAdBgkqhkiG
|
||||||
b2xmc3NsLmNvbYIJAJpBR82hFGKMMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEF
|
9w0BCQEWEGluZm9Ad29sZnNzbC5jb22CCQDZgDrD0vTaNzAMBgNVHRMEBTADAQH/
|
||||||
BQADggEBAGGowbM5yPZ358xY7RUlRIFHrAlYN6tfHS2neHCWxH+Yz1aAow/O4YD6
|
MA0GCSqGSIb3DQEBCwUAA4IBAQCsK6nZFTuaQvuGK8HyGHymyicLSIFkIDvTT+6V
|
||||||
gPaWBJdQTggEMJdk5w3CFqOrqNQR8nAQZWy2ZU28mkAgo2znk236q6Xggpow5gyC
|
1MX9X8fWq6FBhczhFuH9zoqvlSfy8Ho9WV06XQOZy0xcGTWcsm5+KxDif+8UNXnK
|
||||||
bBx/dsx4oZw9Vmc3WGziq4quybKD1aV5dOXJu/M5WkXKrVRlBhu/xdQWM/IQayoH
|
Z+tRqem7X1KvnXmAtTFc8CDKx+mbKYLEpHQKKnbqrVmi+aLPU0ARrBre/Ksolp/P
|
||||||
/qfvR8bfAk0oNaXtG4bYgjtKy3b+mGLUvZgoqoa1AjskTq27Y/fj3OUSQcruk7Mz
|
/7l0MZXEbdJ2wZOXdaafaaN9knW4J6K9TUtUEbSKQ/L8EKWC+1FFV4YAhXGRITdc
|
||||||
HqEmgs7/Zo3FUV+wHw8D3+LFZoKaQqs27z7PRNk541lj8pwkE2+ayzx4vkvGvsjn
|
n/NoBq6ehkaNS+PQQqTPwV2VvBqS+EQeoBvImEGvjpRBYGmxfI5wzohCRDotP95u
|
||||||
ETGL3l/F3lDQh8Vbbh7Wz2g5seHyo9Y=
|
OqrRZL4DaGC2rOVEwbvxyUCQwsmP7DKd4LRLGufamZT+4rYq
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
Certificate:
|
Certificate:
|
||||||
Data:
|
Data:
|
||||||
Version: 3 (0x2)
|
Version: 3 (0x2)
|
||||||
Serial Number:
|
Serial Number: 12841786837162396166 (0xb2373116f65a0a06)
|
||||||
f9:ec:48:2d:d0:a4:49:6c
|
Signature Algorithm: ecdsa-with-SHA256
|
||||||
Signature Algorithm: ecdsa-with-SHA1
|
Issuer: C=US, ST=Washington, L=Seattle, O=Eliptic, OU=ECC, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Issuer: C=US, ST=Washington, L=Seattle, O=Eliptic, OU=ECC, CN=www.yassl.com/emailAddress=info@yassl.com
|
|
||||||
Validity
|
Validity
|
||||||
Not Before: Oct 22 04:02:45 2013 GMT
|
Not Before: May 7 18:21:01 2015 GMT
|
||||||
Not After : Jul 18 04:02:45 2016 GMT
|
Not After : Jan 31 18:21:01 2018 GMT
|
||||||
Subject: C=US, ST=Washington, L=Seattle, O=Eliptic, OU=ECC, CN=www.yassl.com/emailAddress=info@yassl.com
|
Subject: C=US, ST=Washington, L=Seattle, O=Eliptic, OU=ECC, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
Subject Public Key Info:
|
Subject Public Key Info:
|
||||||
Public Key Algorithm: id-ecPublicKey
|
Public Key Algorithm: id-ecPublicKey
|
||||||
EC Public Key:
|
Public-Key: (256 bit)
|
||||||
pub:
|
pub:
|
||||||
04:bb:33:ac:4c:27:50:4a:c6:4a:a5:04:c3:3c:de:
|
04:bb:33:ac:4c:27:50:4a:c6:4a:a5:04:c3:3c:de:
|
||||||
9f:36:db:72:2d:ce:94:ea:2b:fa:cb:20:09:39:2c:
|
9f:36:db:72:2d:ce:94:ea:2b:fa:cb:20:09:39:2c:
|
||||||
|
@ -24,32 +23,32 @@ Certificate:
|
||||||
5D:5D:26:EF:AC:7E:36:F9:9B:76:15:2B:4A:25:02:23:EF:B2:89:30
|
5D:5D:26:EF:AC:7E:36:F9:9B:76:15:2B:4A:25:02:23:EF:B2:89:30
|
||||||
X509v3 Authority Key Identifier:
|
X509v3 Authority Key Identifier:
|
||||||
keyid:5D:5D:26:EF:AC:7E:36:F9:9B:76:15:2B:4A:25:02:23:EF:B2:89:30
|
keyid:5D:5D:26:EF:AC:7E:36:F9:9B:76:15:2B:4A:25:02:23:EF:B2:89:30
|
||||||
DirName:/C=US/ST=Washington/L=Seattle/O=Eliptic/OU=ECC/CN=www.yassl.com/emailAddress=info@yassl.com
|
DirName:/C=US/ST=Washington/L=Seattle/O=Eliptic/OU=ECC/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
|
||||||
serial:F9:EC:48:2D:D0:A4:49:6C
|
serial:B2:37:31:16:F6:5A:0A:06
|
||||||
|
|
||||||
X509v3 Basic Constraints:
|
X509v3 Basic Constraints:
|
||||||
CA:TRUE
|
CA:TRUE
|
||||||
Signature Algorithm: ecdsa-with-SHA1
|
Signature Algorithm: ecdsa-with-SHA256
|
||||||
30:44:02:20:36:14:3b:c8:19:43:87:b9:3d:aa:32:6f:18:9a:
|
30:45:02:20:35:25:33:ea:7c:3b:e2:2e:ed:e4:2e:9a:91:f1:
|
||||||
4e:07:0c:47:6c:e1:dc:87:fd:ad:f4:2c:71:ec:04:ba:c9:58:
|
c3:86:ff:a7:27:35:a9:f6:29:d6:f8:d5:9a:0b:35:f1:21:c7:
|
||||||
02:20:65:4e:67:ee:68:26:ed:1c:03:11:0e:31:91:69:f6:16:
|
02:21:00:bc:79:f7:fd:66:d4:d3:46:61:e4:19:e5:f7:74:03:
|
||||||
27:06:f7:33:68:18:0b:5d:63:5f:8b:e8:bc:d6:00:57
|
83:27:f8:26:c0:86:15:a9:e2:10:e3:ad:6b:b9:1c:1d:eb
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIIDADCCAqigAwIBAgIJAPnsSC3QpElsMAkGByqGSM49BAEwgYsxCzAJBgNVBAYT
|
MIIDDzCCArWgAwIBAgIJALI3MRb2WgoGMAoGCCqGSM49BAMCMIGPMQswCQYDVQQG
|
||||||
AlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxlMRAwDgYD
|
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEQMA4G
|
||||||
VQQKEwdFbGlwdGljMQwwCgYDVQQLEwNFQ0MxFjAUBgNVBAMTDXd3dy55YXNzbC5j
|
A1UECgwHRWxpcHRpYzEMMAoGA1UECwwDRUNDMRgwFgYDVQQDDA93d3cud29sZnNz
|
||||||
b20xHTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTEzMTAyMjA0MDI0
|
bC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20wHhcNMTUwNTA3
|
||||||
NVoXDTE2MDcxODA0MDI0NVowgYsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNo
|
MTgyMTAxWhcNMTgwMTMxMTgyMTAxWjCBjzELMAkGA1UEBhMCVVMxEzARBgNVBAgM
|
||||||
aW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxlMRAwDgYDVQQKEwdFbGlwdGljMQwwCgYD
|
Cldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxEDAOBgNVBAoMB0VsaXB0aWMx
|
||||||
VQQLEwNFQ0MxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEW
|
DDAKBgNVBAsMA0VDQzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZI
|
||||||
DmluZm9AeWFzc2wuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuzOsTCdQ
|
hvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD
|
||||||
SsZKpQTDPN6fNttyLc6U6iv6yyAJOSwW6GEC6a9N0wKTmjFbl5Ihf/DPGNqREQI0
|
QgAEuzOsTCdQSsZKpQTDPN6fNttyLc6U6iv6yyAJOSwW6GEC6a9N0wKTmjFbl5Ih
|
||||||
huggWDMLgDSJ2KOB8zCB8DAdBgNVHQ4EFgQUXV0m76x+NvmbdhUrSiUCI++yiTAw
|
f/DPGNqREQI0huggWDMLgDSJ2KOB9zCB9DAdBgNVHQ4EFgQUXV0m76x+NvmbdhUr
|
||||||
gcAGA1UdIwSBuDCBtYAUXV0m76x+NvmbdhUrSiUCI++yiTChgZGkgY4wgYsxCzAJ
|
SiUCI++yiTAwgcQGA1UdIwSBvDCBuYAUXV0m76x+NvmbdhUrSiUCI++yiTChgZWk
|
||||||
BgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxl
|
gZIwgY8xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQH
|
||||||
MRAwDgYDVQQKEwdFbGlwdGljMQwwCgYDVQQLEwNFQ0MxFjAUBgNVBAMTDXd3dy55
|
DAdTZWF0dGxlMRAwDgYDVQQKDAdFbGlwdGljMQwwCgYDVQQLDANFQ0MxGDAWBgNV
|
||||||
YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tggkA+exILdCk
|
BAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3Ns
|
||||||
SWwwDAYDVR0TBAUwAwEB/zAJBgcqhkjOPQQBA0cAMEQCIDYUO8gZQ4e5Paoybxia
|
LmNvbYIJALI3MRb2WgoGMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSAAwRQIg
|
||||||
TgcMR2zh3If9rfQscewEuslYAiBlTmfuaCbtHAMRDjGRafYWJwb3M2gYC11jX4vo
|
NSUz6nw74i7t5C6akfHDhv+nJzWp9inW+NWaCzXxIccCIQC8eff9ZtTTRmHkGeX3
|
||||||
vNYAVw==
|
dAODJ/gmwIYVqeIQ461ruRwd6w==
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
|
|
|
@ -1,29 +1,29 @@
|
||||||
-----BEGIN ENCRYPTED PRIVATE KEY-----
|
-----BEGIN ENCRYPTED PRIVATE KEY-----
|
||||||
MIIE5TAcBgoqhkiG9w0BDAEBMA4ECFytdly5R2o9AgIIAASCBMOa6fgAUIR5GokK
|
MIIE6jAcBgoqhkiG9w0BDAEDMA4ECAGQiv1ZBAPqAgIIAASCBMhFUVwujBcs/XvB
|
||||||
Z81YZMxC3sNqAwjLEkOwmez2za2fq+2mw6T8tB5W75lFpWyXD1MDPa1PpLzyw27c
|
vmxHOJWn27QJFXXADhKYA7pRFsSx3hlLAAZfQnRuulwoKUVLbyNN7wTB5z8R2PHb
|
||||||
d2C8nipCzp37yYLmXr+aS519CBJR80ily/WLcdv+ScsA6pjOEW2p+VDY55jFp2pr
|
WY1R/d34PIGfYTNZs2uzw3KMn6M4gio+dHwVoMN5eidda4sO861UpTRyy99Y2UXK
|
||||||
n94/K2nFQpMxAdjxnqQCF5ewMLqzy3o3s6U3V9zIxy/xlLYi//UWFI8fqtOikqs4
|
tNE84qQdm+ZbjN5PjFyvfpu5jRGyJWWnvvjlbTBoMP4exHJEEVfvV/QguaL5tOHv
|
||||||
apWLNqJONRZq95OITKO/Nhz7GyEfjrewJmv4zVToEnSagSwbR4IVFn5Lok8rSpI9
|
lZqQ9Lynx6gy+Jt2dF87rz+90MdbjZgaaxqoMx6JYmCCRpkcIjCVdtWVmrUHzbIV
|
||||||
qwey9wsB1CguVwR0O2NjDVKUGXinfhdr+zMQlCoz+xY/Q1TkH4gEY5wpln4cBvtm
|
ee0w1/FiIKx+m63/8DzKxAsCvYuI8dAmWbNZ4KY7kWmGZ7A4dwZaqU87gUSvSnyL
|
||||||
PL/BnD4wEWHh8vS61wfOQ7wPgY+cdCe75stTrKzc6amVJB+40Qi3Vt4TEPGwcP16
|
J67K7+v7Tnx2y8muBkqVMX19EP5fnFRiM16x7/PIikR4Q4zJrN7sK6+zBSeq6szh
|
||||||
/qGl0zpYuAgilPtuEBw3GX3LiigpHmSt43D3DiYNGzv+Aran2Ei9iGSGeI2zHz8r
|
x3N94qm3EzBYY6nJAViEggY+Z+4+SQlErxZkBRfs7hGAejG1RoyyAr0/9ojwUH9p
|
||||||
WFZEnptAwlqeyL7+MZjAOXlu6QG1yix8HvZLmtBHrE2MhuR4KbS3fAUCNQpn8OKu
|
0J4PiDmtnOq14eraRMMeWdIu+3301cZzrZLhBGXXPq1mYcoZxpt+vKTPHPfTSyEh
|
||||||
zxYzs1ti5F2V4c9yK63gSz3H1ObRNsM2OkpUbSVGqLUN6a8HsI6yYh4we6q0gxKD
|
FuFSVDu43s89MwHpsK5b4FAqMd/rpLoXPYEboD6ZK3mhPKiIYkpjdOpQCCjcQ6Kf
|
||||||
VGdzEz4S1BFEBfXWVSPnRNMR4YD8kiQEPutUZFLiWWZ7WliH5yNfHZUia8dovxFa
|
acrFXo5jz+Zafz2U80qhpWxDz3RZQC/MBCwWVS8+iNv8KoxE40SSmlCFMcXSXNwP
|
||||||
MWmAbSjMKRGvV+LvAGQHYBVfJSQO6VvBfBDtu0H4rLr8urmcPY+hbw1XxGfKSQp1
|
dTRsZnRvNX91b8UAn37+dzRE1lJX79xT51uC1UjlkVeWz/ZV5KwupJ0MvdGDNVDN
|
||||||
iIdvVwjefl8wM9LSRsvqY5l4mu+XDPanQlFbzKBOSyLQts97ys3AR+jkK8Bmv14l
|
4F+GpLvd/g2Q3xx4rl1Vx+fUPh+IDRIWRmaJ5rJqqgn1pzZx4tS+0Rjoekk28SUD
|
||||||
xmCF8bJzzz5a2wAqbPhWIbk4J4VfcJEXNMzd19w4SxGv9fUXNiZZElUdNE+wtRsQ
|
DIzmZFswWus385DYhYcn6FAWf2dTq3LulJcX2DovGLiGu3TUA4JlVl3ejWvf5FZY
|
||||||
YvACYn9sZ6JUwg9hNTLXuXZY47LuQrrdTDHupoVA9zLvUYMKgO+pjwS8uy1dLQao
|
kQx/Z9Cf7+nW69Okuwa+DX3d8g1pFPqWyoFN5cLqiNIiolqP/pIVTlCp5WZHRCJx
|
||||||
0aztHLZEXuVJvpiRoMtYZl37ZNoLHQJeZUNyNATshAoD1+uSc7aywl8yqdTzXRR2
|
HO2f+mxt7lvymOKLrlq35DywLhYYj4J8OAXI95LRLGWY5GV68f4BKcVpPweAVrHm
|
||||||
g0rkExXEVJ5OPyzbFdOQSC5HoOC7dInIBmkrSFEJMKDkMzwYI+uSoIbn+8i+Gjzy
|
V2zVgCvIDqe2rlXF/hB5eQiiUa9FOaoKJ2NAhfcCar8Ty0PnYwgFpcBh1fXaxfj+
|
||||||
Vh3/lftts/BIvr4NAh1ZAq/215jZSdAGo+1VZeuBeybwh3RBdBl8PhDBviTvbxSk
|
hwv7Pb2ioRDQOgaxtvF26phms79tMxK3HnDXfBvRzIn2pATOJr5om4z4JYna6DSp
|
||||||
P+F1T+UcbAz9bgjQJgNvDb9XHNI8rfEhfDPX/Pr4VvxBZNndmRJVQDKi23YD/7yF
|
dILlW9X5U5/OATIY9DdtvZiAom36YMUfXbHjHf6cZwIgkJQP3KF+2Jd9iMhQwAmQ
|
||||||
WAwXy418M7DPqp7NYmUHFe7JRm9bHk41EeknLZaZGW5qHwQKA10RoJCgjoOIFTsd
|
xiA114zmxlXzvJqGA1LTwVDPA3VyUTQXAZg/2RroB8rTufYRTYKC37h+YXXwtCkP
|
||||||
kD3Qq/0mEuOiuJn5UPE19xtUpvFWamDf3s3zSHM7VJ+gGNrS/WbQ+KmTimj0Wucd
|
gLQtG6gsWPaQ23xddLQI1pk3HvLFR3y0Zr2vR7OYbv5CFXH3pCVeKN+Y9r6c/IbC
|
||||||
2vWiNCGbhWwmp3LLKQlB5xDwXJy099SZUUkgcxGmfcT7FOpd3QSLYnwtPz8uLW0N
|
CRS2S7iwiEuI0YTvUrfscVIQGuc3iC2mJRjCrQUB28LQ6cbCccLk/P/2ynse/lyu
|
||||||
76zbiUTYCQ/ASLrwcKFGCKKBz62DlRreK23E/RjqkKKCVFzzg8AzQTa02ml+wQyG
|
+29/QLZCL3GJlYHvOL1GBnupHygTOETtVW34+j/jDjyOVvZLTuOwtzb7+8R157OI
|
||||||
+5EOwEF2yIrhV0p4hY/GDAIe3cdchiy1EQf6xH/IxPF/QsKNp0CfHVPgdFwLzjM2
|
bUQujZ9f5IRYeRNTliwsZYQXjOI+iMheWHl1kd/qV3FFO946hp9BV1TeFQwCf1Vx
|
||||||
oFD3analGblxp9CMiDbiKTOdFPL8XcguufqpWra2jtUbe07HQaeU2NcM2TeB2KsU
|
b8kWLgUpZpHz5d07EBKhzSQb0OacMEm5FsS3IRRIdnmqvpMsW1wsOjE6VxkS/Ozg
|
||||||
PhgBwgdNxW69K55iHReaZtuLw0GhD+KBrm7gSteVniiYLzLKzxmMycGGtoNwpbGi
|
QE8YGeT1F10bfcJtp2m9uVRpPfffcckW89wBsI9uLsj6pETzLtHVVyepB7NxKRtT
|
||||||
MMJBE+BYZylG
|
3ChWuLWbwCQsrzyPdms=
|
||||||
-----END ENCRYPTED PRIVATE KEY-----
|
-----END ENCRYPTED PRIVATE KEY-----
|
||||||
|
|
|
@ -97,7 +97,8 @@ to use PKCS#5 v2 instead of v1.5 which is default add
|
||||||
|
|
||||||
to use PKCS#12 instead use -v1 witch a 12 algo like
|
to use PKCS#12 instead use -v1 witch a 12 algo like
|
||||||
|
|
||||||
-v1 PBE-SHA1-RC4-128 # file Pkcs8Enc12 , see man pkcs8 for more info
|
-v1 PBE-SHA1-3DES # file Pkcs8Enc12 , see man pkcs8 for more info
|
||||||
|
-v1 PBE-SHA1-RC4-128 # no longer file Pkcs8Enc12, arc4 now off by default
|
||||||
|
|
||||||
|
|
||||||
**** To convert from pkcs8 to traditional ****
|
**** To convert from pkcs8 to traditional ****
|
||||||
|
@ -123,6 +124,8 @@ openssl dhparam -in dh2048.param -text > dh2048.pem
|
||||||
make a new key
|
make a new key
|
||||||
openssl ecparam -genkey -text -name secp256r1 -out ecc-key.pem
|
openssl ecparam -genkey -text -name secp256r1 -out ecc-key.pem
|
||||||
|
|
||||||
|
convert to compressed
|
||||||
|
openssl ec -in ecc-key.pem -conv_form compressed -out ecc-key-comp.pem
|
||||||
|
|
||||||
*** CRL ***
|
*** CRL ***
|
||||||
|
|
||||||
|
|
83
FreeRTOS-Plus/Source/WolfSSL/certs/wolfssl-website-ca.pem
Normal file
83
FreeRTOS-Plus/Source/WolfSSL/certs/wolfssl-website-ca.pem
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
Certificate:
|
||||||
|
Data:
|
||||||
|
Version: 3 (0x2)
|
||||||
|
Serial Number: 0 (0x0)
|
||||||
|
Signature Algorithm: sha1WithRSAEncryption
|
||||||
|
Issuer: C=US, O=The Go Daddy Group, Inc., OU=Go Daddy Class 2 Certification Authority
|
||||||
|
Validity
|
||||||
|
Not Before: Jun 29 17:06:20 2004 GMT
|
||||||
|
Not After : Jun 29 17:06:20 2034 GMT
|
||||||
|
Subject: C=US, O=The Go Daddy Group, Inc., OU=Go Daddy Class 2 Certification Authority
|
||||||
|
Subject Public Key Info:
|
||||||
|
Public Key Algorithm: rsaEncryption
|
||||||
|
Public-Key: (2048 bit)
|
||||||
|
Modulus:
|
||||||
|
00:de:9d:d7:ea:57:18:49:a1:5b:eb:d7:5f:48:86:
|
||||||
|
ea:be:dd:ff:e4:ef:67:1c:f4:65:68:b3:57:71:a0:
|
||||||
|
5e:77:bb:ed:9b:49:e9:70:80:3d:56:18:63:08:6f:
|
||||||
|
da:f2:cc:d0:3f:7f:02:54:22:54:10:d8:b2:81:d4:
|
||||||
|
c0:75:3d:4b:7f:c7:77:c3:3e:78:ab:1a:03:b5:20:
|
||||||
|
6b:2f:6a:2b:b1:c5:88:7e:c4:bb:1e:b0:c1:d8:45:
|
||||||
|
27:6f:aa:37:58:f7:87:26:d7:d8:2d:f6:a9:17:b7:
|
||||||
|
1f:72:36:4e:a6:17:3f:65:98:92:db:2a:6e:5d:a2:
|
||||||
|
fe:88:e0:0b:de:7f:e5:8d:15:e1:eb:cb:3a:d5:e2:
|
||||||
|
12:a2:13:2d:d8:8e:af:5f:12:3d:a0:08:05:08:b6:
|
||||||
|
5c:a5:65:38:04:45:99:1e:a3:60:60:74:c5:41:a5:
|
||||||
|
72:62:1b:62:c5:1f:6f:5f:1a:42:be:02:51:65:a8:
|
||||||
|
ae:23:18:6a:fc:78:03:a9:4d:7f:80:c3:fa:ab:5a:
|
||||||
|
fc:a1:40:a4:ca:19:16:fe:b2:c8:ef:5e:73:0d:ee:
|
||||||
|
77:bd:9a:f6:79:98:bc:b1:07:67:a2:15:0d:dd:a0:
|
||||||
|
58:c6:44:7b:0a:3e:62:28:5f:ba:41:07:53:58:cf:
|
||||||
|
11:7e:38:74:c5:f8:ff:b5:69:90:8f:84:74:ea:97:
|
||||||
|
1b:af
|
||||||
|
Exponent: 3 (0x3)
|
||||||
|
X509v3 extensions:
|
||||||
|
X509v3 Subject Key Identifier:
|
||||||
|
D2:C4:B0:D2:91:D4:4C:11:71:B3:61:CB:3D:A1:FE:DD:A8:6A:D4:E3
|
||||||
|
X509v3 Authority Key Identifier:
|
||||||
|
keyid:D2:C4:B0:D2:91:D4:4C:11:71:B3:61:CB:3D:A1:FE:DD:A8:6A:D4:E3
|
||||||
|
DirName:/C=US/O=The Go Daddy Group, Inc./OU=Go Daddy Class 2 Certification Authority
|
||||||
|
serial:00
|
||||||
|
|
||||||
|
X509v3 Basic Constraints:
|
||||||
|
CA:TRUE
|
||||||
|
Signature Algorithm: sha1WithRSAEncryption
|
||||||
|
32:4b:f3:b2:ca:3e:91:fc:12:c6:a1:07:8c:8e:77:a0:33:06:
|
||||||
|
14:5c:90:1e:18:f7:08:a6:3d:0a:19:f9:87:80:11:6e:69:e4:
|
||||||
|
96:17:30:ff:34:91:63:72:38:ee:cc:1c:01:a3:1d:94:28:a4:
|
||||||
|
31:f6:7a:c4:54:d7:f6:e5:31:58:03:a2:cc:ce:62:db:94:45:
|
||||||
|
73:b5:bf:45:c9:24:b5:d5:82:02:ad:23:79:69:8d:b8:b6:4d:
|
||||||
|
ce:cf:4c:ca:33:23:e8:1c:88:aa:9d:8b:41:6e:16:c9:20:e5:
|
||||||
|
89:9e:cd:3b:da:70:f7:7e:99:26:20:14:54:25:ab:6e:73:85:
|
||||||
|
e6:9b:21:9d:0a:6c:82:0e:a8:f8:c2:0c:fa:10:1e:6c:96:ef:
|
||||||
|
87:0d:c4:0f:61:8b:ad:ee:83:2b:95:f8:8e:92:84:72:39:eb:
|
||||||
|
20:ea:83:ed:83:cd:97:6e:08:bc:eb:4e:26:b6:73:2b:e4:d3:
|
||||||
|
f6:4c:fe:26:71:e2:61:11:74:4a:ff:57:1a:87:0f:75:48:2e:
|
||||||
|
cf:51:69:17:a0:02:12:61:95:d5:d1:40:b2:10:4c:ee:c4:ac:
|
||||||
|
10:43:a6:a5:9e:0a:d5:95:62:9a:0d:cf:88:82:c5:32:0c:e4:
|
||||||
|
2b:9f:45:e6:0d:9f:28:9c:b1:b9:2a:5a:57:ad:37:0f:af:1d:
|
||||||
|
7f:db:bd:9f
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEh
|
||||||
|
MB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBE
|
||||||
|
YWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3
|
||||||
|
MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRo
|
||||||
|
ZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3Mg
|
||||||
|
MiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggEN
|
||||||
|
ADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCA
|
||||||
|
PVYYYwhv2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6w
|
||||||
|
wdhFJ2+qN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXi
|
||||||
|
EqITLdiOr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWoriMY
|
||||||
|
avx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZEewo+
|
||||||
|
YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0OBBYEFNLE
|
||||||
|
sNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h
|
||||||
|
/t2oatTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5
|
||||||
|
IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmlj
|
||||||
|
YXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD
|
||||||
|
ggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYXMP80kWNy
|
||||||
|
OO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P
|
||||||
|
TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ
|
||||||
|
HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER
|
||||||
|
dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf
|
||||||
|
ReYNnyicsbkqWletNw+vHX/bvZ8=
|
||||||
|
-----END CERTIFICATE-----
|
1113
FreeRTOS-Plus/Source/WolfSSL/configure
vendored
1113
FreeRTOS-Plus/Source/WolfSSL/configure
vendored
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,10 +0,0 @@
|
||||||
# vim:ft=automake
|
|
||||||
# All paths should be given relative to the root
|
|
||||||
|
|
||||||
noinst_PROGRAMS += ctaocrypt/benchmark/benchmark
|
|
||||||
ctaocrypt_benchmark_benchmark_SOURCES = ctaocrypt/benchmark/benchmark.c
|
|
||||||
ctaocrypt_benchmark_benchmark_LDADD = src/libcyassl.la
|
|
||||||
ctaocrypt_benchmark_benchmark_DEPENDENCIES = src/libcyassl.la
|
|
||||||
EXTRA_DIST += ctaocrypt/benchmark/benchmark.sln
|
|
||||||
EXTRA_DIST += ctaocrypt/benchmark/benchmark.vcproj
|
|
||||||
DISTCLEANFILES+= ctaocrypt/benchmark/.libs/benchmark
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,825 +1 @@
|
||||||
/* hmac.c
|
/* dummy file for autoconf */
|
||||||
*
|
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
|
||||||
*
|
|
||||||
* This file is part of CyaSSL.
|
|
||||||
*
|
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/settings.h>
|
|
||||||
|
|
||||||
#ifndef NO_HMAC
|
|
||||||
|
|
||||||
#ifdef CYASSL_PIC32MZ_HASH
|
|
||||||
|
|
||||||
#define InitMd5 InitMd5_sw
|
|
||||||
#define Md5Update Md5Update_sw
|
|
||||||
#define Md5Final Md5Final_sw
|
|
||||||
|
|
||||||
#define InitSha InitSha_sw
|
|
||||||
#define ShaUpdate ShaUpdate_sw
|
|
||||||
#define ShaFinal ShaFinal_sw
|
|
||||||
|
|
||||||
#define InitSha256 InitSha256_sw
|
|
||||||
#define Sha256Update Sha256Update_sw
|
|
||||||
#define Sha256Final Sha256Final_sw
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_FIPS
|
|
||||||
/* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */
|
|
||||||
#define FIPS_NO_WRAPPERS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/hmac.h>
|
|
||||||
#include <cyassl/ctaocrypt/error-crypt.h>
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
static void HmacCaviumFinal(Hmac* hmac, byte* hash);
|
|
||||||
static void HmacCaviumUpdate(Hmac* hmac, const byte* msg, word32 length);
|
|
||||||
static void HmacCaviumSetKey(Hmac* hmac, int type, const byte* key,
|
|
||||||
word32 length);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int InitHmac(Hmac* hmac, int type)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
hmac->innerHashKeyed = 0;
|
|
||||||
hmac->macType = (byte)type;
|
|
||||||
|
|
||||||
if (!(type == MD5 || type == SHA || type == SHA256 || type == SHA384
|
|
||||||
|| type == SHA512 || type == BLAKE2B_ID))
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
|
|
||||||
switch (type) {
|
|
||||||
#ifndef NO_MD5
|
|
||||||
case MD5:
|
|
||||||
InitMd5(&hmac->hash.md5);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NO_SHA
|
|
||||||
case SHA:
|
|
||||||
ret = InitSha(&hmac->hash.sha);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NO_SHA256
|
|
||||||
case SHA256:
|
|
||||||
ret = InitSha256(&hmac->hash.sha256);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SHA384
|
|
||||||
case SHA384:
|
|
||||||
ret = InitSha384(&hmac->hash.sha384);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SHA512
|
|
||||||
case SHA512:
|
|
||||||
ret = InitSha512(&hmac->hash.sha512);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_BLAKE2
|
|
||||||
case BLAKE2B_ID:
|
|
||||||
ret = InitBlake2b(&hmac->hash.blake2b, BLAKE2B_256);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int HmacSetKey(Hmac* hmac, int type, const byte* key, word32 length)
|
|
||||||
{
|
|
||||||
byte* ip = (byte*) hmac->ipad;
|
|
||||||
byte* op = (byte*) hmac->opad;
|
|
||||||
word32 i, hmac_block_size = 0;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
if (hmac->magic == CYASSL_HMAC_CAVIUM_MAGIC)
|
|
||||||
return HmacCaviumSetKey(hmac, type, key, length);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ret = InitHmac(hmac, type);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
#ifdef HAVE_FIPS
|
|
||||||
if (length < HMAC_FIPS_MIN_KEY)
|
|
||||||
return HMAC_MIN_KEYLEN_E;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
switch (hmac->macType) {
|
|
||||||
#ifndef NO_MD5
|
|
||||||
case MD5:
|
|
||||||
{
|
|
||||||
hmac_block_size = MD5_BLOCK_SIZE;
|
|
||||||
if (length <= MD5_BLOCK_SIZE) {
|
|
||||||
XMEMCPY(ip, key, length);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Md5Update(&hmac->hash.md5, key, length);
|
|
||||||
Md5Final(&hmac->hash.md5, ip);
|
|
||||||
length = MD5_DIGEST_SIZE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NO_SHA
|
|
||||||
case SHA:
|
|
||||||
{
|
|
||||||
hmac_block_size = SHA_BLOCK_SIZE;
|
|
||||||
if (length <= SHA_BLOCK_SIZE) {
|
|
||||||
XMEMCPY(ip, key, length);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ShaUpdate(&hmac->hash.sha, key, length);
|
|
||||||
ShaFinal(&hmac->hash.sha, ip);
|
|
||||||
length = SHA_DIGEST_SIZE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NO_SHA256
|
|
||||||
case SHA256:
|
|
||||||
{
|
|
||||||
hmac_block_size = SHA256_BLOCK_SIZE;
|
|
||||||
if (length <= SHA256_BLOCK_SIZE) {
|
|
||||||
XMEMCPY(ip, key, length);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ret = Sha256Update(&hmac->hash.sha256, key, length);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = Sha256Final(&hmac->hash.sha256, ip);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
length = SHA256_DIGEST_SIZE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SHA384
|
|
||||||
case SHA384:
|
|
||||||
{
|
|
||||||
hmac_block_size = SHA384_BLOCK_SIZE;
|
|
||||||
if (length <= SHA384_BLOCK_SIZE) {
|
|
||||||
XMEMCPY(ip, key, length);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ret = Sha384Update(&hmac->hash.sha384, key, length);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = Sha384Final(&hmac->hash.sha384, ip);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
length = SHA384_DIGEST_SIZE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SHA512
|
|
||||||
case SHA512:
|
|
||||||
{
|
|
||||||
hmac_block_size = SHA512_BLOCK_SIZE;
|
|
||||||
if (length <= SHA512_BLOCK_SIZE) {
|
|
||||||
XMEMCPY(ip, key, length);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ret = Sha512Update(&hmac->hash.sha512, key, length);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = Sha512Final(&hmac->hash.sha512, ip);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
length = SHA512_DIGEST_SIZE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_BLAKE2
|
|
||||||
case BLAKE2B_ID:
|
|
||||||
{
|
|
||||||
hmac_block_size = BLAKE2B_BLOCKBYTES;
|
|
||||||
if (length <= BLAKE2B_BLOCKBYTES) {
|
|
||||||
XMEMCPY(ip, key, length);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ret = Blake2bUpdate(&hmac->hash.blake2b, key, length);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = Blake2bFinal(&hmac->hash.blake2b, ip, BLAKE2B_256);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
length = BLAKE2B_256;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
}
|
|
||||||
if (length < hmac_block_size)
|
|
||||||
XMEMSET(ip + length, 0, hmac_block_size - length);
|
|
||||||
|
|
||||||
for(i = 0; i < hmac_block_size; i++) {
|
|
||||||
op[i] = ip[i] ^ OPAD;
|
|
||||||
ip[i] ^= IPAD;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int HmacKeyInnerHash(Hmac* hmac)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
switch (hmac->macType) {
|
|
||||||
#ifndef NO_MD5
|
|
||||||
case MD5:
|
|
||||||
Md5Update(&hmac->hash.md5, (byte*) hmac->ipad, MD5_BLOCK_SIZE);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NO_SHA
|
|
||||||
case SHA:
|
|
||||||
ShaUpdate(&hmac->hash.sha, (byte*) hmac->ipad, SHA_BLOCK_SIZE);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NO_SHA256
|
|
||||||
case SHA256:
|
|
||||||
ret = Sha256Update(&hmac->hash.sha256,
|
|
||||||
(byte*) hmac->ipad, SHA256_BLOCK_SIZE);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SHA384
|
|
||||||
case SHA384:
|
|
||||||
ret = Sha384Update(&hmac->hash.sha384,
|
|
||||||
(byte*) hmac->ipad, SHA384_BLOCK_SIZE);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SHA512
|
|
||||||
case SHA512:
|
|
||||||
ret = Sha512Update(&hmac->hash.sha512,
|
|
||||||
(byte*) hmac->ipad, SHA512_BLOCK_SIZE);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_BLAKE2
|
|
||||||
case BLAKE2B_ID:
|
|
||||||
ret = Blake2bUpdate(&hmac->hash.blake2b,
|
|
||||||
(byte*) hmac->ipad,BLAKE2B_BLOCKBYTES);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
hmac->innerHashKeyed = 1;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int HmacUpdate(Hmac* hmac, const byte* msg, word32 length)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
if (hmac->magic == CYASSL_HMAC_CAVIUM_MAGIC)
|
|
||||||
return HmacCaviumUpdate(hmac, msg, length);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!hmac->innerHashKeyed) {
|
|
||||||
ret = HmacKeyInnerHash(hmac);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (hmac->macType) {
|
|
||||||
#ifndef NO_MD5
|
|
||||||
case MD5:
|
|
||||||
Md5Update(&hmac->hash.md5, msg, length);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NO_SHA
|
|
||||||
case SHA:
|
|
||||||
ShaUpdate(&hmac->hash.sha, msg, length);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NO_SHA256
|
|
||||||
case SHA256:
|
|
||||||
ret = Sha256Update(&hmac->hash.sha256, msg, length);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SHA384
|
|
||||||
case SHA384:
|
|
||||||
ret = Sha384Update(&hmac->hash.sha384, msg, length);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SHA512
|
|
||||||
case SHA512:
|
|
||||||
ret = Sha512Update(&hmac->hash.sha512, msg, length);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_BLAKE2
|
|
||||||
case BLAKE2B_ID:
|
|
||||||
ret = Blake2bUpdate(&hmac->hash.blake2b, msg, length);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int HmacFinal(Hmac* hmac, byte* hash)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
if (hmac->magic == CYASSL_HMAC_CAVIUM_MAGIC)
|
|
||||||
return HmacCaviumFinal(hmac, hash);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!hmac->innerHashKeyed) {
|
|
||||||
ret = HmacKeyInnerHash(hmac);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (hmac->macType) {
|
|
||||||
#ifndef NO_MD5
|
|
||||||
case MD5:
|
|
||||||
{
|
|
||||||
Md5Final(&hmac->hash.md5, (byte*) hmac->innerHash);
|
|
||||||
|
|
||||||
Md5Update(&hmac->hash.md5, (byte*) hmac->opad, MD5_BLOCK_SIZE);
|
|
||||||
Md5Update(&hmac->hash.md5,
|
|
||||||
(byte*) hmac->innerHash, MD5_DIGEST_SIZE);
|
|
||||||
|
|
||||||
Md5Final(&hmac->hash.md5, hash);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NO_SHA
|
|
||||||
case SHA:
|
|
||||||
{
|
|
||||||
ShaFinal(&hmac->hash.sha, (byte*) hmac->innerHash);
|
|
||||||
|
|
||||||
ShaUpdate(&hmac->hash.sha, (byte*) hmac->opad, SHA_BLOCK_SIZE);
|
|
||||||
ShaUpdate(&hmac->hash.sha,
|
|
||||||
(byte*) hmac->innerHash, SHA_DIGEST_SIZE);
|
|
||||||
|
|
||||||
ShaFinal(&hmac->hash.sha, hash);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NO_SHA256
|
|
||||||
case SHA256:
|
|
||||||
{
|
|
||||||
ret = Sha256Final(&hmac->hash.sha256, (byte*) hmac->innerHash);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = Sha256Update(&hmac->hash.sha256,
|
|
||||||
(byte*) hmac->opad, SHA256_BLOCK_SIZE);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = Sha256Update(&hmac->hash.sha256,
|
|
||||||
(byte*) hmac->innerHash, SHA256_DIGEST_SIZE);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = Sha256Final(&hmac->hash.sha256, hash);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SHA384
|
|
||||||
case SHA384:
|
|
||||||
{
|
|
||||||
ret = Sha384Final(&hmac->hash.sha384, (byte*) hmac->innerHash);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = Sha384Update(&hmac->hash.sha384,
|
|
||||||
(byte*) hmac->opad, SHA384_BLOCK_SIZE);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = Sha384Update(&hmac->hash.sha384,
|
|
||||||
(byte*) hmac->innerHash, SHA384_DIGEST_SIZE);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = Sha384Final(&hmac->hash.sha384, hash);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SHA512
|
|
||||||
case SHA512:
|
|
||||||
{
|
|
||||||
ret = Sha512Final(&hmac->hash.sha512, (byte*) hmac->innerHash);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = Sha512Update(&hmac->hash.sha512,
|
|
||||||
(byte*) hmac->opad, SHA512_BLOCK_SIZE);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = Sha512Update(&hmac->hash.sha512,
|
|
||||||
(byte*) hmac->innerHash, SHA512_DIGEST_SIZE);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = Sha512Final(&hmac->hash.sha512, hash);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_BLAKE2
|
|
||||||
case BLAKE2B_ID:
|
|
||||||
{
|
|
||||||
ret = Blake2bFinal(&hmac->hash.blake2b, (byte*) hmac->innerHash,
|
|
||||||
BLAKE2B_256);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = Blake2bUpdate(&hmac->hash.blake2b,
|
|
||||||
(byte*) hmac->opad, BLAKE2B_BLOCKBYTES);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = Blake2bUpdate(&hmac->hash.blake2b,
|
|
||||||
(byte*) hmac->innerHash, BLAKE2B_256);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = Blake2bFinal(&hmac->hash.blake2b, hash, BLAKE2B_256);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
hmac->innerHashKeyed = 0;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
|
|
||||||
/* Initiliaze Hmac for use with Nitrox device */
|
|
||||||
int HmacInitCavium(Hmac* hmac, int devId)
|
|
||||||
{
|
|
||||||
if (hmac == NULL)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (CspAllocContext(CONTEXT_SSL, &hmac->contextHandle, devId) != 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
hmac->keyLen = 0;
|
|
||||||
hmac->dataLen = 0;
|
|
||||||
hmac->type = 0;
|
|
||||||
hmac->devId = devId;
|
|
||||||
hmac->magic = CYASSL_HMAC_CAVIUM_MAGIC;
|
|
||||||
hmac->data = NULL; /* buffered input data */
|
|
||||||
|
|
||||||
hmac->innerHashKeyed = 0;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Free Hmac from use with Nitrox device */
|
|
||||||
void HmacFreeCavium(Hmac* hmac)
|
|
||||||
{
|
|
||||||
if (hmac == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
CspFreeContext(CONTEXT_SSL, hmac->contextHandle, hmac->devId);
|
|
||||||
hmac->magic = 0;
|
|
||||||
XFREE(hmac->data, NULL, DYNAMIC_TYPE_CAVIUM_TMP);
|
|
||||||
hmac->data = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void HmacCaviumFinal(Hmac* hmac, byte* hash)
|
|
||||||
{
|
|
||||||
word32 requestId;
|
|
||||||
|
|
||||||
if (CspHmac(CAVIUM_BLOCKING, hmac->type, NULL, hmac->keyLen,
|
|
||||||
(byte*)hmac->ipad, hmac->dataLen, hmac->data, hash, &requestId,
|
|
||||||
hmac->devId) != 0) {
|
|
||||||
CYASSL_MSG("Cavium Hmac failed");
|
|
||||||
}
|
|
||||||
hmac->innerHashKeyed = 0; /* tell update to start over if used again */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void HmacCaviumUpdate(Hmac* hmac, const byte* msg, word32 length)
|
|
||||||
{
|
|
||||||
word16 add = (word16)length;
|
|
||||||
word32 total;
|
|
||||||
byte* tmp;
|
|
||||||
|
|
||||||
if (length > CYASSL_MAX_16BIT) {
|
|
||||||
CYASSL_MSG("Too big msg for cavium hmac");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hmac->innerHashKeyed == 0) { /* starting new */
|
|
||||||
hmac->dataLen = 0;
|
|
||||||
hmac->innerHashKeyed = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
total = add + hmac->dataLen;
|
|
||||||
if (total > CYASSL_MAX_16BIT) {
|
|
||||||
CYASSL_MSG("Too big msg for cavium hmac");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
tmp = XMALLOC(hmac->dataLen + add, NULL,DYNAMIC_TYPE_CAVIUM_TMP);
|
|
||||||
if (tmp == NULL) {
|
|
||||||
CYASSL_MSG("Out of memory for cavium update");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (hmac->dataLen)
|
|
||||||
XMEMCPY(tmp, hmac->data, hmac->dataLen);
|
|
||||||
XMEMCPY(tmp + hmac->dataLen, msg, add);
|
|
||||||
|
|
||||||
hmac->dataLen += add;
|
|
||||||
XFREE(hmac->data, NULL, DYNAMIC_TYPE_CAVIUM_TMP);
|
|
||||||
hmac->data = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void HmacCaviumSetKey(Hmac* hmac, int type, const byte* key,
|
|
||||||
word32 length)
|
|
||||||
{
|
|
||||||
hmac->macType = (byte)type;
|
|
||||||
if (type == MD5)
|
|
||||||
hmac->type = MD5_TYPE;
|
|
||||||
else if (type == SHA)
|
|
||||||
hmac->type = SHA1_TYPE;
|
|
||||||
else if (type == SHA256)
|
|
||||||
hmac->type = SHA256_TYPE;
|
|
||||||
else {
|
|
||||||
CYASSL_MSG("unsupported cavium hmac type");
|
|
||||||
}
|
|
||||||
|
|
||||||
hmac->innerHashKeyed = 0; /* should we key Startup flag */
|
|
||||||
|
|
||||||
hmac->keyLen = (word16)length;
|
|
||||||
/* store key in ipad */
|
|
||||||
XMEMCPY(hmac->ipad, key, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* HAVE_CAVIUM */
|
|
||||||
|
|
||||||
int CyaSSL_GetHmacMaxSize(void)
|
|
||||||
{
|
|
||||||
return MAX_DIGEST_SIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_HKDF
|
|
||||||
|
|
||||||
#ifndef min
|
|
||||||
|
|
||||||
static INLINE word32 min(word32 a, word32 b)
|
|
||||||
{
|
|
||||||
return a > b ? b : a;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* min */
|
|
||||||
|
|
||||||
|
|
||||||
static INLINE int GetHashSizeByType(int type)
|
|
||||||
{
|
|
||||||
if (!(type == MD5 || type == SHA || type == SHA256 || type == SHA384
|
|
||||||
|| type == SHA512 || type == BLAKE2B_ID))
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
|
|
||||||
switch (type) {
|
|
||||||
#ifndef NO_MD5
|
|
||||||
case MD5:
|
|
||||||
return MD5_DIGEST_SIZE;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NO_SHA
|
|
||||||
case SHA:
|
|
||||||
return SHA_DIGEST_SIZE;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NO_SHA256
|
|
||||||
case SHA256:
|
|
||||||
return SHA256_DIGEST_SIZE;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SHA384
|
|
||||||
case SHA384:
|
|
||||||
return SHA384_DIGEST_SIZE;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SHA512
|
|
||||||
case SHA512:
|
|
||||||
return SHA512_DIGEST_SIZE;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_BLAKE2
|
|
||||||
case BLAKE2B_ID:
|
|
||||||
return BLAKE2B_OUTBYTES;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* HMAC-KDF with hash type, optional salt and info, return 0 on success */
|
|
||||||
int HKDF(int type, const byte* inKey, word32 inKeySz,
|
|
||||||
const byte* salt, word32 saltSz,
|
|
||||||
const byte* info, word32 infoSz,
|
|
||||||
byte* out, word32 outSz)
|
|
||||||
{
|
|
||||||
Hmac myHmac;
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
byte* tmp;
|
|
||||||
byte* prk;
|
|
||||||
#else
|
|
||||||
byte tmp[MAX_DIGEST_SIZE]; /* localSalt helper and T */
|
|
||||||
byte prk[MAX_DIGEST_SIZE];
|
|
||||||
#endif
|
|
||||||
const byte* localSalt; /* either points to user input or tmp */
|
|
||||||
int hashSz = GetHashSizeByType(type);
|
|
||||||
word32 outIdx = 0;
|
|
||||||
byte n = 0x1;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (hashSz < 0)
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
tmp = (byte*)XMALLOC(MAX_DIGEST_SIZE, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
if (tmp == NULL)
|
|
||||||
return MEMORY_E;
|
|
||||||
|
|
||||||
prk = (byte*)XMALLOC(MAX_DIGEST_SIZE, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
if (prk == NULL) {
|
|
||||||
XFREE(tmp, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
return MEMORY_E;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
localSalt = salt;
|
|
||||||
if (localSalt == NULL) {
|
|
||||||
XMEMSET(tmp, 0, hashSz);
|
|
||||||
localSalt = tmp;
|
|
||||||
saltSz = hashSz;
|
|
||||||
}
|
|
||||||
|
|
||||||
do {
|
|
||||||
ret = HmacSetKey(&myHmac, type, localSalt, saltSz);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
ret = HmacUpdate(&myHmac, inKey, inKeySz);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
ret = HmacFinal(&myHmac, prk);
|
|
||||||
} while (0);
|
|
||||||
|
|
||||||
if (ret == 0) {
|
|
||||||
while (outIdx < outSz) {
|
|
||||||
int tmpSz = (n == 1) ? 0 : hashSz;
|
|
||||||
word32 left = outSz - outIdx;
|
|
||||||
|
|
||||||
ret = HmacSetKey(&myHmac, type, prk, hashSz);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
ret = HmacUpdate(&myHmac, tmp, tmpSz);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
ret = HmacUpdate(&myHmac, info, infoSz);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
ret = HmacUpdate(&myHmac, &n, 1);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
ret = HmacFinal(&myHmac, tmp);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
left = min(left, (word32)hashSz);
|
|
||||||
XMEMCPY(out+outIdx, tmp, left);
|
|
||||||
|
|
||||||
outIdx += hashSz;
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
XFREE(tmp, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
XFREE(prk, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* HAVE_HKDF */
|
|
||||||
|
|
||||||
#endif /* NO_HMAC */
|
|
||||||
|
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
# vim:ft=automake
|
|
||||||
# All paths should be given relative to the root
|
|
||||||
|
|
||||||
EXTRA_DIST += ctaocrypt/src/misc.c
|
|
||||||
EXTRA_DIST += ctaocrypt/src/asm.c
|
|
||||||
EXTRA_DIST += ctaocrypt/src/aes_asm.asm
|
|
||||||
|
|
||||||
EXTRA_DIST += \
|
|
||||||
ctaocrypt/src/ecc_fp.c \
|
|
||||||
ctaocrypt/src/fp_mont_small.i \
|
|
||||||
ctaocrypt/src/fp_mul_comba_12.i \
|
|
||||||
ctaocrypt/src/fp_mul_comba_17.i \
|
|
||||||
ctaocrypt/src/fp_mul_comba_20.i \
|
|
||||||
ctaocrypt/src/fp_mul_comba_24.i \
|
|
||||||
ctaocrypt/src/fp_mul_comba_28.i \
|
|
||||||
ctaocrypt/src/fp_mul_comba_32.i \
|
|
||||||
ctaocrypt/src/fp_mul_comba_3.i \
|
|
||||||
ctaocrypt/src/fp_mul_comba_48.i \
|
|
||||||
ctaocrypt/src/fp_mul_comba_4.i \
|
|
||||||
ctaocrypt/src/fp_mul_comba_64.i \
|
|
||||||
ctaocrypt/src/fp_mul_comba_6.i \
|
|
||||||
ctaocrypt/src/fp_mul_comba_7.i \
|
|
||||||
ctaocrypt/src/fp_mul_comba_8.i \
|
|
||||||
ctaocrypt/src/fp_mul_comba_9.i \
|
|
||||||
ctaocrypt/src/fp_mul_comba_small_set.i \
|
|
||||||
ctaocrypt/src/fp_sqr_comba_12.i \
|
|
||||||
ctaocrypt/src/fp_sqr_comba_17.i \
|
|
||||||
ctaocrypt/src/fp_sqr_comba_20.i \
|
|
||||||
ctaocrypt/src/fp_sqr_comba_24.i \
|
|
||||||
ctaocrypt/src/fp_sqr_comba_28.i \
|
|
||||||
ctaocrypt/src/fp_sqr_comba_32.i \
|
|
||||||
ctaocrypt/src/fp_sqr_comba_3.i \
|
|
||||||
ctaocrypt/src/fp_sqr_comba_48.i \
|
|
||||||
ctaocrypt/src/fp_sqr_comba_4.i \
|
|
||||||
ctaocrypt/src/fp_sqr_comba_64.i \
|
|
||||||
ctaocrypt/src/fp_sqr_comba_6.i \
|
|
||||||
ctaocrypt/src/fp_sqr_comba_7.i \
|
|
||||||
ctaocrypt/src/fp_sqr_comba_8.i \
|
|
||||||
ctaocrypt/src/fp_sqr_comba_9.i \
|
|
||||||
ctaocrypt/src/fp_sqr_comba_small_set.i
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* misc.c
|
/* misc.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -19,154 +19,9 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/settings.h>
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/misc.h>
|
|
||||||
|
|
||||||
/* inlining these functions is a huge speed increase and a small size decrease,
|
|
||||||
because the functions are smaller than function call setup/cleanup, e.g.,
|
|
||||||
md5 benchmark is twice as fast with inline. If you don't want it, then
|
|
||||||
define NO_INLINE and compile this file into cyassl, otherwise it's used as
|
|
||||||
a source header
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef NO_INLINE
|
#ifdef NO_INLINE
|
||||||
#define STATIC
|
#include <wolfssl/wolfcrypt/misc.h>
|
||||||
#else
|
#else
|
||||||
#define STATIC static
|
/* for inline includes */
|
||||||
|
#include <wolfcrypt/src/misc.c>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef INTEL_INTRINSICS
|
|
||||||
|
|
||||||
#include <stdlib.h> /* get intrinsic definitions */
|
|
||||||
|
|
||||||
/* for non visual studio probably need no long version, 32 bit only
|
|
||||||
* i.e., _rotl and _rotr */
|
|
||||||
#pragma intrinsic(_lrotl, _lrotr)
|
|
||||||
|
|
||||||
STATIC INLINE word32 rotlFixed(word32 x, word32 y)
|
|
||||||
{
|
|
||||||
return y ? _lrotl(x, y) : x;
|
|
||||||
}
|
|
||||||
|
|
||||||
STATIC INLINE word32 rotrFixed(word32 x, word32 y)
|
|
||||||
{
|
|
||||||
return y ? _lrotr(x, y) : x;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else /* generic */
|
|
||||||
|
|
||||||
STATIC INLINE word32 rotlFixed(word32 x, word32 y)
|
|
||||||
{
|
|
||||||
return (x << y) | (x >> (sizeof(y) * 8 - y));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
STATIC INLINE word32 rotrFixed(word32 x, word32 y)
|
|
||||||
{
|
|
||||||
return (x >> y) | (x << (sizeof(y) * 8 - y));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
STATIC INLINE word32 ByteReverseWord32(word32 value)
|
|
||||||
{
|
|
||||||
#ifdef PPC_INTRINSICS
|
|
||||||
/* PPC: load reverse indexed instruction */
|
|
||||||
return (word32)__lwbrx(&value,0);
|
|
||||||
#elif defined(KEIL_INTRINSICS)
|
|
||||||
return (word32)__rev(value);
|
|
||||||
#elif defined(FAST_ROTATE)
|
|
||||||
/* 5 instructions with rotate instruction, 9 without */
|
|
||||||
return (rotrFixed(value, 8U) & 0xff00ff00) |
|
|
||||||
(rotlFixed(value, 8U) & 0x00ff00ff);
|
|
||||||
#else
|
|
||||||
/* 6 instructions with rotate instruction, 8 without */
|
|
||||||
value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8);
|
|
||||||
return rotlFixed(value, 16U);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
STATIC INLINE void ByteReverseWords(word32* out, const word32* in,
|
|
||||||
word32 byteCount)
|
|
||||||
{
|
|
||||||
word32 count = byteCount/(word32)sizeof(word32), i;
|
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
|
||||||
out[i] = ByteReverseWord32(in[i]);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef WORD64_AVAILABLE
|
|
||||||
|
|
||||||
|
|
||||||
STATIC INLINE word64 rotlFixed64(word64 x, word64 y)
|
|
||||||
{
|
|
||||||
return (x << y) | (x >> (sizeof(y) * 8 - y));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
STATIC INLINE word64 rotrFixed64(word64 x, word64 y)
|
|
||||||
{
|
|
||||||
return (x >> y) | (x << (sizeof(y) * 8 - y));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
STATIC INLINE word64 ByteReverseWord64(word64 value)
|
|
||||||
{
|
|
||||||
#ifdef CTAOCRYPT_SLOW_WORD64
|
|
||||||
return (word64)(ByteReverseWord32((word32)value)) << 32 |
|
|
||||||
ByteReverseWord32((word32)(value>>32));
|
|
||||||
#else
|
|
||||||
value = ((value & W64LIT(0xFF00FF00FF00FF00)) >> 8) |
|
|
||||||
((value & W64LIT(0x00FF00FF00FF00FF)) << 8);
|
|
||||||
value = ((value & W64LIT(0xFFFF0000FFFF0000)) >> 16) |
|
|
||||||
((value & W64LIT(0x0000FFFF0000FFFF)) << 16);
|
|
||||||
return rotlFixed64(value, 32U);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
STATIC INLINE void ByteReverseWords64(word64* out, const word64* in,
|
|
||||||
word32 byteCount)
|
|
||||||
{
|
|
||||||
word32 count = byteCount/(word32)sizeof(word64), i;
|
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
|
||||||
out[i] = ByteReverseWord64(in[i]);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* WORD64_AVAILABLE */
|
|
||||||
|
|
||||||
|
|
||||||
STATIC INLINE void XorWords(word* r, const word* a, word32 n)
|
|
||||||
{
|
|
||||||
word32 i;
|
|
||||||
|
|
||||||
for (i = 0; i < n; i++) r[i] ^= a[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
STATIC INLINE void xorbuf(void* buf, const void* mask, word32 count)
|
|
||||||
{
|
|
||||||
if (((word)buf | (word)mask | count) % CYASSL_WORD_SIZE == 0)
|
|
||||||
XorWords( (word*)buf, (const word*)mask, count / CYASSL_WORD_SIZE);
|
|
||||||
else {
|
|
||||||
word32 i;
|
|
||||||
byte* b = (byte*)buf;
|
|
||||||
const byte* m = (const byte*)mask;
|
|
||||||
|
|
||||||
for (i = 0; i < count; i++) b[i] ^= m[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#undef STATIC
|
|
||||||
|
|
||||||
|
|
|
@ -1,474 +0,0 @@
|
||||||
/* pwdbased.c
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
|
||||||
*
|
|
||||||
* This file is part of CyaSSL.
|
|
||||||
*
|
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/settings.h>
|
|
||||||
|
|
||||||
#ifndef NO_PWDBASED
|
|
||||||
|
|
||||||
#ifdef CYASSL_PIC32MZ_HASH
|
|
||||||
|
|
||||||
#define InitMd5 InitMd5_sw
|
|
||||||
#define Md5Update Md5Update_sw
|
|
||||||
#define Md5Final Md5Final_sw
|
|
||||||
|
|
||||||
#define InitSha InitSha_sw
|
|
||||||
#define ShaUpdate ShaUpdate_sw
|
|
||||||
#define ShaFinal ShaFinal_sw
|
|
||||||
|
|
||||||
#define InitSha256 InitSha256_sw
|
|
||||||
#define Sha256Update Sha256Update_sw
|
|
||||||
#define Sha256Final Sha256Final_sw
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/pwdbased.h>
|
|
||||||
#include <cyassl/ctaocrypt/hmac.h>
|
|
||||||
#include <cyassl/ctaocrypt/integer.h>
|
|
||||||
#include <cyassl/ctaocrypt/error-crypt.h>
|
|
||||||
#if defined(CYASSL_SHA512) || defined(CYASSL_SHA384)
|
|
||||||
#include <cyassl/ctaocrypt/sha512.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NO_INLINE
|
|
||||||
#include <cyassl/ctaocrypt/misc.h>
|
|
||||||
#else
|
|
||||||
#include <ctaocrypt/src/misc.c>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef min
|
|
||||||
|
|
||||||
static INLINE word32 min(word32 a, word32 b)
|
|
||||||
{
|
|
||||||
return a > b ? b : a;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* min */
|
|
||||||
|
|
||||||
|
|
||||||
int PBKDF1(byte* output, const byte* passwd, int pLen, const byte* salt,
|
|
||||||
int sLen, int iterations, int kLen, int hashType)
|
|
||||||
{
|
|
||||||
Md5 md5;
|
|
||||||
Sha sha;
|
|
||||||
int hLen = (hashType == MD5) ? (int)MD5_DIGEST_SIZE : (int)SHA_DIGEST_SIZE;
|
|
||||||
int i, ret = 0;
|
|
||||||
byte buffer[SHA_DIGEST_SIZE]; /* max size */
|
|
||||||
|
|
||||||
if (hashType != MD5 && hashType != SHA)
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
|
|
||||||
if (kLen > hLen)
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
|
|
||||||
if (iterations < 1)
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
|
|
||||||
if (hashType == MD5) {
|
|
||||||
InitMd5(&md5);
|
|
||||||
Md5Update(&md5, passwd, pLen);
|
|
||||||
Md5Update(&md5, salt, sLen);
|
|
||||||
Md5Final(&md5, buffer);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ret = InitSha(&sha);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
ShaUpdate(&sha, passwd, pLen);
|
|
||||||
ShaUpdate(&sha, salt, sLen);
|
|
||||||
ShaFinal(&sha, buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 1; i < iterations; i++) {
|
|
||||||
if (hashType == MD5) {
|
|
||||||
Md5Update(&md5, buffer, hLen);
|
|
||||||
Md5Final(&md5, buffer);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ShaUpdate(&sha, buffer, hLen);
|
|
||||||
ShaFinal(&sha, buffer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
XMEMCPY(output, buffer, kLen);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int PBKDF2(byte* output, const byte* passwd, int pLen, const byte* salt,
|
|
||||||
int sLen, int iterations, int kLen, int hashType)
|
|
||||||
{
|
|
||||||
word32 i = 1;
|
|
||||||
int hLen;
|
|
||||||
int j, ret;
|
|
||||||
Hmac hmac;
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
byte* buffer;
|
|
||||||
#else
|
|
||||||
byte buffer[MAX_DIGEST_SIZE];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (hashType == MD5) {
|
|
||||||
hLen = MD5_DIGEST_SIZE;
|
|
||||||
}
|
|
||||||
else if (hashType == SHA) {
|
|
||||||
hLen = SHA_DIGEST_SIZE;
|
|
||||||
}
|
|
||||||
#ifndef NO_SHA256
|
|
||||||
else if (hashType == SHA256) {
|
|
||||||
hLen = SHA256_DIGEST_SIZE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef CYASSL_SHA512
|
|
||||||
else if (hashType == SHA512) {
|
|
||||||
hLen = SHA512_DIGEST_SIZE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
else
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
buffer = (byte*)XMALLOC(MAX_DIGEST_SIZE, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
if (buffer == NULL)
|
|
||||||
return MEMORY_E;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ret = HmacSetKey(&hmac, hashType, passwd, pLen);
|
|
||||||
|
|
||||||
if (ret == 0) {
|
|
||||||
while (kLen) {
|
|
||||||
int currentLen;
|
|
||||||
|
|
||||||
ret = HmacUpdate(&hmac, salt, sLen);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* encode i */
|
|
||||||
for (j = 0; j < 4; j++) {
|
|
||||||
byte b = (byte)(i >> ((3-j) * 8));
|
|
||||||
|
|
||||||
ret = HmacUpdate(&hmac, &b, 1);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* check ret from inside for loop */
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
ret = HmacFinal(&hmac, buffer);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
currentLen = min(kLen, hLen);
|
|
||||||
XMEMCPY(output, buffer, currentLen);
|
|
||||||
|
|
||||||
for (j = 1; j < iterations; j++) {
|
|
||||||
ret = HmacUpdate(&hmac, buffer, hLen);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
ret = HmacFinal(&hmac, buffer);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
xorbuf(output, buffer, currentLen);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* check ret from inside for loop */
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
output += currentLen;
|
|
||||||
kLen -= currentLen;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
XFREE(buffer, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CYASSL_SHA512
|
|
||||||
#define PBKDF_DIGEST_SIZE SHA512_BLOCK_SIZE
|
|
||||||
#elif !defined(NO_SHA256)
|
|
||||||
#define PBKDF_DIGEST_SIZE SHA256_BLOCK_SIZE
|
|
||||||
#else
|
|
||||||
#define PBKDF_DIGEST_SIZE SHA_DIGEST_SIZE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int PKCS12_PBKDF(byte* output, const byte* passwd, int passLen,const byte* salt,
|
|
||||||
int saltLen, int iterations, int kLen, int hashType, int id)
|
|
||||||
{
|
|
||||||
/* all in bytes instead of bits */
|
|
||||||
word32 u, v, dLen, pLen, iLen, sLen, totalLen;
|
|
||||||
int dynamic = 0;
|
|
||||||
int ret = 0;
|
|
||||||
int i;
|
|
||||||
byte *D, *S, *P, *I;
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
byte staticBuffer[1]; /* force dynamic usage */
|
|
||||||
#else
|
|
||||||
byte staticBuffer[1024];
|
|
||||||
#endif
|
|
||||||
byte* buffer = staticBuffer;
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
byte* Ai;
|
|
||||||
byte* B;
|
|
||||||
#else
|
|
||||||
byte Ai[PBKDF_DIGEST_SIZE];
|
|
||||||
byte B[PBKDF_DIGEST_SIZE];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!iterations)
|
|
||||||
iterations = 1;
|
|
||||||
|
|
||||||
if (hashType == MD5) {
|
|
||||||
v = MD5_BLOCK_SIZE;
|
|
||||||
u = MD5_DIGEST_SIZE;
|
|
||||||
}
|
|
||||||
else if (hashType == SHA) {
|
|
||||||
v = SHA_BLOCK_SIZE;
|
|
||||||
u = SHA_DIGEST_SIZE;
|
|
||||||
}
|
|
||||||
#ifndef NO_SHA256
|
|
||||||
else if (hashType == SHA256) {
|
|
||||||
v = SHA256_BLOCK_SIZE;
|
|
||||||
u = SHA256_DIGEST_SIZE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef CYASSL_SHA512
|
|
||||||
else if (hashType == SHA512) {
|
|
||||||
v = SHA512_BLOCK_SIZE;
|
|
||||||
u = SHA512_DIGEST_SIZE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
else
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
Ai = (byte*)XMALLOC(PBKDF_DIGEST_SIZE, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
if (Ai == NULL)
|
|
||||||
return MEMORY_E;
|
|
||||||
|
|
||||||
B = (byte*)XMALLOC(PBKDF_DIGEST_SIZE, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
if (B == NULL) {
|
|
||||||
XFREE(Ai, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
return MEMORY_E;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
dLen = v;
|
|
||||||
sLen = v * ((saltLen + v - 1) / v);
|
|
||||||
if (passLen)
|
|
||||||
pLen = v * ((passLen + v - 1) / v);
|
|
||||||
else
|
|
||||||
pLen = 0;
|
|
||||||
iLen = sLen + pLen;
|
|
||||||
|
|
||||||
totalLen = dLen + sLen + pLen;
|
|
||||||
|
|
||||||
if (totalLen > sizeof(staticBuffer)) {
|
|
||||||
buffer = (byte*)XMALLOC(totalLen, 0, DYNAMIC_TYPE_KEY);
|
|
||||||
if (buffer == NULL) {
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
XFREE(Ai, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
XFREE(B, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
#endif
|
|
||||||
return MEMORY_E;
|
|
||||||
}
|
|
||||||
dynamic = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
D = buffer;
|
|
||||||
S = D + dLen;
|
|
||||||
P = S + sLen;
|
|
||||||
I = S;
|
|
||||||
|
|
||||||
XMEMSET(D, id, dLen);
|
|
||||||
|
|
||||||
for (i = 0; i < (int)sLen; i++)
|
|
||||||
S[i] = salt[i % saltLen];
|
|
||||||
for (i = 0; i < (int)pLen; i++)
|
|
||||||
P[i] = passwd[i % passLen];
|
|
||||||
|
|
||||||
while (kLen > 0) {
|
|
||||||
word32 currentLen;
|
|
||||||
mp_int B1;
|
|
||||||
|
|
||||||
if (hashType == MD5) {
|
|
||||||
Md5 md5;
|
|
||||||
|
|
||||||
InitMd5(&md5);
|
|
||||||
Md5Update(&md5, buffer, totalLen);
|
|
||||||
Md5Final(&md5, Ai);
|
|
||||||
|
|
||||||
for (i = 1; i < iterations; i++) {
|
|
||||||
Md5Update(&md5, Ai, u);
|
|
||||||
Md5Final(&md5, Ai);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (hashType == SHA) {
|
|
||||||
Sha sha;
|
|
||||||
|
|
||||||
ret = InitSha(&sha);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
ShaUpdate(&sha, buffer, totalLen);
|
|
||||||
ShaFinal(&sha, Ai);
|
|
||||||
|
|
||||||
for (i = 1; i < iterations; i++) {
|
|
||||||
ShaUpdate(&sha, Ai, u);
|
|
||||||
ShaFinal(&sha, Ai);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#ifndef NO_SHA256
|
|
||||||
else if (hashType == SHA256) {
|
|
||||||
Sha256 sha256;
|
|
||||||
|
|
||||||
ret = InitSha256(&sha256);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
ret = Sha256Update(&sha256, buffer, totalLen);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
ret = Sha256Final(&sha256, Ai);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
for (i = 1; i < iterations; i++) {
|
|
||||||
ret = Sha256Update(&sha256, Ai, u);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
ret = Sha256Final(&sha256, Ai);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef CYASSL_SHA512
|
|
||||||
else if (hashType == SHA512) {
|
|
||||||
Sha512 sha512;
|
|
||||||
|
|
||||||
ret = InitSha512(&sha512);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
ret = Sha512Update(&sha512, buffer, totalLen);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
ret = Sha512Final(&sha512, Ai);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
for (i = 1; i < iterations; i++) {
|
|
||||||
ret = Sha512Update(&sha512, Ai, u);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
ret = Sha512Final(&sha512, Ai);
|
|
||||||
if (ret != 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (i = 0; i < (int)v; i++)
|
|
||||||
B[i] = Ai[i % u];
|
|
||||||
|
|
||||||
if (mp_init(&B1) != MP_OKAY)
|
|
||||||
ret = MP_INIT_E;
|
|
||||||
else if (mp_read_unsigned_bin(&B1, B, v) != MP_OKAY)
|
|
||||||
ret = MP_READ_E;
|
|
||||||
else if (mp_add_d(&B1, (mp_digit)1, &B1) != MP_OKAY)
|
|
||||||
ret = MP_ADD_E;
|
|
||||||
|
|
||||||
if (ret != 0) {
|
|
||||||
mp_clear(&B1);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < (int)iLen; i += v) {
|
|
||||||
int outSz;
|
|
||||||
mp_int i1;
|
|
||||||
mp_int res;
|
|
||||||
|
|
||||||
if (mp_init_multi(&i1, &res, NULL, NULL, NULL, NULL) != MP_OKAY) {
|
|
||||||
ret = MP_INIT_E;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (mp_read_unsigned_bin(&i1, I + i, v) != MP_OKAY)
|
|
||||||
ret = MP_READ_E;
|
|
||||||
else if (mp_add(&i1, &B1, &res) != MP_OKAY)
|
|
||||||
ret = MP_ADD_E;
|
|
||||||
else if ( (outSz = mp_unsigned_bin_size(&res)) < 0)
|
|
||||||
ret = MP_TO_E;
|
|
||||||
else {
|
|
||||||
if (outSz > (int)v) {
|
|
||||||
/* take off MSB */
|
|
||||||
byte tmp[129];
|
|
||||||
ret = mp_to_unsigned_bin(&res, tmp);
|
|
||||||
XMEMCPY(I + i, tmp + 1, v);
|
|
||||||
}
|
|
||||||
else if (outSz < (int)v) {
|
|
||||||
XMEMSET(I + i, 0, v - outSz);
|
|
||||||
ret = mp_to_unsigned_bin(&res, I + i + v - outSz);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ret = mp_to_unsigned_bin(&res, I + i);
|
|
||||||
}
|
|
||||||
|
|
||||||
mp_clear(&i1);
|
|
||||||
mp_clear(&res);
|
|
||||||
if (ret < 0) break;
|
|
||||||
}
|
|
||||||
|
|
||||||
currentLen = min(kLen, (int)u);
|
|
||||||
XMEMCPY(output, Ai, currentLen);
|
|
||||||
output += currentLen;
|
|
||||||
kLen -= currentLen;
|
|
||||||
mp_clear(&B1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dynamic) XFREE(buffer, 0, DYNAMIC_TYPE_KEY);
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
XFREE(Ai, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
XFREE(B, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef PBKDF_DIGEST_SIZE
|
|
||||||
|
|
||||||
#endif /* NO_PWDBASED */
|
|
||||||
|
|
|
@ -1,898 +1 @@
|
||||||
/* random.c
|
/* dummy file for autoconf */
|
||||||
*
|
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
|
||||||
*
|
|
||||||
* This file is part of CyaSSL.
|
|
||||||
*
|
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/settings.h>
|
|
||||||
|
|
||||||
/* on HPUX 11 you may need to install /dev/random see
|
|
||||||
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=KRNG11I
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_FIPS
|
|
||||||
/* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */
|
|
||||||
#define FIPS_NO_WRAPPERS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/random.h>
|
|
||||||
#include <cyassl/ctaocrypt/error-crypt.h>
|
|
||||||
|
|
||||||
#if defined(HAVE_HASHDRBG) || defined(NO_RC4)
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/sha256.h>
|
|
||||||
|
|
||||||
#ifdef NO_INLINE
|
|
||||||
#include <cyassl/ctaocrypt/misc.h>
|
|
||||||
#else
|
|
||||||
#include <ctaocrypt/src/misc.c>
|
|
||||||
#endif
|
|
||||||
#endif /* HAVE_HASHDRBG || NO_RC4 */
|
|
||||||
|
|
||||||
#if defined(USE_WINDOWS_API)
|
|
||||||
#ifndef _WIN32_WINNT
|
|
||||||
#define _WIN32_WINNT 0x0400
|
|
||||||
#endif
|
|
||||||
#include <windows.h>
|
|
||||||
#include <wincrypt.h>
|
|
||||||
#else
|
|
||||||
#if !defined(NO_DEV_RANDOM) && !defined(CYASSL_MDK_ARM) \
|
|
||||||
&& !defined(CYASSL_IAR_ARM)
|
|
||||||
#include <fcntl.h>
|
|
||||||
#ifndef EBSNET
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
/* include headers that may be needed to get good seed */
|
|
||||||
#endif
|
|
||||||
#endif /* USE_WINDOWS_API */
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(HAVE_HASHDRBG) || defined(NO_RC4)
|
|
||||||
|
|
||||||
/* Start NIST DRBG code */
|
|
||||||
|
|
||||||
#define OUTPUT_BLOCK_LEN (SHA256_DIGEST_SIZE)
|
|
||||||
#define MAX_REQUEST_LEN (0x10000)
|
|
||||||
#define RESEED_INTERVAL (1000000)
|
|
||||||
#define SECURITY_STRENGTH (256)
|
|
||||||
#define ENTROPY_SZ (SECURITY_STRENGTH/8)
|
|
||||||
#define NONCE_SZ (ENTROPY_SZ/2)
|
|
||||||
#define ENTROPY_NONCE_SZ (ENTROPY_SZ+NONCE_SZ)
|
|
||||||
|
|
||||||
/* Internal return codes */
|
|
||||||
#define DRBG_SUCCESS 0
|
|
||||||
#define DRBG_ERROR 1
|
|
||||||
#define DRBG_FAILURE 2
|
|
||||||
#define DRBG_NEED_RESEED 3
|
|
||||||
|
|
||||||
/* RNG health states */
|
|
||||||
#define DRBG_NOT_INIT 0
|
|
||||||
#define DRBG_OK 1
|
|
||||||
#define DRBG_FAILED 2
|
|
||||||
|
|
||||||
|
|
||||||
enum {
|
|
||||||
drbgInitC = 0,
|
|
||||||
drbgReseed = 1,
|
|
||||||
drbgGenerateW = 2,
|
|
||||||
drbgGenerateH = 3,
|
|
||||||
drbgInitV
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* Hash Derivation Function */
|
|
||||||
/* Returns: DRBG_SUCCESS or DRBG_FAILURE */
|
|
||||||
static int Hash_df(RNG* rng, byte* out, word32 outSz, byte type,
|
|
||||||
const byte* inA, word32 inASz,
|
|
||||||
const byte* inB, word32 inBSz)
|
|
||||||
{
|
|
||||||
byte ctr;
|
|
||||||
int i;
|
|
||||||
int len;
|
|
||||||
word32 bits = (outSz * 8); /* reverse byte order */
|
|
||||||
|
|
||||||
#ifdef LITTLE_ENDIAN_ORDER
|
|
||||||
bits = ByteReverseWord32(bits);
|
|
||||||
#endif
|
|
||||||
len = (outSz / OUTPUT_BLOCK_LEN)
|
|
||||||
+ ((outSz % OUTPUT_BLOCK_LEN) ? 1 : 0);
|
|
||||||
|
|
||||||
for (i = 0, ctr = 1; i < len; i++, ctr++)
|
|
||||||
{
|
|
||||||
if (InitSha256(&rng->sha) != 0)
|
|
||||||
return DRBG_FAILURE;
|
|
||||||
|
|
||||||
if (Sha256Update(&rng->sha, &ctr, sizeof(ctr)) != 0)
|
|
||||||
return DRBG_FAILURE;
|
|
||||||
|
|
||||||
if (Sha256Update(&rng->sha, (byte*)&bits, sizeof(bits)) != 0)
|
|
||||||
return DRBG_FAILURE;
|
|
||||||
|
|
||||||
/* churning V is the only string that doesn't have
|
|
||||||
* the type added */
|
|
||||||
if (type != drbgInitV)
|
|
||||||
if (Sha256Update(&rng->sha, &type, sizeof(type)) != 0)
|
|
||||||
return DRBG_FAILURE;
|
|
||||||
|
|
||||||
if (Sha256Update(&rng->sha, inA, inASz) != 0)
|
|
||||||
return DRBG_FAILURE;
|
|
||||||
|
|
||||||
if (inB != NULL && inBSz > 0)
|
|
||||||
if (Sha256Update(&rng->sha, inB, inBSz) != 0)
|
|
||||||
return DRBG_FAILURE;
|
|
||||||
|
|
||||||
if (Sha256Final(&rng->sha, rng->digest) != 0)
|
|
||||||
return DRBG_FAILURE;
|
|
||||||
|
|
||||||
if (outSz > OUTPUT_BLOCK_LEN) {
|
|
||||||
XMEMCPY(out, rng->digest, OUTPUT_BLOCK_LEN);
|
|
||||||
outSz -= OUTPUT_BLOCK_LEN;
|
|
||||||
out += OUTPUT_BLOCK_LEN;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
XMEMCPY(out, rng->digest, outSz);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return DRBG_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Returns: DRBG_SUCCESS or DRBG_FAILURE */
|
|
||||||
static int Hash_DRBG_Reseed(RNG* rng, const byte* entropy, word32 entropySz)
|
|
||||||
{
|
|
||||||
byte seed[DRBG_SEED_LEN];
|
|
||||||
|
|
||||||
if (Hash_df(rng, seed, sizeof(seed), drbgReseed, rng->V, sizeof(rng->V),
|
|
||||||
entropy, entropySz) != DRBG_SUCCESS) {
|
|
||||||
return DRBG_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
XMEMCPY(rng->V, seed, sizeof(rng->V));
|
|
||||||
XMEMSET(seed, 0, sizeof(seed));
|
|
||||||
|
|
||||||
if (Hash_df(rng, rng->C, sizeof(rng->C), drbgInitC, rng->V,
|
|
||||||
sizeof(rng->V), NULL, 0) != DRBG_SUCCESS) {
|
|
||||||
return DRBG_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
rng->reseedCtr = 1;
|
|
||||||
return DRBG_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static INLINE void array_add_one(byte* data, word32 dataSz)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = dataSz - 1; i >= 0; i--)
|
|
||||||
{
|
|
||||||
data[i]++;
|
|
||||||
if (data[i] != 0) break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Returns: DRBG_SUCCESS or DRBG_FAILURE */
|
|
||||||
static int Hash_gen(RNG* rng, byte* out, word32 outSz, const byte* V)
|
|
||||||
{
|
|
||||||
byte data[DRBG_SEED_LEN];
|
|
||||||
int i;
|
|
||||||
int len = (outSz / OUTPUT_BLOCK_LEN)
|
|
||||||
+ ((outSz % OUTPUT_BLOCK_LEN) ? 1 : 0);
|
|
||||||
|
|
||||||
XMEMCPY(data, V, sizeof(data));
|
|
||||||
for (i = 0; i < len; i++) {
|
|
||||||
if (InitSha256(&rng->sha) != 0 ||
|
|
||||||
Sha256Update(&rng->sha, data, sizeof(data)) != 0 ||
|
|
||||||
Sha256Final(&rng->sha, rng->digest) != 0) {
|
|
||||||
|
|
||||||
return DRBG_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (outSz > OUTPUT_BLOCK_LEN) {
|
|
||||||
XMEMCPY(out, rng->digest, OUTPUT_BLOCK_LEN);
|
|
||||||
outSz -= OUTPUT_BLOCK_LEN;
|
|
||||||
out += OUTPUT_BLOCK_LEN;
|
|
||||||
array_add_one(data, DRBG_SEED_LEN);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
XMEMCPY(out, rng->digest, outSz);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
XMEMSET(data, 0, sizeof(data));
|
|
||||||
|
|
||||||
return DRBG_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static INLINE void array_add(byte* d, word32 dLen, const byte* s, word32 sLen)
|
|
||||||
{
|
|
||||||
word16 carry = 0;
|
|
||||||
|
|
||||||
if (dLen > 0 && sLen > 0 && dLen >= sLen) {
|
|
||||||
int sIdx, dIdx;
|
|
||||||
|
|
||||||
for (sIdx = sLen - 1, dIdx = dLen - 1; sIdx >= 0; dIdx--, sIdx--)
|
|
||||||
{
|
|
||||||
carry += d[dIdx] + s[sIdx];
|
|
||||||
d[dIdx] = carry;
|
|
||||||
carry >>= 8;
|
|
||||||
}
|
|
||||||
if (dIdx > 0)
|
|
||||||
d[dIdx] += carry;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Returns: DRBG_SUCCESS, DRBG_NEED_RESEED, or DRBG_FAILURE */
|
|
||||||
static int Hash_DRBG_Generate(RNG* rng, byte* out, word32 outSz)
|
|
||||||
{
|
|
||||||
int ret = DRBG_NEED_RESEED;
|
|
||||||
|
|
||||||
if (rng->reseedCtr != RESEED_INTERVAL) {
|
|
||||||
byte type = drbgGenerateH;
|
|
||||||
word32 reseedCtr = rng->reseedCtr;
|
|
||||||
|
|
||||||
rng->reseedCtr++;
|
|
||||||
if (Hash_gen(rng, out, outSz, rng->V) != 0 ||
|
|
||||||
InitSha256(&rng->sha) != 0 ||
|
|
||||||
Sha256Update(&rng->sha, &type, sizeof(type)) != 0 ||
|
|
||||||
Sha256Update(&rng->sha, rng->V, sizeof(rng->V)) != 0 ||
|
|
||||||
Sha256Final(&rng->sha, rng->digest) != 0) {
|
|
||||||
|
|
||||||
ret = DRBG_FAILURE;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
array_add(rng->V, sizeof(rng->V), rng->digest, sizeof(rng->digest));
|
|
||||||
array_add(rng->V, sizeof(rng->V), rng->C, sizeof(rng->C));
|
|
||||||
#ifdef LITTLE_ENDIAN_ORDER
|
|
||||||
reseedCtr = ByteReverseWord32(reseedCtr);
|
|
||||||
#endif
|
|
||||||
array_add(rng->V, sizeof(rng->V),
|
|
||||||
(byte*)&reseedCtr, sizeof(reseedCtr));
|
|
||||||
ret = DRBG_SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Returns: DRBG_SUCCESS or DRBG_FAILURE */
|
|
||||||
static int Hash_DRBG_Instantiate(RNG* rng, const byte* seed, word32 seedSz,
|
|
||||||
const byte* nonce, word32 nonceSz)
|
|
||||||
{
|
|
||||||
int ret = DRBG_FAILURE;
|
|
||||||
|
|
||||||
XMEMSET(rng, 0, sizeof(*rng));
|
|
||||||
|
|
||||||
if (Hash_df(rng, rng->V, sizeof(rng->V), drbgInitV, seed, seedSz,
|
|
||||||
nonce, nonceSz) == DRBG_SUCCESS &&
|
|
||||||
Hash_df(rng, rng->C, sizeof(rng->C), drbgInitC, rng->V,
|
|
||||||
sizeof(rng->V), NULL, 0) == DRBG_SUCCESS) {
|
|
||||||
|
|
||||||
rng->reseedCtr = 1;
|
|
||||||
ret = DRBG_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Returns: DRBG_SUCCESS */
|
|
||||||
static int Hash_DRBG_Uninstantiate(RNG* rng)
|
|
||||||
{
|
|
||||||
XMEMSET(rng, 0, sizeof(*rng));
|
|
||||||
|
|
||||||
return DRBG_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* End NIST DRBG Code */
|
|
||||||
|
|
||||||
|
|
||||||
/* Get seed and key cipher */
|
|
||||||
int InitRng(RNG* rng)
|
|
||||||
{
|
|
||||||
int ret = BAD_FUNC_ARG;
|
|
||||||
|
|
||||||
if (rng != NULL) {
|
|
||||||
byte entropy[ENTROPY_NONCE_SZ];
|
|
||||||
|
|
||||||
/* This doesn't use a separate nonce. The entropy input will be
|
|
||||||
* the default size plus the size of the nonce making the seed
|
|
||||||
* size. */
|
|
||||||
if (GenerateSeed(&rng->seed, entropy, ENTROPY_NONCE_SZ) == 0 &&
|
|
||||||
Hash_DRBG_Instantiate(rng, entropy, ENTROPY_NONCE_SZ,
|
|
||||||
NULL, 0) == DRBG_SUCCESS) {
|
|
||||||
rng->status = DRBG_OK;
|
|
||||||
ret = 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
rng->status = DRBG_FAILED;
|
|
||||||
ret = RNG_FAILURE_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
XMEMSET(entropy, 0, ENTROPY_NONCE_SZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* place a generated block in output */
|
|
||||||
int RNG_GenerateBlock(RNG* rng, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (rng == NULL || output == NULL || sz > MAX_REQUEST_LEN)
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
|
|
||||||
if (rng->status != DRBG_OK)
|
|
||||||
return RNG_FAILURE_E;
|
|
||||||
|
|
||||||
ret = Hash_DRBG_Generate(rng, output, sz);
|
|
||||||
if (ret == DRBG_SUCCESS) {
|
|
||||||
ret = 0;
|
|
||||||
}
|
|
||||||
else if (ret == DRBG_NEED_RESEED) {
|
|
||||||
byte entropy[ENTROPY_SZ];
|
|
||||||
|
|
||||||
if (GenerateSeed(&rng->seed, entropy, ENTROPY_SZ) == 0 &&
|
|
||||||
Hash_DRBG_Reseed(rng, entropy, ENTROPY_SZ) == DRBG_SUCCESS &&
|
|
||||||
Hash_DRBG_Generate(rng, output, sz) == DRBG_SUCCESS) {
|
|
||||||
|
|
||||||
ret = 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ret = RNG_FAILURE_E;
|
|
||||||
rng->status = DRBG_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
XMEMSET(entropy, 0, ENTROPY_SZ);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ret = RNG_FAILURE_E;
|
|
||||||
rng->status = DRBG_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int RNG_GenerateByte(RNG* rng, byte* b)
|
|
||||||
{
|
|
||||||
return RNG_GenerateBlock(rng, b, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int FreeRng(RNG* rng)
|
|
||||||
{
|
|
||||||
int ret = BAD_FUNC_ARG;
|
|
||||||
|
|
||||||
if (rng != NULL) {
|
|
||||||
if (Hash_DRBG_Uninstantiate(rng) == DRBG_SUCCESS)
|
|
||||||
ret = 0;
|
|
||||||
else
|
|
||||||
ret = RNG_FAILURE_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int RNG_HealthTest(int reseed, const byte* entropyA, word32 entropyASz,
|
|
||||||
const byte* entropyB, word32 entropyBSz,
|
|
||||||
const byte* output, word32 outputSz)
|
|
||||||
{
|
|
||||||
RNG rng;
|
|
||||||
byte check[SHA256_DIGEST_SIZE * 4];
|
|
||||||
|
|
||||||
if (Hash_DRBG_Instantiate(&rng, entropyA, entropyASz, NULL, 0) != 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (reseed) {
|
|
||||||
if (Hash_DRBG_Reseed(&rng, entropyB, entropyBSz) != 0) {
|
|
||||||
Hash_DRBG_Uninstantiate(&rng);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Hash_DRBG_Generate(&rng, check, sizeof(check)) != 0) {
|
|
||||||
Hash_DRBG_Uninstantiate(&rng);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Hash_DRBG_Generate(&rng, check, sizeof(check)) != 0) {
|
|
||||||
Hash_DRBG_Uninstantiate(&rng);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (outputSz != sizeof(check) || XMEMCMP(output, check, sizeof(check))) {
|
|
||||||
Hash_DRBG_Uninstantiate(&rng);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
Hash_DRBG_Uninstantiate(&rng);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#else /* HAVE_HASHDRBG || NO_RC4 */
|
|
||||||
|
|
||||||
/* Get seed and key cipher */
|
|
||||||
int InitRng(RNG* rng)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
byte* key;
|
|
||||||
byte* junk;
|
|
||||||
#else
|
|
||||||
byte key[32];
|
|
||||||
byte junk[256];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
if (rng->magic == CYASSL_RNG_CAVIUM_MAGIC)
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
key = (byte*)XMALLOC(32, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
if (key == NULL)
|
|
||||||
return MEMORY_E;
|
|
||||||
|
|
||||||
junk = (byte*)XMALLOC(256, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
if (junk == NULL) {
|
|
||||||
XFREE(key, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
return MEMORY_E;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ret = GenerateSeed(&rng->seed, key, 32);
|
|
||||||
|
|
||||||
if (ret == 0) {
|
|
||||||
Arc4SetKey(&rng->cipher, key, sizeof(key));
|
|
||||||
|
|
||||||
ret = RNG_GenerateBlock(rng, junk, 256); /*rid initial state*/
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
XFREE(key, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
XFREE(junk, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
static void CaviumRNG_GenerateBlock(RNG* rng, byte* output, word32 sz);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* place a generated block in output */
|
|
||||||
int RNG_GenerateBlock(RNG* rng, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
if (rng->magic == CYASSL_RNG_CAVIUM_MAGIC)
|
|
||||||
return CaviumRNG_GenerateBlock(rng, output, sz);
|
|
||||||
#endif
|
|
||||||
XMEMSET(output, 0, sz);
|
|
||||||
Arc4Process(&rng->cipher, output, output, sz);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int RNG_GenerateByte(RNG* rng, byte* b)
|
|
||||||
{
|
|
||||||
return RNG_GenerateBlock(rng, b, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/logging.h>
|
|
||||||
#include "cavium_common.h"
|
|
||||||
|
|
||||||
/* Initiliaze RNG for use with Nitrox device */
|
|
||||||
int InitRngCavium(RNG* rng, int devId)
|
|
||||||
{
|
|
||||||
if (rng == NULL)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
rng->devId = devId;
|
|
||||||
rng->magic = CYASSL_RNG_CAVIUM_MAGIC;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void CaviumRNG_GenerateBlock(RNG* rng, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
word offset = 0;
|
|
||||||
word32 requestId;
|
|
||||||
|
|
||||||
while (sz > CYASSL_MAX_16BIT) {
|
|
||||||
word16 slen = (word16)CYASSL_MAX_16BIT;
|
|
||||||
if (CspRandom(CAVIUM_BLOCKING, slen, output + offset, &requestId,
|
|
||||||
rng->devId) != 0) {
|
|
||||||
CYASSL_MSG("Cavium RNG failed");
|
|
||||||
}
|
|
||||||
sz -= CYASSL_MAX_16BIT;
|
|
||||||
offset += CYASSL_MAX_16BIT;
|
|
||||||
}
|
|
||||||
if (sz) {
|
|
||||||
word16 slen = (word16)sz;
|
|
||||||
if (CspRandom(CAVIUM_BLOCKING, slen, output + offset, &requestId,
|
|
||||||
rng->devId) != 0) {
|
|
||||||
CYASSL_MSG("Cavium RNG failed");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* HAVE_CAVIUM */
|
|
||||||
|
|
||||||
#endif /* HAVE_HASHDRBG || NO_RC4 */
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(USE_WINDOWS_API)
|
|
||||||
|
|
||||||
|
|
||||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
if(!CryptAcquireContext(&os->handle, 0, 0, PROV_RSA_FULL,
|
|
||||||
CRYPT_VERIFYCONTEXT))
|
|
||||||
return WINCRYPT_E;
|
|
||||||
|
|
||||||
if (!CryptGenRandom(os->handle, sz, output))
|
|
||||||
return CRYPTGEN_E;
|
|
||||||
|
|
||||||
CryptReleaseContext(os->handle, 0);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#elif defined(HAVE_RTP_SYS) || defined(EBSNET)
|
|
||||||
|
|
||||||
#include "rtprand.h" /* rtp_rand () */
|
|
||||||
#include "rtptime.h" /* rtp_get_system_msec() */
|
|
||||||
|
|
||||||
|
|
||||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
rtp_srand(rtp_get_system_msec());
|
|
||||||
|
|
||||||
for (i = 0; i < sz; i++ ) {
|
|
||||||
output[i] = rtp_rand() % 256;
|
|
||||||
if ( (i % 8) == 7)
|
|
||||||
rtp_srand(rtp_get_system_msec());
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#elif defined(MICRIUM)
|
|
||||||
|
|
||||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
|
|
||||||
NetSecure_InitSeed(output, sz);
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(MBED)
|
|
||||||
|
|
||||||
/* write a real one !!!, just for testing board */
|
|
||||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < sz; i++ )
|
|
||||||
output[i] = i;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(MICROCHIP_PIC32)
|
|
||||||
|
|
||||||
#ifdef MICROCHIP_MPLAB_HARMONY
|
|
||||||
#define PIC32_SEED_COUNT _CP0_GET_COUNT
|
|
||||||
#else
|
|
||||||
#if !defined(CYASSL_MICROCHIP_PIC32MZ)
|
|
||||||
#include <peripheral/timer.h>
|
|
||||||
#endif
|
|
||||||
#define PIC32_SEED_COUNT ReadCoreTimer
|
|
||||||
#endif
|
|
||||||
#ifdef CYASSL_MIC32MZ_RNG
|
|
||||||
#include "xc.h"
|
|
||||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
int i ;
|
|
||||||
byte rnd[8] ;
|
|
||||||
word32 *rnd32 = (word32 *)rnd ;
|
|
||||||
word32 size = sz ;
|
|
||||||
byte* op = output ;
|
|
||||||
|
|
||||||
/* This part has to be replaced with better random seed */
|
|
||||||
RNGNUMGEN1 = ReadCoreTimer();
|
|
||||||
RNGPOLY1 = ReadCoreTimer();
|
|
||||||
RNGPOLY2 = ReadCoreTimer();
|
|
||||||
RNGNUMGEN2 = ReadCoreTimer();
|
|
||||||
#ifdef DEBUG_CYASSL
|
|
||||||
printf("GenerateSeed::Seed=%08x, %08x\n", RNGNUMGEN1, RNGNUMGEN2) ;
|
|
||||||
#endif
|
|
||||||
RNGCONbits.PLEN = 0x40;
|
|
||||||
RNGCONbits.PRNGEN = 1;
|
|
||||||
for(i=0; i<5; i++) { /* wait for RNGNUMGEN ready */
|
|
||||||
volatile int x ;
|
|
||||||
x = RNGNUMGEN1 ;
|
|
||||||
x = RNGNUMGEN2 ;
|
|
||||||
}
|
|
||||||
do {
|
|
||||||
rnd32[0] = RNGNUMGEN1;
|
|
||||||
rnd32[1] = RNGNUMGEN2;
|
|
||||||
|
|
||||||
for(i=0; i<8; i++, op++) {
|
|
||||||
*op = rnd[i] ;
|
|
||||||
size -- ;
|
|
||||||
if(size==0)break ;
|
|
||||||
}
|
|
||||||
} while(size) ;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#else /* CYASSL_MIC32MZ_RNG */
|
|
||||||
/* uses the core timer, in nanoseconds to seed srand */
|
|
||||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
srand(PIC32_SEED_COUNT() * 25);
|
|
||||||
|
|
||||||
for (i = 0; i < sz; i++ ) {
|
|
||||||
output[i] = rand() % 256;
|
|
||||||
if ( (i % 8) == 7)
|
|
||||||
srand(PIC32_SEED_COUNT() * 25);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif /* CYASSL_MIC32MZ_RNG */
|
|
||||||
|
|
||||||
#elif defined(FREESCALE_MQX)
|
|
||||||
|
|
||||||
#ifdef FREESCALE_K70_RNGA
|
|
||||||
/*
|
|
||||||
* Generates a RNG seed using the Random Number Generator Accelerator
|
|
||||||
* on the Kinetis K70. Documentation located in Chapter 37 of
|
|
||||||
* K70 Sub-Family Reference Manual (see Note 3 in the README for link).
|
|
||||||
*/
|
|
||||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
/* turn on RNGA module */
|
|
||||||
SIM_SCGC3 |= SIM_SCGC3_RNGA_MASK;
|
|
||||||
|
|
||||||
/* set SLP bit to 0 - "RNGA is not in sleep mode" */
|
|
||||||
RNG_CR &= ~RNG_CR_SLP_MASK;
|
|
||||||
|
|
||||||
/* set HA bit to 1 - "security violations masked" */
|
|
||||||
RNG_CR |= RNG_CR_HA_MASK;
|
|
||||||
|
|
||||||
/* set GO bit to 1 - "output register loaded with data" */
|
|
||||||
RNG_CR |= RNG_CR_GO_MASK;
|
|
||||||
|
|
||||||
for (i = 0; i < sz; i++) {
|
|
||||||
|
|
||||||
/* wait for RNG FIFO to be full */
|
|
||||||
while((RNG_SR & RNG_SR_OREG_LVL(0xF)) == 0) {}
|
|
||||||
|
|
||||||
/* get value */
|
|
||||||
output[i] = RNG_OR;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(FREESCALE_K53_RNGB)
|
|
||||||
/*
|
|
||||||
* Generates a RNG seed using the Random Number Generator (RNGB)
|
|
||||||
* on the Kinetis K53. Documentation located in Chapter 33 of
|
|
||||||
* K53 Sub-Family Reference Manual (see note in the README for link).
|
|
||||||
*/
|
|
||||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
/* turn on RNGB module */
|
|
||||||
SIM_SCGC3 |= SIM_SCGC3_RNGB_MASK;
|
|
||||||
|
|
||||||
/* reset RNGB */
|
|
||||||
RNG_CMD |= RNG_CMD_SR_MASK;
|
|
||||||
|
|
||||||
/* FIFO generate interrupt, return all zeros on underflow,
|
|
||||||
* set auto reseed */
|
|
||||||
RNG_CR |= (RNG_CR_FUFMOD_MASK | RNG_CR_AR_MASK);
|
|
||||||
|
|
||||||
/* gen seed, clear interrupts, clear errors */
|
|
||||||
RNG_CMD |= (RNG_CMD_GS_MASK | RNG_CMD_CI_MASK | RNG_CMD_CE_MASK);
|
|
||||||
|
|
||||||
/* wait for seeding to complete */
|
|
||||||
while ((RNG_SR & RNG_SR_SDN_MASK) == 0) {}
|
|
||||||
|
|
||||||
for (i = 0; i < sz; i++) {
|
|
||||||
|
|
||||||
/* wait for a word to be available from FIFO */
|
|
||||||
while((RNG_SR & RNG_SR_FIFO_LVL_MASK) == 0) {}
|
|
||||||
|
|
||||||
/* get value */
|
|
||||||
output[i] = RNG_OUT;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
#warning "write a real random seed!!!!, just for testing now"
|
|
||||||
|
|
||||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < sz; i++ )
|
|
||||||
output[i] = i;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif /* FREESCALE_K70_RNGA */
|
|
||||||
|
|
||||||
#elif defined(CYASSL_SAFERTOS) || defined(CYASSL_LEANPSK) \
|
|
||||||
|| defined(CYASSL_IAR_ARM) || defined(CYASSL_MDK_ARM)
|
|
||||||
|
|
||||||
#warning "write a real random seed!!!!, just for testing now"
|
|
||||||
|
|
||||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
word32 i;
|
|
||||||
for (i = 0; i < sz; i++ )
|
|
||||||
output[i] = i;
|
|
||||||
|
|
||||||
(void)os;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(STM32F2_RNG)
|
|
||||||
#undef RNG
|
|
||||||
#include "stm32f2xx_rng.h"
|
|
||||||
#include "stm32f2xx_rcc.h"
|
|
||||||
/*
|
|
||||||
* Generate a RNG seed using the hardware random number generator
|
|
||||||
* on the STM32F2. Documentation located in STM32F2xx Standard Peripheral
|
|
||||||
* Library document (See note in README).
|
|
||||||
*/
|
|
||||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
/* enable RNG clock source */
|
|
||||||
RCC_AHB2PeriphClockCmd(RCC_AHB2Periph_RNG, ENABLE);
|
|
||||||
|
|
||||||
/* enable RNG peripheral */
|
|
||||||
RNG_Cmd(ENABLE);
|
|
||||||
|
|
||||||
for (i = 0; i < sz; i++) {
|
|
||||||
/* wait until RNG number is ready */
|
|
||||||
while(RNG_GetFlagStatus(RNG_FLAG_DRDY)== RESET) { }
|
|
||||||
|
|
||||||
/* get value */
|
|
||||||
output[i] = RNG_GetRandomNumber();
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#elif defined(CYASSL_LPC43xx) || defined(CYASSL_STM32F2xx)
|
|
||||||
|
|
||||||
#warning "write a real random seed!!!!, just for testing now"
|
|
||||||
|
|
||||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < sz; i++ )
|
|
||||||
output[i] = i;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(CUSTOM_RAND_GENERATE)
|
|
||||||
|
|
||||||
/* Implement your own random generation function
|
|
||||||
* word32 rand_gen(void);
|
|
||||||
* #define CUSTOM_RAND_GENERATE rand_gen */
|
|
||||||
|
|
||||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < sz; i++ )
|
|
||||||
output[i] = CUSTOM_RAND_GENERATE();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(NO_DEV_RANDOM)
|
|
||||||
|
|
||||||
#error "you need to write an os specific GenerateSeed() here"
|
|
||||||
|
|
||||||
/*
|
|
||||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#else /* !USE_WINDOWS_API && !HAVE_RPT_SYS && !MICRIUM && !NO_DEV_RANDOM */
|
|
||||||
|
|
||||||
|
|
||||||
/* may block */
|
|
||||||
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
os->fd = open("/dev/urandom",O_RDONLY);
|
|
||||||
if (os->fd == -1) {
|
|
||||||
/* may still have /dev/random */
|
|
||||||
os->fd = open("/dev/random",O_RDONLY);
|
|
||||||
if (os->fd == -1)
|
|
||||||
return OPEN_RAN_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (sz) {
|
|
||||||
int len = (int)read(os->fd, output, sz);
|
|
||||||
if (len == -1) {
|
|
||||||
ret = READ_RAN_E;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
sz -= len;
|
|
||||||
output += len;
|
|
||||||
|
|
||||||
if (sz) {
|
|
||||||
#ifdef BLOCKING
|
|
||||||
sleep(0); /* context switch */
|
|
||||||
#else
|
|
||||||
ret = RAN_BLOCK_E;
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close(os->fd);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* USE_WINDOWS_API */
|
|
||||||
|
|
||||||
|
|
|
@ -1,834 +1 @@
|
||||||
/* rsa.c
|
/* dummy file for autoconf */
|
||||||
*
|
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
|
||||||
*
|
|
||||||
* This file is part of CyaSSL.
|
|
||||||
*
|
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/settings.h>
|
|
||||||
|
|
||||||
#ifndef NO_RSA
|
|
||||||
|
|
||||||
#ifdef HAVE_FIPS
|
|
||||||
/* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */
|
|
||||||
#define FIPS_NO_WRAPPERS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/rsa.h>
|
|
||||||
#include <cyassl/ctaocrypt/random.h>
|
|
||||||
#include <cyassl/ctaocrypt/error-crypt.h>
|
|
||||||
#include <cyassl/ctaocrypt/logging.h>
|
|
||||||
|
|
||||||
#ifdef SHOW_GEN
|
|
||||||
#ifdef FREESCALE_MQX
|
|
||||||
#include <fio.h>
|
|
||||||
#else
|
|
||||||
#include <stdio.h>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
static int InitCaviumRsaKey(RsaKey* key, void* heap);
|
|
||||||
static int FreeCaviumRsaKey(RsaKey* key);
|
|
||||||
static int CaviumRsaPublicEncrypt(const byte* in, word32 inLen, byte* out,
|
|
||||||
word32 outLen, RsaKey* key);
|
|
||||||
static int CaviumRsaPrivateDecrypt(const byte* in, word32 inLen, byte* out,
|
|
||||||
word32 outLen, RsaKey* key);
|
|
||||||
static int CaviumRsaSSL_Sign(const byte* in, word32 inLen, byte* out,
|
|
||||||
word32 outLen, RsaKey* key);
|
|
||||||
static int CaviumRsaSSL_Verify(const byte* in, word32 inLen, byte* out,
|
|
||||||
word32 outLen, RsaKey* key);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
enum {
|
|
||||||
RSA_PUBLIC_ENCRYPT = 0,
|
|
||||||
RSA_PUBLIC_DECRYPT = 1,
|
|
||||||
RSA_PRIVATE_ENCRYPT = 2,
|
|
||||||
RSA_PRIVATE_DECRYPT = 3,
|
|
||||||
|
|
||||||
RSA_BLOCK_TYPE_1 = 1,
|
|
||||||
RSA_BLOCK_TYPE_2 = 2,
|
|
||||||
|
|
||||||
RSA_MIN_SIZE = 512,
|
|
||||||
RSA_MAX_SIZE = 4096,
|
|
||||||
|
|
||||||
RSA_MIN_PAD_SZ = 11 /* seperator + 0 + pad value + 8 pads */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
int InitRsaKey(RsaKey* key, void* heap)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
if (key->magic == CYASSL_RSA_CAVIUM_MAGIC)
|
|
||||||
return InitCaviumRsaKey(key, heap);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
key->type = -1; /* haven't decided yet */
|
|
||||||
key->heap = heap;
|
|
||||||
|
|
||||||
/* TomsFastMath doesn't use memory allocation */
|
|
||||||
#ifndef USE_FAST_MATH
|
|
||||||
key->n.dp = key->e.dp = 0; /* public alloc parts */
|
|
||||||
|
|
||||||
key->d.dp = key->p.dp = 0; /* private alloc parts */
|
|
||||||
key->q.dp = key->dP.dp = 0;
|
|
||||||
key->u.dp = key->dQ.dp = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int FreeRsaKey(RsaKey* key)
|
|
||||||
{
|
|
||||||
(void)key;
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
if (key->magic == CYASSL_RSA_CAVIUM_MAGIC)
|
|
||||||
return FreeCaviumRsaKey(key);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* TomsFastMath doesn't use memory allocation */
|
|
||||||
#ifndef USE_FAST_MATH
|
|
||||||
if (key->type == RSA_PRIVATE) {
|
|
||||||
mp_clear(&key->u);
|
|
||||||
mp_clear(&key->dQ);
|
|
||||||
mp_clear(&key->dP);
|
|
||||||
mp_clear(&key->q);
|
|
||||||
mp_clear(&key->p);
|
|
||||||
mp_clear(&key->d);
|
|
||||||
}
|
|
||||||
mp_clear(&key->e);
|
|
||||||
mp_clear(&key->n);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int RsaPad(const byte* input, word32 inputLen, byte* pkcsBlock,
|
|
||||||
word32 pkcsBlockLen, byte padValue, RNG* rng)
|
|
||||||
{
|
|
||||||
if (inputLen == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
pkcsBlock[0] = 0x0; /* set first byte to zero and advance */
|
|
||||||
pkcsBlock++; pkcsBlockLen--;
|
|
||||||
pkcsBlock[0] = padValue; /* insert padValue */
|
|
||||||
|
|
||||||
if (padValue == RSA_BLOCK_TYPE_1)
|
|
||||||
/* pad with 0xff bytes */
|
|
||||||
XMEMSET(&pkcsBlock[1], 0xFF, pkcsBlockLen - inputLen - 2);
|
|
||||||
else {
|
|
||||||
/* pad with non-zero random bytes */
|
|
||||||
word32 padLen = pkcsBlockLen - inputLen - 1, i;
|
|
||||||
int ret = RNG_GenerateBlock(rng, &pkcsBlock[1], padLen);
|
|
||||||
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
/* remove zeros */
|
|
||||||
for (i = 1; i < padLen; i++)
|
|
||||||
if (pkcsBlock[i] == 0) pkcsBlock[i] = 0x01;
|
|
||||||
}
|
|
||||||
|
|
||||||
pkcsBlock[pkcsBlockLen-inputLen-1] = 0; /* separator */
|
|
||||||
XMEMCPY(pkcsBlock+pkcsBlockLen-inputLen, input, inputLen);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static word32 RsaUnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen,
|
|
||||||
byte **output, byte padValue)
|
|
||||||
{
|
|
||||||
word32 maxOutputLen = (pkcsBlockLen > 10) ? (pkcsBlockLen - 10) : 0,
|
|
||||||
invalid = 0,
|
|
||||||
i = 1,
|
|
||||||
outputLen;
|
|
||||||
|
|
||||||
if (pkcsBlock[0] != 0x0) /* skip past zero */
|
|
||||||
invalid = 1;
|
|
||||||
pkcsBlock++; pkcsBlockLen--;
|
|
||||||
|
|
||||||
/* Require block type padValue */
|
|
||||||
invalid = (pkcsBlock[0] != padValue) || invalid;
|
|
||||||
|
|
||||||
/* skip past the padding until we find the separator */
|
|
||||||
while (i<pkcsBlockLen && pkcsBlock[i++]) { /* null body */
|
|
||||||
}
|
|
||||||
if(!(i==pkcsBlockLen || pkcsBlock[i-1]==0)) {
|
|
||||||
CYASSL_MSG("RsaUnPad error, bad formatting");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
outputLen = pkcsBlockLen - i;
|
|
||||||
invalid = (outputLen > maxOutputLen) || invalid;
|
|
||||||
|
|
||||||
if (invalid) {
|
|
||||||
CYASSL_MSG("RsaUnPad error, bad formatting");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
*output = (byte *)(pkcsBlock + i);
|
|
||||||
return outputLen;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int RsaFunction(const byte* in, word32 inLen, byte* out, word32* outLen,
|
|
||||||
int type, RsaKey* key)
|
|
||||||
{
|
|
||||||
#define ERROR_OUT(x) { ret = x; goto done;}
|
|
||||||
|
|
||||||
mp_int tmp;
|
|
||||||
int ret = 0;
|
|
||||||
word32 keyLen, len;
|
|
||||||
|
|
||||||
if (mp_init(&tmp) != MP_OKAY)
|
|
||||||
return MP_INIT_E;
|
|
||||||
|
|
||||||
if (mp_read_unsigned_bin(&tmp, (byte*)in, inLen) != MP_OKAY)
|
|
||||||
ERROR_OUT(MP_READ_E);
|
|
||||||
|
|
||||||
if (type == RSA_PRIVATE_DECRYPT || type == RSA_PRIVATE_ENCRYPT) {
|
|
||||||
#ifdef RSA_LOW_MEM /* half as much memory but twice as slow */
|
|
||||||
if (mp_exptmod(&tmp, &key->d, &key->n, &tmp) != MP_OKAY)
|
|
||||||
ERROR_OUT(MP_EXPTMOD_E);
|
|
||||||
#else
|
|
||||||
#define INNER_ERROR_OUT(x) { ret = x; goto inner_done; }
|
|
||||||
|
|
||||||
mp_int tmpa, tmpb;
|
|
||||||
|
|
||||||
if (mp_init(&tmpa) != MP_OKAY)
|
|
||||||
ERROR_OUT(MP_INIT_E);
|
|
||||||
|
|
||||||
if (mp_init(&tmpb) != MP_OKAY) {
|
|
||||||
mp_clear(&tmpa);
|
|
||||||
ERROR_OUT(MP_INIT_E);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* tmpa = tmp^dP mod p */
|
|
||||||
if (mp_exptmod(&tmp, &key->dP, &key->p, &tmpa) != MP_OKAY)
|
|
||||||
INNER_ERROR_OUT(MP_EXPTMOD_E);
|
|
||||||
|
|
||||||
/* tmpb = tmp^dQ mod q */
|
|
||||||
if (mp_exptmod(&tmp, &key->dQ, &key->q, &tmpb) != MP_OKAY)
|
|
||||||
INNER_ERROR_OUT(MP_EXPTMOD_E);
|
|
||||||
|
|
||||||
/* tmp = (tmpa - tmpb) * qInv (mod p) */
|
|
||||||
if (mp_sub(&tmpa, &tmpb, &tmp) != MP_OKAY)
|
|
||||||
INNER_ERROR_OUT(MP_SUB_E);
|
|
||||||
|
|
||||||
if (mp_mulmod(&tmp, &key->u, &key->p, &tmp) != MP_OKAY)
|
|
||||||
INNER_ERROR_OUT(MP_MULMOD_E);
|
|
||||||
|
|
||||||
/* tmp = tmpb + q * tmp */
|
|
||||||
if (mp_mul(&tmp, &key->q, &tmp) != MP_OKAY)
|
|
||||||
INNER_ERROR_OUT(MP_MUL_E);
|
|
||||||
|
|
||||||
if (mp_add(&tmp, &tmpb, &tmp) != MP_OKAY)
|
|
||||||
INNER_ERROR_OUT(MP_ADD_E);
|
|
||||||
|
|
||||||
inner_done:
|
|
||||||
mp_clear(&tmpa);
|
|
||||||
mp_clear(&tmpb);
|
|
||||||
|
|
||||||
if (ret != 0) return ret;
|
|
||||||
|
|
||||||
#endif /* RSA_LOW_MEM */
|
|
||||||
}
|
|
||||||
else if (type == RSA_PUBLIC_ENCRYPT || type == RSA_PUBLIC_DECRYPT) {
|
|
||||||
if (mp_exptmod(&tmp, &key->e, &key->n, &tmp) != MP_OKAY)
|
|
||||||
ERROR_OUT(MP_EXPTMOD_E);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ERROR_OUT(RSA_WRONG_TYPE_E);
|
|
||||||
|
|
||||||
keyLen = mp_unsigned_bin_size(&key->n);
|
|
||||||
if (keyLen > *outLen)
|
|
||||||
ERROR_OUT(RSA_BUFFER_E);
|
|
||||||
|
|
||||||
len = mp_unsigned_bin_size(&tmp);
|
|
||||||
|
|
||||||
/* pad front w/ zeros to match key length */
|
|
||||||
while (len < keyLen) {
|
|
||||||
*out++ = 0x00;
|
|
||||||
len++;
|
|
||||||
}
|
|
||||||
|
|
||||||
*outLen = keyLen;
|
|
||||||
|
|
||||||
/* convert */
|
|
||||||
if (mp_to_unsigned_bin(&tmp, out) != MP_OKAY)
|
|
||||||
ERROR_OUT(MP_TO_E);
|
|
||||||
|
|
||||||
done:
|
|
||||||
mp_clear(&tmp);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int RsaPublicEncrypt(const byte* in, word32 inLen, byte* out, word32 outLen,
|
|
||||||
RsaKey* key, RNG* rng)
|
|
||||||
{
|
|
||||||
int sz, ret;
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
if (key->magic == CYASSL_RSA_CAVIUM_MAGIC)
|
|
||||||
return CaviumRsaPublicEncrypt(in, inLen, out, outLen, key);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
sz = mp_unsigned_bin_size(&key->n);
|
|
||||||
if (sz > (int)outLen)
|
|
||||||
return RSA_BUFFER_E;
|
|
||||||
|
|
||||||
if (inLen > (word32)(sz - RSA_MIN_PAD_SZ))
|
|
||||||
return RSA_BUFFER_E;
|
|
||||||
|
|
||||||
ret = RsaPad(in, inLen, out, sz, RSA_BLOCK_TYPE_2, rng);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
if ((ret = RsaFunction(out, sz, out, &outLen, RSA_PUBLIC_ENCRYPT, key)) < 0)
|
|
||||||
sz = ret;
|
|
||||||
|
|
||||||
return sz;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int RsaPrivateDecryptInline(byte* in, word32 inLen, byte** out, RsaKey* key)
|
|
||||||
{
|
|
||||||
int plainLen, ret;
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
if (key->magic == CYASSL_RSA_CAVIUM_MAGIC) {
|
|
||||||
ret = CaviumRsaPrivateDecrypt(in, inLen, in, inLen, key);
|
|
||||||
if (ret > 0)
|
|
||||||
*out = in;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((ret = RsaFunction(in, inLen, in, &inLen, RSA_PRIVATE_DECRYPT, key))
|
|
||||||
< 0) {
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
plainLen = RsaUnPad(in, inLen, out, RSA_BLOCK_TYPE_2);
|
|
||||||
|
|
||||||
return plainLen;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int RsaPrivateDecrypt(const byte* in, word32 inLen, byte* out, word32 outLen,
|
|
||||||
RsaKey* key)
|
|
||||||
{
|
|
||||||
int plainLen, ret;
|
|
||||||
byte* tmp;
|
|
||||||
byte* pad = 0;
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
if (key->magic == CYASSL_RSA_CAVIUM_MAGIC)
|
|
||||||
return CaviumRsaPrivateDecrypt(in, inLen, out, outLen, key);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
tmp = (byte*)XMALLOC(inLen, key->heap, DYNAMIC_TYPE_RSA);
|
|
||||||
if (tmp == NULL) {
|
|
||||||
return MEMORY_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
XMEMCPY(tmp, in, inLen);
|
|
||||||
|
|
||||||
if ((ret = plainLen = RsaPrivateDecryptInline(tmp, inLen, &pad, key))
|
|
||||||
< 0) {
|
|
||||||
XFREE(tmp, key->heap, DYNAMIC_TYPE_RSA);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
if (plainLen > (int)outLen)
|
|
||||||
plainLen = BAD_FUNC_ARG;
|
|
||||||
else
|
|
||||||
XMEMCPY(out, pad, plainLen);
|
|
||||||
XMEMSET(tmp, 0x00, inLen);
|
|
||||||
|
|
||||||
XFREE(tmp, key->heap, DYNAMIC_TYPE_RSA);
|
|
||||||
return plainLen;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* for Rsa Verify */
|
|
||||||
int RsaSSL_VerifyInline(byte* in, word32 inLen, byte** out, RsaKey* key)
|
|
||||||
{
|
|
||||||
int plainLen, ret;
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
if (key->magic == CYASSL_RSA_CAVIUM_MAGIC) {
|
|
||||||
ret = CaviumRsaSSL_Verify(in, inLen, in, inLen, key);
|
|
||||||
if (ret > 0)
|
|
||||||
*out = in;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((ret = RsaFunction(in, inLen, in, &inLen, RSA_PUBLIC_DECRYPT, key))
|
|
||||||
< 0) {
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
plainLen = RsaUnPad(in, inLen, out, RSA_BLOCK_TYPE_1);
|
|
||||||
|
|
||||||
return plainLen;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int RsaSSL_Verify(const byte* in, word32 inLen, byte* out, word32 outLen,
|
|
||||||
RsaKey* key)
|
|
||||||
{
|
|
||||||
int plainLen, ret;
|
|
||||||
byte* tmp;
|
|
||||||
byte* pad = 0;
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
if (key->magic == CYASSL_RSA_CAVIUM_MAGIC)
|
|
||||||
return CaviumRsaSSL_Verify(in, inLen, out, outLen, key);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
tmp = (byte*)XMALLOC(inLen, key->heap, DYNAMIC_TYPE_RSA);
|
|
||||||
if (tmp == NULL) {
|
|
||||||
return MEMORY_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
XMEMCPY(tmp, in, inLen);
|
|
||||||
|
|
||||||
if ((ret = plainLen = RsaSSL_VerifyInline(tmp, inLen, &pad, key))
|
|
||||||
< 0) {
|
|
||||||
XFREE(tmp, key->heap, DYNAMIC_TYPE_RSA);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (plainLen > (int)outLen)
|
|
||||||
plainLen = BAD_FUNC_ARG;
|
|
||||||
else
|
|
||||||
XMEMCPY(out, pad, plainLen);
|
|
||||||
XMEMSET(tmp, 0x00, inLen);
|
|
||||||
|
|
||||||
XFREE(tmp, key->heap, DYNAMIC_TYPE_RSA);
|
|
||||||
return plainLen;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* for Rsa Sign */
|
|
||||||
int RsaSSL_Sign(const byte* in, word32 inLen, byte* out, word32 outLen,
|
|
||||||
RsaKey* key, RNG* rng)
|
|
||||||
{
|
|
||||||
int sz, ret;
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
if (key->magic == CYASSL_RSA_CAVIUM_MAGIC)
|
|
||||||
return CaviumRsaSSL_Sign(in, inLen, out, outLen, key);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
sz = mp_unsigned_bin_size(&key->n);
|
|
||||||
if (sz > (int)outLen)
|
|
||||||
return RSA_BUFFER_E;
|
|
||||||
|
|
||||||
if (inLen > (word32)(sz - RSA_MIN_PAD_SZ))
|
|
||||||
return RSA_BUFFER_E;
|
|
||||||
|
|
||||||
ret = RsaPad(in, inLen, out, sz, RSA_BLOCK_TYPE_1, rng);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
if ((ret = RsaFunction(out, sz, out, &outLen, RSA_PRIVATE_ENCRYPT,key)) < 0)
|
|
||||||
sz = ret;
|
|
||||||
|
|
||||||
return sz;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int RsaEncryptSize(RsaKey* key)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
if (key->magic == CYASSL_RSA_CAVIUM_MAGIC)
|
|
||||||
return key->c_nSz;
|
|
||||||
#endif
|
|
||||||
return mp_unsigned_bin_size(&key->n);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef CYASSL_KEY_GEN
|
|
||||||
|
|
||||||
static const int USE_BBS = 1;
|
|
||||||
|
|
||||||
static int rand_prime(mp_int* N, int len, RNG* rng, void* heap)
|
|
||||||
{
|
|
||||||
int err, res, type;
|
|
||||||
byte* buf;
|
|
||||||
|
|
||||||
(void)heap;
|
|
||||||
if (N == NULL || rng == NULL)
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
|
|
||||||
/* get type */
|
|
||||||
if (len < 0) {
|
|
||||||
type = USE_BBS;
|
|
||||||
len = -len;
|
|
||||||
} else {
|
|
||||||
type = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* allow sizes between 2 and 512 bytes for a prime size */
|
|
||||||
if (len < 2 || len > 512) {
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* allocate buffer to work with */
|
|
||||||
buf = (byte*)XMALLOC(len, heap, DYNAMIC_TYPE_RSA);
|
|
||||||
if (buf == NULL) {
|
|
||||||
return MEMORY_E;
|
|
||||||
}
|
|
||||||
XMEMSET(buf, 0, len);
|
|
||||||
|
|
||||||
do {
|
|
||||||
#ifdef SHOW_GEN
|
|
||||||
printf(".");
|
|
||||||
fflush(stdout);
|
|
||||||
#endif
|
|
||||||
/* generate value */
|
|
||||||
err = RNG_GenerateBlock(rng, buf, len);
|
|
||||||
if (err != 0) {
|
|
||||||
XFREE(buf, heap, DYNAMIC_TYPE_RSA);
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* munge bits */
|
|
||||||
buf[0] |= 0x80 | 0x40;
|
|
||||||
buf[len-1] |= 0x01 | ((type & USE_BBS) ? 0x02 : 0x00);
|
|
||||||
|
|
||||||
/* load value */
|
|
||||||
if ((err = mp_read_unsigned_bin(N, buf, len)) != MP_OKAY) {
|
|
||||||
XFREE(buf, heap, DYNAMIC_TYPE_RSA);
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* test */
|
|
||||||
if ((err = mp_prime_is_prime(N, 8, &res)) != MP_OKAY) {
|
|
||||||
XFREE(buf, heap, DYNAMIC_TYPE_RSA);
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
} while (res == MP_NO);
|
|
||||||
|
|
||||||
#ifdef LTC_CLEAN_STACK
|
|
||||||
XMEMSET(buf, 0, len);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
XFREE(buf, heap, DYNAMIC_TYPE_RSA);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Make an RSA key for size bits, with e specified, 65537 is a good e */
|
|
||||||
int MakeRsaKey(RsaKey* key, int size, long e, RNG* rng)
|
|
||||||
{
|
|
||||||
mp_int p, q, tmp1, tmp2, tmp3;
|
|
||||||
int err;
|
|
||||||
|
|
||||||
if (key == NULL || rng == NULL)
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
|
|
||||||
if (size < RSA_MIN_SIZE || size > RSA_MAX_SIZE)
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
|
|
||||||
if (e < 3 || (e & 1) == 0)
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
|
|
||||||
if ((err = mp_init_multi(&p, &q, &tmp1, &tmp2, &tmp3, NULL)) != MP_OKAY)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
err = mp_set_int(&tmp3, e);
|
|
||||||
|
|
||||||
/* make p */
|
|
||||||
if (err == MP_OKAY) {
|
|
||||||
do {
|
|
||||||
err = rand_prime(&p, size/16, rng, key->heap); /* size in bytes/2 */
|
|
||||||
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
err = mp_sub_d(&p, 1, &tmp1); /* tmp1 = p-1 */
|
|
||||||
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
err = mp_gcd(&tmp1, &tmp3, &tmp2); /* tmp2 = gcd(p-1, e) */
|
|
||||||
} while (err == MP_OKAY && mp_cmp_d(&tmp2, 1) != 0); /* e divdes p-1 */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* make q */
|
|
||||||
if (err == MP_OKAY) {
|
|
||||||
do {
|
|
||||||
err = rand_prime(&q, size/16, rng, key->heap); /* size in bytes/2 */
|
|
||||||
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
err = mp_sub_d(&q, 1, &tmp1); /* tmp1 = q-1 */
|
|
||||||
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
err = mp_gcd(&tmp1, &tmp3, &tmp2); /* tmp2 = gcd(q-1, e) */
|
|
||||||
} while (err == MP_OKAY && mp_cmp_d(&tmp2, 1) != 0); /* e divdes q-1 */
|
|
||||||
}
|
|
||||||
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
err = mp_init_multi(&key->n, &key->e, &key->d, &key->p, &key->q, NULL);
|
|
||||||
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
err = mp_init_multi(&key->dP, &key->dQ, &key->u, NULL, NULL, NULL);
|
|
||||||
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
err = mp_sub_d(&p, 1, &tmp2); /* tmp2 = p-1 */
|
|
||||||
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
err = mp_lcm(&tmp1, &tmp2, &tmp1); /* tmp1 = lcm(p-1, q-1),last loop */
|
|
||||||
|
|
||||||
/* make key */
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
err = mp_set_int(&key->e, e); /* key->e = e */
|
|
||||||
|
|
||||||
if (err == MP_OKAY) /* key->d = 1/e mod lcm(p-1, q-1) */
|
|
||||||
err = mp_invmod(&key->e, &tmp1, &key->d);
|
|
||||||
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
err = mp_mul(&p, &q, &key->n); /* key->n = pq */
|
|
||||||
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
err = mp_sub_d(&p, 1, &tmp1);
|
|
||||||
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
err = mp_sub_d(&q, 1, &tmp2);
|
|
||||||
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
err = mp_mod(&key->d, &tmp1, &key->dP);
|
|
||||||
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
err = mp_mod(&key->d, &tmp2, &key->dQ);
|
|
||||||
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
err = mp_invmod(&q, &p, &key->u);
|
|
||||||
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
err = mp_copy(&p, &key->p);
|
|
||||||
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
err = mp_copy(&q, &key->q);
|
|
||||||
|
|
||||||
if (err == MP_OKAY)
|
|
||||||
key->type = RSA_PRIVATE;
|
|
||||||
|
|
||||||
mp_clear(&tmp3);
|
|
||||||
mp_clear(&tmp2);
|
|
||||||
mp_clear(&tmp1);
|
|
||||||
mp_clear(&q);
|
|
||||||
mp_clear(&p);
|
|
||||||
|
|
||||||
if (err != MP_OKAY) {
|
|
||||||
FreeRsaKey(key);
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* CYASSL_KEY_GEN */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/logging.h>
|
|
||||||
#include "cavium_common.h"
|
|
||||||
|
|
||||||
/* Initiliaze RSA for use with Nitrox device */
|
|
||||||
int RsaInitCavium(RsaKey* rsa, int devId)
|
|
||||||
{
|
|
||||||
if (rsa == NULL)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (CspAllocContext(CONTEXT_SSL, &rsa->contextHandle, devId) != 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
rsa->devId = devId;
|
|
||||||
rsa->magic = CYASSL_RSA_CAVIUM_MAGIC;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Free RSA from use with Nitrox device */
|
|
||||||
void RsaFreeCavium(RsaKey* rsa)
|
|
||||||
{
|
|
||||||
if (rsa == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
CspFreeContext(CONTEXT_SSL, rsa->contextHandle, rsa->devId);
|
|
||||||
rsa->magic = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Initialize cavium RSA key */
|
|
||||||
static int InitCaviumRsaKey(RsaKey* key, void* heap)
|
|
||||||
{
|
|
||||||
if (key == NULL)
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
|
|
||||||
key->heap = heap;
|
|
||||||
key->type = -1; /* don't know yet */
|
|
||||||
|
|
||||||
key->c_n = NULL;
|
|
||||||
key->c_e = NULL;
|
|
||||||
key->c_d = NULL;
|
|
||||||
key->c_p = NULL;
|
|
||||||
key->c_q = NULL;
|
|
||||||
key->c_dP = NULL;
|
|
||||||
key->c_dQ = NULL;
|
|
||||||
key->c_u = NULL;
|
|
||||||
|
|
||||||
key->c_nSz = 0;
|
|
||||||
key->c_eSz = 0;
|
|
||||||
key->c_dSz = 0;
|
|
||||||
key->c_pSz = 0;
|
|
||||||
key->c_qSz = 0;
|
|
||||||
key->c_dP_Sz = 0;
|
|
||||||
key->c_dQ_Sz = 0;
|
|
||||||
key->c_uSz = 0;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Free cavium RSA key */
|
|
||||||
static int FreeCaviumRsaKey(RsaKey* key)
|
|
||||||
{
|
|
||||||
if (key == NULL)
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
|
|
||||||
XFREE(key->c_n, key->heap, DYNAMIC_TYPE_CAVIUM_TMP);
|
|
||||||
XFREE(key->c_e, key->heap, DYNAMIC_TYPE_CAVIUM_TMP);
|
|
||||||
XFREE(key->c_d, key->heap, DYNAMIC_TYPE_CAVIUM_TMP);
|
|
||||||
XFREE(key->c_p, key->heap, DYNAMIC_TYPE_CAVIUM_TMP);
|
|
||||||
XFREE(key->c_q, key->heap, DYNAMIC_TYPE_CAVIUM_TMP);
|
|
||||||
XFREE(key->c_dP, key->heap, DYNAMIC_TYPE_CAVIUM_TMP);
|
|
||||||
XFREE(key->c_dQ, key->heap, DYNAMIC_TYPE_CAVIUM_TMP);
|
|
||||||
XFREE(key->c_u, key->heap, DYNAMIC_TYPE_CAVIUM_TMP);
|
|
||||||
|
|
||||||
return InitCaviumRsaKey(key, key->heap); /* reset pointers */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int CaviumRsaPublicEncrypt(const byte* in, word32 inLen, byte* out,
|
|
||||||
word32 outLen, RsaKey* key)
|
|
||||||
{
|
|
||||||
word32 requestId;
|
|
||||||
word32 ret;
|
|
||||||
|
|
||||||
if (key == NULL || in == NULL || out == NULL || outLen < (word32)key->c_nSz)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
ret = CspPkcs1v15Enc(CAVIUM_BLOCKING, BT2, key->c_nSz, key->c_eSz,
|
|
||||||
(word16)inLen, key->c_n, key->c_e, (byte*)in, out,
|
|
||||||
&requestId, key->devId);
|
|
||||||
if (ret != 0) {
|
|
||||||
CYASSL_MSG("Cavium Enc BT2 failed");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return key->c_nSz;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static INLINE void ato16(const byte* c, word16* u16)
|
|
||||||
{
|
|
||||||
*u16 = (c[0] << 8) | (c[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int CaviumRsaPrivateDecrypt(const byte* in, word32 inLen, byte* out,
|
|
||||||
word32 outLen, RsaKey* key)
|
|
||||||
{
|
|
||||||
word32 requestId;
|
|
||||||
word32 ret;
|
|
||||||
word16 outSz = (word16)outLen;
|
|
||||||
|
|
||||||
if (key == NULL || in == NULL || out == NULL || inLen != (word32)key->c_nSz)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
ret = CspPkcs1v15CrtDec(CAVIUM_BLOCKING, BT2, key->c_nSz, key->c_q,
|
|
||||||
key->c_dQ, key->c_p, key->c_dP, key->c_u,
|
|
||||||
(byte*)in, &outSz, out, &requestId, key->devId);
|
|
||||||
if (ret != 0) {
|
|
||||||
CYASSL_MSG("Cavium CRT Dec BT2 failed");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
ato16((const byte*)&outSz, &outSz);
|
|
||||||
|
|
||||||
return outSz;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int CaviumRsaSSL_Sign(const byte* in, word32 inLen, byte* out,
|
|
||||||
word32 outLen, RsaKey* key)
|
|
||||||
{
|
|
||||||
word32 requestId;
|
|
||||||
word32 ret;
|
|
||||||
|
|
||||||
if (key == NULL || in == NULL || out == NULL || inLen == 0 || outLen <
|
|
||||||
(word32)key->c_nSz)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
ret = CspPkcs1v15CrtEnc(CAVIUM_BLOCKING, BT1, key->c_nSz, (word16)inLen,
|
|
||||||
key->c_q, key->c_dQ, key->c_p, key->c_dP, key->c_u,
|
|
||||||
(byte*)in, out, &requestId, key->devId);
|
|
||||||
if (ret != 0) {
|
|
||||||
CYASSL_MSG("Cavium CRT Enc BT1 failed");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return key->c_nSz;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int CaviumRsaSSL_Verify(const byte* in, word32 inLen, byte* out,
|
|
||||||
word32 outLen, RsaKey* key)
|
|
||||||
{
|
|
||||||
word32 requestId;
|
|
||||||
word32 ret;
|
|
||||||
word16 outSz = (word16)outLen;
|
|
||||||
|
|
||||||
if (key == NULL || in == NULL || out == NULL || inLen != (word32)key->c_nSz)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
ret = CspPkcs1v15Dec(CAVIUM_BLOCKING, BT1, key->c_nSz, key->c_eSz,
|
|
||||||
key->c_n, key->c_e, (byte*)in, &outSz, out,
|
|
||||||
&requestId, key->devId);
|
|
||||||
if (ret != 0) {
|
|
||||||
CYASSL_MSG("Cavium Dec BT1 failed");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
outSz = ntohs(outSz);
|
|
||||||
|
|
||||||
return outSz;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* HAVE_CAVIUM */
|
|
||||||
|
|
||||||
#endif /* NO_RSA */
|
|
||||||
|
|
|
@ -1,429 +1 @@
|
||||||
/* sha.c
|
/* dummy file for autoconf */
|
||||||
*
|
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
|
||||||
*
|
|
||||||
* This file is part of CyaSSL.
|
|
||||||
*
|
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/settings.h>
|
|
||||||
|
|
||||||
#if !defined(NO_SHA)
|
|
||||||
|
|
||||||
#ifdef CYASSL_PIC32MZ_HASH
|
|
||||||
#define InitSha InitSha_sw
|
|
||||||
#define ShaUpdate ShaUpdate_sw
|
|
||||||
#define ShaFinal ShaFinal_sw
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_FIPS
|
|
||||||
/* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */
|
|
||||||
#define FIPS_NO_WRAPPERS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/sha.h>
|
|
||||||
#include <cyassl/ctaocrypt/logging.h>
|
|
||||||
#include <cyassl/ctaocrypt/error-crypt.h>
|
|
||||||
|
|
||||||
#ifdef NO_INLINE
|
|
||||||
#include <cyassl/ctaocrypt/misc.h>
|
|
||||||
#else
|
|
||||||
#include <ctaocrypt/src/misc.c>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FREESCALE_MMCAU
|
|
||||||
#include "cau_api.h"
|
|
||||||
#define XTRANSFORM(S,B) cau_sha1_hash_n((B), 1, ((S))->digest)
|
|
||||||
#else
|
|
||||||
#define XTRANSFORM(S,B) Transform((S))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef STM32F2_HASH
|
|
||||||
/*
|
|
||||||
* STM32F2 hardware SHA1 support through the STM32F2 standard peripheral
|
|
||||||
* library. Documentation located in STM32F2xx Standard Peripheral Library
|
|
||||||
* document (See note in README).
|
|
||||||
*/
|
|
||||||
#include "stm32f2xx.h"
|
|
||||||
#include "stm32f2xx_hash.h"
|
|
||||||
|
|
||||||
int InitSha(Sha* sha)
|
|
||||||
{
|
|
||||||
/* STM32F2 struct notes:
|
|
||||||
* sha->buffer = first 4 bytes used to hold partial block if needed
|
|
||||||
* sha->buffLen = num bytes currently stored in sha->buffer
|
|
||||||
* sha->loLen = num bytes that have been written to STM32 FIFO
|
|
||||||
*/
|
|
||||||
XMEMSET(sha->buffer, 0, SHA_REG_SIZE);
|
|
||||||
sha->buffLen = 0;
|
|
||||||
sha->loLen = 0;
|
|
||||||
|
|
||||||
/* initialize HASH peripheral */
|
|
||||||
HASH_DeInit();
|
|
||||||
|
|
||||||
/* configure algo used, algo mode, datatype */
|
|
||||||
HASH->CR &= ~ (HASH_CR_ALGO | HASH_CR_DATATYPE | HASH_CR_MODE);
|
|
||||||
HASH->CR |= (HASH_AlgoSelection_SHA1 | HASH_AlgoMode_HASH
|
|
||||||
| HASH_DataType_8b);
|
|
||||||
|
|
||||||
/* reset HASH processor */
|
|
||||||
HASH->CR |= HASH_CR_INIT;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int ShaUpdate(Sha* sha, const byte* data, word32 len)
|
|
||||||
{
|
|
||||||
word32 i = 0;
|
|
||||||
word32 fill = 0;
|
|
||||||
word32 diff = 0;
|
|
||||||
|
|
||||||
/* if saved partial block is available */
|
|
||||||
if (sha->buffLen) {
|
|
||||||
fill = 4 - sha->buffLen;
|
|
||||||
|
|
||||||
/* if enough data to fill, fill and push to FIFO */
|
|
||||||
if (fill <= len) {
|
|
||||||
XMEMCPY((byte*)sha->buffer + sha->buffLen, data, fill);
|
|
||||||
HASH_DataIn(*(uint32_t*)sha->buffer);
|
|
||||||
|
|
||||||
data += fill;
|
|
||||||
len -= fill;
|
|
||||||
sha->loLen += 4;
|
|
||||||
sha->buffLen = 0;
|
|
||||||
} else {
|
|
||||||
/* append partial to existing stored block */
|
|
||||||
XMEMCPY((byte*)sha->buffer + sha->buffLen, data, len);
|
|
||||||
sha->buffLen += len;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* write input block in the IN FIFO */
|
|
||||||
for(i = 0; i < len; i += 4)
|
|
||||||
{
|
|
||||||
diff = len - i;
|
|
||||||
if ( diff < 4) {
|
|
||||||
/* store incomplete last block, not yet in FIFO */
|
|
||||||
XMEMSET(sha->buffer, 0, SHA_REG_SIZE);
|
|
||||||
XMEMCPY((byte*)sha->buffer, data, diff);
|
|
||||||
sha->buffLen = diff;
|
|
||||||
} else {
|
|
||||||
HASH_DataIn(*(uint32_t*)data);
|
|
||||||
data+=4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* keep track of total data length thus far */
|
|
||||||
sha->loLen += (len - sha->buffLen);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int ShaFinal(Sha* sha, byte* hash)
|
|
||||||
{
|
|
||||||
__IO uint16_t nbvalidbitsdata = 0;
|
|
||||||
|
|
||||||
/* finish reading any trailing bytes into FIFO */
|
|
||||||
if (sha->buffLen) {
|
|
||||||
HASH_DataIn(*(uint32_t*)sha->buffer);
|
|
||||||
sha->loLen += sha->buffLen;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* calculate number of valid bits in last word of input data */
|
|
||||||
nbvalidbitsdata = 8 * (sha->loLen % SHA_REG_SIZE);
|
|
||||||
|
|
||||||
/* configure number of valid bits in last word of the data */
|
|
||||||
HASH_SetLastWordValidBitsNbr(nbvalidbitsdata);
|
|
||||||
|
|
||||||
/* start HASH processor */
|
|
||||||
HASH_StartDigest();
|
|
||||||
|
|
||||||
/* wait until Busy flag == RESET */
|
|
||||||
while (HASH_GetFlagStatus(HASH_FLAG_BUSY) != RESET) {}
|
|
||||||
|
|
||||||
/* read message digest */
|
|
||||||
sha->digest[0] = HASH->HR[0];
|
|
||||||
sha->digest[1] = HASH->HR[1];
|
|
||||||
sha->digest[2] = HASH->HR[2];
|
|
||||||
sha->digest[3] = HASH->HR[3];
|
|
||||||
sha->digest[4] = HASH->HR[4];
|
|
||||||
|
|
||||||
ByteReverseWords(sha->digest, sha->digest, SHA_DIGEST_SIZE);
|
|
||||||
|
|
||||||
XMEMCPY(hash, sha->digest, SHA_DIGEST_SIZE);
|
|
||||||
|
|
||||||
return InitSha(sha); /* reset state */
|
|
||||||
}
|
|
||||||
|
|
||||||
#else /* CTaoCrypt software implementation */
|
|
||||||
|
|
||||||
#ifndef min
|
|
||||||
|
|
||||||
static INLINE word32 min(word32 a, word32 b)
|
|
||||||
{
|
|
||||||
return a > b ? b : a;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* min */
|
|
||||||
|
|
||||||
|
|
||||||
int InitSha(Sha* sha)
|
|
||||||
{
|
|
||||||
#ifdef FREESCALE_MMCAU
|
|
||||||
cau_sha1_initialize_output(sha->digest);
|
|
||||||
#else
|
|
||||||
sha->digest[0] = 0x67452301L;
|
|
||||||
sha->digest[1] = 0xEFCDAB89L;
|
|
||||||
sha->digest[2] = 0x98BADCFEL;
|
|
||||||
sha->digest[3] = 0x10325476L;
|
|
||||||
sha->digest[4] = 0xC3D2E1F0L;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
sha->buffLen = 0;
|
|
||||||
sha->loLen = 0;
|
|
||||||
sha->hiLen = 0;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef FREESCALE_MMCAU
|
|
||||||
|
|
||||||
#define blk0(i) (W[i] = sha->buffer[i])
|
|
||||||
#define blk1(i) (W[i&15] = \
|
|
||||||
rotlFixed(W[(i+13)&15]^W[(i+8)&15]^W[(i+2)&15]^W[i&15],1))
|
|
||||||
|
|
||||||
#define f1(x,y,z) (z^(x &(y^z)))
|
|
||||||
#define f2(x,y,z) (x^y^z)
|
|
||||||
#define f3(x,y,z) ((x&y)|(z&(x|y)))
|
|
||||||
#define f4(x,y,z) (x^y^z)
|
|
||||||
|
|
||||||
/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
|
|
||||||
#define R0(v,w,x,y,z,i) z+= f1(w,x,y) + blk0(i) + 0x5A827999+ \
|
|
||||||
rotlFixed(v,5); w = rotlFixed(w,30);
|
|
||||||
#define R1(v,w,x,y,z,i) z+= f1(w,x,y) + blk1(i) + 0x5A827999+ \
|
|
||||||
rotlFixed(v,5); w = rotlFixed(w,30);
|
|
||||||
#define R2(v,w,x,y,z,i) z+= f2(w,x,y) + blk1(i) + 0x6ED9EBA1+ \
|
|
||||||
rotlFixed(v,5); w = rotlFixed(w,30);
|
|
||||||
#define R3(v,w,x,y,z,i) z+= f3(w,x,y) + blk1(i) + 0x8F1BBCDC+ \
|
|
||||||
rotlFixed(v,5); w = rotlFixed(w,30);
|
|
||||||
#define R4(v,w,x,y,z,i) z+= f4(w,x,y) + blk1(i) + 0xCA62C1D6+ \
|
|
||||||
rotlFixed(v,5); w = rotlFixed(w,30);
|
|
||||||
|
|
||||||
|
|
||||||
static void Transform(Sha* sha)
|
|
||||||
{
|
|
||||||
word32 W[SHA_BLOCK_SIZE / sizeof(word32)];
|
|
||||||
|
|
||||||
/* Copy context->state[] to working vars */
|
|
||||||
word32 a = sha->digest[0];
|
|
||||||
word32 b = sha->digest[1];
|
|
||||||
word32 c = sha->digest[2];
|
|
||||||
word32 d = sha->digest[3];
|
|
||||||
word32 e = sha->digest[4];
|
|
||||||
|
|
||||||
#ifdef USE_SLOW_SHA
|
|
||||||
word32 t, i;
|
|
||||||
|
|
||||||
for (i = 0; i < 16; i++) {
|
|
||||||
R0(a, b, c, d, e, i);
|
|
||||||
t = e; e = d; d = c; c = b; b = a; a = t;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; i < 20; i++) {
|
|
||||||
R1(a, b, c, d, e, i);
|
|
||||||
t = e; e = d; d = c; c = b; b = a; a = t;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; i < 40; i++) {
|
|
||||||
R2(a, b, c, d, e, i);
|
|
||||||
t = e; e = d; d = c; c = b; b = a; a = t;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; i < 60; i++) {
|
|
||||||
R3(a, b, c, d, e, i);
|
|
||||||
t = e; e = d; d = c; c = b; b = a; a = t;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; i < 80; i++) {
|
|
||||||
R4(a, b, c, d, e, i);
|
|
||||||
t = e; e = d; d = c; c = b; b = a; a = t;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
/* nearly 1 K bigger in code size but 25% faster */
|
|
||||||
/* 4 rounds of 20 operations each. Loop unrolled. */
|
|
||||||
R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3);
|
|
||||||
R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7);
|
|
||||||
R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11);
|
|
||||||
R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15);
|
|
||||||
|
|
||||||
R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19);
|
|
||||||
|
|
||||||
R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23);
|
|
||||||
R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27);
|
|
||||||
R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31);
|
|
||||||
R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35);
|
|
||||||
R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39);
|
|
||||||
|
|
||||||
R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43);
|
|
||||||
R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47);
|
|
||||||
R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51);
|
|
||||||
R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55);
|
|
||||||
R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59);
|
|
||||||
|
|
||||||
R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63);
|
|
||||||
R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67);
|
|
||||||
R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71);
|
|
||||||
R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75);
|
|
||||||
R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Add the working vars back into digest state[] */
|
|
||||||
sha->digest[0] += a;
|
|
||||||
sha->digest[1] += b;
|
|
||||||
sha->digest[2] += c;
|
|
||||||
sha->digest[3] += d;
|
|
||||||
sha->digest[4] += e;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* FREESCALE_MMCAU */
|
|
||||||
|
|
||||||
|
|
||||||
static INLINE void AddLength(Sha* sha, word32 len)
|
|
||||||
{
|
|
||||||
word32 tmp = sha->loLen;
|
|
||||||
if ( (sha->loLen += len) < tmp)
|
|
||||||
sha->hiLen++; /* carry low to high */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int ShaUpdate(Sha* sha, const byte* data, word32 len)
|
|
||||||
{
|
|
||||||
/* do block size increments */
|
|
||||||
byte* local = (byte*)sha->buffer;
|
|
||||||
|
|
||||||
while (len) {
|
|
||||||
word32 add = min(len, SHA_BLOCK_SIZE - sha->buffLen);
|
|
||||||
XMEMCPY(&local[sha->buffLen], data, add);
|
|
||||||
|
|
||||||
sha->buffLen += add;
|
|
||||||
data += add;
|
|
||||||
len -= add;
|
|
||||||
|
|
||||||
if (sha->buffLen == SHA_BLOCK_SIZE) {
|
|
||||||
#if defined(LITTLE_ENDIAN_ORDER) && !defined(FREESCALE_MMCAU)
|
|
||||||
ByteReverseWords(sha->buffer, sha->buffer, SHA_BLOCK_SIZE);
|
|
||||||
#endif
|
|
||||||
XTRANSFORM(sha, local);
|
|
||||||
AddLength(sha, SHA_BLOCK_SIZE);
|
|
||||||
sha->buffLen = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int ShaFinal(Sha* sha, byte* hash)
|
|
||||||
{
|
|
||||||
byte* local = (byte*)sha->buffer;
|
|
||||||
|
|
||||||
AddLength(sha, sha->buffLen); /* before adding pads */
|
|
||||||
|
|
||||||
local[sha->buffLen++] = 0x80; /* add 1 */
|
|
||||||
|
|
||||||
/* pad with zeros */
|
|
||||||
if (sha->buffLen > SHA_PAD_SIZE) {
|
|
||||||
XMEMSET(&local[sha->buffLen], 0, SHA_BLOCK_SIZE - sha->buffLen);
|
|
||||||
sha->buffLen += SHA_BLOCK_SIZE - sha->buffLen;
|
|
||||||
|
|
||||||
#if defined(LITTLE_ENDIAN_ORDER) && !defined(FREESCALE_MMCAU)
|
|
||||||
ByteReverseWords(sha->buffer, sha->buffer, SHA_BLOCK_SIZE);
|
|
||||||
#endif
|
|
||||||
XTRANSFORM(sha, local);
|
|
||||||
sha->buffLen = 0;
|
|
||||||
}
|
|
||||||
XMEMSET(&local[sha->buffLen], 0, SHA_PAD_SIZE - sha->buffLen);
|
|
||||||
|
|
||||||
/* put lengths in bits */
|
|
||||||
sha->hiLen = (sha->loLen >> (8*sizeof(sha->loLen) - 3)) +
|
|
||||||
(sha->hiLen << 3);
|
|
||||||
sha->loLen = sha->loLen << 3;
|
|
||||||
|
|
||||||
/* store lengths */
|
|
||||||
#if defined(LITTLE_ENDIAN_ORDER) && !defined(FREESCALE_MMCAU)
|
|
||||||
ByteReverseWords(sha->buffer, sha->buffer, SHA_BLOCK_SIZE);
|
|
||||||
#endif
|
|
||||||
/* ! length ordering dependent on digest endian type ! */
|
|
||||||
XMEMCPY(&local[SHA_PAD_SIZE], &sha->hiLen, sizeof(word32));
|
|
||||||
XMEMCPY(&local[SHA_PAD_SIZE + sizeof(word32)], &sha->loLen, sizeof(word32));
|
|
||||||
|
|
||||||
#ifdef FREESCALE_MMCAU
|
|
||||||
/* Kinetis requires only these bytes reversed */
|
|
||||||
ByteReverseWords(&sha->buffer[SHA_PAD_SIZE/sizeof(word32)],
|
|
||||||
&sha->buffer[SHA_PAD_SIZE/sizeof(word32)],
|
|
||||||
2 * sizeof(word32));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
XTRANSFORM(sha, local);
|
|
||||||
#ifdef LITTLE_ENDIAN_ORDER
|
|
||||||
ByteReverseWords(sha->digest, sha->digest, SHA_DIGEST_SIZE);
|
|
||||||
#endif
|
|
||||||
XMEMCPY(hash, sha->digest, SHA_DIGEST_SIZE);
|
|
||||||
|
|
||||||
return InitSha(sha); /* reset state */
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* STM32F2_HASH */
|
|
||||||
|
|
||||||
|
|
||||||
int ShaHash(const byte* data, word32 len, byte* hash)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
Sha* sha;
|
|
||||||
#else
|
|
||||||
Sha sha[1];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
sha = (Sha*)XMALLOC(sizeof(Sha), NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
if (sha == NULL)
|
|
||||||
return MEMORY_E;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((ret = InitSha(sha)) != 0) {
|
|
||||||
CYASSL_MSG("InitSha failed");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ShaUpdate(sha, data, len);
|
|
||||||
ShaFinal(sha, hash);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
XFREE(sha, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* NO_SHA */
|
|
||||||
|
|
|
@ -1,322 +1 @@
|
||||||
/* sha256.c
|
/* dummy file for autoconf */
|
||||||
*
|
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
|
||||||
*
|
|
||||||
* This file is part of CyaSSL.
|
|
||||||
*
|
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/* code submitted by raphael.huck@efixo.com */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/settings.h>
|
|
||||||
|
|
||||||
#if !defined(NO_SHA256)
|
|
||||||
|
|
||||||
#ifdef CYASSL_PIC32MZ_HASH
|
|
||||||
#define InitSha256 InitSha256_sw
|
|
||||||
#define Sha256Update Sha256Update_sw
|
|
||||||
#define Sha256Final Sha256Final_sw
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_FIPS
|
|
||||||
/* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */
|
|
||||||
#define FIPS_NO_WRAPPERS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/sha256.h>
|
|
||||||
#include <cyassl/ctaocrypt/logging.h>
|
|
||||||
#include <cyassl/ctaocrypt/error-crypt.h>
|
|
||||||
|
|
||||||
#ifdef NO_INLINE
|
|
||||||
#include <cyassl/ctaocrypt/misc.h>
|
|
||||||
#else
|
|
||||||
#include <ctaocrypt/src/misc.c>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FREESCALE_MMCAU
|
|
||||||
#include "cau_api.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef min
|
|
||||||
|
|
||||||
static INLINE word32 min(word32 a, word32 b)
|
|
||||||
{
|
|
||||||
return a > b ? b : a;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* min */
|
|
||||||
|
|
||||||
|
|
||||||
int InitSha256(Sha256* sha256)
|
|
||||||
{
|
|
||||||
#ifdef FREESCALE_MMCAU
|
|
||||||
cau_sha256_initialize_output(sha256->digest);
|
|
||||||
#else
|
|
||||||
sha256->digest[0] = 0x6A09E667L;
|
|
||||||
sha256->digest[1] = 0xBB67AE85L;
|
|
||||||
sha256->digest[2] = 0x3C6EF372L;
|
|
||||||
sha256->digest[3] = 0xA54FF53AL;
|
|
||||||
sha256->digest[4] = 0x510E527FL;
|
|
||||||
sha256->digest[5] = 0x9B05688CL;
|
|
||||||
sha256->digest[6] = 0x1F83D9ABL;
|
|
||||||
sha256->digest[7] = 0x5BE0CD19L;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
sha256->buffLen = 0;
|
|
||||||
sha256->loLen = 0;
|
|
||||||
sha256->hiLen = 0;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef FREESCALE_MMCAU
|
|
||||||
#define XTRANSFORM(S,B) Transform((S), (B))
|
|
||||||
|
|
||||||
static int Transform(Sha256* sha256, byte* buf)
|
|
||||||
{
|
|
||||||
cau_sha256_hash_n(buf, 1, sha256->digest);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
#define XTRANSFORM(S,B) Transform((S))
|
|
||||||
|
|
||||||
static const word32 K[64] = {
|
|
||||||
0x428A2F98L, 0x71374491L, 0xB5C0FBCFL, 0xE9B5DBA5L, 0x3956C25BL,
|
|
||||||
0x59F111F1L, 0x923F82A4L, 0xAB1C5ED5L, 0xD807AA98L, 0x12835B01L,
|
|
||||||
0x243185BEL, 0x550C7DC3L, 0x72BE5D74L, 0x80DEB1FEL, 0x9BDC06A7L,
|
|
||||||
0xC19BF174L, 0xE49B69C1L, 0xEFBE4786L, 0x0FC19DC6L, 0x240CA1CCL,
|
|
||||||
0x2DE92C6FL, 0x4A7484AAL, 0x5CB0A9DCL, 0x76F988DAL, 0x983E5152L,
|
|
||||||
0xA831C66DL, 0xB00327C8L, 0xBF597FC7L, 0xC6E00BF3L, 0xD5A79147L,
|
|
||||||
0x06CA6351L, 0x14292967L, 0x27B70A85L, 0x2E1B2138L, 0x4D2C6DFCL,
|
|
||||||
0x53380D13L, 0x650A7354L, 0x766A0ABBL, 0x81C2C92EL, 0x92722C85L,
|
|
||||||
0xA2BFE8A1L, 0xA81A664BL, 0xC24B8B70L, 0xC76C51A3L, 0xD192E819L,
|
|
||||||
0xD6990624L, 0xF40E3585L, 0x106AA070L, 0x19A4C116L, 0x1E376C08L,
|
|
||||||
0x2748774CL, 0x34B0BCB5L, 0x391C0CB3L, 0x4ED8AA4AL, 0x5B9CCA4FL,
|
|
||||||
0x682E6FF3L, 0x748F82EEL, 0x78A5636FL, 0x84C87814L, 0x8CC70208L,
|
|
||||||
0x90BEFFFAL, 0xA4506CEBL, 0xBEF9A3F7L, 0xC67178F2L
|
|
||||||
};
|
|
||||||
|
|
||||||
#define Ch(x,y,z) (z ^ (x & (y ^ z)))
|
|
||||||
#define Maj(x,y,z) (((x | y) & z) | (x & y))
|
|
||||||
#define S(x, n) rotrFixed(x, n)
|
|
||||||
#define R(x, n) (((x)&0xFFFFFFFFU)>>(n))
|
|
||||||
#define Sigma0(x) (S(x, 2) ^ S(x, 13) ^ S(x, 22))
|
|
||||||
#define Sigma1(x) (S(x, 6) ^ S(x, 11) ^ S(x, 25))
|
|
||||||
#define Gamma0(x) (S(x, 7) ^ S(x, 18) ^ R(x, 3))
|
|
||||||
#define Gamma1(x) (S(x, 17) ^ S(x, 19) ^ R(x, 10))
|
|
||||||
|
|
||||||
#define RND(a,b,c,d,e,f,g,h,i) \
|
|
||||||
t0 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; \
|
|
||||||
t1 = Sigma0(a) + Maj(a, b, c); \
|
|
||||||
d += t0; \
|
|
||||||
h = t0 + t1;
|
|
||||||
|
|
||||||
|
|
||||||
static int Transform(Sha256* sha256)
|
|
||||||
{
|
|
||||||
word32 S[8], t0, t1;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
word32* W;
|
|
||||||
|
|
||||||
W = (word32*) XMALLOC(sizeof(word32) * 64, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
if (W == NULL)
|
|
||||||
return MEMORY_E;
|
|
||||||
#else
|
|
||||||
word32 W[64];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Copy context->state[] to working vars */
|
|
||||||
for (i = 0; i < 8; i++)
|
|
||||||
S[i] = sha256->digest[i];
|
|
||||||
|
|
||||||
for (i = 0; i < 16; i++)
|
|
||||||
W[i] = sha256->buffer[i];
|
|
||||||
|
|
||||||
for (i = 16; i < 64; i++)
|
|
||||||
W[i] = Gamma1(W[i-2]) + W[i-7] + Gamma0(W[i-15]) + W[i-16];
|
|
||||||
|
|
||||||
for (i = 0; i < 64; i += 8) {
|
|
||||||
RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],i+0);
|
|
||||||
RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],i+1);
|
|
||||||
RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],i+2);
|
|
||||||
RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],i+3);
|
|
||||||
RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],i+4);
|
|
||||||
RND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],i+5);
|
|
||||||
RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],i+6);
|
|
||||||
RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],i+7);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Add the working vars back into digest state[] */
|
|
||||||
for (i = 0; i < 8; i++) {
|
|
||||||
sha256->digest[i] += S[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
XFREE(W, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* FREESCALE_MMCAU */
|
|
||||||
|
|
||||||
|
|
||||||
static INLINE void AddLength(Sha256* sha256, word32 len)
|
|
||||||
{
|
|
||||||
word32 tmp = sha256->loLen;
|
|
||||||
if ( (sha256->loLen += len) < tmp)
|
|
||||||
sha256->hiLen++; /* carry low to high */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int Sha256Update(Sha256* sha256, const byte* data, word32 len)
|
|
||||||
{
|
|
||||||
/* do block size increments */
|
|
||||||
byte* local = (byte*)sha256->buffer;
|
|
||||||
|
|
||||||
while (len) {
|
|
||||||
word32 add = min(len, SHA256_BLOCK_SIZE - sha256->buffLen);
|
|
||||||
XMEMCPY(&local[sha256->buffLen], data, add);
|
|
||||||
|
|
||||||
sha256->buffLen += add;
|
|
||||||
data += add;
|
|
||||||
len -= add;
|
|
||||||
|
|
||||||
if (sha256->buffLen == SHA256_BLOCK_SIZE) {
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
#if defined(LITTLE_ENDIAN_ORDER) && !defined(FREESCALE_MMCAU)
|
|
||||||
ByteReverseWords(sha256->buffer, sha256->buffer,
|
|
||||||
SHA256_BLOCK_SIZE);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ret = XTRANSFORM(sha256, local);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
AddLength(sha256, SHA256_BLOCK_SIZE);
|
|
||||||
sha256->buffLen = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int Sha256Final(Sha256* sha256, byte* hash)
|
|
||||||
{
|
|
||||||
byte* local = (byte*)sha256->buffer;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
AddLength(sha256, sha256->buffLen); /* before adding pads */
|
|
||||||
|
|
||||||
local[sha256->buffLen++] = 0x80; /* add 1 */
|
|
||||||
|
|
||||||
/* pad with zeros */
|
|
||||||
if (sha256->buffLen > SHA256_PAD_SIZE) {
|
|
||||||
XMEMSET(&local[sha256->buffLen], 0, SHA256_BLOCK_SIZE - sha256->buffLen);
|
|
||||||
sha256->buffLen += SHA256_BLOCK_SIZE - sha256->buffLen;
|
|
||||||
|
|
||||||
#if defined(LITTLE_ENDIAN_ORDER) && !defined(FREESCALE_MMCAU)
|
|
||||||
ByteReverseWords(sha256->buffer, sha256->buffer, SHA256_BLOCK_SIZE);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ret = XTRANSFORM(sha256, local);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
sha256->buffLen = 0;
|
|
||||||
}
|
|
||||||
XMEMSET(&local[sha256->buffLen], 0, SHA256_PAD_SIZE - sha256->buffLen);
|
|
||||||
|
|
||||||
/* put lengths in bits */
|
|
||||||
sha256->hiLen = (sha256->loLen >> (8*sizeof(sha256->loLen) - 3)) +
|
|
||||||
(sha256->hiLen << 3);
|
|
||||||
sha256->loLen = sha256->loLen << 3;
|
|
||||||
|
|
||||||
/* store lengths */
|
|
||||||
#if defined(LITTLE_ENDIAN_ORDER) && !defined(FREESCALE_MMCAU)
|
|
||||||
ByteReverseWords(sha256->buffer, sha256->buffer, SHA256_BLOCK_SIZE);
|
|
||||||
#endif
|
|
||||||
/* ! length ordering dependent on digest endian type ! */
|
|
||||||
XMEMCPY(&local[SHA256_PAD_SIZE], &sha256->hiLen, sizeof(word32));
|
|
||||||
XMEMCPY(&local[SHA256_PAD_SIZE + sizeof(word32)], &sha256->loLen,
|
|
||||||
sizeof(word32));
|
|
||||||
|
|
||||||
#ifdef FREESCALE_MMCAU
|
|
||||||
/* Kinetis requires only these bytes reversed */
|
|
||||||
ByteReverseWords(&sha256->buffer[SHA256_PAD_SIZE/sizeof(word32)],
|
|
||||||
&sha256->buffer[SHA256_PAD_SIZE/sizeof(word32)],
|
|
||||||
2 * sizeof(word32));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ret = XTRANSFORM(sha256, local);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
#ifdef LITTLE_ENDIAN_ORDER
|
|
||||||
ByteReverseWords(sha256->digest, sha256->digest, SHA256_DIGEST_SIZE);
|
|
||||||
#endif
|
|
||||||
XMEMCPY(hash, sha256->digest, SHA256_DIGEST_SIZE);
|
|
||||||
|
|
||||||
return InitSha256(sha256); /* reset state */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int Sha256Hash(const byte* data, word32 len, byte* hash)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
Sha256* sha256;
|
|
||||||
#else
|
|
||||||
Sha256 sha256[1];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
sha256 = (Sha256*)XMALLOC(sizeof(Sha256), NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
if (sha256 == NULL)
|
|
||||||
return MEMORY_E;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((ret = InitSha256(sha256)) != 0) {
|
|
||||||
CYASSL_MSG("InitSha256 failed");
|
|
||||||
}
|
|
||||||
else if ((ret = Sha256Update(sha256, data, len)) != 0) {
|
|
||||||
CYASSL_MSG("Sha256Update failed");
|
|
||||||
}
|
|
||||||
else if ((ret = Sha256Final(sha256, hash)) != 0) {
|
|
||||||
CYASSL_MSG("Sha256Final failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
XFREE(sha256, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* NO_SHA256 */
|
|
||||||
|
|
||||||
|
|
|
@ -1,542 +1 @@
|
||||||
/* sha512.c
|
/* dummy file for autoconf */
|
||||||
*
|
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
|
||||||
*
|
|
||||||
* This file is part of CyaSSL.
|
|
||||||
*
|
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/settings.h>
|
|
||||||
|
|
||||||
#ifdef CYASSL_SHA512
|
|
||||||
|
|
||||||
#ifdef HAVE_FIPS
|
|
||||||
/* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */
|
|
||||||
#define FIPS_NO_WRAPPERS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/sha512.h>
|
|
||||||
#include <cyassl/ctaocrypt/logging.h>
|
|
||||||
#include <cyassl/ctaocrypt/error-crypt.h>
|
|
||||||
|
|
||||||
#ifdef NO_INLINE
|
|
||||||
#include <cyassl/ctaocrypt/misc.h>
|
|
||||||
#else
|
|
||||||
#include <ctaocrypt/src/misc.c>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef min
|
|
||||||
|
|
||||||
static INLINE word32 min(word32 a, word32 b)
|
|
||||||
{
|
|
||||||
return a > b ? b : a;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* min */
|
|
||||||
|
|
||||||
|
|
||||||
int InitSha512(Sha512* sha512)
|
|
||||||
{
|
|
||||||
sha512->digest[0] = W64LIT(0x6a09e667f3bcc908);
|
|
||||||
sha512->digest[1] = W64LIT(0xbb67ae8584caa73b);
|
|
||||||
sha512->digest[2] = W64LIT(0x3c6ef372fe94f82b);
|
|
||||||
sha512->digest[3] = W64LIT(0xa54ff53a5f1d36f1);
|
|
||||||
sha512->digest[4] = W64LIT(0x510e527fade682d1);
|
|
||||||
sha512->digest[5] = W64LIT(0x9b05688c2b3e6c1f);
|
|
||||||
sha512->digest[6] = W64LIT(0x1f83d9abfb41bd6b);
|
|
||||||
sha512->digest[7] = W64LIT(0x5be0cd19137e2179);
|
|
||||||
|
|
||||||
sha512->buffLen = 0;
|
|
||||||
sha512->loLen = 0;
|
|
||||||
sha512->hiLen = 0;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static const word64 K512[80] = {
|
|
||||||
W64LIT(0x428a2f98d728ae22), W64LIT(0x7137449123ef65cd),
|
|
||||||
W64LIT(0xb5c0fbcfec4d3b2f), W64LIT(0xe9b5dba58189dbbc),
|
|
||||||
W64LIT(0x3956c25bf348b538), W64LIT(0x59f111f1b605d019),
|
|
||||||
W64LIT(0x923f82a4af194f9b), W64LIT(0xab1c5ed5da6d8118),
|
|
||||||
W64LIT(0xd807aa98a3030242), W64LIT(0x12835b0145706fbe),
|
|
||||||
W64LIT(0x243185be4ee4b28c), W64LIT(0x550c7dc3d5ffb4e2),
|
|
||||||
W64LIT(0x72be5d74f27b896f), W64LIT(0x80deb1fe3b1696b1),
|
|
||||||
W64LIT(0x9bdc06a725c71235), W64LIT(0xc19bf174cf692694),
|
|
||||||
W64LIT(0xe49b69c19ef14ad2), W64LIT(0xefbe4786384f25e3),
|
|
||||||
W64LIT(0x0fc19dc68b8cd5b5), W64LIT(0x240ca1cc77ac9c65),
|
|
||||||
W64LIT(0x2de92c6f592b0275), W64LIT(0x4a7484aa6ea6e483),
|
|
||||||
W64LIT(0x5cb0a9dcbd41fbd4), W64LIT(0x76f988da831153b5),
|
|
||||||
W64LIT(0x983e5152ee66dfab), W64LIT(0xa831c66d2db43210),
|
|
||||||
W64LIT(0xb00327c898fb213f), W64LIT(0xbf597fc7beef0ee4),
|
|
||||||
W64LIT(0xc6e00bf33da88fc2), W64LIT(0xd5a79147930aa725),
|
|
||||||
W64LIT(0x06ca6351e003826f), W64LIT(0x142929670a0e6e70),
|
|
||||||
W64LIT(0x27b70a8546d22ffc), W64LIT(0x2e1b21385c26c926),
|
|
||||||
W64LIT(0x4d2c6dfc5ac42aed), W64LIT(0x53380d139d95b3df),
|
|
||||||
W64LIT(0x650a73548baf63de), W64LIT(0x766a0abb3c77b2a8),
|
|
||||||
W64LIT(0x81c2c92e47edaee6), W64LIT(0x92722c851482353b),
|
|
||||||
W64LIT(0xa2bfe8a14cf10364), W64LIT(0xa81a664bbc423001),
|
|
||||||
W64LIT(0xc24b8b70d0f89791), W64LIT(0xc76c51a30654be30),
|
|
||||||
W64LIT(0xd192e819d6ef5218), W64LIT(0xd69906245565a910),
|
|
||||||
W64LIT(0xf40e35855771202a), W64LIT(0x106aa07032bbd1b8),
|
|
||||||
W64LIT(0x19a4c116b8d2d0c8), W64LIT(0x1e376c085141ab53),
|
|
||||||
W64LIT(0x2748774cdf8eeb99), W64LIT(0x34b0bcb5e19b48a8),
|
|
||||||
W64LIT(0x391c0cb3c5c95a63), W64LIT(0x4ed8aa4ae3418acb),
|
|
||||||
W64LIT(0x5b9cca4f7763e373), W64LIT(0x682e6ff3d6b2b8a3),
|
|
||||||
W64LIT(0x748f82ee5defb2fc), W64LIT(0x78a5636f43172f60),
|
|
||||||
W64LIT(0x84c87814a1f0ab72), W64LIT(0x8cc702081a6439ec),
|
|
||||||
W64LIT(0x90befffa23631e28), W64LIT(0xa4506cebde82bde9),
|
|
||||||
W64LIT(0xbef9a3f7b2c67915), W64LIT(0xc67178f2e372532b),
|
|
||||||
W64LIT(0xca273eceea26619c), W64LIT(0xd186b8c721c0c207),
|
|
||||||
W64LIT(0xeada7dd6cde0eb1e), W64LIT(0xf57d4f7fee6ed178),
|
|
||||||
W64LIT(0x06f067aa72176fba), W64LIT(0x0a637dc5a2c898a6),
|
|
||||||
W64LIT(0x113f9804bef90dae), W64LIT(0x1b710b35131c471b),
|
|
||||||
W64LIT(0x28db77f523047d84), W64LIT(0x32caab7b40c72493),
|
|
||||||
W64LIT(0x3c9ebe0a15c9bebc), W64LIT(0x431d67c49c100d4c),
|
|
||||||
W64LIT(0x4cc5d4becb3e42b6), W64LIT(0x597f299cfc657e2a),
|
|
||||||
W64LIT(0x5fcb6fab3ad6faec), W64LIT(0x6c44198c4a475817)
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#define blk0(i) (W[i] = sha512->buffer[i])
|
|
||||||
#define blk2(i) (W[i&15]+=s1(W[(i-2)&15])+W[(i-7)&15]+s0(W[(i-15)&15]))
|
|
||||||
|
|
||||||
#define Ch(x,y,z) (z^(x&(y^z)))
|
|
||||||
#define Maj(x,y,z) ((x&y)|(z&(x|y)))
|
|
||||||
|
|
||||||
#define a(i) T[(0-i)&7]
|
|
||||||
#define b(i) T[(1-i)&7]
|
|
||||||
#define c(i) T[(2-i)&7]
|
|
||||||
#define d(i) T[(3-i)&7]
|
|
||||||
#define e(i) T[(4-i)&7]
|
|
||||||
#define f(i) T[(5-i)&7]
|
|
||||||
#define g(i) T[(6-i)&7]
|
|
||||||
#define h(i) T[(7-i)&7]
|
|
||||||
|
|
||||||
#define S0(x) (rotrFixed64(x,28)^rotrFixed64(x,34)^rotrFixed64(x,39))
|
|
||||||
#define S1(x) (rotrFixed64(x,14)^rotrFixed64(x,18)^rotrFixed64(x,41))
|
|
||||||
#define s0(x) (rotrFixed64(x,1)^rotrFixed64(x,8)^(x>>7))
|
|
||||||
#define s1(x) (rotrFixed64(x,19)^rotrFixed64(x,61)^(x>>6))
|
|
||||||
|
|
||||||
#define R(i) h(i)+=S1(e(i))+Ch(e(i),f(i),g(i))+K[i+j]+(j?blk2(i):blk0(i));\
|
|
||||||
d(i)+=h(i);h(i)+=S0(a(i))+Maj(a(i),b(i),c(i))
|
|
||||||
|
|
||||||
#define blk384(i) (W[i] = sha384->buffer[i])
|
|
||||||
|
|
||||||
#define R2(i) h(i)+=S1(e(i))+Ch(e(i),f(i),g(i))+K[i+j]+(j?blk2(i):blk384(i));\
|
|
||||||
d(i)+=h(i);h(i)+=S0(a(i))+Maj(a(i),b(i),c(i))
|
|
||||||
|
|
||||||
|
|
||||||
static int Transform(Sha512* sha512)
|
|
||||||
{
|
|
||||||
const word64* K = K512;
|
|
||||||
|
|
||||||
word32 j;
|
|
||||||
word64 T[8];
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
word64* W;
|
|
||||||
|
|
||||||
W = (word64*) XMALLOC(sizeof(word64) * 16, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
if (W == NULL)
|
|
||||||
return MEMORY_E;
|
|
||||||
#else
|
|
||||||
word64 W[16];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Copy digest to working vars */
|
|
||||||
XMEMCPY(T, sha512->digest, sizeof(T));
|
|
||||||
|
|
||||||
#ifdef USE_SLOW_SHA2
|
|
||||||
/* over twice as small, but 50% slower */
|
|
||||||
/* 80 operations, not unrolled */
|
|
||||||
for (j = 0; j < 80; j += 16) {
|
|
||||||
int m;
|
|
||||||
for (m = 0; m < 16; m++) { /* braces needed here for macros {} */
|
|
||||||
R(m);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
/* 80 operations, partially loop unrolled */
|
|
||||||
for (j = 0; j < 80; j += 16) {
|
|
||||||
R( 0); R( 1); R( 2); R( 3);
|
|
||||||
R( 4); R( 5); R( 6); R( 7);
|
|
||||||
R( 8); R( 9); R(10); R(11);
|
|
||||||
R(12); R(13); R(14); R(15);
|
|
||||||
}
|
|
||||||
#endif /* USE_SLOW_SHA2 */
|
|
||||||
|
|
||||||
/* Add the working vars back into digest */
|
|
||||||
|
|
||||||
sha512->digest[0] += a(0);
|
|
||||||
sha512->digest[1] += b(0);
|
|
||||||
sha512->digest[2] += c(0);
|
|
||||||
sha512->digest[3] += d(0);
|
|
||||||
sha512->digest[4] += e(0);
|
|
||||||
sha512->digest[5] += f(0);
|
|
||||||
sha512->digest[6] += g(0);
|
|
||||||
sha512->digest[7] += h(0);
|
|
||||||
|
|
||||||
/* Wipe variables */
|
|
||||||
XMEMSET(W, 0, sizeof(word64) * 16);
|
|
||||||
XMEMSET(T, 0, sizeof(T));
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
XFREE(W, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static INLINE void AddLength(Sha512* sha512, word32 len)
|
|
||||||
{
|
|
||||||
word32 tmp = sha512->loLen;
|
|
||||||
if ( (sha512->loLen += len) < tmp)
|
|
||||||
sha512->hiLen++; /* carry low to high */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int Sha512Update(Sha512* sha512, const byte* data, word32 len)
|
|
||||||
{
|
|
||||||
/* do block size increments */
|
|
||||||
byte* local = (byte*)sha512->buffer;
|
|
||||||
|
|
||||||
while (len) {
|
|
||||||
word32 add = min(len, SHA512_BLOCK_SIZE - sha512->buffLen);
|
|
||||||
XMEMCPY(&local[sha512->buffLen], data, add);
|
|
||||||
|
|
||||||
sha512->buffLen += add;
|
|
||||||
data += add;
|
|
||||||
len -= add;
|
|
||||||
|
|
||||||
if (sha512->buffLen == SHA512_BLOCK_SIZE) {
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
#ifdef LITTLE_ENDIAN_ORDER
|
|
||||||
ByteReverseWords64(sha512->buffer, sha512->buffer,
|
|
||||||
SHA512_BLOCK_SIZE);
|
|
||||||
#endif
|
|
||||||
ret = Transform(sha512);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
AddLength(sha512, SHA512_BLOCK_SIZE);
|
|
||||||
sha512->buffLen = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int Sha512Final(Sha512* sha512, byte* hash)
|
|
||||||
{
|
|
||||||
byte* local = (byte*)sha512->buffer;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
AddLength(sha512, sha512->buffLen); /* before adding pads */
|
|
||||||
|
|
||||||
local[sha512->buffLen++] = 0x80; /* add 1 */
|
|
||||||
|
|
||||||
/* pad with zeros */
|
|
||||||
if (sha512->buffLen > SHA512_PAD_SIZE) {
|
|
||||||
XMEMSET(&local[sha512->buffLen], 0, SHA512_BLOCK_SIZE -sha512->buffLen);
|
|
||||||
sha512->buffLen += SHA512_BLOCK_SIZE - sha512->buffLen;
|
|
||||||
|
|
||||||
#ifdef LITTLE_ENDIAN_ORDER
|
|
||||||
ByteReverseWords64(sha512->buffer,sha512->buffer,SHA512_BLOCK_SIZE);
|
|
||||||
#endif
|
|
||||||
ret = Transform(sha512);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
sha512->buffLen = 0;
|
|
||||||
}
|
|
||||||
XMEMSET(&local[sha512->buffLen], 0, SHA512_PAD_SIZE - sha512->buffLen);
|
|
||||||
|
|
||||||
/* put lengths in bits */
|
|
||||||
sha512->hiLen = (sha512->loLen >> (8*sizeof(sha512->loLen) - 3)) +
|
|
||||||
(sha512->hiLen << 3);
|
|
||||||
sha512->loLen = sha512->loLen << 3;
|
|
||||||
|
|
||||||
/* store lengths */
|
|
||||||
#ifdef LITTLE_ENDIAN_ORDER
|
|
||||||
ByteReverseWords64(sha512->buffer, sha512->buffer, SHA512_PAD_SIZE);
|
|
||||||
#endif
|
|
||||||
/* ! length ordering dependent on digest endian type ! */
|
|
||||||
sha512->buffer[SHA512_BLOCK_SIZE / sizeof(word64) - 2] = sha512->hiLen;
|
|
||||||
sha512->buffer[SHA512_BLOCK_SIZE / sizeof(word64) - 1] = sha512->loLen;
|
|
||||||
|
|
||||||
ret = Transform(sha512);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
#ifdef LITTLE_ENDIAN_ORDER
|
|
||||||
ByteReverseWords64(sha512->digest, sha512->digest, SHA512_DIGEST_SIZE);
|
|
||||||
#endif
|
|
||||||
XMEMCPY(hash, sha512->digest, SHA512_DIGEST_SIZE);
|
|
||||||
|
|
||||||
return InitSha512(sha512); /* reset state */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int Sha512Hash(const byte* data, word32 len, byte* hash)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
Sha512* sha512;
|
|
||||||
#else
|
|
||||||
Sha512 sha512[1];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
sha512 = (Sha512*)XMALLOC(sizeof(Sha512), NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
if (sha512 == NULL)
|
|
||||||
return MEMORY_E;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((ret = InitSha512(sha512)) != 0) {
|
|
||||||
CYASSL_MSG("InitSha512 failed");
|
|
||||||
}
|
|
||||||
else if ((ret = Sha512Update(sha512, data, len)) != 0) {
|
|
||||||
CYASSL_MSG("Sha512Update failed");
|
|
||||||
}
|
|
||||||
else if ((ret = Sha512Final(sha512, hash)) != 0) {
|
|
||||||
CYASSL_MSG("Sha512Final failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
XFREE(sha512, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef CYASSL_SHA384
|
|
||||||
|
|
||||||
int InitSha384(Sha384* sha384)
|
|
||||||
{
|
|
||||||
sha384->digest[0] = W64LIT(0xcbbb9d5dc1059ed8);
|
|
||||||
sha384->digest[1] = W64LIT(0x629a292a367cd507);
|
|
||||||
sha384->digest[2] = W64LIT(0x9159015a3070dd17);
|
|
||||||
sha384->digest[3] = W64LIT(0x152fecd8f70e5939);
|
|
||||||
sha384->digest[4] = W64LIT(0x67332667ffc00b31);
|
|
||||||
sha384->digest[5] = W64LIT(0x8eb44a8768581511);
|
|
||||||
sha384->digest[6] = W64LIT(0xdb0c2e0d64f98fa7);
|
|
||||||
sha384->digest[7] = W64LIT(0x47b5481dbefa4fa4);
|
|
||||||
|
|
||||||
sha384->buffLen = 0;
|
|
||||||
sha384->loLen = 0;
|
|
||||||
sha384->hiLen = 0;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int Transform384(Sha384* sha384)
|
|
||||||
{
|
|
||||||
const word64* K = K512;
|
|
||||||
|
|
||||||
word32 j;
|
|
||||||
word64 T[8];
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
word64* W;
|
|
||||||
|
|
||||||
W = (word64*) XMALLOC(sizeof(word64) * 16, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
if (W == NULL)
|
|
||||||
return MEMORY_E;
|
|
||||||
#else
|
|
||||||
word64 W[16];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Copy digest to working vars */
|
|
||||||
XMEMCPY(T, sha384->digest, sizeof(T));
|
|
||||||
|
|
||||||
#ifdef USE_SLOW_SHA2
|
|
||||||
/* over twice as small, but 50% slower */
|
|
||||||
/* 80 operations, not unrolled */
|
|
||||||
for (j = 0; j < 80; j += 16) {
|
|
||||||
int m;
|
|
||||||
for (m = 0; m < 16; m++) { /* braces needed for macros {} */
|
|
||||||
R2(m);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
/* 80 operations, partially loop unrolled */
|
|
||||||
for (j = 0; j < 80; j += 16) {
|
|
||||||
R2( 0); R2( 1); R2( 2); R2( 3);
|
|
||||||
R2( 4); R2( 5); R2( 6); R2( 7);
|
|
||||||
R2( 8); R2( 9); R2(10); R2(11);
|
|
||||||
R2(12); R2(13); R2(14); R2(15);
|
|
||||||
}
|
|
||||||
#endif /* USE_SLOW_SHA2 */
|
|
||||||
|
|
||||||
/* Add the working vars back into digest */
|
|
||||||
|
|
||||||
sha384->digest[0] += a(0);
|
|
||||||
sha384->digest[1] += b(0);
|
|
||||||
sha384->digest[2] += c(0);
|
|
||||||
sha384->digest[3] += d(0);
|
|
||||||
sha384->digest[4] += e(0);
|
|
||||||
sha384->digest[5] += f(0);
|
|
||||||
sha384->digest[6] += g(0);
|
|
||||||
sha384->digest[7] += h(0);
|
|
||||||
|
|
||||||
/* Wipe variables */
|
|
||||||
XMEMSET(W, 0, sizeof(word64) * 16);
|
|
||||||
XMEMSET(T, 0, sizeof(T));
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
XFREE(W, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static INLINE void AddLength384(Sha384* sha384, word32 len)
|
|
||||||
{
|
|
||||||
word32 tmp = sha384->loLen;
|
|
||||||
if ( (sha384->loLen += len) < tmp)
|
|
||||||
sha384->hiLen++; /* carry low to high */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int Sha384Update(Sha384* sha384, const byte* data, word32 len)
|
|
||||||
{
|
|
||||||
/* do block size increments */
|
|
||||||
byte* local = (byte*)sha384->buffer;
|
|
||||||
|
|
||||||
while (len) {
|
|
||||||
word32 add = min(len, SHA384_BLOCK_SIZE - sha384->buffLen);
|
|
||||||
XMEMCPY(&local[sha384->buffLen], data, add);
|
|
||||||
|
|
||||||
sha384->buffLen += add;
|
|
||||||
data += add;
|
|
||||||
len -= add;
|
|
||||||
|
|
||||||
if (sha384->buffLen == SHA384_BLOCK_SIZE) {
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
#ifdef LITTLE_ENDIAN_ORDER
|
|
||||||
ByteReverseWords64(sha384->buffer, sha384->buffer,
|
|
||||||
SHA384_BLOCK_SIZE);
|
|
||||||
#endif
|
|
||||||
ret = Transform384(sha384);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
AddLength384(sha384, SHA384_BLOCK_SIZE);
|
|
||||||
sha384->buffLen = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int Sha384Final(Sha384* sha384, byte* hash)
|
|
||||||
{
|
|
||||||
byte* local = (byte*)sha384->buffer;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
AddLength384(sha384, sha384->buffLen); /* before adding pads */
|
|
||||||
|
|
||||||
local[sha384->buffLen++] = 0x80; /* add 1 */
|
|
||||||
|
|
||||||
/* pad with zeros */
|
|
||||||
if (sha384->buffLen > SHA384_PAD_SIZE) {
|
|
||||||
XMEMSET(&local[sha384->buffLen], 0, SHA384_BLOCK_SIZE -sha384->buffLen);
|
|
||||||
sha384->buffLen += SHA384_BLOCK_SIZE - sha384->buffLen;
|
|
||||||
|
|
||||||
#ifdef LITTLE_ENDIAN_ORDER
|
|
||||||
ByteReverseWords64(sha384->buffer,sha384->buffer,SHA384_BLOCK_SIZE);
|
|
||||||
#endif
|
|
||||||
ret = Transform384(sha384);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
sha384->buffLen = 0;
|
|
||||||
}
|
|
||||||
XMEMSET(&local[sha384->buffLen], 0, SHA384_PAD_SIZE - sha384->buffLen);
|
|
||||||
|
|
||||||
/* put lengths in bits */
|
|
||||||
sha384->hiLen = (sha384->loLen >> (8*sizeof(sha384->loLen) - 3)) +
|
|
||||||
(sha384->hiLen << 3);
|
|
||||||
sha384->loLen = sha384->loLen << 3;
|
|
||||||
|
|
||||||
/* store lengths */
|
|
||||||
#ifdef LITTLE_ENDIAN_ORDER
|
|
||||||
ByteReverseWords64(sha384->buffer, sha384->buffer, SHA384_PAD_SIZE);
|
|
||||||
#endif
|
|
||||||
/* ! length ordering dependent on digest endian type ! */
|
|
||||||
sha384->buffer[SHA384_BLOCK_SIZE / sizeof(word64) - 2] = sha384->hiLen;
|
|
||||||
sha384->buffer[SHA384_BLOCK_SIZE / sizeof(word64) - 1] = sha384->loLen;
|
|
||||||
|
|
||||||
ret = Transform384(sha384);
|
|
||||||
if (ret != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
#ifdef LITTLE_ENDIAN_ORDER
|
|
||||||
ByteReverseWords64(sha384->digest, sha384->digest, SHA384_DIGEST_SIZE);
|
|
||||||
#endif
|
|
||||||
XMEMCPY(hash, sha384->digest, SHA384_DIGEST_SIZE);
|
|
||||||
|
|
||||||
return InitSha384(sha384); /* reset state */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int Sha384Hash(const byte* data, word32 len, byte* hash)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
Sha384* sha384;
|
|
||||||
#else
|
|
||||||
Sha384 sha384[1];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
sha384 = (Sha384*)XMALLOC(sizeof(Sha384), NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
if (sha384 == NULL)
|
|
||||||
return MEMORY_E;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((ret = InitSha384(sha384)) != 0) {
|
|
||||||
CYASSL_MSG("InitSha384 failed");
|
|
||||||
}
|
|
||||||
else if ((ret = Sha384Update(sha384, data, len)) != 0) {
|
|
||||||
CYASSL_MSG("Sha384Update failed");
|
|
||||||
}
|
|
||||||
else if ((ret = Sha384Final(sha384, hash)) != 0) {
|
|
||||||
CYASSL_MSG("Sha384Final failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CYASSL_SMALL_STACK
|
|
||||||
XFREE(sha384, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* CYASSL_SHA384 */
|
|
||||||
|
|
||||||
#endif /* CYASSL_SHA512 */
|
|
||||||
|
|
|
@ -1,436 +0,0 @@
|
||||||
/* port.c
|
|
||||||
*
|
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
|
||||||
*
|
|
||||||
* This file is part of CyaSSL.
|
|
||||||
*
|
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/settings.h>
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
|
||||||
#include <cyassl/ctaocrypt/error-crypt.h>
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
/* 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy */
|
|
||||||
#pragma warning(disable: 4996)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef SINGLE_THREADED
|
|
||||||
|
|
||||||
int InitMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
(void)m;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int FreeMutex(CyaSSL_Mutex *m)
|
|
||||||
{
|
|
||||||
(void)m;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int LockMutex(CyaSSL_Mutex *m)
|
|
||||||
{
|
|
||||||
(void)m;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int UnLockMutex(CyaSSL_Mutex *m)
|
|
||||||
{
|
|
||||||
(void)m;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else /* MULTI_THREAD */
|
|
||||||
|
|
||||||
#if defined(FREERTOS)
|
|
||||||
|
|
||||||
int InitMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
int iReturn;
|
|
||||||
|
|
||||||
*m = ( CyaSSL_Mutex ) xSemaphoreCreateMutex();
|
|
||||||
if( *m != NULL )
|
|
||||||
iReturn = 0;
|
|
||||||
else
|
|
||||||
iReturn = BAD_MUTEX_E;
|
|
||||||
|
|
||||||
return iReturn;
|
|
||||||
}
|
|
||||||
|
|
||||||
int FreeMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
vSemaphoreDelete( *m );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int LockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
/* Assume an infinite block, or should there be zero block? */
|
|
||||||
xSemaphoreTake( *m, portMAX_DELAY );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int UnLockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
xSemaphoreGive( *m );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(CYASSL_SAFERTOS)
|
|
||||||
|
|
||||||
int InitMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
vSemaphoreCreateBinary(m->mutexBuffer, m->mutex);
|
|
||||||
if (m->mutex == NULL)
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int FreeMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
(void)m;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int LockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
/* Assume an infinite block */
|
|
||||||
xSemaphoreTake(m->mutex, portMAX_DELAY);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int UnLockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
xSemaphoreGive(m->mutex);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#elif defined(USE_WINDOWS_API)
|
|
||||||
|
|
||||||
int InitMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
InitializeCriticalSection(m);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int FreeMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
DeleteCriticalSection(m);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int LockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
EnterCriticalSection(m);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int UnLockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
LeaveCriticalSection(m);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(CYASSL_PTHREADS)
|
|
||||||
|
|
||||||
int InitMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
if (pthread_mutex_init(m, 0) == 0)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int FreeMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
if (pthread_mutex_destroy(m) == 0)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int LockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
if (pthread_mutex_lock(m) == 0)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int UnLockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
if (pthread_mutex_unlock(m) == 0)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(THREADX)
|
|
||||||
|
|
||||||
int InitMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
if (tx_mutex_create(m, "CyaSSL Mutex", TX_NO_INHERIT) == 0)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int FreeMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
if (tx_mutex_delete(m) == 0)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int LockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
if (tx_mutex_get(m, TX_WAIT_FOREVER) == 0)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int UnLockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
if (tx_mutex_put(m) == 0)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(MICRIUM)
|
|
||||||
|
|
||||||
int InitMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
|
|
||||||
if (NetSecure_OS_MutexCreate(m) == 0)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
#else
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int FreeMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
|
|
||||||
if (NetSecure_OS_FreeMutex(m) == 0)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
#else
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int LockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
|
|
||||||
if (NetSecure_OS_LockMutex(m) == 0)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
#else
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int UnLockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
|
|
||||||
if (NetSecure_OS_UnLockMutex(m) == 0)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
#else
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(EBSNET)
|
|
||||||
|
|
||||||
int InitMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
if (rtp_sig_mutex_alloc(m, "CyaSSL Mutex") == -1)
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int FreeMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
rtp_sig_mutex_free(*m);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int LockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
if (rtp_sig_mutex_claim_timed(*m, RTIP_INF) == 0)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
int UnLockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
rtp_sig_mutex_release(*m);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(FREESCALE_MQX)
|
|
||||||
|
|
||||||
int InitMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
if (_mutex_init(m, NULL) == MQX_EOK)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
int FreeMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
if (_mutex_destroy(m) == MQX_EOK)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
int LockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
if (_mutex_lock(m) == MQX_EOK)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
int UnLockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
if (_mutex_unlock(m) == MQX_EOK)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return BAD_MUTEX_E;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(CYASSL_MDK_ARM)|| defined(CYASSL_CMSIS_RTOS)
|
|
||||||
|
|
||||||
#if defined(CYASSL_CMSIS_RTOS)
|
|
||||||
#include "cmsis_os.h"
|
|
||||||
#define CMSIS_NMUTEX 10
|
|
||||||
osMutexDef(CyaSSL_mt0) ; osMutexDef(CyaSSL_mt1) ; osMutexDef(CyaSSL_mt2) ;
|
|
||||||
osMutexDef(CyaSSL_mt3) ; osMutexDef(CyaSSL_mt4) ; osMutexDef(CyaSSL_mt5) ;
|
|
||||||
osMutexDef(CyaSSL_mt6) ; osMutexDef(CyaSSL_mt7) ; osMutexDef(CyaSSL_mt8) ;
|
|
||||||
osMutexDef(CyaSSL_mt9) ;
|
|
||||||
|
|
||||||
static const osMutexDef_t *CMSIS_mutex[] = { osMutex(CyaSSL_mt0),
|
|
||||||
osMutex(CyaSSL_mt1), osMutex(CyaSSL_mt2), osMutex(CyaSSL_mt3),
|
|
||||||
osMutex(CyaSSL_mt4), osMutex(CyaSSL_mt5), osMutex(CyaSSL_mt6),
|
|
||||||
osMutex(CyaSSL_mt7), osMutex(CyaSSL_mt8), osMutex(CyaSSL_mt9) } ;
|
|
||||||
|
|
||||||
static osMutexId CMSIS_mutexID[CMSIS_NMUTEX] = {0} ;
|
|
||||||
|
|
||||||
int InitMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
int i ;
|
|
||||||
for (i=0; i<CMSIS_NMUTEX; i++) {
|
|
||||||
if(CMSIS_mutexID[i] == 0) {
|
|
||||||
CMSIS_mutexID[i] = osMutexCreate(CMSIS_mutex[i]) ;
|
|
||||||
(*m) = CMSIS_mutexID[i] ;
|
|
||||||
return 0 ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return -1 ;
|
|
||||||
}
|
|
||||||
|
|
||||||
int FreeMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
int i ;
|
|
||||||
osMutexDelete (*m) ;
|
|
||||||
for (i=0; i<CMSIS_NMUTEX; i++) {
|
|
||||||
if(CMSIS_mutexID[i] == (*m)) {
|
|
||||||
CMSIS_mutexID[i] = 0 ;
|
|
||||||
return(0) ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return(-1) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
int LockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
osMutexWait(*m, osWaitForever) ;
|
|
||||||
return(0) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
int UnLockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
osMutexRelease (*m);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
|
|
||||||
int InitMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
os_mut_init (m);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int FreeMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
return(0) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
int LockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
os_mut_wait (m, 0xffff);
|
|
||||||
return(0) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
int UnLockMutex(CyaSSL_Mutex* m)
|
|
||||||
{
|
|
||||||
os_mut_release (m);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif /* USE_WINDOWS_API */
|
|
||||||
#endif /* SINGLE_THREADED */
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* wolfcrypt_first.c
|
/* wolfcrypt_first.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* wolfcrypt_last.c
|
/* wolfcrypt_last.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
# vim:ft=automake
|
|
||||||
# All paths should be given relative to the root
|
|
||||||
|
|
||||||
noinst_PROGRAMS+= ctaocrypt/test/testctaocrypt
|
|
||||||
ctaocrypt_test_testctaocrypt_SOURCES = ctaocrypt/test/test.c
|
|
||||||
ctaocrypt_test_testctaocrypt_LDADD = src/libcyassl.la
|
|
||||||
ctaocrypt_test_testctaocrypt_DEPENDENCIES = src/libcyassl.la
|
|
||||||
noinst_HEADERS += ctaocrypt/test/test.h
|
|
||||||
EXTRA_DIST += ctaocrypt/test/test.sln
|
|
||||||
EXTRA_DIST += ctaocrypt/test/test.vcproj
|
|
||||||
DISTCLEANFILES+= ctaocrypt/test/.libs/testctaocrypt
|
|
|
@ -1,383 +0,0 @@
|
||||||
// !$*UTF8*$!
|
|
||||||
{
|
|
||||||
archiveVersion = 1;
|
|
||||||
classes = {
|
|
||||||
};
|
|
||||||
objectVersion = 46;
|
|
||||||
objects = {
|
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
|
||||||
52397C5D17E0E63200517C9A /* port.c in Sources */ = {isa = PBXBuildFile; fileRef = 52397C5C17E0E63200517C9A /* port.c */; };
|
|
||||||
52B1348216F3CCC400C07B32 /* tls.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1347B16F3CCC400C07B32 /* tls.c */; };
|
|
||||||
52B1348316F3CCC400C07B32 /* ssl.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1347C16F3CCC400C07B32 /* ssl.c */; };
|
|
||||||
52B1348416F3CCC400C07B32 /* ocsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1347D16F3CCC400C07B32 /* ocsp.c */; };
|
|
||||||
52B1348516F3CCC400C07B32 /* keys.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1347E16F3CCC400C07B32 /* keys.c */; };
|
|
||||||
52B1348616F3CCC400C07B32 /* io.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1347F16F3CCC400C07B32 /* io.c */; };
|
|
||||||
52B1348716F3CCC400C07B32 /* internal.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1348016F3CCC400C07B32 /* internal.c */; };
|
|
||||||
52B1348816F3CCC400C07B32 /* crl.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1348116F3CCC400C07B32 /* crl.c */; };
|
|
||||||
52B134A316F3CDF300C07B32 /* tfm.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1348916F3CDF300C07B32 /* tfm.c */; };
|
|
||||||
52B134A416F3CDF300C07B32 /* sha256.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1348A16F3CDF300C07B32 /* sha256.c */; };
|
|
||||||
52B134A516F3CDF300C07B32 /* sha.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1348B16F3CDF300C07B32 /* sha.c */; };
|
|
||||||
52B134A616F3CDF300C07B32 /* rsa.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1348C16F3CDF300C07B32 /* rsa.c */; };
|
|
||||||
52B134A716F3CDF300C07B32 /* ripemd.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1348D16F3CDF300C07B32 /* ripemd.c */; };
|
|
||||||
52B134A816F3CDF300C07B32 /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1348E16F3CDF300C07B32 /* random.c */; };
|
|
||||||
52B134A916F3CDF300C07B32 /* rabbit.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1348F16F3CDF300C07B32 /* rabbit.c */; };
|
|
||||||
52B134AA16F3CDF300C07B32 /* pwdbased.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1349016F3CDF300C07B32 /* pwdbased.c */; };
|
|
||||||
52B134AB16F3CDF300C07B32 /* misc.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1349116F3CDF300C07B32 /* misc.c */; };
|
|
||||||
52B134AC16F3CDF300C07B32 /* memory.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1349216F3CDF300C07B32 /* memory.c */; };
|
|
||||||
52B134AD16F3CDF300C07B32 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1349316F3CDF300C07B32 /* md5.c */; };
|
|
||||||
52B134AE16F3CDF300C07B32 /* md4.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1349416F3CDF300C07B32 /* md4.c */; };
|
|
||||||
52B134AF16F3CDF300C07B32 /* logging.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1349516F3CDF300C07B32 /* logging.c */; };
|
|
||||||
52B134B016F3CDF300C07B32 /* integer.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1349616F3CDF300C07B32 /* integer.c */; };
|
|
||||||
52B134B116F3CDF300C07B32 /* hmac.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1349716F3CDF300C07B32 /* hmac.c */; };
|
|
||||||
52B134B216F3CDF300C07B32 /* hc128.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1349816F3CDF300C07B32 /* hc128.c */; };
|
|
||||||
52B134B316F3CDF300C07B32 /* error.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1349916F3CDF300C07B32 /* error.c */; };
|
|
||||||
52B134B416F3CDF300C07B32 /* ecc.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1349A16F3CDF300C07B32 /* ecc.c */; };
|
|
||||||
52B134B516F3CDF300C07B32 /* dsa.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1349B16F3CDF300C07B32 /* dsa.c */; };
|
|
||||||
52B134B616F3CDF300C07B32 /* dh.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1349C16F3CDF300C07B32 /* dh.c */; };
|
|
||||||
52B134B716F3CDF300C07B32 /* des3.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1349D16F3CDF300C07B32 /* des3.c */; };
|
|
||||||
52B134B816F3CDF300C07B32 /* coding.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1349E16F3CDF300C07B32 /* coding.c */; };
|
|
||||||
52B134B916F3CDF300C07B32 /* camellia.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B1349F16F3CDF300C07B32 /* camellia.c */; };
|
|
||||||
52B134BA16F3CDF300C07B32 /* asn.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B134A016F3CDF300C07B32 /* asn.c */; };
|
|
||||||
52B134BB16F3CDF300C07B32 /* arc4.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B134A116F3CDF300C07B32 /* arc4.c */; };
|
|
||||||
52B134BC16F3CDF300C07B32 /* aes.c in Sources */ = {isa = PBXBuildFile; fileRef = 52B134A216F3CDF300C07B32 /* aes.c */; };
|
|
||||||
/* End PBXBuildFile section */
|
|
||||||
|
|
||||||
/* Begin PBXCopyFilesBuildPhase section */
|
|
||||||
52B1344B16F3C9E800C07B32 /* CopyFiles */ = {
|
|
||||||
isa = PBXCopyFilesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
dstPath = "include/${PRODUCT_NAME}";
|
|
||||||
dstSubfolderSpec = 16;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXCopyFilesBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
|
||||||
52397C5C17E0E63200517C9A /* port.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = port.c; path = ctaocrypt/src/port.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1344D16F3C9E800C07B32 /* libcyassl-ios.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcyassl-ios.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
||||||
52B1347B16F3CCC400C07B32 /* tls.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tls.c; path = src/tls.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1347C16F3CCC400C07B32 /* ssl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ssl.c; path = src/ssl.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1347D16F3CCC400C07B32 /* ocsp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ocsp.c; path = src/ocsp.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1347E16F3CCC400C07B32 /* keys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = keys.c; path = src/keys.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1347F16F3CCC400C07B32 /* io.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = io.c; path = src/io.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1348016F3CCC400C07B32 /* internal.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = internal.c; path = src/internal.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1348116F3CCC400C07B32 /* crl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = crl.c; path = src/crl.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1348916F3CDF300C07B32 /* tfm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tfm.c; path = ctaocrypt/src/tfm.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1348A16F3CDF300C07B32 /* sha256.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sha256.c; path = ctaocrypt/src/sha256.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1348B16F3CDF300C07B32 /* sha.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sha.c; path = ctaocrypt/src/sha.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1348C16F3CDF300C07B32 /* rsa.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = rsa.c; path = ctaocrypt/src/rsa.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1348D16F3CDF300C07B32 /* ripemd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ripemd.c; path = ctaocrypt/src/ripemd.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1348E16F3CDF300C07B32 /* random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = random.c; path = ctaocrypt/src/random.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1348F16F3CDF300C07B32 /* rabbit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = rabbit.c; path = ctaocrypt/src/rabbit.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1349016F3CDF300C07B32 /* pwdbased.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pwdbased.c; path = ctaocrypt/src/pwdbased.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1349116F3CDF300C07B32 /* misc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = misc.c; path = ctaocrypt/src/misc.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1349216F3CDF300C07B32 /* memory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = memory.c; path = ctaocrypt/src/memory.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1349316F3CDF300C07B32 /* md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = md5.c; path = ctaocrypt/src/md5.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1349416F3CDF300C07B32 /* md4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = md4.c; path = ctaocrypt/src/md4.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1349516F3CDF300C07B32 /* logging.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = logging.c; path = ctaocrypt/src/logging.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1349616F3CDF300C07B32 /* integer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = integer.c; path = ctaocrypt/src/integer.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1349716F3CDF300C07B32 /* hmac.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = hmac.c; path = ctaocrypt/src/hmac.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1349816F3CDF300C07B32 /* hc128.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = hc128.c; path = ctaocrypt/src/hc128.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1349916F3CDF300C07B32 /* error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = error.c; path = ctaocrypt/src/error.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1349A16F3CDF300C07B32 /* ecc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ecc.c; path = ctaocrypt/src/ecc.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1349B16F3CDF300C07B32 /* dsa.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = dsa.c; path = ctaocrypt/src/dsa.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1349C16F3CDF300C07B32 /* dh.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = dh.c; path = ctaocrypt/src/dh.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1349D16F3CDF300C07B32 /* des3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = des3.c; path = ctaocrypt/src/des3.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1349E16F3CDF300C07B32 /* coding.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = coding.c; path = ctaocrypt/src/coding.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B1349F16F3CDF300C07B32 /* camellia.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = camellia.c; path = ctaocrypt/src/camellia.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B134A016F3CDF300C07B32 /* asn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = asn.c; path = ctaocrypt/src/asn.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B134A116F3CDF300C07B32 /* arc4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = arc4.c; path = ctaocrypt/src/arc4.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
52B134A216F3CDF300C07B32 /* aes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = aes.c; path = ctaocrypt/src/aes.c; sourceTree = SOURCE_ROOT; };
|
|
||||||
/* End PBXFileReference section */
|
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
|
||||||
52B1344A16F3C9E800C07B32 /* Frameworks */ = {
|
|
||||||
isa = PBXFrameworksBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXFrameworksBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXGroup section */
|
|
||||||
52B1344416F3C9E800C07B32 = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
52B1347816F3CC0400C07B32 /* Source */,
|
|
||||||
52B1344E16F3C9E800C07B32 /* Products */,
|
|
||||||
);
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
52B1344E16F3C9E800C07B32 /* Products */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
52B1344D16F3C9E800C07B32 /* libcyassl-ios.a */,
|
|
||||||
);
|
|
||||||
name = Products;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
52B1347816F3CC0400C07B32 /* Source */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
52B1347916F3CC9200C07B32 /* cyaSSL */,
|
|
||||||
52B1347A16F3CC9A00C07B32 /* wolfCrypt */,
|
|
||||||
);
|
|
||||||
name = Source;
|
|
||||||
path = "cyassl-ios";
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
52B1347916F3CC9200C07B32 /* cyaSSL */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
52B1347B16F3CCC400C07B32 /* tls.c */,
|
|
||||||
52B1347C16F3CCC400C07B32 /* ssl.c */,
|
|
||||||
52B1347D16F3CCC400C07B32 /* ocsp.c */,
|
|
||||||
52B1347E16F3CCC400C07B32 /* keys.c */,
|
|
||||||
52B1347F16F3CCC400C07B32 /* io.c */,
|
|
||||||
52B1348016F3CCC400C07B32 /* internal.c */,
|
|
||||||
52B1348116F3CCC400C07B32 /* crl.c */,
|
|
||||||
);
|
|
||||||
name = cyaSSL;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
52B1347A16F3CC9A00C07B32 /* wolfCrypt */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
52397C5C17E0E63200517C9A /* port.c */,
|
|
||||||
52B1348916F3CDF300C07B32 /* tfm.c */,
|
|
||||||
52B1348A16F3CDF300C07B32 /* sha256.c */,
|
|
||||||
52B1348B16F3CDF300C07B32 /* sha.c */,
|
|
||||||
52B1348C16F3CDF300C07B32 /* rsa.c */,
|
|
||||||
52B1348D16F3CDF300C07B32 /* ripemd.c */,
|
|
||||||
52B1348E16F3CDF300C07B32 /* random.c */,
|
|
||||||
52B1348F16F3CDF300C07B32 /* rabbit.c */,
|
|
||||||
52B1349016F3CDF300C07B32 /* pwdbased.c */,
|
|
||||||
52B1349116F3CDF300C07B32 /* misc.c */,
|
|
||||||
52B1349216F3CDF300C07B32 /* memory.c */,
|
|
||||||
52B1349316F3CDF300C07B32 /* md5.c */,
|
|
||||||
52B1349416F3CDF300C07B32 /* md4.c */,
|
|
||||||
52B1349516F3CDF300C07B32 /* logging.c */,
|
|
||||||
52B1349616F3CDF300C07B32 /* integer.c */,
|
|
||||||
52B1349716F3CDF300C07B32 /* hmac.c */,
|
|
||||||
52B1349816F3CDF300C07B32 /* hc128.c */,
|
|
||||||
52B1349916F3CDF300C07B32 /* error.c */,
|
|
||||||
52B1349A16F3CDF300C07B32 /* ecc.c */,
|
|
||||||
52B1349B16F3CDF300C07B32 /* dsa.c */,
|
|
||||||
52B1349C16F3CDF300C07B32 /* dh.c */,
|
|
||||||
52B1349D16F3CDF300C07B32 /* des3.c */,
|
|
||||||
52B1349E16F3CDF300C07B32 /* coding.c */,
|
|
||||||
52B1349F16F3CDF300C07B32 /* camellia.c */,
|
|
||||||
52B134A016F3CDF300C07B32 /* asn.c */,
|
|
||||||
52B134A116F3CDF300C07B32 /* arc4.c */,
|
|
||||||
52B134A216F3CDF300C07B32 /* aes.c */,
|
|
||||||
);
|
|
||||||
name = wolfCrypt;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
/* End PBXGroup section */
|
|
||||||
|
|
||||||
/* Begin PBXNativeTarget section */
|
|
||||||
52B1344C16F3C9E800C07B32 /* cyassl-ios */ = {
|
|
||||||
isa = PBXNativeTarget;
|
|
||||||
buildConfigurationList = 52B1347216F3C9E800C07B32 /* Build configuration list for PBXNativeTarget "cyassl-ios" */;
|
|
||||||
buildPhases = (
|
|
||||||
52B1344916F3C9E800C07B32 /* Sources */,
|
|
||||||
52B1344A16F3C9E800C07B32 /* Frameworks */,
|
|
||||||
52B1344B16F3C9E800C07B32 /* CopyFiles */,
|
|
||||||
);
|
|
||||||
buildRules = (
|
|
||||||
);
|
|
||||||
dependencies = (
|
|
||||||
);
|
|
||||||
name = "cyassl-ios";
|
|
||||||
productName = "cyassl-ios";
|
|
||||||
productReference = 52B1344D16F3C9E800C07B32 /* libcyassl-ios.a */;
|
|
||||||
productType = "com.apple.product-type.library.static";
|
|
||||||
};
|
|
||||||
/* End PBXNativeTarget section */
|
|
||||||
|
|
||||||
/* Begin PBXProject section */
|
|
||||||
52B1344516F3C9E800C07B32 /* Project object */ = {
|
|
||||||
isa = PBXProject;
|
|
||||||
attributes = {
|
|
||||||
LastUpgradeCheck = 0460;
|
|
||||||
ORGANIZATIONNAME = "wolfSSL Inc";
|
|
||||||
};
|
|
||||||
buildConfigurationList = 52B1344816F3C9E800C07B32 /* Build configuration list for PBXProject "cyassl-ios" */;
|
|
||||||
compatibilityVersion = "Xcode 3.2";
|
|
||||||
developmentRegion = English;
|
|
||||||
hasScannedForEncodings = 0;
|
|
||||||
knownRegions = (
|
|
||||||
en,
|
|
||||||
);
|
|
||||||
mainGroup = 52B1344416F3C9E800C07B32;
|
|
||||||
productRefGroup = 52B1344E16F3C9E800C07B32 /* Products */;
|
|
||||||
projectDirPath = "";
|
|
||||||
projectRoot = "";
|
|
||||||
targets = (
|
|
||||||
52B1344C16F3C9E800C07B32 /* cyassl-ios */,
|
|
||||||
);
|
|
||||||
};
|
|
||||||
/* End PBXProject section */
|
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
|
||||||
52B1344916F3C9E800C07B32 /* Sources */ = {
|
|
||||||
isa = PBXSourcesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
52B1348216F3CCC400C07B32 /* tls.c in Sources */,
|
|
||||||
52B1348316F3CCC400C07B32 /* ssl.c in Sources */,
|
|
||||||
52B1348416F3CCC400C07B32 /* ocsp.c in Sources */,
|
|
||||||
52B1348516F3CCC400C07B32 /* keys.c in Sources */,
|
|
||||||
52B1348616F3CCC400C07B32 /* io.c in Sources */,
|
|
||||||
52B1348716F3CCC400C07B32 /* internal.c in Sources */,
|
|
||||||
52B1348816F3CCC400C07B32 /* crl.c in Sources */,
|
|
||||||
52B134A316F3CDF300C07B32 /* tfm.c in Sources */,
|
|
||||||
52B134A416F3CDF300C07B32 /* sha256.c in Sources */,
|
|
||||||
52B134A516F3CDF300C07B32 /* sha.c in Sources */,
|
|
||||||
52B134A616F3CDF300C07B32 /* rsa.c in Sources */,
|
|
||||||
52B134A716F3CDF300C07B32 /* ripemd.c in Sources */,
|
|
||||||
52B134A816F3CDF300C07B32 /* random.c in Sources */,
|
|
||||||
52B134A916F3CDF300C07B32 /* rabbit.c in Sources */,
|
|
||||||
52B134AA16F3CDF300C07B32 /* pwdbased.c in Sources */,
|
|
||||||
52B134AB16F3CDF300C07B32 /* misc.c in Sources */,
|
|
||||||
52B134AC16F3CDF300C07B32 /* memory.c in Sources */,
|
|
||||||
52B134AD16F3CDF300C07B32 /* md5.c in Sources */,
|
|
||||||
52B134AE16F3CDF300C07B32 /* md4.c in Sources */,
|
|
||||||
52B134AF16F3CDF300C07B32 /* logging.c in Sources */,
|
|
||||||
52B134B016F3CDF300C07B32 /* integer.c in Sources */,
|
|
||||||
52B134B116F3CDF300C07B32 /* hmac.c in Sources */,
|
|
||||||
52B134B216F3CDF300C07B32 /* hc128.c in Sources */,
|
|
||||||
52B134B316F3CDF300C07B32 /* error.c in Sources */,
|
|
||||||
52B134B416F3CDF300C07B32 /* ecc.c in Sources */,
|
|
||||||
52B134B516F3CDF300C07B32 /* dsa.c in Sources */,
|
|
||||||
52B134B616F3CDF300C07B32 /* dh.c in Sources */,
|
|
||||||
52B134B716F3CDF300C07B32 /* des3.c in Sources */,
|
|
||||||
52B134B816F3CDF300C07B32 /* coding.c in Sources */,
|
|
||||||
52B134B916F3CDF300C07B32 /* camellia.c in Sources */,
|
|
||||||
52B134BA16F3CDF300C07B32 /* asn.c in Sources */,
|
|
||||||
52B134BB16F3CDF300C07B32 /* arc4.c in Sources */,
|
|
||||||
52B134BC16F3CDF300C07B32 /* aes.c in Sources */,
|
|
||||||
52397C5D17E0E63200517C9A /* port.c in Sources */,
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXSourcesBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin XCBuildConfiguration section */
|
|
||||||
52B1347016F3C9E800C07B32 /* Debug */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
|
||||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
|
||||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
||||||
CLANG_WARN_INT_CONVERSION = YES;
|
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
||||||
COPY_PHASE_STRIP = NO;
|
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
||||||
GCC_DYNAMIC_NO_PIC = NO;
|
|
||||||
GCC_OPTIMIZATION_LEVEL = 0;
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
||||||
"DEBUG=1",
|
|
||||||
"$(inherited)",
|
|
||||||
);
|
|
||||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
|
||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
|
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
|
||||||
SDKROOT = iphoneos;
|
|
||||||
USER_HEADER_SEARCH_PATHS = "cyassl/ctaocrypt cyassl include";
|
|
||||||
};
|
|
||||||
name = Debug;
|
|
||||||
};
|
|
||||||
52B1347116F3C9E800C07B32 /* Release */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
|
||||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
|
||||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
||||||
CLANG_WARN_INT_CONVERSION = YES;
|
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
||||||
COPY_PHASE_STRIP = YES;
|
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
|
||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
|
|
||||||
SDKROOT = iphoneos;
|
|
||||||
USER_HEADER_SEARCH_PATHS = "cyassl/ctaocrypt cyassl include";
|
|
||||||
VALIDATE_PRODUCT = NO;
|
|
||||||
};
|
|
||||||
name = Release;
|
|
||||||
};
|
|
||||||
52B1347316F3C9E800C07B32 /* Debug */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ALWAYS_SEARCH_USER_PATHS = YES;
|
|
||||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
|
||||||
DSTROOT = /tmp/cyassl_ios.dst;
|
|
||||||
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
|
||||||
GCC_PREFIX_HEADER = "";
|
|
||||||
HEADER_SEARCH_PATHS = $SRCROOT;
|
|
||||||
OTHER_LDFLAGS = "";
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
||||||
SKIP_INSTALL = YES;
|
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
|
||||||
USER_HEADER_SEARCH_PATHS = "cyassl/ctaocrypt cyassl";
|
|
||||||
};
|
|
||||||
name = Debug;
|
|
||||||
};
|
|
||||||
52B1347416F3C9E800C07B32 /* Release */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ALWAYS_SEARCH_USER_PATHS = YES;
|
|
||||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
|
||||||
DSTROOT = /tmp/cyassl_ios.dst;
|
|
||||||
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
|
||||||
GCC_PREFIX_HEADER = "";
|
|
||||||
HEADER_SEARCH_PATHS = $SRCROOT;
|
|
||||||
OTHER_LDFLAGS = "";
|
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
||||||
SKIP_INSTALL = YES;
|
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
|
||||||
USER_HEADER_SEARCH_PATHS = "cyassl/ctaocrypt cyassl";
|
|
||||||
};
|
|
||||||
name = Release;
|
|
||||||
};
|
|
||||||
/* End XCBuildConfiguration section */
|
|
||||||
|
|
||||||
/* Begin XCConfigurationList section */
|
|
||||||
52B1344816F3C9E800C07B32 /* Build configuration list for PBXProject "cyassl-ios" */ = {
|
|
||||||
isa = XCConfigurationList;
|
|
||||||
buildConfigurations = (
|
|
||||||
52B1347016F3C9E800C07B32 /* Debug */,
|
|
||||||
52B1347116F3C9E800C07B32 /* Release */,
|
|
||||||
);
|
|
||||||
defaultConfigurationIsVisible = 0;
|
|
||||||
defaultConfigurationName = Release;
|
|
||||||
};
|
|
||||||
52B1347216F3C9E800C07B32 /* Build configuration list for PBXNativeTarget "cyassl-ios" */ = {
|
|
||||||
isa = XCConfigurationList;
|
|
||||||
buildConfigurations = (
|
|
||||||
52B1347316F3C9E800C07B32 /* Debug */,
|
|
||||||
52B1347416F3C9E800C07B32 /* Release */,
|
|
||||||
);
|
|
||||||
defaultConfigurationIsVisible = 0;
|
|
||||||
defaultConfigurationName = Release;
|
|
||||||
};
|
|
||||||
/* End XCConfigurationList section */
|
|
||||||
};
|
|
||||||
rootObject = 52B1344516F3C9E800C07B32 /* Project object */;
|
|
||||||
}
|
|
|
@ -1,379 +0,0 @@
|
||||||
// !$*UTF8*$!
|
|
||||||
{
|
|
||||||
archiveVersion = 1;
|
|
||||||
classes = {
|
|
||||||
};
|
|
||||||
objectVersion = 45;
|
|
||||||
objects = {
|
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
|
||||||
43809E9B0FB7AD1C0050922E /* md4.c in Sources */ = {isa = PBXBuildFile; fileRef = 43809E9A0FB7AD1C0050922E /* md4.c */; };
|
|
||||||
43962ADF0DE7ED48003C5E5B /* ssl.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2790DDF984100F2D488 /* ssl.c */; };
|
|
||||||
439B3820136B391E004C965E /* logging.c in Sources */ = {isa = PBXBuildFile; fileRef = 439B381F136B391E004C965E /* logging.c */; };
|
|
||||||
43B89CBD142FEB5E00284CC6 /* internal.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CBC142FEB5E00284CC6 /* internal.c */; };
|
|
||||||
43B89CBF142FEB6C00284CC6 /* io.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CBE142FEB6C00284CC6 /* io.c */; };
|
|
||||||
43B89CC5142FEBBD00284CC6 /* memory.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CC0142FEBBD00284CC6 /* memory.c */; };
|
|
||||||
43B89CC6142FEBBD00284CC6 /* tfm.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CC1142FEBBD00284CC6 /* tfm.c */; };
|
|
||||||
43B89CC7142FEBBD00284CC6 /* ripemd.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CC2142FEBBD00284CC6 /* ripemd.c */; };
|
|
||||||
43B89CC8142FEBBD00284CC6 /* sha512.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CC3142FEBBD00284CC6 /* sha512.c */; };
|
|
||||||
43B89CC9142FEBBD00284CC6 /* pwdbased.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CC4142FEBBD00284CC6 /* pwdbased.c */; };
|
|
||||||
43C6C27C0DDF984100F2D488 /* keys.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2780DDF984100F2D488 /* keys.c */; };
|
|
||||||
43C6C27E0DDF984100F2D488 /* tls.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C27A0DDF984100F2D488 /* tls.c */; };
|
|
||||||
43C6C2920DDF98D400F2D488 /* aes.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2830DDF98D400F2D488 /* aes.c */; };
|
|
||||||
43C6C2930DDF98D400F2D488 /* arc4.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2840DDF98D400F2D488 /* arc4.c */; };
|
|
||||||
43C6C2940DDF98D400F2D488 /* asn.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2850DDF98D400F2D488 /* asn.c */; };
|
|
||||||
43C6C2950DDF98D400F2D488 /* coding.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2860DDF98D400F2D488 /* coding.c */; };
|
|
||||||
43C6C2960DDF98D400F2D488 /* des3.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2870DDF98D400F2D488 /* des3.c */; };
|
|
||||||
43C6C2970DDF98D400F2D488 /* dh.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2880DDF98D400F2D488 /* dh.c */; };
|
|
||||||
43C6C2980DDF98D400F2D488 /* dsa.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2890DDF98D400F2D488 /* dsa.c */; };
|
|
||||||
43C6C2990DDF98D400F2D488 /* hmac.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C28A0DDF98D400F2D488 /* hmac.c */; };
|
|
||||||
43C6C29A0DDF98D400F2D488 /* integer.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C28B0DDF98D400F2D488 /* integer.c */; };
|
|
||||||
43C6C29B0DDF98D400F2D488 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C28C0DDF98D400F2D488 /* md5.c */; };
|
|
||||||
43C6C29D0DDF98D400F2D488 /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C28E0DDF98D400F2D488 /* random.c */; };
|
|
||||||
43C6C29E0DDF98D400F2D488 /* rsa.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C28F0DDF98D400F2D488 /* rsa.c */; };
|
|
||||||
43C6C29F0DDF98D400F2D488 /* sha.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2900DDF98D400F2D488 /* sha.c */; };
|
|
||||||
43C6C2A00DDF98D400F2D488 /* sha256.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2910DDF98D400F2D488 /* sha256.c */; };
|
|
||||||
43D565650F1EC9A600550C88 /* hc128.c in Sources */ = {isa = PBXBuildFile; fileRef = 43D565640F1EC9A600550C88 /* hc128.c */; };
|
|
||||||
43D565670F1EC9CC00550C88 /* rabbit.c in Sources */ = {isa = PBXBuildFile; fileRef = 43D565660F1EC9CC00550C88 /* rabbit.c */; };
|
|
||||||
/* End PBXBuildFile section */
|
|
||||||
|
|
||||||
/* Begin PBXCopyFilesBuildPhase section */
|
|
||||||
43C6C3160DDFAC6A00F2D488 /* CopyFiles */ = {
|
|
||||||
isa = PBXCopyFilesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
dstPath = "";
|
|
||||||
dstSubfolderSpec = 7;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
43C6C3170DDFAC6A00F2D488 /* CopyFiles */ = {
|
|
||||||
isa = PBXCopyFilesBuildPhase;
|
|
||||||
buildActionMask = 8;
|
|
||||||
dstPath = "";
|
|
||||||
dstSubfolderSpec = 7;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 1;
|
|
||||||
};
|
|
||||||
43C6C3180DDFAC6A00F2D488 /* CopyFiles */ = {
|
|
||||||
isa = PBXCopyFilesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
dstPath = "";
|
|
||||||
dstSubfolderSpec = 7;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXCopyFilesBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
|
||||||
4368F6E40E9EA1140002A123 /* test.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = test.c; path = ctaocrypt/test/test.c; sourceTree = "<group>"; };
|
|
||||||
43809E9A0FB7AD1C0050922E /* md4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = md4.c; path = ctaocrypt/src/md4.c; sourceTree = "<group>"; };
|
|
||||||
439B381F136B391E004C965E /* logging.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = logging.c; path = ctaocrypt/src/logging.c; sourceTree = "<group>"; };
|
|
||||||
43B89CBC142FEB5E00284CC6 /* internal.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = internal.c; path = src/internal.c; sourceTree = "<group>"; };
|
|
||||||
43B89CBE142FEB6C00284CC6 /* io.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = io.c; path = src/io.c; sourceTree = "<group>"; };
|
|
||||||
43B89CC0142FEBBD00284CC6 /* memory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = memory.c; path = ctaocrypt/src/memory.c; sourceTree = "<group>"; };
|
|
||||||
43B89CC1142FEBBD00284CC6 /* tfm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tfm.c; path = ctaocrypt/src/tfm.c; sourceTree = "<group>"; };
|
|
||||||
43B89CC2142FEBBD00284CC6 /* ripemd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ripemd.c; path = ctaocrypt/src/ripemd.c; sourceTree = "<group>"; };
|
|
||||||
43B89CC3142FEBBD00284CC6 /* sha512.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sha512.c; path = ctaocrypt/src/sha512.c; sourceTree = "<group>"; };
|
|
||||||
43B89CC4142FEBBD00284CC6 /* pwdbased.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pwdbased.c; path = ctaocrypt/src/pwdbased.c; sourceTree = "<group>"; };
|
|
||||||
43C6C2780DDF984100F2D488 /* keys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = keys.c; path = src/keys.c; sourceTree = "<group>"; };
|
|
||||||
43C6C2790DDF984100F2D488 /* ssl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 0; name = ssl.c; path = src/ssl.c; sourceTree = "<group>"; };
|
|
||||||
43C6C27A0DDF984100F2D488 /* tls.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = tls.c; path = src/tls.c; sourceTree = "<group>"; };
|
|
||||||
43C6C2830DDF98D400F2D488 /* aes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = aes.c; path = ctaocrypt/src/aes.c; sourceTree = "<group>"; };
|
|
||||||
43C6C2840DDF98D400F2D488 /* arc4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = arc4.c; path = ctaocrypt/src/arc4.c; sourceTree = "<group>"; };
|
|
||||||
43C6C2850DDF98D400F2D488 /* asn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = asn.c; path = ctaocrypt/src/asn.c; sourceTree = "<group>"; };
|
|
||||||
43C6C2860DDF98D400F2D488 /* coding.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = coding.c; path = ctaocrypt/src/coding.c; sourceTree = "<group>"; };
|
|
||||||
43C6C2870DDF98D400F2D488 /* des3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = des3.c; path = ctaocrypt/src/des3.c; sourceTree = "<group>"; };
|
|
||||||
43C6C2880DDF98D400F2D488 /* dh.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = dh.c; path = ctaocrypt/src/dh.c; sourceTree = "<group>"; };
|
|
||||||
43C6C2890DDF98D400F2D488 /* dsa.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = dsa.c; path = ctaocrypt/src/dsa.c; sourceTree = "<group>"; };
|
|
||||||
43C6C28A0DDF98D400F2D488 /* hmac.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 0; name = hmac.c; path = ctaocrypt/src/hmac.c; sourceTree = "<group>"; };
|
|
||||||
43C6C28B0DDF98D400F2D488 /* integer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = integer.c; path = ctaocrypt/src/integer.c; sourceTree = "<group>"; };
|
|
||||||
43C6C28C0DDF98D400F2D488 /* md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = md5.c; path = ctaocrypt/src/md5.c; sourceTree = "<group>"; };
|
|
||||||
43C6C28E0DDF98D400F2D488 /* random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = random.c; path = ctaocrypt/src/random.c; sourceTree = "<group>"; };
|
|
||||||
43C6C28F0DDF98D400F2D488 /* rsa.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = rsa.c; path = ctaocrypt/src/rsa.c; sourceTree = "<group>"; };
|
|
||||||
43C6C2900DDF98D400F2D488 /* sha.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = sha.c; path = ctaocrypt/src/sha.c; sourceTree = "<group>"; };
|
|
||||||
43C6C2910DDF98D400F2D488 /* sha256.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 0; name = sha256.c; path = ctaocrypt/src/sha256.c; sourceTree = "<group>"; };
|
|
||||||
43CB530D116E9FD5000A264B /* iphone-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "iphone-Info.plist"; sourceTree = "<group>"; };
|
|
||||||
43D565640F1EC9A600550C88 /* hc128.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = hc128.c; path = ctaocrypt/src/hc128.c; sourceTree = "<group>"; };
|
|
||||||
43D565660F1EC9CC00550C88 /* rabbit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = rabbit.c; path = ctaocrypt/src/rabbit.c; sourceTree = "<group>"; };
|
|
||||||
D2AAC046055464E500DB518D /* libcyassl.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libcyassl.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
||||||
/* End PBXFileReference section */
|
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
|
||||||
D289987405E68DCB004EDB86 /* Frameworks */ = {
|
|
||||||
isa = PBXFrameworksBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXFrameworksBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXGroup section */
|
|
||||||
08FB7794FE84155DC02AAC07 /* cyassl */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
08FB7795FE84155DC02AAC07 /* Source */,
|
|
||||||
C6A0FF2B0290797F04C91782 /* Documentation */,
|
|
||||||
1AB674ADFE9D54B511CA2CBB /* Products */,
|
|
||||||
43CB530D116E9FD5000A264B /* iphone-Info.plist */,
|
|
||||||
);
|
|
||||||
name = cyassl;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
08FB7795FE84155DC02AAC07 /* Source */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
43CA25B90EA400A60011ECA2 /* headers */,
|
|
||||||
43CA25720EA3F9B20011ECA2 /* src */,
|
|
||||||
);
|
|
||||||
name = Source;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
1AB674ADFE9D54B511CA2CBB /* Products */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
D2AAC046055464E500DB518D /* libcyassl.a */,
|
|
||||||
);
|
|
||||||
name = Products;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
43CA25720EA3F9B20011ECA2 /* src */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
43B89CC0142FEBBD00284CC6 /* memory.c */,
|
|
||||||
43B89CC1142FEBBD00284CC6 /* tfm.c */,
|
|
||||||
43B89CC2142FEBBD00284CC6 /* ripemd.c */,
|
|
||||||
43B89CC3142FEBBD00284CC6 /* sha512.c */,
|
|
||||||
43B89CC4142FEBBD00284CC6 /* pwdbased.c */,
|
|
||||||
43B89CBE142FEB6C00284CC6 /* io.c */,
|
|
||||||
43B89CBC142FEB5E00284CC6 /* internal.c */,
|
|
||||||
439B381F136B391E004C965E /* logging.c */,
|
|
||||||
43809E9A0FB7AD1C0050922E /* md4.c */,
|
|
||||||
43D565660F1EC9CC00550C88 /* rabbit.c */,
|
|
||||||
43D565640F1EC9A600550C88 /* hc128.c */,
|
|
||||||
43C6C2830DDF98D400F2D488 /* aes.c */,
|
|
||||||
43C6C2840DDF98D400F2D488 /* arc4.c */,
|
|
||||||
43C6C2850DDF98D400F2D488 /* asn.c */,
|
|
||||||
43C6C2860DDF98D400F2D488 /* coding.c */,
|
|
||||||
43C6C2870DDF98D400F2D488 /* des3.c */,
|
|
||||||
4368F6E40E9EA1140002A123 /* test.c */,
|
|
||||||
43C6C2880DDF98D400F2D488 /* dh.c */,
|
|
||||||
43C6C2890DDF98D400F2D488 /* dsa.c */,
|
|
||||||
43C6C28A0DDF98D400F2D488 /* hmac.c */,
|
|
||||||
43C6C28B0DDF98D400F2D488 /* integer.c */,
|
|
||||||
43C6C28C0DDF98D400F2D488 /* md5.c */,
|
|
||||||
43C6C28E0DDF98D400F2D488 /* random.c */,
|
|
||||||
43C6C28F0DDF98D400F2D488 /* rsa.c */,
|
|
||||||
43C6C2900DDF98D400F2D488 /* sha.c */,
|
|
||||||
43C6C2910DDF98D400F2D488 /* sha256.c */,
|
|
||||||
43C6C2780DDF984100F2D488 /* keys.c */,
|
|
||||||
43C6C2790DDF984100F2D488 /* ssl.c */,
|
|
||||||
43C6C27A0DDF984100F2D488 /* tls.c */,
|
|
||||||
);
|
|
||||||
name = src;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
43CA25B90EA400A60011ECA2 /* headers */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
);
|
|
||||||
name = headers;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
C6A0FF2B0290797F04C91782 /* Documentation */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
);
|
|
||||||
name = Documentation;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
/* End PBXGroup section */
|
|
||||||
|
|
||||||
/* Begin PBXHeadersBuildPhase section */
|
|
||||||
D2AAC043055464E500DB518D /* Headers */ = {
|
|
||||||
isa = PBXHeadersBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXHeadersBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin PBXNativeTarget section */
|
|
||||||
D2AAC045055464E500DB518D /* cyassl */ = {
|
|
||||||
isa = PBXNativeTarget;
|
|
||||||
buildConfigurationList = 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "cyassl" */;
|
|
||||||
buildPhases = (
|
|
||||||
D2AAC043055464E500DB518D /* Headers */,
|
|
||||||
D2AAC044055464E500DB518D /* Sources */,
|
|
||||||
D289987405E68DCB004EDB86 /* Frameworks */,
|
|
||||||
43C6C3160DDFAC6A00F2D488 /* CopyFiles */,
|
|
||||||
43C6C3170DDFAC6A00F2D488 /* CopyFiles */,
|
|
||||||
43C6C3180DDFAC6A00F2D488 /* CopyFiles */,
|
|
||||||
);
|
|
||||||
buildRules = (
|
|
||||||
);
|
|
||||||
dependencies = (
|
|
||||||
);
|
|
||||||
name = cyassl;
|
|
||||||
productName = cyassl;
|
|
||||||
productReference = D2AAC046055464E500DB518D /* libcyassl.a */;
|
|
||||||
productType = "com.apple.product-type.library.static";
|
|
||||||
};
|
|
||||||
/* End PBXNativeTarget section */
|
|
||||||
|
|
||||||
/* Begin PBXProject section */
|
|
||||||
08FB7793FE84155DC02AAC07 /* Project object */ = {
|
|
||||||
isa = PBXProject;
|
|
||||||
attributes = {
|
|
||||||
BuildIndependentTargetsInParallel = YES;
|
|
||||||
};
|
|
||||||
buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "cyassl-iphone" */;
|
|
||||||
compatibilityVersion = "Xcode 3.1";
|
|
||||||
developmentRegion = English;
|
|
||||||
hasScannedForEncodings = 1;
|
|
||||||
knownRegions = (
|
|
||||||
English,
|
|
||||||
Japanese,
|
|
||||||
French,
|
|
||||||
German,
|
|
||||||
);
|
|
||||||
mainGroup = 08FB7794FE84155DC02AAC07 /* cyassl */;
|
|
||||||
projectDirPath = "";
|
|
||||||
projectRoot = "";
|
|
||||||
targets = (
|
|
||||||
D2AAC045055464E500DB518D /* cyassl */,
|
|
||||||
);
|
|
||||||
};
|
|
||||||
/* End PBXProject section */
|
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
|
||||||
D2AAC044055464E500DB518D /* Sources */ = {
|
|
||||||
isa = PBXSourcesBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
43C6C27C0DDF984100F2D488 /* keys.c in Sources */,
|
|
||||||
43C6C27E0DDF984100F2D488 /* tls.c in Sources */,
|
|
||||||
43C6C2920DDF98D400F2D488 /* aes.c in Sources */,
|
|
||||||
43C6C2930DDF98D400F2D488 /* arc4.c in Sources */,
|
|
||||||
43C6C2940DDF98D400F2D488 /* asn.c in Sources */,
|
|
||||||
43C6C2950DDF98D400F2D488 /* coding.c in Sources */,
|
|
||||||
43C6C2960DDF98D400F2D488 /* des3.c in Sources */,
|
|
||||||
43C6C2970DDF98D400F2D488 /* dh.c in Sources */,
|
|
||||||
43C6C2980DDF98D400F2D488 /* dsa.c in Sources */,
|
|
||||||
43C6C2990DDF98D400F2D488 /* hmac.c in Sources */,
|
|
||||||
43C6C29A0DDF98D400F2D488 /* integer.c in Sources */,
|
|
||||||
43C6C29B0DDF98D400F2D488 /* md5.c in Sources */,
|
|
||||||
43C6C29D0DDF98D400F2D488 /* random.c in Sources */,
|
|
||||||
43C6C29E0DDF98D400F2D488 /* rsa.c in Sources */,
|
|
||||||
43C6C29F0DDF98D400F2D488 /* sha.c in Sources */,
|
|
||||||
43C6C2A00DDF98D400F2D488 /* sha256.c in Sources */,
|
|
||||||
43962ADF0DE7ED48003C5E5B /* ssl.c in Sources */,
|
|
||||||
43D565650F1EC9A600550C88 /* hc128.c in Sources */,
|
|
||||||
43D565670F1EC9CC00550C88 /* rabbit.c in Sources */,
|
|
||||||
43809E9B0FB7AD1C0050922E /* md4.c in Sources */,
|
|
||||||
439B3820136B391E004C965E /* logging.c in Sources */,
|
|
||||||
43B89CBD142FEB5E00284CC6 /* internal.c in Sources */,
|
|
||||||
43B89CBF142FEB6C00284CC6 /* io.c in Sources */,
|
|
||||||
43B89CC5142FEBBD00284CC6 /* memory.c in Sources */,
|
|
||||||
43B89CC6142FEBBD00284CC6 /* tfm.c in Sources */,
|
|
||||||
43B89CC7142FEBBD00284CC6 /* ripemd.c in Sources */,
|
|
||||||
43B89CC8142FEBBD00284CC6 /* sha512.c in Sources */,
|
|
||||||
43B89CC9142FEBBD00284CC6 /* pwdbased.c in Sources */,
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
};
|
|
||||||
/* End PBXSourcesBuildPhase section */
|
|
||||||
|
|
||||||
/* Begin XCBuildConfiguration section */
|
|
||||||
1DEB91EC08733DB70010E9CD /* Debug */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
|
||||||
COPY_PHASE_STRIP = NO;
|
|
||||||
GCC_DYNAMIC_NO_PIC = NO;
|
|
||||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
|
||||||
GCC_MODEL_TUNING = G5;
|
|
||||||
GCC_OPTIMIZATION_LEVEL = 0;
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = IPHONE;
|
|
||||||
HEADER_SEARCH_PATHS = $SRCROOT;
|
|
||||||
INSTALL_PATH = /usr/local/lib;
|
|
||||||
PRODUCT_NAME = cyassl;
|
|
||||||
SDKROOT = iphoneos;
|
|
||||||
USER_HEADER_SEARCH_PATHS = "";
|
|
||||||
WARNING_CFLAGS = "-Wall";
|
|
||||||
ZERO_LINK = YES;
|
|
||||||
};
|
|
||||||
name = Debug;
|
|
||||||
};
|
|
||||||
1DEB91ED08733DB70010E9CD /* Release */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
|
||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
|
||||||
GCC_MODEL_TUNING = G5;
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = IPHONE;
|
|
||||||
HEADER_SEARCH_PATHS = $SRCROOT;
|
|
||||||
INSTALL_PATH = /usr/local/lib;
|
|
||||||
PRODUCT_NAME = cyassl;
|
|
||||||
USER_HEADER_SEARCH_PATHS = "";
|
|
||||||
WARNING_CFLAGS = "-Wall";
|
|
||||||
};
|
|
||||||
name = Release;
|
|
||||||
};
|
|
||||||
1DEB91F008733DB70010E9CD /* Debug */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = IPHONE;
|
|
||||||
GCC_VERSION = 4.2;
|
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
||||||
PREBINDING = NO;
|
|
||||||
SDKROOT = iphoneos;
|
|
||||||
USER_HEADER_SEARCH_PATHS = "include ctaocrypt/include";
|
|
||||||
};
|
|
||||||
name = Debug;
|
|
||||||
};
|
|
||||||
1DEB91F108733DB70010E9CD /* Release */ = {
|
|
||||||
isa = XCBuildConfiguration;
|
|
||||||
buildSettings = {
|
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = IPHONE;
|
|
||||||
GCC_VERSION = 4.2;
|
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
||||||
PREBINDING = NO;
|
|
||||||
SDKROOT = iphonesimulator2.2;
|
|
||||||
USER_HEADER_SEARCH_PATHS = "include ctaocrypt/include";
|
|
||||||
};
|
|
||||||
name = Release;
|
|
||||||
};
|
|
||||||
/* End XCBuildConfiguration section */
|
|
||||||
|
|
||||||
/* Begin XCConfigurationList section */
|
|
||||||
1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "cyassl" */ = {
|
|
||||||
isa = XCConfigurationList;
|
|
||||||
buildConfigurations = (
|
|
||||||
1DEB91EC08733DB70010E9CD /* Debug */,
|
|
||||||
1DEB91ED08733DB70010E9CD /* Release */,
|
|
||||||
);
|
|
||||||
defaultConfigurationIsVisible = 0;
|
|
||||||
defaultConfigurationName = Release;
|
|
||||||
};
|
|
||||||
1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "cyassl-iphone" */ = {
|
|
||||||
isa = XCConfigurationList;
|
|
||||||
buildConfigurations = (
|
|
||||||
1DEB91F008733DB70010E9CD /* Debug */,
|
|
||||||
1DEB91F108733DB70010E9CD /* Release */,
|
|
||||||
);
|
|
||||||
defaultConfigurationIsVisible = 0;
|
|
||||||
defaultConfigurationName = Release;
|
|
||||||
};
|
|
||||||
/* End XCConfigurationList section */
|
|
||||||
};
|
|
||||||
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
|
|
||||||
}
|
|
|
@ -1,65 +0,0 @@
|
||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
|
||||||
# Visual C++ Express 2008
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cyassl", "cyassl-ntru.vcproj", "{73973223-5EE8-41CA-8E88-1D60E89A237B}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsuite", "testsuite\testsuite-ntru.vcproj", "{611E8971-46E0-4D0A-B5A1-632C3B00CB80}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echoserver", "examples\echoserver\echoserver-ntru.vcproj", "{07D97C48-E08F-4E34-9F67-3064039FF2CB}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echoclient", "examples\echoclient\echoclient-ntru.vcproj", "{8362A816-C5DC-4E22-B5C5-9E6806387073}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "examples\client\client-ntru.vcproj", "{3ADE9549-582D-4D8E-9826-B172197A7959}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "server", "examples\server\server-ntru.vcproj", "{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Win32 = Debug|Win32
|
|
||||||
Release|Win32 = Release|Win32
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{3ADE9549-582D-4D8E-9826-B172197A7959}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{3ADE9549-582D-4D8E-9826-B172197A7959}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
|
@ -1,313 +0,0 @@
|
||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
|
||||||
<VisualStudioProject
|
|
||||||
ProjectType="Visual C++"
|
|
||||||
Version="9.00"
|
|
||||||
Name="cyassl"
|
|
||||||
ProjectGUID="{73973223-5EE8-41CA-8E88-1D60E89A237B}"
|
|
||||||
RootNamespace="cyassl"
|
|
||||||
Keyword="Win32Proj"
|
|
||||||
TargetFrameworkVersion="196613"
|
|
||||||
>
|
|
||||||
<Platforms>
|
|
||||||
<Platform
|
|
||||||
Name="Win32"
|
|
||||||
/>
|
|
||||||
</Platforms>
|
|
||||||
<ToolFiles>
|
|
||||||
</ToolFiles>
|
|
||||||
<Configurations>
|
|
||||||
<Configuration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
|
||||||
IntermediateDirectory="$(ConfigurationName)"
|
|
||||||
ConfigurationType="4"
|
|
||||||
CharacterSet="1"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreBuildEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCustomBuildTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXMLDataGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebServiceProxyGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCMIDLTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="0"
|
|
||||||
AdditionalIncludeDirectories="./;NTRU/include"
|
|
||||||
PreprocessorDefinitions="OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;HAVE_NTRU;NO_PSK;WIN32"
|
|
||||||
MinimalRebuild="true"
|
|
||||||
BasicRuntimeChecks="3"
|
|
||||||
RuntimeLibrary="3"
|
|
||||||
UsePrecompiledHeader="0"
|
|
||||||
WarningLevel="3"
|
|
||||||
DebugInformationFormat="4"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManagedResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreLinkEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCLibrarianTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCALinkTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXDCMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCBscMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCFxCopTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPostBuildEventTool"
|
|
||||||
/>
|
|
||||||
</Configuration>
|
|
||||||
<Configuration
|
|
||||||
Name="Release|Win32"
|
|
||||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
|
||||||
IntermediateDirectory="$(ConfigurationName)"
|
|
||||||
ConfigurationType="4"
|
|
||||||
CharacterSet="1"
|
|
||||||
WholeProgramOptimization="1"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreBuildEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCustomBuildTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXMLDataGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebServiceProxyGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCMIDLTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="2"
|
|
||||||
EnableIntrinsicFunctions="true"
|
|
||||||
AdditionalIncludeDirectories="./;NTRU/include"
|
|
||||||
PreprocessorDefinitions="OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;HAVE_NTRU;NO_PSK;WIN32"
|
|
||||||
RuntimeLibrary="2"
|
|
||||||
EnableFunctionLevelLinking="true"
|
|
||||||
UsePrecompiledHeader="0"
|
|
||||||
WarningLevel="3"
|
|
||||||
DebugInformationFormat="3"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManagedResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreLinkEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCLibrarianTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCALinkTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXDCMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCBscMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCFxCopTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPostBuildEventTool"
|
|
||||||
/>
|
|
||||||
</Configuration>
|
|
||||||
</Configurations>
|
|
||||||
<References>
|
|
||||||
</References>
|
|
||||||
<Files>
|
|
||||||
<Filter
|
|
||||||
Name="Source Files"
|
|
||||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
|
||||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
|
||||||
>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\aes.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\arc4.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\asm.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\asn.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\blake2b.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\camellia.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\coding.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\crl.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\des3.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\dh.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\dsa.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\ecc.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\error.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\hc128.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\hmac.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\integer.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\internal.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\io.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\keys.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\logging.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\md4.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\md5.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\memory.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\misc.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\ocsp.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\wc_port.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\pwdbased.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\rabbit.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\random.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\ripemd.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\rsa.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\sha.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\sha256.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\sha512.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\ssl.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\tls.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
</Filter>
|
|
||||||
<Filter
|
|
||||||
Name="Header Files"
|
|
||||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
|
||||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
|
||||||
>
|
|
||||||
</Filter>
|
|
||||||
<Filter
|
|
||||||
Name="Resource Files"
|
|
||||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
|
||||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
|
||||||
>
|
|
||||||
</Filter>
|
|
||||||
</Files>
|
|
||||||
<Globals>
|
|
||||||
</Globals>
|
|
||||||
</VisualStudioProject>
|
|
|
@ -1,74 +0,0 @@
|
||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
|
||||||
# Visual C++ Express 2008
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cyassl", "cyassl.vcproj", "{73973223-5EE8-41CA-8E88-1D60E89A237B}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsuite", "testsuite\testsuite.vcproj", "{611E8971-46E0-4D0A-B5A1-632C3B00CB80}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sslSniffer", "sslSniffer\sslSniffer.vcproj", "{34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echoserver", "examples\echoserver\echoserver.vcproj", "{07D97C48-E08F-4E34-9F67-3064039FF2CB}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echoclient", "examples\echoclient\echoclient.vcproj", "{8362A816-C5DC-4E22-B5C5-9E6806387073}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "examples\client\client.vcproj", "{3ADE9549-582D-4D8E-9826-B172197A7959}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "server", "examples\server\server.vcproj", "{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Win32 = Debug|Win32
|
|
||||||
Release|Win32 = Release|Win32
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{3ADE9549-582D-4D8E-9826-B172197A7959}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{3ADE9549-582D-4D8E-9826-B172197A7959}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
|
@ -1,306 +0,0 @@
|
||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
|
||||||
<VisualStudioProject
|
|
||||||
ProjectType="Visual C++"
|
|
||||||
Version="9.00"
|
|
||||||
Name="cyassl"
|
|
||||||
ProjectGUID="{73973223-5EE8-41CA-8E88-1D60E89A237B}"
|
|
||||||
RootNamespace="cyassl"
|
|
||||||
Keyword="Win32Proj"
|
|
||||||
TargetFrameworkVersion="196613"
|
|
||||||
>
|
|
||||||
<Platforms>
|
|
||||||
<Platform
|
|
||||||
Name="Win32"
|
|
||||||
/>
|
|
||||||
</Platforms>
|
|
||||||
<ToolFiles>
|
|
||||||
</ToolFiles>
|
|
||||||
<Configurations>
|
|
||||||
<Configuration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
|
||||||
IntermediateDirectory="$(ConfigurationName)"
|
|
||||||
ConfigurationType="4"
|
|
||||||
CharacterSet="1"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreBuildEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCustomBuildTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXMLDataGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebServiceProxyGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCMIDLTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="0"
|
|
||||||
AdditionalIncludeDirectories="./"
|
|
||||||
PreprocessorDefinitions="OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;NO_PSK"
|
|
||||||
MinimalRebuild="true"
|
|
||||||
BasicRuntimeChecks="3"
|
|
||||||
RuntimeLibrary="3"
|
|
||||||
UsePrecompiledHeader="0"
|
|
||||||
WarningLevel="4"
|
|
||||||
DebugInformationFormat="4"
|
|
||||||
DisableSpecificWarnings="4206"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManagedResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreLinkEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCLibrarianTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCALinkTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXDCMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCBscMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCFxCopTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPostBuildEventTool"
|
|
||||||
/>
|
|
||||||
</Configuration>
|
|
||||||
<Configuration
|
|
||||||
Name="Release|Win32"
|
|
||||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
|
||||||
IntermediateDirectory="$(ConfigurationName)"
|
|
||||||
ConfigurationType="4"
|
|
||||||
CharacterSet="1"
|
|
||||||
WholeProgramOptimization="1"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreBuildEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCustomBuildTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXMLDataGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebServiceProxyGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCMIDLTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="2"
|
|
||||||
EnableIntrinsicFunctions="true"
|
|
||||||
AdditionalIncludeDirectories="./"
|
|
||||||
PreprocessorDefinitions="OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;NO_PSK"
|
|
||||||
RuntimeLibrary="2"
|
|
||||||
EnableFunctionLevelLinking="true"
|
|
||||||
UsePrecompiledHeader="0"
|
|
||||||
WarningLevel="3"
|
|
||||||
DebugInformationFormat="3"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManagedResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreLinkEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCLibrarianTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCALinkTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXDCMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCBscMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCFxCopTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPostBuildEventTool"
|
|
||||||
/>
|
|
||||||
</Configuration>
|
|
||||||
</Configurations>
|
|
||||||
<References>
|
|
||||||
</References>
|
|
||||||
<Files>
|
|
||||||
<Filter
|
|
||||||
Name="Source Files"
|
|
||||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
|
||||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
|
||||||
>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\aes.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\arc4.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\asn.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\blake2b.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\camellia.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\coding.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\crl.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\des3.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\dh.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\dsa.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\ecc.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\error.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\hc128.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\hmac.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\integer.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\internal.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\io.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\keys.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\logging.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\md4.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\md5.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\memory.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\ocsp.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\wc_port.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\pwdbased.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\rabbit.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\random.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\ripemd.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\rsa.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\sha.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\sha256.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\ctaocrypt\src\sha512.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\ssl.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\tls.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
</Filter>
|
|
||||||
<Filter
|
|
||||||
Name="Header Files"
|
|
||||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
|
||||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
|
||||||
>
|
|
||||||
</Filter>
|
|
||||||
<Filter
|
|
||||||
Name="Resource Files"
|
|
||||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
|
||||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
|
||||||
>
|
|
||||||
</Filter>
|
|
||||||
</Files>
|
|
||||||
<Globals>
|
|
||||||
</Globals>
|
|
||||||
</VisualStudioProject>
|
|
|
@ -1,182 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|x64">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|x64">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectGuid>{73973223-5EE8-41CA-8E88-1D60E89A237B}</ProjectGuid>
|
|
||||||
<RootNamespace>cyassl</RootNamespace>
|
|
||||||
<Keyword>Win32Proj</Keyword>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<PlatformToolset>v110</PlatformToolset>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<PlatformToolset>v110</PlatformToolset>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<PlatformToolset>v110</PlatformToolset>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<PlatformToolset>v110</PlatformToolset>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="ExtensionSettings">
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<_ProjectFileVersion>11.0.61030.0</_ProjectFileVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
|
||||||
<IntDir>$(Configuration)\</IntDir>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
|
||||||
<IntDir>$(Configuration)\</IntDir>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<AdditionalIncludeDirectories>./;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<PreprocessorDefinitions>OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;NO_PSK;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<MinimalRebuild>true</MinimalRebuild>
|
|
||||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
|
||||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
|
||||||
<PrecompiledHeader />
|
|
||||||
<WarningLevel>Level4</WarningLevel>
|
|
||||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
|
||||||
<DisableSpecificWarnings>4206;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<AdditionalIncludeDirectories>./;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<PreprocessorDefinitions>OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;NO_PSK;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
|
||||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
|
||||||
<PrecompiledHeader>
|
|
||||||
</PrecompiledHeader>
|
|
||||||
<WarningLevel>Level4</WarningLevel>
|
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
||||||
<DisableSpecificWarnings>4206;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<Optimization>MaxSpeed</Optimization>
|
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
||||||
<AdditionalIncludeDirectories>./;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<PreprocessorDefinitions>OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;NO_PSK;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
||||||
<PrecompiledHeader />
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<Optimization>MaxSpeed</Optimization>
|
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
||||||
<AdditionalIncludeDirectories>./;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<PreprocessorDefinitions>OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;NO_PSK;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
||||||
<PrecompiledHeader>
|
|
||||||
</PrecompiledHeader>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="ctaocrypt\src\aes.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\arc4.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\asn.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\blake2b.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\camellia.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\coding.c" />
|
|
||||||
<ClCompile Include="src\crl.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\des3.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\dh.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\dsa.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\ecc.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\error.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\hc128.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\hmac.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\integer.c" />
|
|
||||||
<ClCompile Include="src\internal.c" />
|
|
||||||
<ClCompile Include="src\io.c" />
|
|
||||||
<ClCompile Include="src\keys.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\logging.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\md4.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\md5.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\memory.c" />
|
|
||||||
<ClCompile Include="src\ocsp.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\wc_port.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\pwdbased.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\rabbit.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\random.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\ripemd.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\rsa.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\sha.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\sha256.c" />
|
|
||||||
<ClCompile Include="ctaocrypt\src\sha512.c" />
|
|
||||||
<ClCompile Include="src\ssl.c" />
|
|
||||||
<ClCompile Include="src\tls.c" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<CustomBuild Include="ctaocrypt\src\aes_asm.asm">
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
|
||||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity)</Command>
|
|
||||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)%(Filename).obj</Outputs>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
|
||||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ml64.exe /c /Zi /Fo"$(OutDir)%(Filename).obj" %(Identity)</Command>
|
|
||||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)%(Filename).obj</Outputs>
|
|
||||||
</CustomBuild>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* callbacks.h
|
/* callbacks.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 wolfSSL Inc.
|
* Copyright (C) 2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -19,62 +19,4 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <wolfssl/callbacks.h>
|
||||||
#ifndef CYASSL_CALLBACKS_H
|
|
||||||
#define CYASSL_CALLBACKS_H
|
|
||||||
|
|
||||||
#include <sys/time.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
enum { /* CALLBACK CONTSTANTS */
|
|
||||||
MAX_PACKETNAME_SZ = 24,
|
|
||||||
MAX_CIPHERNAME_SZ = 24,
|
|
||||||
MAX_TIMEOUT_NAME_SZ = 24,
|
|
||||||
MAX_PACKETS_HANDSHAKE = 14, /* 12 for client auth plus 2 alerts */
|
|
||||||
MAX_VALUE_SZ = 128, /* all handshake packets but Cert should
|
|
||||||
fit here */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct handShakeInfo_st {
|
|
||||||
char cipherName[MAX_CIPHERNAME_SZ + 1]; /* negotiated cipher */
|
|
||||||
char packetNames[MAX_PACKETS_HANDSHAKE][MAX_PACKETNAME_SZ + 1];
|
|
||||||
/* SSL packet names */
|
|
||||||
int numberPackets; /* actual # of packets */
|
|
||||||
int negotiationError; /* cipher/parameter err */
|
|
||||||
} HandShakeInfo;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct timeval Timeval;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct packetInfo_st {
|
|
||||||
char packetName[MAX_PACKETNAME_SZ + 1]; /* SSL packet name */
|
|
||||||
Timeval timestamp; /* when it occured */
|
|
||||||
unsigned char value[MAX_VALUE_SZ]; /* if fits, it's here */
|
|
||||||
unsigned char* bufferValue; /* otherwise here (non 0) */
|
|
||||||
int valueSz; /* sz of value or buffer */
|
|
||||||
} PacketInfo;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct timeoutInfo_st {
|
|
||||||
char timeoutName[MAX_TIMEOUT_NAME_SZ + 1]; /* timeout Name */
|
|
||||||
int flags; /* for future use */
|
|
||||||
int numberPackets; /* actual # of packets */
|
|
||||||
PacketInfo packets[MAX_PACKETS_HANDSHAKE]; /* list of all packets */
|
|
||||||
Timeval timeoutValue; /* timer that caused it */
|
|
||||||
} TimeoutInfo;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* CYASSL_CALLBACKS_H */
|
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,15 +1,15 @@
|
||||||
/* crl.h
|
/* crl.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -19,33 +19,4 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <wolfssl/crl.h>
|
||||||
#ifndef CYASSL_CRL_H
|
|
||||||
#define CYASSL_CRL_H
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CRL
|
|
||||||
|
|
||||||
#include <cyassl/ssl.h>
|
|
||||||
#include <cyassl/ctaocrypt/asn.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct CYASSL_CRL CYASSL_CRL;
|
|
||||||
|
|
||||||
CYASSL_LOCAL int InitCRL(CYASSL_CRL*, CYASSL_CERT_MANAGER*);
|
|
||||||
CYASSL_LOCAL void FreeCRL(CYASSL_CRL*, int dynamic);
|
|
||||||
|
|
||||||
CYASSL_LOCAL int LoadCRL(CYASSL_CRL* crl, const char* path, int type, int mon);
|
|
||||||
CYASSL_LOCAL int BufferLoadCRL(CYASSL_CRL*, const byte*, long, int);
|
|
||||||
CYASSL_LOCAL int CheckCertCRL(CYASSL_CRL*, DecodedCert*);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* HAVE_CRL */
|
|
||||||
#endif /* CYASSL_CRL_H */
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* aes.h
|
/* aes.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -25,158 +25,41 @@
|
||||||
#ifndef CTAO_CRYPT_AES_H
|
#ifndef CTAO_CRYPT_AES_H
|
||||||
#define CTAO_CRYPT_AES_H
|
#define CTAO_CRYPT_AES_H
|
||||||
|
|
||||||
|
#include <wolfssl/wolfcrypt/aes.h>
|
||||||
|
#define AesSetKey wc_AesSetKey
|
||||||
|
#define AesSetIV wc_AesSetIV
|
||||||
|
#define AesCbcEncrypt wc_AesCbcEncrypt
|
||||||
|
#define AesCbcDecrypt wc_AesCbcDecrypt
|
||||||
|
#define AesCbcDecryptWithKey wc_AesCbcDecryptWithKey
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
/* AES-CTR */
|
||||||
|
#ifdef WOLFSSL_AES_COUNTER
|
||||||
#ifdef HAVE_CAVIUM
|
#define AesCtrEncrypt wc_AesCtrEncrypt
|
||||||
#include <cyassl/ctaocrypt/logging.h>
|
|
||||||
#include "cavium_common.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
/* AES-DIRECT */
|
||||||
#ifdef CYASSL_AESNI
|
#if defined(WOLFSSL_AES_DIRECT)
|
||||||
|
#define AesEncryptDirect wc_AesEncryptDirect
|
||||||
#include <wmmintrin.h>
|
#define AesDecryptDirect wc_AesDecryptDirect
|
||||||
|
#define AesSetKeyDirect wc_AesSetKeyDirect
|
||||||
#if !defined (ALIGN16)
|
|
||||||
#if defined (__GNUC__)
|
|
||||||
#define ALIGN16 __attribute__ ( (aligned (16)))
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
/* disable align warning, we want alignment ! */
|
|
||||||
#pragma warning(disable: 4324)
|
|
||||||
#define ALIGN16 __declspec (align (16))
|
|
||||||
#else
|
|
||||||
#define ALIGN16
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CYASSL_AESNI */
|
|
||||||
|
|
||||||
#if !defined (ALIGN16)
|
|
||||||
#define ALIGN16
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#define CYASSL_AES_CAVIUM_MAGIC 0xBEEF0002
|
|
||||||
|
|
||||||
enum {
|
|
||||||
AES_ENC_TYPE = 1, /* cipher unique type */
|
|
||||||
AES_ENCRYPTION = 0,
|
|
||||||
AES_DECRYPTION = 1,
|
|
||||||
AES_BLOCK_SIZE = 16
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct Aes {
|
|
||||||
/* AESNI needs key first, rounds 2nd, not sure why yet */
|
|
||||||
ALIGN16 word32 key[60];
|
|
||||||
word32 rounds;
|
|
||||||
|
|
||||||
ALIGN16 word32 reg[AES_BLOCK_SIZE / sizeof(word32)]; /* for CBC mode */
|
|
||||||
ALIGN16 word32 tmp[AES_BLOCK_SIZE / sizeof(word32)]; /* same */
|
|
||||||
|
|
||||||
#ifdef HAVE_AESGCM
|
#ifdef HAVE_AESGCM
|
||||||
ALIGN16 byte H[AES_BLOCK_SIZE];
|
#define AesGcmSetKey wc_AesGcmSetKey
|
||||||
#ifdef GCM_TABLE
|
#define AesGcmEncrypt wc_AesGcmEncrypt
|
||||||
/* key-based fast multiplication table. */
|
#define AesGcmDecrypt wc_AesGcmDecrypt
|
||||||
ALIGN16 byte M0[256][AES_BLOCK_SIZE];
|
#define GmacSetKey wc_GmacSetKey
|
||||||
#endif /* GCM_TABLE */
|
#define GmacUpdate wc_GmacUpdate
|
||||||
#endif /* HAVE_AESGCM */
|
|
||||||
#ifdef CYASSL_AESNI
|
|
||||||
byte use_aesni;
|
|
||||||
#endif /* CYASSL_AESNI */
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
AesType type; /* aes key type */
|
|
||||||
int devId; /* nitrox device id */
|
|
||||||
word32 magic; /* using cavium magic */
|
|
||||||
word64 contextHandle; /* nitrox context memory handle */
|
|
||||||
#endif
|
|
||||||
#ifdef CYASSL_AES_COUNTER
|
|
||||||
word32 left; /* unsued bytes left from last call */
|
|
||||||
#endif
|
|
||||||
#ifdef CYASSL_PIC32MZ_CRYPT
|
|
||||||
word32 key_ce[AES_BLOCK_SIZE*2/sizeof(word32)] ;
|
|
||||||
word32 iv_ce [AES_BLOCK_SIZE /sizeof(word32)] ;
|
|
||||||
int keylen ;
|
|
||||||
#endif
|
|
||||||
} Aes;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API int AesSetKey(Aes* aes, const byte* key, word32 len, const byte* iv,
|
|
||||||
int dir);
|
|
||||||
CYASSL_API int AesSetIV(Aes* aes, const byte* iv);
|
|
||||||
CYASSL_API int AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz);
|
|
||||||
CYASSL_API int AesCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 sz);
|
|
||||||
CYASSL_API void AesCtrEncrypt(Aes* aes, byte* out, const byte* in, word32 sz);
|
|
||||||
CYASSL_API void AesEncryptDirect(Aes* aes, byte* out, const byte* in);
|
|
||||||
CYASSL_API void AesDecryptDirect(Aes* aes, byte* out, const byte* in);
|
|
||||||
CYASSL_API int AesSetKeyDirect(Aes* aes, const byte* key, word32 len,
|
|
||||||
const byte* iv, int dir);
|
|
||||||
#ifdef HAVE_AESGCM
|
|
||||||
CYASSL_API void AesGcmSetKey(Aes* aes, const byte* key, word32 len);
|
|
||||||
CYASSL_API void AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz,
|
|
||||||
const byte* iv, word32 ivSz,
|
|
||||||
byte* authTag, word32 authTagSz,
|
|
||||||
const byte* authIn, word32 authInSz);
|
|
||||||
CYASSL_API int AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz,
|
|
||||||
const byte* iv, word32 ivSz,
|
|
||||||
const byte* authTag, word32 authTagSz,
|
|
||||||
const byte* authIn, word32 authInSz);
|
|
||||||
|
|
||||||
typedef struct Gmac {
|
|
||||||
Aes aes;
|
|
||||||
} Gmac;
|
|
||||||
CYASSL_API void GmacSetKey(Gmac* gmac, const byte* key, word32 len);
|
|
||||||
CYASSL_API void GmacUpdate(Gmac* gmac, const byte* iv, word32 ivSz,
|
|
||||||
const byte* authIn, word32 authInSz,
|
|
||||||
byte* authTag, word32 authTagSz);
|
|
||||||
#endif /* HAVE_AESGCM */
|
#endif /* HAVE_AESGCM */
|
||||||
#ifdef HAVE_AESCCM
|
#ifdef HAVE_AESCCM
|
||||||
CYASSL_API void AesCcmSetKey(Aes* aes, const byte* key, word32 keySz);
|
#define AesCcmSetKey wc_AesCcmSetKey
|
||||||
CYASSL_API void AesCcmEncrypt(Aes* aes, byte* out, const byte* in, word32 inSz,
|
#define AesCcmEncrypt wc_AesCcmEncrypt
|
||||||
const byte* nonce, word32 nonceSz,
|
#define AesCcmDecrypt wc_AesCcmDecrypt
|
||||||
byte* authTag, word32 authTagSz,
|
|
||||||
const byte* authIn, word32 authInSz);
|
|
||||||
CYASSL_API int AesCcmDecrypt(Aes* aes, byte* out, const byte* in, word32 inSz,
|
|
||||||
const byte* nonce, word32 nonceSz,
|
|
||||||
const byte* authTag, word32 authTagSz,
|
|
||||||
const byte* authIn, word32 authInSz);
|
|
||||||
#endif /* HAVE_AESCCM */
|
#endif /* HAVE_AESCCM */
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
#ifdef HAVE_CAVIUM
|
||||||
CYASSL_API int AesInitCavium(Aes*, int);
|
#define AesInitCavium wc_AesInitCavium
|
||||||
CYASSL_API void AesFreeCavium(Aes*);
|
#define AesFreeCavium wc_AesFreeCavium
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_FIPS
|
|
||||||
/* fips wrapper calls, user can call direct */
|
|
||||||
CYASSL_API int AesSetKey_fips(Aes* aes, const byte* key, word32 len,
|
|
||||||
const byte* iv, int dir);
|
|
||||||
CYASSL_API int AesSetIV_fips(Aes* aes, const byte* iv);
|
|
||||||
CYASSL_API int AesCbcEncrypt_fips(Aes* aes, byte* out, const byte* in,
|
|
||||||
word32 sz);
|
|
||||||
CYASSL_API int AesCbcDecrypt_fips(Aes* aes, byte* out, const byte* in,
|
|
||||||
word32 sz);
|
|
||||||
#ifndef FIPS_NO_WRAPPERS
|
|
||||||
/* if not impl or fips.c impl wrapper force fips calls if fips build */
|
|
||||||
#define AesSetKey AesSetKey_fips
|
|
||||||
#define AesSetIV AesSetIV_fips
|
|
||||||
#define AesCbcEncrypt AesCbcEncrypt_fips
|
|
||||||
#define AesCbcDecrypt AesCbcDecrypt_fips
|
|
||||||
#endif /* FIPS_NO_WRAPPERS */
|
|
||||||
|
|
||||||
#endif /* HAVE_FIPS */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_AES_H */
|
#endif /* CTAO_CRYPT_AES_H */
|
||||||
#endif /* NO_AES */
|
#endif /* NO_AES */
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* arc4.h
|
/* arc4.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -19,50 +19,18 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef CTAO_CRYPT_ARC4_H
|
#ifndef CTAO_CRYPT_ARC4_H
|
||||||
#define CTAO_CRYPT_ARC4_H
|
#define CTAO_CRYPT_ARC4_H
|
||||||
|
|
||||||
|
/* for arc4 reverse compatibility */
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#ifndef NO_RC4
|
||||||
|
#include <wolfssl/wolfcrypt/arc4.h>
|
||||||
|
#define CYASSL_ARC4_CAVIUM_MAGIC WOLFSSL_ARC4_CAVIUM_MAGIC
|
||||||
#ifdef __cplusplus
|
#define Arc4Process wc_Arc4Process
|
||||||
extern "C" {
|
#define Arc4SetKey wc_Arc4SetKey
|
||||||
|
#define Arc4InitCavium wc_Arc4InitCavium
|
||||||
|
#define Arc4FreeCavium wc_Arc4FreeCavium
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define CYASSL_ARC4_CAVIUM_MAGIC 0xBEEF0001
|
|
||||||
|
|
||||||
enum {
|
|
||||||
ARC4_ENC_TYPE = 4, /* cipher unique type */
|
|
||||||
ARC4_STATE_SIZE = 256
|
|
||||||
};
|
|
||||||
|
|
||||||
/* ARC4 encryption and decryption */
|
|
||||||
typedef struct Arc4 {
|
|
||||||
byte x;
|
|
||||||
byte y;
|
|
||||||
byte state[ARC4_STATE_SIZE];
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
int devId; /* nitrox device id */
|
|
||||||
word32 magic; /* using cavium magic */
|
|
||||||
word64 contextHandle; /* nitrox context memory handle */
|
|
||||||
#endif
|
|
||||||
} Arc4;
|
|
||||||
|
|
||||||
CYASSL_API void Arc4Process(Arc4*, byte*, const byte*, word32);
|
|
||||||
CYASSL_API void Arc4SetKey(Arc4*, const byte*, word32);
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
CYASSL_API int Arc4InitCavium(Arc4*, int);
|
|
||||||
CYASSL_API void Arc4FreeCavium(Arc4*);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_ARC4_H */
|
#endif /* CTAO_CRYPT_ARC4_H */
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* asn.h
|
/* asn.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -24,8 +24,7 @@
|
||||||
#ifndef CTAO_CRYPT_ASN_H
|
#ifndef CTAO_CRYPT_ASN_H
|
||||||
#define CTAO_CRYPT_ASN_H
|
#define CTAO_CRYPT_ASN_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
/* pull in compatibility for each include */
|
||||||
#include <cyassl/ctaocrypt/rsa.h>
|
|
||||||
#include <cyassl/ctaocrypt/dh.h>
|
#include <cyassl/ctaocrypt/dh.h>
|
||||||
#include <cyassl/ctaocrypt/dsa.h>
|
#include <cyassl/ctaocrypt/dsa.h>
|
||||||
#include <cyassl/ctaocrypt/sha.h>
|
#include <cyassl/ctaocrypt/sha.h>
|
||||||
|
@ -35,677 +34,16 @@
|
||||||
#include <cyassl/ctaocrypt/ecc.h>
|
#include <cyassl/ctaocrypt/ecc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
#include <wolfssl/wolfcrypt/asn.h>
|
||||||
|
|
||||||
|
#ifndef WOLFSSL_PEMCERT_TODER_DEFINED
|
||||||
|
#ifndef NO_FILESYSTEM
|
||||||
|
#define CyaSSL_PemCertToDer wolfSSL_PemCertToDer
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
enum {
|
|
||||||
ISSUER = 0,
|
|
||||||
SUBJECT = 1,
|
|
||||||
|
|
||||||
EXTERNAL_SERIAL_SIZE = 32,
|
|
||||||
|
|
||||||
BEFORE = 0,
|
|
||||||
AFTER = 1
|
|
||||||
};
|
|
||||||
|
|
||||||
/* ASN Tags */
|
|
||||||
enum ASN_Tags {
|
|
||||||
ASN_BOOLEAN = 0x01,
|
|
||||||
ASN_INTEGER = 0x02,
|
|
||||||
ASN_BIT_STRING = 0x03,
|
|
||||||
ASN_OCTET_STRING = 0x04,
|
|
||||||
ASN_TAG_NULL = 0x05,
|
|
||||||
ASN_OBJECT_ID = 0x06,
|
|
||||||
ASN_ENUMERATED = 0x0a,
|
|
||||||
ASN_UTF8STRING = 0x0c,
|
|
||||||
ASN_SEQUENCE = 0x10,
|
|
||||||
ASN_SET = 0x11,
|
|
||||||
ASN_UTC_TIME = 0x17,
|
|
||||||
ASN_OTHER_TYPE = 0x00,
|
|
||||||
ASN_RFC822_TYPE = 0x01,
|
|
||||||
ASN_DNS_TYPE = 0x02,
|
|
||||||
ASN_DIR_TYPE = 0x04,
|
|
||||||
ASN_GENERALIZED_TIME = 0x18,
|
|
||||||
CRL_EXTENSIONS = 0xa0,
|
|
||||||
ASN_EXTENSIONS = 0xa3,
|
|
||||||
ASN_LONG_LENGTH = 0x80
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ASN_Flags{
|
|
||||||
ASN_CONSTRUCTED = 0x20,
|
|
||||||
ASN_CONTEXT_SPECIFIC = 0x80
|
|
||||||
};
|
|
||||||
|
|
||||||
enum DN_Tags {
|
|
||||||
ASN_COMMON_NAME = 0x03, /* CN */
|
|
||||||
ASN_SUR_NAME = 0x04, /* SN */
|
|
||||||
ASN_SERIAL_NUMBER = 0x05, /* serialNumber */
|
|
||||||
ASN_COUNTRY_NAME = 0x06, /* C */
|
|
||||||
ASN_LOCALITY_NAME = 0x07, /* L */
|
|
||||||
ASN_STATE_NAME = 0x08, /* ST */
|
|
||||||
ASN_ORG_NAME = 0x0a, /* O */
|
|
||||||
ASN_ORGUNIT_NAME = 0x0b /* OU */
|
|
||||||
};
|
|
||||||
|
|
||||||
enum PBES {
|
|
||||||
PBE_MD5_DES = 0,
|
|
||||||
PBE_SHA1_DES = 1,
|
|
||||||
PBE_SHA1_DES3 = 2,
|
|
||||||
PBE_SHA1_RC4_128 = 3,
|
|
||||||
PBES2 = 13 /* algo ID */
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ENCRYPTION_TYPES {
|
|
||||||
DES_TYPE = 0,
|
|
||||||
DES3_TYPE = 1,
|
|
||||||
RC4_TYPE = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ECC_TYPES {
|
|
||||||
ECC_PREFIX_0 = 160,
|
|
||||||
ECC_PREFIX_1 = 161
|
|
||||||
};
|
|
||||||
|
|
||||||
enum Misc_ASN {
|
|
||||||
ASN_NAME_MAX = 256,
|
|
||||||
MAX_SALT_SIZE = 64, /* MAX PKCS Salt length */
|
|
||||||
MAX_IV_SIZE = 64, /* MAX PKCS Iv length */
|
|
||||||
MAX_KEY_SIZE = 64, /* MAX PKCS Key length */
|
|
||||||
PKCS5 = 5, /* PKCS oid tag */
|
|
||||||
PKCS5v2 = 6, /* PKCS #5 v2.0 */
|
|
||||||
PKCS12 = 12, /* PKCS #12 */
|
|
||||||
MAX_UNICODE_SZ = 256,
|
|
||||||
ASN_BOOL_SIZE = 2, /* including type */
|
|
||||||
SHA_SIZE = 20,
|
|
||||||
RSA_INTS = 8, /* RSA ints in private key */
|
|
||||||
MIN_DATE_SIZE = 13,
|
|
||||||
MAX_DATE_SIZE = 32,
|
|
||||||
ASN_GEN_TIME_SZ = 15, /* 7 numbers * 2 + Zulu tag */
|
|
||||||
MAX_ENCODED_SIG_SZ = 512,
|
|
||||||
MAX_SIG_SZ = 256,
|
|
||||||
MAX_ALGO_SZ = 20,
|
|
||||||
MAX_SEQ_SZ = 5, /* enum(seq | con) + length(4) */
|
|
||||||
MAX_SET_SZ = 5, /* enum(set | con) + length(4) */
|
|
||||||
MAX_OCTET_STR_SZ = 5, /* enum(set | con) + length(4) */
|
|
||||||
MAX_EXP_SZ = 5, /* enum(contextspec|con|exp) + length(4) */
|
|
||||||
MAX_PRSTR_SZ = 5, /* enum(prstr) + length(4) */
|
|
||||||
MAX_VERSION_SZ = 5, /* enum + id + version(byte) + (header(2))*/
|
|
||||||
MAX_ENCODED_DIG_SZ = 73, /* sha512 + enum(bit or octet) + legnth(4) */
|
|
||||||
MAX_RSA_INT_SZ = 517, /* RSA raw sz 4096 for bits + tag + len(4) */
|
|
||||||
MAX_NTRU_KEY_SZ = 610, /* NTRU 112 bit public key */
|
|
||||||
MAX_NTRU_ENC_SZ = 628, /* NTRU 112 bit DER public encoding */
|
|
||||||
MAX_LENGTH_SZ = 4, /* Max length size for DER encoding */
|
|
||||||
MAX_RSA_E_SZ = 16, /* Max RSA public e size */
|
|
||||||
MAX_CA_SZ = 32, /* Max encoded CA basic constraint length */
|
|
||||||
MAX_SN_SZ = 35, /* Max encoded serial number (INT) length */
|
|
||||||
#ifdef CYASSL_CERT_GEN
|
|
||||||
#ifdef CYASSL_CERT_REQ
|
|
||||||
/* Max encoded cert req attributes length */
|
|
||||||
MAX_ATTRIB_SZ = MAX_SEQ_SZ * 3 + (11 + MAX_SEQ_SZ) * 2 +
|
|
||||||
MAX_PRSTR_SZ + CTC_NAME_SIZE, /* 11 is the OID size */
|
|
||||||
#endif
|
|
||||||
#ifdef CYASSL_ALT_NAMES
|
|
||||||
MAX_EXTENSIONS_SZ = 1 + MAX_LENGTH_SZ + CTC_MAX_ALT_SIZE,
|
|
||||||
#else
|
|
||||||
MAX_EXTENSIONS_SZ = 1 + MAX_LENGTH_SZ + MAX_CA_SZ,
|
|
||||||
#endif
|
|
||||||
/* Max total extensions, id + len + others */
|
|
||||||
#endif
|
|
||||||
MAX_OCSP_EXT_SZ = 58, /* Max OCSP Extension length */
|
|
||||||
MAX_OCSP_NONCE_SZ = 18, /* OCSP Nonce size */
|
|
||||||
EIGHTK_BUF = 8192, /* Tmp buffer size */
|
|
||||||
MAX_PUBLIC_KEY_SZ = MAX_NTRU_ENC_SZ + MAX_ALGO_SZ + MAX_SEQ_SZ * 2
|
|
||||||
/* use bigger NTRU size */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum Oid_Types {
|
|
||||||
hashType = 0,
|
|
||||||
sigType = 1,
|
|
||||||
keyType = 2,
|
|
||||||
curveType = 3,
|
|
||||||
blkType = 4
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum Hash_Sum {
|
|
||||||
MD2h = 646,
|
|
||||||
MD5h = 649,
|
|
||||||
SHAh = 88,
|
|
||||||
SHA256h = 414,
|
|
||||||
SHA384h = 415,
|
|
||||||
SHA512h = 416
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum Block_Sum {
|
|
||||||
DESb = 69,
|
|
||||||
DES3b = 652
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum Key_Sum {
|
|
||||||
DSAk = 515,
|
|
||||||
RSAk = 645,
|
|
||||||
NTRUk = 274,
|
|
||||||
ECDSAk = 518
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum Ecc_Sum {
|
|
||||||
ECC_256R1 = 526,
|
|
||||||
ECC_384R1 = 210,
|
|
||||||
ECC_521R1 = 211,
|
|
||||||
ECC_160R1 = 184,
|
|
||||||
ECC_192R1 = 520,
|
|
||||||
ECC_224R1 = 209
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum KDF_Sum {
|
|
||||||
PBKDF2_OID = 660
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum Extensions_Sum {
|
|
||||||
BASIC_CA_OID = 133,
|
|
||||||
ALT_NAMES_OID = 131,
|
|
||||||
CRL_DIST_OID = 145,
|
|
||||||
AUTH_INFO_OID = 69,
|
|
||||||
CA_ISSUER_OID = 117,
|
|
||||||
AUTH_KEY_OID = 149,
|
|
||||||
SUBJ_KEY_OID = 128,
|
|
||||||
CERT_POLICY_OID = 146,
|
|
||||||
KEY_USAGE_OID = 129, /* 2.5.29.15 */
|
|
||||||
INHIBIT_ANY_OID = 168, /* 2.5.29.54 */
|
|
||||||
EXT_KEY_USAGE_OID = 151, /* 2.5.29.37 */
|
|
||||||
NAME_CONS_OID = 144 /* 2.5.29.30 */
|
|
||||||
};
|
|
||||||
|
|
||||||
enum CertificatePolicy_Sum {
|
|
||||||
CP_ANY_OID = 146 /* id-ce 32 0 */
|
|
||||||
};
|
|
||||||
|
|
||||||
enum SepHardwareName_Sum {
|
|
||||||
HW_NAME_OID = 79 /* 1.3.6.1.5.5.7.8.4 from RFC 4108*/
|
|
||||||
};
|
|
||||||
|
|
||||||
enum AuthInfo_Sum {
|
|
||||||
AIA_OCSP_OID = 116, /* 1.3.6.1.5.5.7.48.1 */
|
|
||||||
AIA_CA_ISSUER_OID = 117 /* 1.3.6.1.5.5.7.48.2 */
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ExtKeyUsage_Sum { /* From RFC 5280 */
|
|
||||||
EKU_ANY_OID = 151, /* 2.5.29.37.0, anyExtendedKeyUsage */
|
|
||||||
EKU_SERVER_AUTH_OID = 71, /* 1.3.6.1.5.5.7.3.1, id-kp-serverAuth */
|
|
||||||
EKU_CLIENT_AUTH_OID = 72, /* 1.3.6.1.5.5.7.3.2, id-kp-clientAuth */
|
|
||||||
EKU_OCSP_SIGN_OID = 79, /* 1.3.6.1.5.5.7.3.9, OCSPSigning */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum VerifyType {
|
|
||||||
NO_VERIFY = 0,
|
|
||||||
VERIFY = 1
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* Key usage extension bits */
|
|
||||||
#define KEYUSE_DIGITAL_SIG 0x0100
|
|
||||||
#define KEYUSE_CONTENT_COMMIT 0x0080
|
|
||||||
#define KEYUSE_KEY_ENCIPHER 0x0040
|
|
||||||
#define KEYUSE_DATA_ENCIPHER 0x0020
|
|
||||||
#define KEYUSE_KEY_AGREE 0x0010
|
|
||||||
#define KEYUSE_KEY_CERT_SIGN 0x0008
|
|
||||||
#define KEYUSE_CRL_SIGN 0x0004
|
|
||||||
#define KEYUSE_ENCIPHER_ONLY 0x0002
|
|
||||||
#define KEYUSE_DECIPHER_ONLY 0x0001
|
|
||||||
|
|
||||||
#define EXTKEYUSE_ANY 0x08
|
|
||||||
#define EXTKEYUSE_OCSP_SIGN 0x04
|
|
||||||
#define EXTKEYUSE_CLIENT_AUTH 0x02
|
|
||||||
#define EXTKEYUSE_SERVER_AUTH 0x01
|
|
||||||
|
|
||||||
typedef struct DNS_entry DNS_entry;
|
|
||||||
|
|
||||||
struct DNS_entry {
|
|
||||||
DNS_entry* next; /* next on DNS list */
|
|
||||||
char* name; /* actual DNS name */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct Base_entry Base_entry;
|
|
||||||
|
|
||||||
struct Base_entry {
|
|
||||||
Base_entry* next; /* next on name base list */
|
|
||||||
char* name; /* actual name base */
|
|
||||||
int nameSz; /* name length */
|
|
||||||
byte type; /* Name base type (DNS or RFC822) */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct DecodedName {
|
|
||||||
char* fullName;
|
|
||||||
int fullNameLen;
|
|
||||||
int entryCount;
|
|
||||||
int cnIdx;
|
|
||||||
int cnLen;
|
|
||||||
int snIdx;
|
|
||||||
int snLen;
|
|
||||||
int cIdx;
|
|
||||||
int cLen;
|
|
||||||
int lIdx;
|
|
||||||
int lLen;
|
|
||||||
int stIdx;
|
|
||||||
int stLen;
|
|
||||||
int oIdx;
|
|
||||||
int oLen;
|
|
||||||
int ouIdx;
|
|
||||||
int ouLen;
|
|
||||||
int emailIdx;
|
|
||||||
int emailLen;
|
|
||||||
int uidIdx;
|
|
||||||
int uidLen;
|
|
||||||
int serialIdx;
|
|
||||||
int serialLen;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct DecodedCert DecodedCert;
|
|
||||||
typedef struct DecodedName DecodedName;
|
|
||||||
typedef struct Signer Signer;
|
|
||||||
|
|
||||||
|
|
||||||
struct DecodedCert {
|
|
||||||
byte* publicKey;
|
|
||||||
word32 pubKeySize;
|
|
||||||
int pubKeyStored;
|
|
||||||
word32 certBegin; /* offset to start of cert */
|
|
||||||
word32 sigIndex; /* offset to start of signature */
|
|
||||||
word32 sigLength; /* length of signature */
|
|
||||||
word32 signatureOID; /* sum of algorithm object id */
|
|
||||||
word32 keyOID; /* sum of key algo object id */
|
|
||||||
int version; /* cert version, 1 or 3 */
|
|
||||||
DNS_entry* altNames; /* alt names list of dns entries */
|
|
||||||
#ifndef IGNORE_NAME_CONSTRAINTS
|
|
||||||
DNS_entry* altEmailNames; /* alt names list of RFC822 entries */
|
|
||||||
Base_entry* permittedNames; /* Permitted name bases */
|
|
||||||
Base_entry* excludedNames; /* Excluded name bases */
|
|
||||||
#endif /* IGNORE_NAME_CONSTRAINTS */
|
|
||||||
byte subjectHash[SHA_SIZE]; /* hash of all Names */
|
|
||||||
byte issuerHash[SHA_SIZE]; /* hash of all Names */
|
|
||||||
#ifdef HAVE_OCSP
|
|
||||||
byte issuerKeyHash[SHA_SIZE]; /* hash of the public Key */
|
|
||||||
#endif /* HAVE_OCSP */
|
|
||||||
byte* signature; /* not owned, points into raw cert */
|
|
||||||
char* subjectCN; /* CommonName */
|
|
||||||
int subjectCNLen; /* CommonName Length */
|
|
||||||
char subjectCNEnc; /* CommonName Encoding */
|
|
||||||
int subjectCNStored; /* have we saved a copy we own */
|
|
||||||
char issuer[ASN_NAME_MAX]; /* full name including common name */
|
|
||||||
char subject[ASN_NAME_MAX]; /* full name including common name */
|
|
||||||
int verify; /* Default to yes, but could be off */
|
|
||||||
byte* source; /* byte buffer holder cert, NOT owner */
|
|
||||||
word32 srcIdx; /* current offset into buffer */
|
|
||||||
word32 maxIdx; /* max offset based on init size */
|
|
||||||
void* heap; /* for user memory overrides */
|
|
||||||
byte serial[EXTERNAL_SERIAL_SIZE]; /* raw serial number */
|
|
||||||
int serialSz; /* raw serial bytes stored */
|
|
||||||
byte* extensions; /* not owned, points into raw cert */
|
|
||||||
int extensionsSz; /* length of cert extensions */
|
|
||||||
word32 extensionsIdx; /* if want to go back and parse later */
|
|
||||||
byte* extAuthInfo; /* Authority Information Access URI */
|
|
||||||
int extAuthInfoSz; /* length of the URI */
|
|
||||||
byte* extCrlInfo; /* CRL Distribution Points */
|
|
||||||
int extCrlInfoSz; /* length of the URI */
|
|
||||||
byte extSubjKeyId[SHA_SIZE]; /* Subject Key ID */
|
|
||||||
byte extSubjKeyIdSet; /* Set when the SKID was read from cert */
|
|
||||||
byte extAuthKeyId[SHA_SIZE]; /* Authority Key ID */
|
|
||||||
byte extAuthKeyIdSet; /* Set when the AKID was read from cert */
|
|
||||||
#ifndef IGNORE_NAME_CONSTRAINTS
|
|
||||||
byte extNameConstraintSet;
|
|
||||||
#endif /* IGNORE_NAME_CONSTRAINTS */
|
|
||||||
byte isCA; /* CA basic constraint true */
|
|
||||||
byte extKeyUsageSet;
|
|
||||||
word16 extKeyUsage; /* Key usage bitfield */
|
|
||||||
byte extExtKeyUsageSet; /* Extended Key Usage */
|
|
||||||
byte extExtKeyUsage; /* Extended Key usage bitfield */
|
|
||||||
#ifdef OPENSSL_EXTRA
|
|
||||||
byte extBasicConstSet;
|
|
||||||
byte extBasicConstCrit;
|
|
||||||
byte extBasicConstPlSet;
|
|
||||||
word32 pathLength; /* CA basic constraint path length, opt */
|
|
||||||
byte extSubjAltNameSet;
|
|
||||||
byte extSubjAltNameCrit;
|
|
||||||
byte extAuthKeyIdCrit;
|
|
||||||
#ifndef IGNORE_NAME_CONSTRAINTS
|
|
||||||
byte extNameConstraintCrit;
|
|
||||||
#endif /* IGNORE_NAME_CONSTRAINTS */
|
|
||||||
byte extSubjKeyIdCrit;
|
|
||||||
byte extKeyUsageCrit;
|
|
||||||
byte extExtKeyUsageCrit;
|
|
||||||
byte* extExtKeyUsageSrc;
|
|
||||||
word32 extExtKeyUsageSz;
|
|
||||||
word32 extExtKeyUsageCount;
|
|
||||||
byte* extAuthKeyIdSrc;
|
|
||||||
word32 extAuthKeyIdSz;
|
|
||||||
byte* extSubjKeyIdSrc;
|
|
||||||
word32 extSubjKeyIdSz;
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_ECC
|
|
||||||
word32 pkCurveOID; /* Public Key's curve OID */
|
|
||||||
#endif /* HAVE_ECC */
|
|
||||||
byte* beforeDate;
|
|
||||||
int beforeDateLen;
|
|
||||||
byte* afterDate;
|
|
||||||
int afterDateLen;
|
|
||||||
#ifdef HAVE_PKCS7
|
|
||||||
byte* issuerRaw; /* pointer to issuer inside source */
|
|
||||||
int issuerRawLen;
|
|
||||||
#endif
|
|
||||||
#ifndef IGNORE_NAME_CONSTRAINT
|
|
||||||
byte* subjectRaw; /* pointer to subject inside source */
|
|
||||||
int subjectRawLen;
|
|
||||||
#endif
|
|
||||||
#if defined(CYASSL_CERT_GEN)
|
|
||||||
/* easy access to subject info for other sign */
|
|
||||||
char* subjectSN;
|
|
||||||
int subjectSNLen;
|
|
||||||
char subjectSNEnc;
|
|
||||||
char* subjectC;
|
|
||||||
int subjectCLen;
|
|
||||||
char subjectCEnc;
|
|
||||||
char* subjectL;
|
|
||||||
int subjectLLen;
|
|
||||||
char subjectLEnc;
|
|
||||||
char* subjectST;
|
|
||||||
int subjectSTLen;
|
|
||||||
char subjectSTEnc;
|
|
||||||
char* subjectO;
|
|
||||||
int subjectOLen;
|
|
||||||
char subjectOEnc;
|
|
||||||
char* subjectOU;
|
|
||||||
int subjectOULen;
|
|
||||||
char subjectOUEnc;
|
|
||||||
char* subjectEmail;
|
|
||||||
int subjectEmailLen;
|
|
||||||
#endif /* CYASSL_CERT_GEN */
|
|
||||||
#ifdef OPENSSL_EXTRA
|
|
||||||
DecodedName issuerName;
|
|
||||||
DecodedName subjectName;
|
|
||||||
#endif /* OPENSSL_EXTRA */
|
|
||||||
#ifdef CYASSL_SEP
|
|
||||||
int deviceTypeSz;
|
|
||||||
byte* deviceType;
|
|
||||||
int hwTypeSz;
|
|
||||||
byte* hwType;
|
|
||||||
int hwSerialNumSz;
|
|
||||||
byte* hwSerialNum;
|
|
||||||
#ifdef OPENSSL_EXTRA
|
|
||||||
byte extCertPolicySet;
|
|
||||||
byte extCertPolicyCrit;
|
|
||||||
#endif /* OPENSSL_EXTRA */
|
|
||||||
#endif /* CYASSL_SEP */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef SHA_DIGEST_SIZE
|
|
||||||
#define SIGNER_DIGEST_SIZE SHA_DIGEST_SIZE
|
|
||||||
#else
|
|
||||||
#define SIGNER_DIGEST_SIZE 20
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* CA Signers */
|
|
||||||
/* if change layout change PERSIST_CERT_CACHE functions too */
|
|
||||||
struct Signer {
|
|
||||||
word32 pubKeySize;
|
|
||||||
word32 keyOID; /* key type */
|
|
||||||
word16 keyUsage;
|
|
||||||
byte* publicKey;
|
|
||||||
int nameLen;
|
|
||||||
char* name; /* common name */
|
|
||||||
#ifndef IGNORE_NAME_CONSTRAINTS
|
|
||||||
Base_entry* permittedNames;
|
|
||||||
Base_entry* excludedNames;
|
|
||||||
#endif /* IGNORE_NAME_CONSTRAINTS */
|
|
||||||
byte subjectNameHash[SIGNER_DIGEST_SIZE];
|
|
||||||
/* sha hash of names in certificate */
|
|
||||||
#ifndef NO_SKID
|
|
||||||
byte subjectKeyIdHash[SIGNER_DIGEST_SIZE];
|
|
||||||
/* sha hash of names in certificate */
|
|
||||||
#endif
|
|
||||||
Signer* next;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* not for public consumption but may use for testing sometimes */
|
|
||||||
#ifdef CYASSL_TEST_CERT
|
|
||||||
#define CYASSL_TEST_API CYASSL_API
|
|
||||||
#else
|
|
||||||
#define CYASSL_TEST_API CYASSL_LOCAL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
CYASSL_TEST_API void FreeAltNames(DNS_entry*, void*);
|
|
||||||
#ifndef IGNORE_NAME_CONSTRAINTS
|
|
||||||
CYASSL_TEST_API void FreeNameSubtrees(Base_entry*, void*);
|
|
||||||
#endif /* IGNORE_NAME_CONSTRAINTS */
|
|
||||||
CYASSL_TEST_API void InitDecodedCert(DecodedCert*, byte*, word32, void*);
|
|
||||||
CYASSL_TEST_API void FreeDecodedCert(DecodedCert*);
|
|
||||||
CYASSL_TEST_API int ParseCert(DecodedCert*, int type, int verify, void* cm);
|
|
||||||
|
|
||||||
CYASSL_LOCAL int ParseCertRelative(DecodedCert*, int type, int verify,void* cm);
|
|
||||||
CYASSL_LOCAL int DecodeToKey(DecodedCert*, int verify);
|
|
||||||
|
|
||||||
CYASSL_LOCAL word32 EncodeSignature(byte* out, const byte* digest, word32 digSz,
|
|
||||||
int hashOID);
|
|
||||||
|
|
||||||
CYASSL_LOCAL Signer* MakeSigner(void*);
|
|
||||||
CYASSL_LOCAL void FreeSigner(Signer*, void*);
|
|
||||||
CYASSL_LOCAL void FreeSignerTable(Signer**, int, void*);
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_LOCAL int ToTraditional(byte* buffer, word32 length);
|
|
||||||
CYASSL_LOCAL int ToTraditionalEnc(byte* buffer, word32 length,const char*, int);
|
|
||||||
|
|
||||||
CYASSL_LOCAL int ValidateDate(const byte* date, byte format, int dateType);
|
|
||||||
|
|
||||||
/* ASN.1 helper functions */
|
|
||||||
CYASSL_LOCAL int GetLength(const byte* input, word32* inOutIdx, int* len,
|
|
||||||
word32 maxIdx);
|
|
||||||
CYASSL_LOCAL int GetSequence(const byte* input, word32* inOutIdx, int* len,
|
|
||||||
word32 maxIdx);
|
|
||||||
CYASSL_LOCAL int GetSet(const byte* input, word32* inOutIdx, int* len,
|
|
||||||
word32 maxIdx);
|
|
||||||
CYASSL_LOCAL int GetMyVersion(const byte* input, word32* inOutIdx,
|
|
||||||
int* version);
|
|
||||||
CYASSL_LOCAL int GetInt(mp_int* mpi, const byte* input, word32* inOutIdx,
|
|
||||||
word32 maxIdx);
|
|
||||||
CYASSL_LOCAL int GetAlgoId(const byte* input, word32* inOutIdx, word32* oid,
|
|
||||||
word32 maxIdx);
|
|
||||||
CYASSL_LOCAL word32 SetLength(word32 length, byte* output);
|
|
||||||
CYASSL_LOCAL word32 SetSequence(word32 len, byte* output);
|
|
||||||
CYASSL_LOCAL word32 SetOctetString(word32 len, byte* output);
|
|
||||||
CYASSL_LOCAL word32 SetImplicit(byte tag, byte number, word32 len,byte* output);
|
|
||||||
CYASSL_LOCAL word32 SetExplicit(byte number, word32 len, byte* output);
|
|
||||||
CYASSL_LOCAL word32 SetSet(word32 len, byte* output);
|
|
||||||
CYASSL_LOCAL word32 SetAlgoID(int algoOID, byte* output, int type, int curveSz);
|
|
||||||
CYASSL_LOCAL int SetMyVersion(word32 version, byte* output, int header);
|
|
||||||
CYASSL_LOCAL int SetSerialNumber(const byte* sn, word32 snSz, byte* output);
|
|
||||||
CYASSL_LOCAL int GetNameHash(const byte* source, word32* idx, byte* hash,
|
|
||||||
int maxIdx);
|
|
||||||
|
|
||||||
#ifdef HAVE_ECC
|
|
||||||
/* ASN sig helpers */
|
|
||||||
CYASSL_LOCAL int StoreECC_DSA_Sig(byte* out, word32* outLen, mp_int* r,
|
|
||||||
mp_int* s);
|
|
||||||
CYASSL_LOCAL int DecodeECC_DSA_Sig(const byte* sig, word32 sigLen,
|
|
||||||
mp_int* r, mp_int* s);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_CERT_GEN
|
|
||||||
|
|
||||||
enum cert_enums {
|
|
||||||
NAME_ENTRIES = 8,
|
|
||||||
JOINT_LEN = 2,
|
|
||||||
EMAIL_JOINT_LEN = 9,
|
|
||||||
RSA_KEY = 10,
|
|
||||||
NTRU_KEY = 11,
|
|
||||||
ECC_KEY = 12
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* CYASSL_CERT_GEN */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* for pointer use */
|
|
||||||
typedef struct CertStatus CertStatus;
|
|
||||||
|
|
||||||
#ifdef HAVE_OCSP
|
|
||||||
|
|
||||||
enum Ocsp_Response_Status {
|
|
||||||
OCSP_SUCCESSFUL = 0, /* Response has valid confirmations */
|
|
||||||
OCSP_MALFORMED_REQUEST = 1, /* Illegal confirmation request */
|
|
||||||
OCSP_INTERNAL_ERROR = 2, /* Internal error in issuer */
|
|
||||||
OCSP_TRY_LATER = 3, /* Try again later */
|
|
||||||
OCSP_SIG_REQUIRED = 5, /* Must sign the request (4 is skipped) */
|
|
||||||
OCSP_UNAUTHROIZED = 6 /* Request unauthorized */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum Ocsp_Cert_Status {
|
|
||||||
CERT_GOOD = 0,
|
|
||||||
CERT_REVOKED = 1,
|
|
||||||
CERT_UNKNOWN = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum Ocsp_Sums {
|
|
||||||
OCSP_BASIC_OID = 117,
|
|
||||||
OCSP_NONCE_OID = 118
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct OcspRequest OcspRequest;
|
|
||||||
typedef struct OcspResponse OcspResponse;
|
|
||||||
|
|
||||||
|
|
||||||
struct CertStatus {
|
|
||||||
CertStatus* next;
|
|
||||||
|
|
||||||
byte serial[EXTERNAL_SERIAL_SIZE];
|
|
||||||
int serialSz;
|
|
||||||
|
|
||||||
int status;
|
|
||||||
|
|
||||||
byte thisDate[MAX_DATE_SIZE];
|
|
||||||
byte nextDate[MAX_DATE_SIZE];
|
|
||||||
byte thisDateFormat;
|
|
||||||
byte nextDateFormat;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct OcspResponse {
|
|
||||||
int responseStatus; /* return code from Responder */
|
|
||||||
|
|
||||||
byte* response; /* Pointer to beginning of OCSP Response */
|
|
||||||
word32 responseSz; /* length of the OCSP Response */
|
|
||||||
|
|
||||||
byte producedDate[MAX_DATE_SIZE];
|
|
||||||
/* Date at which this response was signed */
|
|
||||||
byte producedDateFormat; /* format of the producedDate */
|
|
||||||
byte* issuerHash;
|
|
||||||
byte* issuerKeyHash;
|
|
||||||
|
|
||||||
byte* cert;
|
|
||||||
word32 certSz;
|
|
||||||
|
|
||||||
byte* sig; /* Pointer to sig in source */
|
|
||||||
word32 sigSz; /* Length in octets for the sig */
|
|
||||||
word32 sigOID; /* OID for hash used for sig */
|
|
||||||
|
|
||||||
CertStatus* status; /* certificate status to fill out */
|
|
||||||
|
|
||||||
byte* nonce; /* pointer to nonce inside ASN.1 response */
|
|
||||||
int nonceSz; /* length of the nonce string */
|
|
||||||
|
|
||||||
byte* source; /* pointer to source buffer, not owned */
|
|
||||||
word32 maxIdx; /* max offset based on init size */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct OcspRequest {
|
|
||||||
DecodedCert* cert;
|
|
||||||
|
|
||||||
byte useNonce;
|
|
||||||
byte nonce[MAX_OCSP_NONCE_SZ];
|
|
||||||
int nonceSz;
|
|
||||||
|
|
||||||
byte* issuerHash; /* pointer to issuerHash in source cert */
|
|
||||||
byte* issuerKeyHash; /* pointer to issuerKeyHash in source cert */
|
|
||||||
byte* serial; /* pointer to serial number in source cert */
|
|
||||||
int serialSz; /* length of the serial number */
|
|
||||||
|
|
||||||
byte* dest; /* pointer to the destination ASN.1 buffer */
|
|
||||||
word32 destSz; /* length of the destination buffer */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_LOCAL void InitOcspResponse(OcspResponse*, CertStatus*, byte*, word32);
|
|
||||||
CYASSL_LOCAL int OcspResponseDecode(OcspResponse*);
|
|
||||||
|
|
||||||
CYASSL_LOCAL void InitOcspRequest(OcspRequest*, DecodedCert*,
|
|
||||||
byte, byte*, word32);
|
|
||||||
CYASSL_LOCAL int EncodeOcspRequest(OcspRequest*);
|
|
||||||
|
|
||||||
CYASSL_LOCAL int CompareOcspReqResp(OcspRequest*, OcspResponse*);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* HAVE_OCSP */
|
|
||||||
|
|
||||||
|
|
||||||
/* for pointer use */
|
|
||||||
typedef struct RevokedCert RevokedCert;
|
|
||||||
|
|
||||||
#ifdef HAVE_CRL
|
|
||||||
|
|
||||||
struct RevokedCert {
|
|
||||||
byte serialNumber[EXTERNAL_SERIAL_SIZE];
|
|
||||||
int serialSz;
|
|
||||||
RevokedCert* next;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct DecodedCRL DecodedCRL;
|
|
||||||
|
|
||||||
struct DecodedCRL {
|
|
||||||
word32 certBegin; /* offset to start of cert */
|
|
||||||
word32 sigIndex; /* offset to start of signature */
|
|
||||||
word32 sigLength; /* length of signature */
|
|
||||||
word32 signatureOID; /* sum of algorithm object id */
|
|
||||||
byte* signature; /* pointer into raw source, not owned */
|
|
||||||
byte issuerHash[SHA_DIGEST_SIZE]; /* issuer hash */
|
|
||||||
byte crlHash[SHA_DIGEST_SIZE]; /* raw crl data hash */
|
|
||||||
byte lastDate[MAX_DATE_SIZE]; /* last date updated */
|
|
||||||
byte nextDate[MAX_DATE_SIZE]; /* next update date */
|
|
||||||
byte lastDateFormat; /* format of last date */
|
|
||||||
byte nextDateFormat; /* format of next date */
|
|
||||||
RevokedCert* certs; /* revoked cert list */
|
|
||||||
int totalCerts; /* number on list */
|
|
||||||
};
|
|
||||||
|
|
||||||
CYASSL_LOCAL void InitDecodedCRL(DecodedCRL*);
|
|
||||||
CYASSL_LOCAL int ParseCRL(DecodedCRL*, const byte* buff, word32 sz, void* cm);
|
|
||||||
CYASSL_LOCAL void FreeDecodedCRL(DecodedCRL*);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* HAVE_CRL */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_ASN_H */
|
#endif /* CTAO_CRYPT_ASN_H */
|
||||||
|
|
||||||
#endif /* !NO_ASN */
|
#endif /* !NO_ASN */
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* asn_public.h
|
/* asn_public.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -23,167 +23,56 @@
|
||||||
#ifndef CTAO_CRYPT_ASN_PUBLIC_H
|
#ifndef CTAO_CRYPT_ASN_PUBLIC_H
|
||||||
#define CTAO_CRYPT_ASN_PUBLIC_H
|
#define CTAO_CRYPT_ASN_PUBLIC_H
|
||||||
|
|
||||||
|
/* pull in compatibility for each of the includes */
|
||||||
|
#include <cyassl/ctaocrypt/types.h>
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <cyassl/ctaocrypt/types.h>
|
||||||
#include <cyassl/ctaocrypt/ecc.h>
|
#include <cyassl/ctaocrypt/ecc.h>
|
||||||
#ifdef CYASSL_CERT_GEN
|
#ifdef WOLFSSL_CERT_GEN
|
||||||
#include <cyassl/ctaocrypt/rsa.h>
|
#include <cyassl/ctaocrypt/rsa.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <wolfssl/wolfcrypt/asn_public.h>
|
||||||
|
#ifdef WOLFSSL_CERT_GEN
|
||||||
|
#define InitCert wc_InitCert
|
||||||
|
#define MakeCert wc_MakeCert
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef WOLFSSL_CERT_REQ
|
||||||
extern "C" {
|
#define MakeCertReq wc_MakeCertReq
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define SignCert wc_SignCert
|
||||||
|
#define MakeSelfCert wc_MakeSelfCert
|
||||||
|
#define SetIssuer wc_SetIssuer
|
||||||
|
#define SetSubject wc_SetSubject
|
||||||
|
|
||||||
/* Certificate file Type */
|
#ifdef WOLFSSL_ALT_NAMES
|
||||||
enum CertType {
|
#define SetAltNames wc_SetAltNames
|
||||||
CERT_TYPE = 0,
|
|
||||||
PRIVATEKEY_TYPE,
|
|
||||||
DH_PARAM_TYPE,
|
|
||||||
CRL_TYPE,
|
|
||||||
CA_TYPE,
|
|
||||||
ECC_PRIVATEKEY_TYPE,
|
|
||||||
CERTREQ_TYPE
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* Signature type, by OID sum */
|
|
||||||
enum Ctc_SigType {
|
|
||||||
CTC_SHAwDSA = 517,
|
|
||||||
CTC_MD2wRSA = 646,
|
|
||||||
CTC_MD5wRSA = 648,
|
|
||||||
CTC_SHAwRSA = 649,
|
|
||||||
CTC_SHAwECDSA = 520,
|
|
||||||
CTC_SHA256wRSA = 655,
|
|
||||||
CTC_SHA256wECDSA = 524,
|
|
||||||
CTC_SHA384wRSA = 656,
|
|
||||||
CTC_SHA384wECDSA = 525,
|
|
||||||
CTC_SHA512wRSA = 657,
|
|
||||||
CTC_SHA512wECDSA = 526
|
|
||||||
};
|
|
||||||
|
|
||||||
enum Ctc_Encoding {
|
|
||||||
CTC_UTF8 = 0x0c, /* utf8 */
|
|
||||||
CTC_PRINTABLE = 0x13 /* printable */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef CYASSL_CERT_GEN
|
|
||||||
|
|
||||||
#ifndef HAVE_ECC
|
|
||||||
typedef struct ecc_key ecc_key;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum Ctc_Misc {
|
#define SetIssuerBuffer wc_SetIssuerBuffer
|
||||||
CTC_NAME_SIZE = 64,
|
#define SetSubjectBuffer wc_SetSubjectBuffer
|
||||||
CTC_DATE_SIZE = 32,
|
#define SetAltNamesBuffer wc_SetAltNamesBuffer
|
||||||
CTC_MAX_ALT_SIZE = 16384, /* may be huge */
|
#define SetDatesBuffer wc_SetDatesBuffer
|
||||||
CTC_SERIAL_SIZE = 8
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct CertName {
|
|
||||||
char country[CTC_NAME_SIZE];
|
|
||||||
char countryEnc;
|
|
||||||
char state[CTC_NAME_SIZE];
|
|
||||||
char stateEnc;
|
|
||||||
char locality[CTC_NAME_SIZE];
|
|
||||||
char localityEnc;
|
|
||||||
char sur[CTC_NAME_SIZE];
|
|
||||||
char surEnc;
|
|
||||||
char org[CTC_NAME_SIZE];
|
|
||||||
char orgEnc;
|
|
||||||
char unit[CTC_NAME_SIZE];
|
|
||||||
char unitEnc;
|
|
||||||
char commonName[CTC_NAME_SIZE];
|
|
||||||
char commonNameEnc;
|
|
||||||
char email[CTC_NAME_SIZE]; /* !!!! email has to be last !!!! */
|
|
||||||
} CertName;
|
|
||||||
|
|
||||||
|
|
||||||
/* for user to fill for certificate generation */
|
|
||||||
typedef struct Cert {
|
|
||||||
int version; /* x509 version */
|
|
||||||
byte serial[CTC_SERIAL_SIZE]; /* serial number */
|
|
||||||
int sigType; /* signature algo type */
|
|
||||||
CertName issuer; /* issuer info */
|
|
||||||
int daysValid; /* validity days */
|
|
||||||
int selfSigned; /* self signed flag */
|
|
||||||
CertName subject; /* subject info */
|
|
||||||
int isCA; /* is this going to be a CA */
|
|
||||||
/* internal use only */
|
|
||||||
int bodySz; /* pre sign total size */
|
|
||||||
int keyType; /* public key type of subject */
|
|
||||||
#ifdef CYASSL_ALT_NAMES
|
|
||||||
byte altNames[CTC_MAX_ALT_SIZE]; /* altNames copy */
|
|
||||||
int altNamesSz; /* altNames size in bytes */
|
|
||||||
byte beforeDate[CTC_DATE_SIZE]; /* before date copy */
|
|
||||||
int beforeDateSz; /* size of copy */
|
|
||||||
byte afterDate[CTC_DATE_SIZE]; /* after date copy */
|
|
||||||
int afterDateSz; /* size of copy */
|
|
||||||
#endif
|
|
||||||
#ifdef CYASSL_CERT_REQ
|
|
||||||
char challengePw[CTC_NAME_SIZE];
|
|
||||||
#endif
|
|
||||||
} Cert;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Initialize and Set Certficate defaults:
|
|
||||||
version = 3 (0x2)
|
|
||||||
serial = 0 (Will be randomly generated)
|
|
||||||
sigType = SHA_WITH_RSA
|
|
||||||
issuer = blank
|
|
||||||
daysValid = 500
|
|
||||||
selfSigned = 1 (true) use subject as issuer
|
|
||||||
subject = blank
|
|
||||||
isCA = 0 (false)
|
|
||||||
keyType = RSA_KEY (default)
|
|
||||||
*/
|
|
||||||
CYASSL_API void InitCert(Cert*);
|
|
||||||
CYASSL_API int MakeCert(Cert*, byte* derBuffer, word32 derSz, RsaKey*,
|
|
||||||
ecc_key*, RNG*);
|
|
||||||
#ifdef CYASSL_CERT_REQ
|
|
||||||
CYASSL_API int MakeCertReq(Cert*, byte* derBuffer, word32 derSz, RsaKey*,
|
|
||||||
ecc_key*);
|
|
||||||
#endif
|
|
||||||
CYASSL_API int SignCert(int requestSz, int sigType, byte* derBuffer,
|
|
||||||
word32 derSz, RsaKey*, ecc_key*, RNG*);
|
|
||||||
CYASSL_API int MakeSelfCert(Cert*, byte* derBuffer, word32 derSz, RsaKey*,
|
|
||||||
RNG*);
|
|
||||||
CYASSL_API int SetIssuer(Cert*, const char*);
|
|
||||||
CYASSL_API int SetSubject(Cert*, const char*);
|
|
||||||
#ifdef CYASSL_ALT_NAMES
|
|
||||||
CYASSL_API int SetAltNames(Cert*, const char*);
|
|
||||||
#endif
|
|
||||||
CYASSL_API int SetIssuerBuffer(Cert*, const byte*, int);
|
|
||||||
CYASSL_API int SetSubjectBuffer(Cert*, const byte*, int);
|
|
||||||
CYASSL_API int SetAltNamesBuffer(Cert*, const byte*, int);
|
|
||||||
CYASSL_API int SetDatesBuffer(Cert*, const byte*, int);
|
|
||||||
|
|
||||||
#ifdef HAVE_NTRU
|
#ifdef HAVE_NTRU
|
||||||
CYASSL_API int MakeNtruCert(Cert*, byte* derBuffer, word32 derSz,
|
#define MakeNtruCert wc_MakeNtruCert
|
||||||
const byte* ntruKey, word16 keySz, RNG*);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CYASSL_CERT_GEN */
|
#endif /* WOLFSSL_CERT_GEN */
|
||||||
|
|
||||||
|
#if defined(WOLFSSL_KEY_GEN) || defined(WOLFSSL_CERT_GEN)
|
||||||
#if defined(CYASSL_KEY_GEN) || defined(CYASSL_CERT_GEN)
|
#define DerToPem wc_DerToPem
|
||||||
CYASSL_API int DerToPem(const byte* der, word32 derSz, byte* output,
|
|
||||||
word32 outputSz, int type);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_ECC
|
#ifdef HAVE_ECC
|
||||||
/* private key helpers */
|
/* private key helpers */
|
||||||
CYASSL_API int EccPrivateKeyDecode(const byte* input,word32* inOutIdx,
|
#define EccPrivateKeyDecode wc_EccPrivateKeyDecode
|
||||||
ecc_key*,word32);
|
#define EccKeyToDer wc_EccKeyToDer
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* DER encode signature */
|
||||||
#ifdef __cplusplus
|
#define EncodeSignature wc_EncodeSignature
|
||||||
} /* extern "C" */
|
#define GetCTC_HashOID wc_GetCTC_HashOID
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_ASN_PUBLIC_H */
|
#endif /* CTAO_CRYPT_ASN_PUBLIC_H */
|
||||||
|
|
||||||
|
|
|
@ -12,16 +12,16 @@
|
||||||
*/
|
*/
|
||||||
/* blake2-impl.h
|
/* blake2-impl.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -36,119 +36,7 @@
|
||||||
#define CTAOCRYPT_BLAKE2_IMPL_H
|
#define CTAOCRYPT_BLAKE2_IMPL_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <cyassl/ctaocrypt/types.h>
|
||||||
|
#include <wolfssl/wolfcrypt/blake2_impl.h>
|
||||||
static inline word32 load32( const void *src )
|
|
||||||
{
|
|
||||||
#if defined(LITTLE_ENDIAN_ORDER)
|
|
||||||
return *( word32 * )( src );
|
|
||||||
#else
|
|
||||||
const byte *p = ( byte * )src;
|
|
||||||
word32 w = *p++;
|
|
||||||
w |= ( word32 )( *p++ ) << 8;
|
|
||||||
w |= ( word32 )( *p++ ) << 16;
|
|
||||||
w |= ( word32 )( *p++ ) << 24;
|
|
||||||
return w;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline word64 load64( const void *src )
|
|
||||||
{
|
|
||||||
#if defined(LITTLE_ENDIAN_ORDER)
|
|
||||||
return *( word64 * )( src );
|
|
||||||
#else
|
|
||||||
const byte *p = ( byte * )src;
|
|
||||||
word64 w = *p++;
|
|
||||||
w |= ( word64 )( *p++ ) << 8;
|
|
||||||
w |= ( word64 )( *p++ ) << 16;
|
|
||||||
w |= ( word64 )( *p++ ) << 24;
|
|
||||||
w |= ( word64 )( *p++ ) << 32;
|
|
||||||
w |= ( word64 )( *p++ ) << 40;
|
|
||||||
w |= ( word64 )( *p++ ) << 48;
|
|
||||||
w |= ( word64 )( *p++ ) << 56;
|
|
||||||
return w;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void store32( void *dst, word32 w )
|
|
||||||
{
|
|
||||||
#if defined(LITTLE_ENDIAN_ORDER)
|
|
||||||
*( word32 * )( dst ) = w;
|
|
||||||
#else
|
|
||||||
byte *p = ( byte * )dst;
|
|
||||||
*p++ = ( byte )w; w >>= 8;
|
|
||||||
*p++ = ( byte )w; w >>= 8;
|
|
||||||
*p++ = ( byte )w; w >>= 8;
|
|
||||||
*p++ = ( byte )w;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void store64( void *dst, word64 w )
|
|
||||||
{
|
|
||||||
#if defined(LITTLE_ENDIAN_ORDER)
|
|
||||||
*( word64 * )( dst ) = w;
|
|
||||||
#else
|
|
||||||
byte *p = ( byte * )dst;
|
|
||||||
*p++ = ( byte )w; w >>= 8;
|
|
||||||
*p++ = ( byte )w; w >>= 8;
|
|
||||||
*p++ = ( byte )w; w >>= 8;
|
|
||||||
*p++ = ( byte )w; w >>= 8;
|
|
||||||
*p++ = ( byte )w; w >>= 8;
|
|
||||||
*p++ = ( byte )w; w >>= 8;
|
|
||||||
*p++ = ( byte )w; w >>= 8;
|
|
||||||
*p++ = ( byte )w;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline word64 load48( const void *src )
|
|
||||||
{
|
|
||||||
const byte *p = ( const byte * )src;
|
|
||||||
word64 w = *p++;
|
|
||||||
w |= ( word64 )( *p++ ) << 8;
|
|
||||||
w |= ( word64 )( *p++ ) << 16;
|
|
||||||
w |= ( word64 )( *p++ ) << 24;
|
|
||||||
w |= ( word64 )( *p++ ) << 32;
|
|
||||||
w |= ( word64 )( *p++ ) << 40;
|
|
||||||
return w;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void store48( void *dst, word64 w )
|
|
||||||
{
|
|
||||||
byte *p = ( byte * )dst;
|
|
||||||
*p++ = ( byte )w; w >>= 8;
|
|
||||||
*p++ = ( byte )w; w >>= 8;
|
|
||||||
*p++ = ( byte )w; w >>= 8;
|
|
||||||
*p++ = ( byte )w; w >>= 8;
|
|
||||||
*p++ = ( byte )w; w >>= 8;
|
|
||||||
*p++ = ( byte )w;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline word32 rotl32( const word32 w, const unsigned c )
|
|
||||||
{
|
|
||||||
return ( w << c ) | ( w >> ( 32 - c ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline word64 rotl64( const word64 w, const unsigned c )
|
|
||||||
{
|
|
||||||
return ( w << c ) | ( w >> ( 64 - c ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline word32 rotr32( const word32 w, const unsigned c )
|
|
||||||
{
|
|
||||||
return ( w >> c ) | ( w << ( 32 - c ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline word64 rotr64( const word64 w, const unsigned c )
|
|
||||||
{
|
|
||||||
return ( w >> c ) | ( w << ( 64 - c ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* prevents compiler optimizing out memset() */
|
|
||||||
static inline void secure_zero_memory( void *v, word64 n )
|
|
||||||
{
|
|
||||||
volatile byte *p = ( volatile byte * )v;
|
|
||||||
|
|
||||||
while( n-- ) *p++ = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* CTAOCRYPT_BLAKE2_IMPL_H */
|
#endif /* CTAOCRYPT_BLAKE2_IMPL_H */
|
||||||
|
|
||||||
|
|
|
@ -12,16 +12,16 @@
|
||||||
*/
|
*/
|
||||||
/* blake2-int.h
|
/* blake2-int.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -37,147 +37,7 @@
|
||||||
#define CTAOCRYPT_BLAKE2_INT_H
|
#define CTAOCRYPT_BLAKE2_INT_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <cyassl/ctaocrypt/types.h>
|
||||||
|
#include <wolfssl/wolfcrypt/blake2_int.h>
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
#define ALIGN(x) __declspec(align(x))
|
|
||||||
#elif defined(__GNUC__)
|
|
||||||
#define ALIGN(x) __attribute__((aligned(x)))
|
|
||||||
#else
|
|
||||||
#define ALIGN(x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
enum blake2s_constant
|
|
||||||
{
|
|
||||||
BLAKE2S_BLOCKBYTES = 64,
|
|
||||||
BLAKE2S_OUTBYTES = 32,
|
|
||||||
BLAKE2S_KEYBYTES = 32,
|
|
||||||
BLAKE2S_SALTBYTES = 8,
|
|
||||||
BLAKE2S_PERSONALBYTES = 8
|
|
||||||
};
|
|
||||||
|
|
||||||
enum blake2b_constant
|
|
||||||
{
|
|
||||||
BLAKE2B_BLOCKBYTES = 128,
|
|
||||||
BLAKE2B_OUTBYTES = 64,
|
|
||||||
BLAKE2B_KEYBYTES = 64,
|
|
||||||
BLAKE2B_SALTBYTES = 16,
|
|
||||||
BLAKE2B_PERSONALBYTES = 16
|
|
||||||
};
|
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
|
||||||
typedef struct __blake2s_param
|
|
||||||
{
|
|
||||||
byte digest_length; /* 1 */
|
|
||||||
byte key_length; /* 2 */
|
|
||||||
byte fanout; /* 3 */
|
|
||||||
byte depth; /* 4 */
|
|
||||||
word32 leaf_length; /* 8 */
|
|
||||||
byte node_offset[6];/* 14 */
|
|
||||||
byte node_depth; /* 15 */
|
|
||||||
byte inner_length; /* 16 */
|
|
||||||
/* byte reserved[0]; */
|
|
||||||
byte salt[BLAKE2B_SALTBYTES]; /* 24 */
|
|
||||||
byte personal[BLAKE2S_PERSONALBYTES]; /* 32 */
|
|
||||||
} blake2s_param;
|
|
||||||
|
|
||||||
ALIGN( 64 ) typedef struct __blake2s_state
|
|
||||||
{
|
|
||||||
word32 h[8];
|
|
||||||
word32 t[2];
|
|
||||||
word32 f[2];
|
|
||||||
byte buf[2 * BLAKE2S_BLOCKBYTES];
|
|
||||||
word64 buflen;
|
|
||||||
byte last_node;
|
|
||||||
} blake2s_state ;
|
|
||||||
|
|
||||||
typedef struct __blake2b_param
|
|
||||||
{
|
|
||||||
byte digest_length; /* 1 */
|
|
||||||
byte key_length; /* 2 */
|
|
||||||
byte fanout; /* 3 */
|
|
||||||
byte depth; /* 4 */
|
|
||||||
word32 leaf_length; /* 8 */
|
|
||||||
word64 node_offset; /* 16 */
|
|
||||||
byte node_depth; /* 17 */
|
|
||||||
byte inner_length; /* 18 */
|
|
||||||
byte reserved[14]; /* 32 */
|
|
||||||
byte salt[BLAKE2B_SALTBYTES]; /* 48 */
|
|
||||||
byte personal[BLAKE2B_PERSONALBYTES]; /* 64 */
|
|
||||||
} blake2b_param;
|
|
||||||
|
|
||||||
ALIGN( 64 ) typedef struct __blake2b_state
|
|
||||||
{
|
|
||||||
word64 h[8];
|
|
||||||
word64 t[2];
|
|
||||||
word64 f[2];
|
|
||||||
byte buf[2 * BLAKE2B_BLOCKBYTES];
|
|
||||||
word64 buflen;
|
|
||||||
byte last_node;
|
|
||||||
} blake2b_state;
|
|
||||||
|
|
||||||
typedef struct __blake2sp_state
|
|
||||||
{
|
|
||||||
blake2s_state S[8][1];
|
|
||||||
blake2s_state R[1];
|
|
||||||
byte buf[8 * BLAKE2S_BLOCKBYTES];
|
|
||||||
word64 buflen;
|
|
||||||
} blake2sp_state;
|
|
||||||
|
|
||||||
typedef struct __blake2bp_state
|
|
||||||
{
|
|
||||||
blake2b_state S[4][1];
|
|
||||||
blake2b_state R[1];
|
|
||||||
byte buf[4 * BLAKE2B_BLOCKBYTES];
|
|
||||||
word64 buflen;
|
|
||||||
} blake2bp_state;
|
|
||||||
#pragma pack(pop)
|
|
||||||
|
|
||||||
/* Streaming API */
|
|
||||||
int blake2s_init( blake2s_state *S, const byte outlen );
|
|
||||||
int blake2s_init_key( blake2s_state *S, const byte outlen, const void *key, const byte keylen );
|
|
||||||
int blake2s_init_param( blake2s_state *S, const blake2s_param *P );
|
|
||||||
int blake2s_update( blake2s_state *S, const byte *in, word64 inlen );
|
|
||||||
int blake2s_final( blake2s_state *S, byte *out, byte outlen );
|
|
||||||
|
|
||||||
int blake2b_init( blake2b_state *S, const byte outlen );
|
|
||||||
int blake2b_init_key( blake2b_state *S, const byte outlen, const void *key, const byte keylen );
|
|
||||||
int blake2b_init_param( blake2b_state *S, const blake2b_param *P );
|
|
||||||
int blake2b_update( blake2b_state *S, const byte *in, word64 inlen );
|
|
||||||
int blake2b_final( blake2b_state *S, byte *out, byte outlen );
|
|
||||||
|
|
||||||
int blake2sp_init( blake2sp_state *S, const byte outlen );
|
|
||||||
int blake2sp_init_key( blake2sp_state *S, const byte outlen, const void *key, const byte keylen );
|
|
||||||
int blake2sp_update( blake2sp_state *S, const byte *in, word64 inlen );
|
|
||||||
int blake2sp_final( blake2sp_state *S, byte *out, byte outlen );
|
|
||||||
|
|
||||||
int blake2bp_init( blake2bp_state *S, const byte outlen );
|
|
||||||
int blake2bp_init_key( blake2bp_state *S, const byte outlen, const void *key, const byte keylen );
|
|
||||||
int blake2bp_update( blake2bp_state *S, const byte *in, word64 inlen );
|
|
||||||
int blake2bp_final( blake2bp_state *S, byte *out, byte outlen );
|
|
||||||
|
|
||||||
/* Simple API */
|
|
||||||
int blake2s( byte *out, const void *in, const void *key, const byte outlen, const word64 inlen, byte keylen );
|
|
||||||
int blake2b( byte *out, const void *in, const void *key, const byte outlen, const word64 inlen, byte keylen );
|
|
||||||
|
|
||||||
int blake2sp( byte *out, const void *in, const void *key, const byte outlen, const word64 inlen, byte keylen );
|
|
||||||
int blake2bp( byte *out, const void *in, const void *key, const byte outlen, const word64 inlen, byte keylen );
|
|
||||||
|
|
||||||
static inline int blake2( byte *out, const void *in, const void *key, const byte outlen, const word64 inlen, byte keylen )
|
|
||||||
{
|
|
||||||
return blake2b( out, in, key, outlen, inlen, keylen );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CTAOCRYPT_BLAKE2_INT_H */
|
#endif /* CTAOCRYPT_BLAKE2_INT_H */
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* blake2.h
|
/* blake2.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -25,35 +25,19 @@
|
||||||
#ifndef CTAOCRYPT_BLAKE2_H
|
#ifndef CTAOCRYPT_BLAKE2_H
|
||||||
#define CTAOCRYPT_BLAKE2_H
|
#define CTAOCRYPT_BLAKE2_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/blake2-int.h>
|
#include <wolfssl/wolfcrypt/blake2.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* for blake2 reverse compatibility */
|
||||||
extern "C" {
|
#ifndef HAVE_FIPS
|
||||||
#endif
|
#define InitBlake2b wc_InitBlake2b
|
||||||
|
#define Blake2bUpdate wc_Blake2bUpdate
|
||||||
/* in bytes, variable digest size up to 512 bits (64 bytes) */
|
#define Blake2bFinal wc_Blake2bFinal
|
||||||
enum {
|
#else
|
||||||
BLAKE2B_ID = 7, /* hash type unique */
|
/* name for when fips hmac calls blake */
|
||||||
BLAKE2B_256 = 32 /* 256 bit type, SSL default */
|
#define wc_InitBlake2b InitBlake2b
|
||||||
};
|
#define wc_Blake2bUpdate Blake2bUpdate
|
||||||
|
#define wc_Blake2bFinal Blake2bFinal
|
||||||
|
#endif /* HAVE_FIPS */
|
||||||
/* BLAKE2b digest */
|
|
||||||
typedef struct Blake2b {
|
|
||||||
blake2b_state S[1]; /* our state */
|
|
||||||
word32 digestSz; /* digest size used on init */
|
|
||||||
} Blake2b;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API int InitBlake2b(Blake2b*, word32);
|
|
||||||
CYASSL_API int Blake2bUpdate(Blake2b*, const byte*, word32);
|
|
||||||
CYASSL_API int Blake2bFinal(Blake2b*, byte*, word32);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CTAOCRYPT_BLAKE2_H */
|
#endif /* CTAOCRYPT_BLAKE2_H */
|
||||||
#endif /* HAVE_BLAKE2 */
|
#endif /* HAVE_BLAKE2 */
|
||||||
|
|
|
@ -1,42 +1,15 @@
|
||||||
/* camellia.h ver 1.2.0
|
|
||||||
*
|
|
||||||
* Copyright (c) 2006,2007
|
|
||||||
* NTT (Nippon Telegraph and Telephone Corporation) . All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer as
|
|
||||||
* the first lines of this file unmodified.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY NTT ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
* IN NO EVENT SHALL NTT BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* camellia.h
|
/* camellia.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -46,51 +19,20 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CAMELLIA
|
|
||||||
|
|
||||||
#ifndef CTAO_CRYPT_CAMELLIA_H
|
#ifndef CTAO_CRYPT_CAMELLIA_H
|
||||||
#define CTAO_CRYPT_CAMELLIA_H
|
#define CTAO_CRYPT_CAMELLIA_H
|
||||||
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
/* for camellia reverse compatibility */
|
||||||
|
#ifdef HAVE_CAMELLIA
|
||||||
#ifdef __cplusplus
|
#include <wolfssl/wolfcrypt/camellia.h>
|
||||||
extern "C" {
|
#define CamelliaSetKey wc_CamelliaSetKey
|
||||||
|
#define CamelliaSetIV wc_CamelliaSetIV
|
||||||
|
#define CamelliaEncryptDirect wc_CamelliaEncryptDirect
|
||||||
|
#define CamelliaDecryptDirect wc_CamelliaDecryptDirect
|
||||||
|
#define CamelliaCbcEncrypt wc_CamelliaCbcEncrypt
|
||||||
|
#define CamelliaCbcDecrypt wc_CamelliaCbcDecrypt
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* CTAO_CRYPT_CAMELLIA_H */
|
||||||
enum {
|
|
||||||
CAMELLIA_BLOCK_SIZE = 16
|
|
||||||
};
|
|
||||||
|
|
||||||
#define CAMELLIA_TABLE_BYTE_LEN 272
|
|
||||||
#define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / sizeof(word32))
|
|
||||||
|
|
||||||
typedef word32 KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN];
|
|
||||||
|
|
||||||
typedef struct Camellia {
|
|
||||||
word32 keySz;
|
|
||||||
KEY_TABLE_TYPE key;
|
|
||||||
word32 reg[CAMELLIA_BLOCK_SIZE / sizeof(word32)]; /* for CBC mode */
|
|
||||||
word32 tmp[CAMELLIA_BLOCK_SIZE / sizeof(word32)]; /* for CBC mode */
|
|
||||||
} Camellia;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API int CamelliaSetKey(Camellia* cam,
|
|
||||||
const byte* key, word32 len, const byte* iv);
|
|
||||||
CYASSL_API int CamelliaSetIV(Camellia* cam, const byte* iv);
|
|
||||||
CYASSL_API void CamelliaEncryptDirect(Camellia* cam, byte* out, const byte* in);
|
|
||||||
CYASSL_API void CamelliaDecryptDirect(Camellia* cam, byte* out, const byte* in);
|
|
||||||
CYASSL_API void CamelliaCbcEncrypt(Camellia* cam,
|
|
||||||
byte* out, const byte* in, word32 sz);
|
|
||||||
CYASSL_API void CamelliaCbcDecrypt(Camellia* cam,
|
|
||||||
byte* out, const byte* in, word32 sz);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_AES_H */
|
|
||||||
#endif /* HAVE_CAMELLIA */
|
|
||||||
|
|
||||||
|
|
35
FreeRTOS-Plus/Source/WolfSSL/cyassl/ctaocrypt/chacha.h
Normal file
35
FreeRTOS-Plus/Source/WolfSSL/cyassl/ctaocrypt/chacha.h
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/* chacha.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
|
*
|
||||||
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
|
*
|
||||||
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CTAO_CRYPT_CHACHA_H
|
||||||
|
#define CTAO_CRYPT_CHACHA_H
|
||||||
|
|
||||||
|
|
||||||
|
/* for chacha reverse compatibility */
|
||||||
|
#ifdef HAVE_CHACHA
|
||||||
|
#include <wolfssl/wolfcrypt/chacha.h>
|
||||||
|
#define Chacha_Process wc_Chacha_Process
|
||||||
|
#define Chacha_SetKey wc_Chacha_SetKey
|
||||||
|
#define Chacha_SetIV wc_Chacha_SetIV
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* CTAO_CRYPT_CHACHA_H */
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* coding.h
|
/* coding.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -23,36 +23,7 @@
|
||||||
#ifndef CTAO_CRYPT_CODING_H
|
#ifndef CTAO_CRYPT_CODING_H
|
||||||
#define CTAO_CRYPT_CODING_H
|
#define CTAO_CRYPT_CODING_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <wolfssl/wolfcrypt/coding.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* decode needed by CyaSSL */
|
|
||||||
CYASSL_LOCAL int Base64_Decode(const byte* in, word32 inLen, byte* out,
|
|
||||||
word32* outLen);
|
|
||||||
|
|
||||||
#if defined(OPENSSL_EXTRA) || defined(SESSION_CERTS) || defined(CYASSL_KEY_GEN) || defined(CYASSL_CERT_GEN) || defined(HAVE_WEBSERVER)
|
|
||||||
/* encode isn't */
|
|
||||||
CYASSL_API
|
|
||||||
int Base64_Encode(const byte* in, word32 inLen, byte* out,
|
|
||||||
word32* outLen);
|
|
||||||
CYASSL_API
|
|
||||||
int Base64_EncodeEsc(const byte* in, word32 inLen, byte* out,
|
|
||||||
word32* outLen);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) || defined(HAVE_FIPS)
|
|
||||||
CYASSL_API
|
|
||||||
int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_CODING_H */
|
#endif /* CTAO_CRYPT_CODING_H */
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* compress.h
|
/* compress.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -25,26 +25,11 @@
|
||||||
#ifndef CTAO_CRYPT_COMPRESS_H
|
#ifndef CTAO_CRYPT_COMPRESS_H
|
||||||
#define CTAO_CRYPT_COMPRESS_H
|
#define CTAO_CRYPT_COMPRESS_H
|
||||||
|
|
||||||
|
#include <wolfssl/wolfcrypt/compress.h>
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
/* reverse compatibility */
|
||||||
|
#define Compress wc_Compress
|
||||||
|
#define DeCompress wc_DeCompress
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#define COMPRESS_FIXED 1
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API int Compress(byte*, word32, const byte*, word32, word32);
|
|
||||||
CYASSL_API int DeCompress(byte*, word32, const byte*, word32);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_COMPRESS_H */
|
#endif /* CTAO_CRYPT_COMPRESS_H */
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* des3.h
|
/* des3.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -26,100 +26,21 @@
|
||||||
#define CTAO_CRYPT_DES3_H
|
#define CTAO_CRYPT_DES3_H
|
||||||
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <wolfssl/wolfcrypt/des3.h>
|
||||||
|
#define Des_SetKey wc_Des_SetKey
|
||||||
|
#define Des_SetIV wc_Des_SetIV
|
||||||
#ifdef __cplusplus
|
#define Des_CbcEncrypt wc_Des_CbcEncrypt
|
||||||
extern "C" {
|
#define Des_CbcDecrypt wc_Des_CbcDecrypt
|
||||||
#endif
|
#define Des_EcbEncrypt wc_Des_EcbEncrypt
|
||||||
|
#define Des_CbcDecryptWithKey wc_Des_CbcDecryptWithKey
|
||||||
#define CYASSL_3DES_CAVIUM_MAGIC 0xBEEF0003
|
#define Des3_SetKey wc_Des3_SetKey
|
||||||
|
#define Des3_SetIV wc_Des3_SetIV
|
||||||
enum {
|
#define Des3_CbcEncrypt wc_Des3_CbcEncrypt
|
||||||
DES_ENC_TYPE = 2, /* cipher unique type */
|
#define Des3_CbcDecrypt wc_Des3_CbcDecrypt
|
||||||
DES3_ENC_TYPE = 3, /* cipher unique type */
|
#define Des3_CbcDecryptWithKey wc_Des3_CbcDecryptWithKey
|
||||||
DES_BLOCK_SIZE = 8,
|
|
||||||
DES_KS_SIZE = 32,
|
|
||||||
|
|
||||||
DES_ENCRYPTION = 0,
|
|
||||||
DES_DECRYPTION = 1
|
|
||||||
};
|
|
||||||
|
|
||||||
#define DES_IVLEN 8
|
|
||||||
#define DES_KEYLEN 8
|
|
||||||
#define DES3_IVLEN 8
|
|
||||||
#define DES3_KEYLEN 24
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef STM32F2_CRYPTO
|
|
||||||
enum {
|
|
||||||
DES_CBC = 0,
|
|
||||||
DES_ECB = 1
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* DES encryption and decryption */
|
|
||||||
typedef struct Des {
|
|
||||||
word32 reg[DES_BLOCK_SIZE / sizeof(word32)]; /* for CBC mode */
|
|
||||||
word32 tmp[DES_BLOCK_SIZE / sizeof(word32)]; /* same */
|
|
||||||
word32 key[DES_KS_SIZE];
|
|
||||||
} Des;
|
|
||||||
|
|
||||||
|
|
||||||
/* DES3 encryption and decryption */
|
|
||||||
typedef struct Des3 {
|
|
||||||
word32 key[3][DES_KS_SIZE];
|
|
||||||
word32 reg[DES_BLOCK_SIZE / sizeof(word32)]; /* for CBC mode */
|
|
||||||
word32 tmp[DES_BLOCK_SIZE / sizeof(word32)]; /* same */
|
|
||||||
#ifdef HAVE_CAVIUM
|
#ifdef HAVE_CAVIUM
|
||||||
int devId; /* nitrox device id */
|
#define Des3_InitCavium wc_Des3_InitCavium
|
||||||
word32 magic; /* using cavium magic */
|
#define Des3_FreeCavium wc_Des3_FreeCavium
|
||||||
word64 contextHandle; /* nitrox context memory handle */
|
|
||||||
#endif
|
|
||||||
} Des3;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API int Des_SetKey(Des* des, const byte* key, const byte* iv, int dir);
|
|
||||||
CYASSL_API void Des_SetIV(Des* des, const byte* iv);
|
|
||||||
CYASSL_API int Des_CbcEncrypt(Des* des, byte* out, const byte* in, word32 sz);
|
|
||||||
CYASSL_API int Des_CbcDecrypt(Des* des, byte* out, const byte* in, word32 sz);
|
|
||||||
CYASSL_API int Des_EcbEncrypt(Des* des, byte* out, const byte* in, word32 sz);
|
|
||||||
|
|
||||||
CYASSL_API int Des3_SetKey(Des3* des, const byte* key, const byte* iv,int dir);
|
|
||||||
CYASSL_API int Des3_SetIV(Des3* des, const byte* iv);
|
|
||||||
CYASSL_API int Des3_CbcEncrypt(Des3* des, byte* out, const byte* in,word32 sz);
|
|
||||||
CYASSL_API int Des3_CbcDecrypt(Des3* des, byte* out, const byte* in,word32 sz);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
CYASSL_API int Des3_InitCavium(Des3*, int);
|
|
||||||
CYASSL_API void Des3_FreeCavium(Des3*);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_FIPS
|
|
||||||
/* fips wrapper calls, user can call direct */
|
|
||||||
CYASSL_API int Des3_SetKey_fips(Des3* des, const byte* key, const byte* iv,
|
|
||||||
int dir);
|
|
||||||
CYASSL_API int Des3_SetIV_fips(Des3* des, const byte* iv);
|
|
||||||
CYASSL_API int Des3_CbcEncrypt_fips(Des3* des, byte* out, const byte* in,
|
|
||||||
word32 sz);
|
|
||||||
CYASSL_API int Des3_CbcDecrypt_fips(Des3* des, byte* out, const byte* in,
|
|
||||||
word32 sz);
|
|
||||||
#ifndef FIPS_NO_WRAPPERS
|
|
||||||
/* if not impl or fips.c impl wrapper force fips calls if fips build */
|
|
||||||
#define Des3_SetKey Des3_SetKey_fips
|
|
||||||
#define Des3_SetIV Des3_SetIV_fips
|
|
||||||
#define Des3_CbcEncrypt Des3_CbcEncrypt_fips
|
|
||||||
#define Des3_CbcDecrypt Des3_CbcDecrypt_fips
|
|
||||||
#endif /* FIPS_NO_WRAPPERS */
|
|
||||||
|
|
||||||
#endif /* HAVE_FIPS */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* NO_DES3 */
|
#endif /* NO_DES3 */
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* dh.h
|
/* dh.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -25,41 +25,15 @@
|
||||||
#ifndef CTAO_CRYPT_DH_H
|
#ifndef CTAO_CRYPT_DH_H
|
||||||
#define CTAO_CRYPT_DH_H
|
#define CTAO_CRYPT_DH_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
/* for dh reverse compatibility */
|
||||||
#include <cyassl/ctaocrypt/integer.h>
|
#include <wolfssl/wolfcrypt/dh.h>
|
||||||
#include <cyassl/ctaocrypt/random.h>
|
#define InitDhKey wc_InitDhKey
|
||||||
|
#define FreeDhKey wc_FreeDhKey
|
||||||
#ifdef __cplusplus
|
#define DhGenerateKeyPair wc_DhGenerateKeyPair
|
||||||
extern "C" {
|
#define DhAgree wc_DhAgree
|
||||||
#endif
|
#define DhKeyDecode wc_DhKeyDecode
|
||||||
|
#define DhSetKey wc_DhSetKey
|
||||||
|
#define DhParamsLoad wc_DhParamsLoad
|
||||||
/* Diffie-Hellman Key */
|
|
||||||
typedef struct DhKey {
|
|
||||||
mp_int p, g; /* group parameters */
|
|
||||||
} DhKey;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API void InitDhKey(DhKey* key);
|
|
||||||
CYASSL_API void FreeDhKey(DhKey* key);
|
|
||||||
|
|
||||||
CYASSL_API int DhGenerateKeyPair(DhKey* key, RNG* rng, byte* priv,
|
|
||||||
word32* privSz, byte* pub, word32* pubSz);
|
|
||||||
CYASSL_API int DhAgree(DhKey* key, byte* agree, word32* agreeSz,
|
|
||||||
const byte* priv, word32 privSz, const byte* otherPub,
|
|
||||||
word32 pubSz);
|
|
||||||
|
|
||||||
CYASSL_API int DhKeyDecode(const byte* input, word32* inOutIdx, DhKey* key,
|
|
||||||
word32);
|
|
||||||
CYASSL_API int DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g,
|
|
||||||
word32 gSz);
|
|
||||||
CYASSL_API int DhParamsLoad(const byte* input, word32 inSz, byte* p,
|
|
||||||
word32* pInOutSz, byte* g, word32* gInOutSz);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_DH_H */
|
#endif /* CTAO_CRYPT_DH_H */
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* dsa.h
|
/* dsa.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -25,42 +25,7 @@
|
||||||
#ifndef CTAO_CRYPT_DSA_H
|
#ifndef CTAO_CRYPT_DSA_H
|
||||||
#define CTAO_CRYPT_DSA_H
|
#define CTAO_CRYPT_DSA_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <wolfssl/wolfcrypt/dsa.h>
|
||||||
#include <cyassl/ctaocrypt/integer.h>
|
|
||||||
#include <cyassl/ctaocrypt/random.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
enum {
|
|
||||||
DSA_PUBLIC = 0,
|
|
||||||
DSA_PRIVATE = 1
|
|
||||||
};
|
|
||||||
|
|
||||||
/* DSA */
|
|
||||||
typedef struct DsaKey {
|
|
||||||
mp_int p, q, g, y, x;
|
|
||||||
int type; /* public or private */
|
|
||||||
} DsaKey;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API void InitDsaKey(DsaKey* key);
|
|
||||||
CYASSL_API void FreeDsaKey(DsaKey* key);
|
|
||||||
|
|
||||||
CYASSL_API int DsaSign(const byte* digest, byte* out, DsaKey* key, RNG* rng);
|
|
||||||
CYASSL_API int DsaVerify(const byte* digest, const byte* sig, DsaKey* key,
|
|
||||||
int* answer);
|
|
||||||
|
|
||||||
CYASSL_API int DsaPublicKeyDecode(const byte* input, word32* inOutIdx, DsaKey*,
|
|
||||||
word32);
|
|
||||||
CYASSL_API int DsaPrivateKeyDecode(const byte* input, word32* inOutIdx, DsaKey*,
|
|
||||||
word32);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_DSA_H */
|
#endif /* CTAO_CRYPT_DSA_H */
|
||||||
#endif /* NO_DSA */
|
#endif /* NO_DSA */
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* ecc.h
|
/* ecc.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -24,161 +24,45 @@
|
||||||
#ifndef CTAO_CRYPT_ECC_H
|
#ifndef CTAO_CRYPT_ECC_H
|
||||||
#define CTAO_CRYPT_ECC_H
|
#define CTAO_CRYPT_ECC_H
|
||||||
|
|
||||||
|
#include <wolfssl/wolfcrypt/ecc.h>
|
||||||
|
|
||||||
|
/* includes for compatibility */
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <cyassl/ctaocrypt/types.h>
|
||||||
#include <cyassl/ctaocrypt/integer.h>
|
#include <cyassl/ctaocrypt/integer.h>
|
||||||
#include <cyassl/ctaocrypt/random.h>
|
#include <cyassl/ctaocrypt/random.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* for ecc reverse compatibility */
|
||||||
extern "C" {
|
#ifdef HAVE_ECC
|
||||||
#endif
|
#define ecc_make_key wc_ecc_make_key
|
||||||
|
#define ecc_shared_secret wc_ecc_shared_secret
|
||||||
|
#define ecc_sign_hash wc_ecc_sign_hash
|
||||||
enum {
|
#define ecc_verify_hash wc_ecc_verify_hash
|
||||||
ECC_PUBLICKEY = 1,
|
#define ecc_init wc_ecc_init
|
||||||
ECC_PRIVATEKEY = 2,
|
#define ecc_free wc_ecc_free
|
||||||
ECC_MAXNAME = 16, /* MAX CURVE NAME LENGTH */
|
#define ecc_fp_free wc_ecc_fp_free
|
||||||
SIG_HEADER_SZ = 6, /* ECC signature header size */
|
#define ecc_export_x963 wc_ecc_export_x963
|
||||||
ECC_BUFSIZE = 256, /* for exported keys temp buffer */
|
#define ecc_size wc_ecc_size
|
||||||
ECC_MINSIZE = 20, /* MIN Private Key size */
|
#define ecc_sig_size wc_ecc_sig_size
|
||||||
ECC_MAXSIZE = 66 /* MAX Private Key size */
|
#define ecc_export_x963_ex wc_ecc_export_x963_ex
|
||||||
};
|
#define ecc_import_x963 wc_ecc_import_x963
|
||||||
|
#define ecc_import_private_key wc_ecc_import_private_key
|
||||||
|
#define ecc_rs_to_sig wc_ecc_rs_to_sig
|
||||||
/* ECC set type defined a NIST GF(p) curve */
|
#define ecc_import_raw wc_ecc_import_raw
|
||||||
typedef struct {
|
#define ecc_export_private_only wc_ecc_export_private_only
|
||||||
int size; /* The size of the curve in octets */
|
|
||||||
const char* name; /* name of this curve */
|
|
||||||
const char* prime; /* prime that defines the field, curve is in (hex) */
|
|
||||||
const char* Bf; /* fields B param (hex) */
|
|
||||||
const char* order; /* order of the curve (hex) */
|
|
||||||
const char* Gx; /* x coordinate of the base point on curve (hex) */
|
|
||||||
const char* Gy; /* y coordinate of the base point on curve (hex) */
|
|
||||||
} ecc_set_type;
|
|
||||||
|
|
||||||
|
|
||||||
/* A point on an ECC curve, stored in Jacbobian format such that (x,y,z) =>
|
|
||||||
(x/z^2, y/z^3, 1) when interpreted as affine */
|
|
||||||
typedef struct {
|
|
||||||
mp_int x; /* The x coordinate */
|
|
||||||
mp_int y; /* The y coordinate */
|
|
||||||
mp_int z; /* The z coordinate */
|
|
||||||
} ecc_point;
|
|
||||||
|
|
||||||
|
|
||||||
/* An ECC Key */
|
|
||||||
typedef struct {
|
|
||||||
int type; /* Public or Private */
|
|
||||||
int idx; /* Index into the ecc_sets[] for the parameters of
|
|
||||||
this curve if -1, this key is using user supplied
|
|
||||||
curve in dp */
|
|
||||||
const ecc_set_type* dp; /* domain parameters, either points to NIST
|
|
||||||
curves (idx >= 0) or user supplied */
|
|
||||||
ecc_point pubkey; /* public key */
|
|
||||||
mp_int k; /* private key */
|
|
||||||
} ecc_key;
|
|
||||||
|
|
||||||
|
|
||||||
/* ECC predefined curve sets */
|
|
||||||
extern const ecc_set_type ecc_sets[];
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API
|
|
||||||
int ecc_make_key(RNG* rng, int keysize, ecc_key* key);
|
|
||||||
CYASSL_API
|
|
||||||
int ecc_shared_secret(ecc_key* private_key, ecc_key* public_key, byte* out,
|
|
||||||
word32* outlen);
|
|
||||||
CYASSL_API
|
|
||||||
int ecc_sign_hash(const byte* in, word32 inlen, byte* out, word32 *outlen,
|
|
||||||
RNG* rng, ecc_key* key);
|
|
||||||
CYASSL_API
|
|
||||||
int ecc_verify_hash(const byte* sig, word32 siglen, const byte* hash,
|
|
||||||
word32 hashlen, int* stat, ecc_key* key);
|
|
||||||
CYASSL_API
|
|
||||||
void ecc_init(ecc_key* key);
|
|
||||||
CYASSL_API
|
|
||||||
void ecc_free(ecc_key* key);
|
|
||||||
CYASSL_API
|
|
||||||
void ecc_fp_free(void);
|
|
||||||
|
|
||||||
|
|
||||||
/* ASN key helpers */
|
|
||||||
CYASSL_API
|
|
||||||
int ecc_export_x963(ecc_key*, byte* out, word32* outLen);
|
|
||||||
CYASSL_API
|
|
||||||
int ecc_import_x963(const byte* in, word32 inLen, ecc_key* key);
|
|
||||||
CYASSL_API
|
|
||||||
int ecc_import_private_key(const byte* priv, word32 privSz, const byte* pub,
|
|
||||||
word32 pubSz, ecc_key* key);
|
|
||||||
CYASSL_API
|
|
||||||
int ecc_export_private_only(ecc_key* key, byte* out, word32* outLen);
|
|
||||||
|
|
||||||
/* size helper */
|
|
||||||
CYASSL_API
|
|
||||||
int ecc_size(ecc_key* key);
|
|
||||||
CYASSL_API
|
|
||||||
int ecc_sig_size(ecc_key* key);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_ECC_ENCRYPT
|
#ifdef HAVE_ECC_ENCRYPT
|
||||||
/* ecc encrypt */
|
/* ecc encrypt */
|
||||||
|
#define ecc_ctx_new wc_ecc_ctx_new
|
||||||
enum ecEncAlgo {
|
#define ecc_ctx_free wc_ecc_ctx_free
|
||||||
ecAES_128_CBC = 1, /* default */
|
#define ecc_ctx_reset wc_ecc_ctx_reset
|
||||||
ecAES_256_CBC = 2
|
#define ecc_ctx_get_own_salt wc_ecc_ctx_get_own_salt
|
||||||
};
|
#define ecc_ctx_set_peer_salt wc_ecc_ctx_set_peer_salt
|
||||||
|
#define ecc_ctx_set_info wc_ecc_ctx_set_info
|
||||||
enum ecKdfAlgo {
|
#define ecc_encrypt wc_ecc_encrypt
|
||||||
ecHKDF_SHA256 = 1, /* default */
|
#define ecc_decrypt wc_ecc_decrypt
|
||||||
ecHKDF_SHA1 = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ecMacAlgo {
|
|
||||||
ecHMAC_SHA256 = 1, /* default */
|
|
||||||
ecHMAC_SHA1 = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
|
||||||
KEY_SIZE_128 = 16,
|
|
||||||
KEY_SIZE_256 = 32,
|
|
||||||
IV_SIZE_64 = 8,
|
|
||||||
EXCHANGE_SALT_SZ = 16,
|
|
||||||
EXCHANGE_INFO_SZ = 23
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ecFlags {
|
|
||||||
REQ_RESP_CLIENT = 1,
|
|
||||||
REQ_RESP_SERVER = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct ecEncCtx ecEncCtx;
|
|
||||||
|
|
||||||
CYASSL_API
|
|
||||||
ecEncCtx* ecc_ctx_new(int flags, RNG* rng);
|
|
||||||
CYASSL_API
|
|
||||||
void ecc_ctx_free(ecEncCtx*);
|
|
||||||
CYASSL_API
|
|
||||||
int ecc_ctx_reset(ecEncCtx*, RNG*); /* reset for use again w/o alloc/free */
|
|
||||||
|
|
||||||
CYASSL_API
|
|
||||||
const byte* ecc_ctx_get_own_salt(ecEncCtx*);
|
|
||||||
CYASSL_API
|
|
||||||
int ecc_ctx_set_peer_salt(ecEncCtx*, const byte* salt);
|
|
||||||
CYASSL_API
|
|
||||||
int ecc_ctx_set_info(ecEncCtx*, const byte* info, int sz);
|
|
||||||
|
|
||||||
CYASSL_API
|
|
||||||
int ecc_encrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
|
|
||||||
word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx);
|
|
||||||
CYASSL_API
|
|
||||||
int ecc_decrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
|
|
||||||
word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx);
|
|
||||||
|
|
||||||
#endif /* HAVE_ECC_ENCRYPT */
|
#endif /* HAVE_ECC_ENCRYPT */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_ECC_H */
|
#endif /* CTAO_CRYPT_ECC_H */
|
||||||
#endif /* HAVE_ECC */
|
#endif /* HAVE_ECC */
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* error-crypt.h
|
/* error-crypt.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -23,124 +23,10 @@
|
||||||
#ifndef CTAO_CRYPT_ERROR_H
|
#ifndef CTAO_CRYPT_ERROR_H
|
||||||
#define CTAO_CRYPT_ERROR_H
|
#define CTAO_CRYPT_ERROR_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
/* for name change and fips compatibility @wc_fips */
|
||||||
|
#include <wolfssl/wolfcrypt/error-crypt.h>
|
||||||
|
#define CTaoCryptErrorString wc_ErrorString
|
||||||
#ifdef __cplusplus
|
#define CTaoCryptGetErrorString wc_GetErrorString
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* error codes */
|
|
||||||
enum {
|
|
||||||
MAX_CODE_E = -100, /* errors -101 - -299 */
|
|
||||||
OPEN_RAN_E = -101, /* opening random device error */
|
|
||||||
READ_RAN_E = -102, /* reading random device error */
|
|
||||||
WINCRYPT_E = -103, /* windows crypt init error */
|
|
||||||
CRYPTGEN_E = -104, /* windows crypt generation error */
|
|
||||||
RAN_BLOCK_E = -105, /* reading random device would block */
|
|
||||||
BAD_MUTEX_E = -106, /* Bad mutex operation */
|
|
||||||
|
|
||||||
MP_INIT_E = -110, /* mp_init error state */
|
|
||||||
MP_READ_E = -111, /* mp_read error state */
|
|
||||||
MP_EXPTMOD_E = -112, /* mp_exptmod error state */
|
|
||||||
MP_TO_E = -113, /* mp_to_xxx error state, can't convert */
|
|
||||||
MP_SUB_E = -114, /* mp_sub error state, can't subtract */
|
|
||||||
MP_ADD_E = -115, /* mp_add error state, can't add */
|
|
||||||
MP_MUL_E = -116, /* mp_mul error state, can't multiply */
|
|
||||||
MP_MULMOD_E = -117, /* mp_mulmod error state, can't multiply mod */
|
|
||||||
MP_MOD_E = -118, /* mp_mod error state, can't mod */
|
|
||||||
MP_INVMOD_E = -119, /* mp_invmod error state, can't inv mod */
|
|
||||||
MP_CMP_E = -120, /* mp_cmp error state */
|
|
||||||
MP_ZERO_E = -121, /* got a mp zero result, not expected */
|
|
||||||
|
|
||||||
MEMORY_E = -125, /* out of memory error */
|
|
||||||
|
|
||||||
RSA_WRONG_TYPE_E = -130, /* RSA wrong block type for RSA function */
|
|
||||||
RSA_BUFFER_E = -131, /* RSA buffer error, output too small or
|
|
||||||
input too large */
|
|
||||||
BUFFER_E = -132, /* output buffer too small or input too large */
|
|
||||||
ALGO_ID_E = -133, /* setting algo id error */
|
|
||||||
PUBLIC_KEY_E = -134, /* setting public key error */
|
|
||||||
DATE_E = -135, /* setting date validity error */
|
|
||||||
SUBJECT_E = -136, /* setting subject name error */
|
|
||||||
ISSUER_E = -137, /* setting issuer name error */
|
|
||||||
CA_TRUE_E = -138, /* setting CA basic constraint true error */
|
|
||||||
EXTENSIONS_E = -139, /* setting extensions error */
|
|
||||||
|
|
||||||
ASN_PARSE_E = -140, /* ASN parsing error, invalid input */
|
|
||||||
ASN_VERSION_E = -141, /* ASN version error, invalid number */
|
|
||||||
ASN_GETINT_E = -142, /* ASN get big int error, invalid data */
|
|
||||||
ASN_RSA_KEY_E = -143, /* ASN key init error, invalid input */
|
|
||||||
ASN_OBJECT_ID_E = -144, /* ASN object id error, invalid id */
|
|
||||||
ASN_TAG_NULL_E = -145, /* ASN tag error, not null */
|
|
||||||
ASN_EXPECT_0_E = -146, /* ASN expect error, not zero */
|
|
||||||
ASN_BITSTR_E = -147, /* ASN bit string error, wrong id */
|
|
||||||
ASN_UNKNOWN_OID_E = -148, /* ASN oid error, unknown sum id */
|
|
||||||
ASN_DATE_SZ_E = -149, /* ASN date error, bad size */
|
|
||||||
ASN_BEFORE_DATE_E = -150, /* ASN date error, current date before */
|
|
||||||
ASN_AFTER_DATE_E = -151, /* ASN date error, current date after */
|
|
||||||
ASN_SIG_OID_E = -152, /* ASN signature error, mismatched oid */
|
|
||||||
ASN_TIME_E = -153, /* ASN time error, unknown time type */
|
|
||||||
ASN_INPUT_E = -154, /* ASN input error, not enough data */
|
|
||||||
ASN_SIG_CONFIRM_E = -155, /* ASN sig error, confirm failure */
|
|
||||||
ASN_SIG_HASH_E = -156, /* ASN sig error, unsupported hash type */
|
|
||||||
ASN_SIG_KEY_E = -157, /* ASN sig error, unsupported key type */
|
|
||||||
ASN_DH_KEY_E = -158, /* ASN key init error, invalid input */
|
|
||||||
ASN_NTRU_KEY_E = -159, /* ASN ntru key decode error, invalid input */
|
|
||||||
ASN_CRIT_EXT_E = -160, /* ASN unsupported critical extension */
|
|
||||||
|
|
||||||
ECC_BAD_ARG_E = -170, /* ECC input argument of wrong type */
|
|
||||||
ASN_ECC_KEY_E = -171, /* ASN ECC bad input */
|
|
||||||
ECC_CURVE_OID_E = -172, /* Unsupported ECC OID curve type */
|
|
||||||
BAD_FUNC_ARG = -173, /* Bad function argument provided */
|
|
||||||
NOT_COMPILED_IN = -174, /* Feature not compiled in */
|
|
||||||
UNICODE_SIZE_E = -175, /* Unicode password too big */
|
|
||||||
NO_PASSWORD = -176, /* no password provided by user */
|
|
||||||
ALT_NAME_E = -177, /* alt name size problem, too big */
|
|
||||||
|
|
||||||
AES_GCM_AUTH_E = -180, /* AES-GCM Authentication check failure */
|
|
||||||
AES_CCM_AUTH_E = -181, /* AES-CCM Authentication check failure */
|
|
||||||
|
|
||||||
CAVIUM_INIT_E = -182, /* Cavium Init type error */
|
|
||||||
|
|
||||||
COMPRESS_INIT_E = -183, /* Compress init error */
|
|
||||||
COMPRESS_E = -184, /* Compress error */
|
|
||||||
DECOMPRESS_INIT_E = -185, /* DeCompress init error */
|
|
||||||
DECOMPRESS_E = -186, /* DeCompress error */
|
|
||||||
|
|
||||||
BAD_ALIGN_E = -187, /* Bad alignment for operation, no alloc */
|
|
||||||
ASN_NO_SIGNER_E = -188, /* ASN no signer to confirm failure */
|
|
||||||
ASN_CRL_CONFIRM_E = -189, /* ASN CRL signature confirm failure */
|
|
||||||
ASN_CRL_NO_SIGNER_E = -190, /* ASN CRL no signer to confirm failure */
|
|
||||||
ASN_OCSP_CONFIRM_E = -191, /* ASN OCSP signature confirm failure */
|
|
||||||
|
|
||||||
BAD_ENC_STATE_E = -192, /* Bad ecc enc state operation */
|
|
||||||
BAD_PADDING_E = -193, /* Bad padding, msg not correct length */
|
|
||||||
|
|
||||||
REQ_ATTRIBUTE_E = -194, /* setting cert request attributes error */
|
|
||||||
|
|
||||||
PKCS7_OID_E = -195, /* PKCS#7, mismatched OID error */
|
|
||||||
PKCS7_RECIP_E = -196, /* PKCS#7, recipient error */
|
|
||||||
FIPS_NOT_ALLOWED_E = -197, /* FIPS not allowed error */
|
|
||||||
ASN_NAME_INVALID_E = -198, /* ASN name constraint error */
|
|
||||||
|
|
||||||
RNG_FAILURE_E = -199, /* RNG Failed, Reinitialize */
|
|
||||||
|
|
||||||
HMAC_MIN_KEYLEN_E = -200, /* FIPS Mode HMAC Minimum Key Length error */
|
|
||||||
|
|
||||||
MIN_CODE_E = -300 /* errors -101 - -299 */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API void CTaoCryptErrorString(int err, char* buff);
|
|
||||||
CYASSL_API const char* CTaoCryptGetErrorString(int error);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_ERROR_H */
|
#endif /* CTAO_CRYPT_ERROR_H */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* fips_test.h
|
/* fips_test.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -30,9 +30,24 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Known Answer Test string inputs are hex */
|
/* Known Answer Test string inputs are hex, internal */
|
||||||
|
CYASSL_LOCAL int DoKnownAnswerTests(char*, int);
|
||||||
|
|
||||||
CYASSL_LOCAL int DoKnownAnswerTests(void);
|
|
||||||
|
/* FIPS failure callback */
|
||||||
|
typedef void(*wolfCrypt_fips_cb)(int ok, int err, const char* hash);
|
||||||
|
|
||||||
|
/* Public set function */
|
||||||
|
CYASSL_API int wolfCrypt_SetCb_fips(wolfCrypt_fips_cb cbf);
|
||||||
|
|
||||||
|
/* Public get status functions */
|
||||||
|
CYASSL_API int wolfCrypt_GetStatus_fips(void);
|
||||||
|
CYASSL_API const char* wolfCrypt_GetCoreHash_fips(void);
|
||||||
|
|
||||||
|
#ifdef HAVE_FORCE_FIPS_FAILURE
|
||||||
|
/* Public function to force failure mode for operational testing */
|
||||||
|
CYASSL_API int wolfCrypt_SetStatus_fips(int);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* hc128.h
|
/* hc128.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -25,36 +25,15 @@
|
||||||
#ifndef CTAO_CRYPT_HC128_H
|
#ifndef CTAO_CRYPT_HC128_H
|
||||||
#define CTAO_CRYPT_HC128_H
|
#define CTAO_CRYPT_HC128_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <wolfssl/wolfcrypt/hc128.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* for hc128 reverse compatibility */
|
||||||
extern "C" {
|
#ifdef HAVE_HC128
|
||||||
#endif
|
#define Hc128_Process wc_Hc128_Process
|
||||||
|
#define Hc128_SetKey wc_Hc128_SetKey
|
||||||
|
|
||||||
enum {
|
|
||||||
HC128_ENC_TYPE = 6 /* cipher unique type */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* HC-128 stream cipher */
|
|
||||||
typedef struct HC128 {
|
|
||||||
word32 T[1024]; /* P[i] = T[i]; Q[i] = T[1024 + i ]; */
|
|
||||||
word32 X[16];
|
|
||||||
word32 Y[16];
|
|
||||||
word32 counter1024; /* counter1024 = i mod 1024 at the ith step */
|
|
||||||
word32 key[8];
|
|
||||||
word32 iv[8];
|
|
||||||
} HC128;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API int Hc128_Process(HC128*, byte*, const byte*, word32);
|
|
||||||
CYASSL_API int Hc128_SetKey(HC128*, const byte* key, const byte* iv);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_HC128_H */
|
#endif /* CTAO_CRYPT_HC128_H */
|
||||||
|
|
||||||
#endif /* HAVE_HC128 */
|
#endif /* HAVE_HC128 */
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* hmac.h
|
/* hmac.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -25,176 +25,19 @@
|
||||||
#ifndef CTAO_CRYPT_HMAC_H
|
#ifndef CTAO_CRYPT_HMAC_H
|
||||||
#define CTAO_CRYPT_HMAC_H
|
#define CTAO_CRYPT_HMAC_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <wolfssl/wolfcrypt/hmac.h>
|
||||||
|
#define HmacSetKey wc_HmacSetKey
|
||||||
#ifndef NO_MD5
|
#define HmacUpdate wc_HmacUpdate
|
||||||
#include <cyassl/ctaocrypt/md5.h>
|
#define HmacFinal wc_HmacFinal
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NO_SHA
|
|
||||||
#include <cyassl/ctaocrypt/sha.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NO_SHA256
|
|
||||||
#include <cyassl/ctaocrypt/sha256.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_SHA512
|
|
||||||
#include <cyassl/ctaocrypt/sha512.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_BLAKE2
|
|
||||||
#include <cyassl/ctaocrypt/blake2.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
#ifdef HAVE_CAVIUM
|
||||||
#include <cyassl/ctaocrypt/logging.h>
|
#define HmacInitCavium wc_HmacInitCavium
|
||||||
#include "cavium_common.h"
|
#define HmacFreeCavium wc_HmacFreeCavium
|
||||||
#endif
|
#endif
|
||||||
|
#define CyaSSL_GetHmacMaxSize wolfSSL_GetHmacMaxSize
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#define CYASSL_HMAC_CAVIUM_MAGIC 0xBEEF0005
|
|
||||||
|
|
||||||
enum {
|
|
||||||
HMAC_FIPS_MIN_KEY = 14, /* 112 bit key length minimum */
|
|
||||||
|
|
||||||
IPAD = 0x36,
|
|
||||||
OPAD = 0x5C,
|
|
||||||
|
|
||||||
/* If any hash is not enabled, add the ID here. */
|
|
||||||
#ifdef NO_MD5
|
|
||||||
MD5 = 0,
|
|
||||||
#endif
|
|
||||||
#ifdef NO_SHA
|
|
||||||
SHA = 1,
|
|
||||||
#endif
|
|
||||||
#ifdef NO_SHA256
|
|
||||||
SHA256 = 2,
|
|
||||||
#endif
|
|
||||||
#ifndef CYASSL_SHA512
|
|
||||||
SHA512 = 4,
|
|
||||||
#endif
|
|
||||||
#ifndef CYASSL_SHA384
|
|
||||||
SHA384 = 5,
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_BLAKE2
|
|
||||||
BLAKE2B_ID = 7,
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Select the largest available hash for the buffer size. */
|
|
||||||
#if defined(CYASSL_SHA512)
|
|
||||||
MAX_DIGEST_SIZE = SHA512_DIGEST_SIZE,
|
|
||||||
HMAC_BLOCK_SIZE = SHA512_BLOCK_SIZE
|
|
||||||
#elif defined(HAVE_BLAKE2)
|
|
||||||
MAX_DIGEST_SIZE = BLAKE2B_OUTBYTES,
|
|
||||||
HMAC_BLOCK_SIZE = BLAKE2B_BLOCKBYTES,
|
|
||||||
#elif defined(CYASSL_SHA384)
|
|
||||||
MAX_DIGEST_SIZE = SHA384_DIGEST_SIZE,
|
|
||||||
HMAC_BLOCK_SIZE = SHA384_BLOCK_SIZE
|
|
||||||
#elif !defined(NO_SHA256)
|
|
||||||
MAX_DIGEST_SIZE = SHA256_DIGEST_SIZE,
|
|
||||||
HMAC_BLOCK_SIZE = SHA256_BLOCK_SIZE
|
|
||||||
#elif !defined(NO_SHA)
|
|
||||||
MAX_DIGEST_SIZE = SHA_DIGEST_SIZE,
|
|
||||||
HMAC_BLOCK_SIZE = SHA_BLOCK_SIZE
|
|
||||||
#elif !defined(NO_MD5)
|
|
||||||
MAX_DIGEST_SIZE = MD5_DIGEST_SIZE,
|
|
||||||
HMAC_BLOCK_SIZE = MD5_BLOCK_SIZE
|
|
||||||
#else
|
|
||||||
#error "You have to have some kind of hash if you want to use HMAC."
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* hash union */
|
|
||||||
typedef union {
|
|
||||||
#ifndef NO_MD5
|
|
||||||
Md5 md5;
|
|
||||||
#endif
|
|
||||||
#ifndef NO_SHA
|
|
||||||
Sha sha;
|
|
||||||
#endif
|
|
||||||
#ifndef NO_SHA256
|
|
||||||
Sha256 sha256;
|
|
||||||
#endif
|
|
||||||
#ifdef CYASSL_SHA384
|
|
||||||
Sha384 sha384;
|
|
||||||
#endif
|
|
||||||
#ifdef CYASSL_SHA512
|
|
||||||
Sha512 sha512;
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_BLAKE2
|
|
||||||
Blake2b blake2b;
|
|
||||||
#endif
|
|
||||||
} Hash;
|
|
||||||
|
|
||||||
/* Hmac digest */
|
|
||||||
typedef struct Hmac {
|
|
||||||
Hash hash;
|
|
||||||
word32 ipad[HMAC_BLOCK_SIZE / sizeof(word32)]; /* same block size all*/
|
|
||||||
word32 opad[HMAC_BLOCK_SIZE / sizeof(word32)];
|
|
||||||
word32 innerHash[MAX_DIGEST_SIZE / sizeof(word32)];
|
|
||||||
byte macType; /* md5 sha or sha256 */
|
|
||||||
byte innerHashKeyed; /* keyed flag */
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
word16 keyLen; /* hmac key length */
|
|
||||||
word16 dataLen;
|
|
||||||
HashType type; /* hmac key type */
|
|
||||||
int devId; /* nitrox device id */
|
|
||||||
word32 magic; /* using cavium magic */
|
|
||||||
word64 contextHandle; /* nitrox context memory handle */
|
|
||||||
byte* data; /* buffered input data for one call */
|
|
||||||
#endif
|
|
||||||
} Hmac;
|
|
||||||
|
|
||||||
|
|
||||||
/* does init */
|
|
||||||
CYASSL_API int HmacSetKey(Hmac*, int type, const byte* key, word32 keySz);
|
|
||||||
CYASSL_API int HmacUpdate(Hmac*, const byte*, word32);
|
|
||||||
CYASSL_API int HmacFinal(Hmac*, byte*);
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
CYASSL_API int HmacInitCavium(Hmac*, int);
|
|
||||||
CYASSL_API void HmacFreeCavium(Hmac*);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
CYASSL_API int CyaSSL_GetHmacMaxSize(void);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_HKDF
|
#ifdef HAVE_HKDF
|
||||||
|
#define HKDF wc_HKDF
|
||||||
CYASSL_API int HKDF(int type, const byte* inKey, word32 inKeySz,
|
|
||||||
const byte* salt, word32 saltSz,
|
|
||||||
const byte* info, word32 infoSz,
|
|
||||||
byte* out, word32 outSz);
|
|
||||||
|
|
||||||
#endif /* HAVE_HKDF */
|
#endif /* HAVE_HKDF */
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_FIPS
|
|
||||||
/* fips wrapper calls, user can call direct */
|
|
||||||
CYASSL_API int HmacSetKey_fips(Hmac*, int type, const byte* key,
|
|
||||||
word32 keySz);
|
|
||||||
CYASSL_API int HmacUpdate_fips(Hmac*, const byte*, word32);
|
|
||||||
CYASSL_API int HmacFinal_fips(Hmac*, byte*);
|
|
||||||
#ifndef FIPS_NO_WRAPPERS
|
|
||||||
/* if not impl or fips.c impl wrapper force fips calls if fips build */
|
|
||||||
#define HmacSetKey HmacSetKey_fips
|
|
||||||
#define HmacUpdate HmacUpdate_fips
|
|
||||||
#define HmacFinal HmacFinal_fips
|
|
||||||
#endif /* FIPS_NO_WRAPPERS */
|
|
||||||
|
|
||||||
#endif /* HAVE_FIPS */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_HMAC_H */
|
#endif /* CTAO_CRYPT_HMAC_H */
|
||||||
|
|
||||||
#endif /* NO_HMAC */
|
#endif /* NO_HMAC */
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
# vim:ft=automake
|
# vim:ft=automake
|
||||||
# All paths should be given relative to the root
|
# All paths should be given relative to the root
|
||||||
|
|
||||||
|
EXTRA_DIST+= ctaocrypt/src/misc.c
|
||||||
|
|
||||||
nobase_include_HEADERS+= \
|
nobase_include_HEADERS+= \
|
||||||
cyassl/ctaocrypt/aes.h \
|
cyassl/ctaocrypt/aes.h \
|
||||||
cyassl/ctaocrypt/arc4.h \
|
cyassl/ctaocrypt/arc4.h \
|
||||||
cyassl/ctaocrypt/asn.h \
|
cyassl/ctaocrypt/asn.h \
|
||||||
cyassl/ctaocrypt/asn_public.h \
|
cyassl/ctaocrypt/asn_public.h \
|
||||||
|
cyassl/ctaocrypt/poly1305.h \
|
||||||
cyassl/ctaocrypt/camellia.h \
|
cyassl/ctaocrypt/camellia.h \
|
||||||
cyassl/ctaocrypt/coding.h \
|
cyassl/ctaocrypt/coding.h \
|
||||||
cyassl/ctaocrypt/compress.h \
|
cyassl/ctaocrypt/compress.h \
|
||||||
|
@ -26,10 +29,12 @@ nobase_include_HEADERS+= \
|
||||||
cyassl/ctaocrypt/wc_port.h \
|
cyassl/ctaocrypt/wc_port.h \
|
||||||
cyassl/ctaocrypt/pwdbased.h \
|
cyassl/ctaocrypt/pwdbased.h \
|
||||||
cyassl/ctaocrypt/rabbit.h \
|
cyassl/ctaocrypt/rabbit.h \
|
||||||
|
cyassl/ctaocrypt/chacha.h \
|
||||||
cyassl/ctaocrypt/random.h \
|
cyassl/ctaocrypt/random.h \
|
||||||
cyassl/ctaocrypt/ripemd.h \
|
cyassl/ctaocrypt/ripemd.h \
|
||||||
cyassl/ctaocrypt/rsa.h \
|
cyassl/ctaocrypt/rsa.h \
|
||||||
cyassl/ctaocrypt/settings.h \
|
cyassl/ctaocrypt/settings.h \
|
||||||
|
cyassl/ctaocrypt/settings_comp.h \
|
||||||
cyassl/ctaocrypt/sha256.h \
|
cyassl/ctaocrypt/sha256.h \
|
||||||
cyassl/ctaocrypt/sha512.h \
|
cyassl/ctaocrypt/sha512.h \
|
||||||
cyassl/ctaocrypt/sha.h \
|
cyassl/ctaocrypt/sha.h \
|
||||||
|
@ -43,3 +48,7 @@ nobase_include_HEADERS+= \
|
||||||
cyassl/ctaocrypt/memory.h \
|
cyassl/ctaocrypt/memory.h \
|
||||||
cyassl/ctaocrypt/mpi_class.h \
|
cyassl/ctaocrypt/mpi_class.h \
|
||||||
cyassl/ctaocrypt/mpi_superclass.h
|
cyassl/ctaocrypt/mpi_superclass.h
|
||||||
|
|
||||||
|
noinst_HEADERS+= \
|
||||||
|
cyassl/ctaocrypt/port/pic32/pic32mz-crypt.h
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* integer.h
|
/* integer.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -28,294 +28,7 @@
|
||||||
#ifndef CTAO_CRYPT_INTEGER_H
|
#ifndef CTAO_CRYPT_INTEGER_H
|
||||||
#define CTAO_CRYPT_INTEGER_H
|
#define CTAO_CRYPT_INTEGER_H
|
||||||
|
|
||||||
/* may optionally use fast math instead, not yet supported on all platforms and
|
#include <wolfssl/wolfcrypt/integer.h>
|
||||||
may not be faster on all
|
|
||||||
*/
|
|
||||||
#include <cyassl/ctaocrypt/types.h> /* will set MP_xxBIT if not default */
|
|
||||||
#ifdef USE_FAST_MATH
|
|
||||||
#include <cyassl/ctaocrypt/tfm.h>
|
|
||||||
#else
|
|
||||||
|
|
||||||
#ifndef CHAR_BIT
|
|
||||||
#include <limits.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/mpi_class.h>
|
|
||||||
|
|
||||||
#ifndef MIN
|
|
||||||
#define MIN(x,y) ((x)<(y)?(x):(y))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef MAX
|
|
||||||
#define MAX(x,y) ((x)>(y)?(x):(y))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
|
|
||||||
/* C++ compilers don't like assigning void * to mp_digit * */
|
|
||||||
#define OPT_CAST(x) (x *)
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* C on the other hand doesn't care */
|
|
||||||
#define OPT_CAST(x)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* detect 64-bit mode if possible */
|
|
||||||
#if defined(__x86_64__)
|
|
||||||
#if !(defined(MP_64BIT) && defined(MP_16BIT) && defined(MP_8BIT))
|
|
||||||
#define MP_64BIT
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
/* if intel compiler doesn't provide 128 bit type don't turn on 64bit */
|
|
||||||
#if defined(MP_64BIT) && defined(__INTEL_COMPILER) && !defined(HAVE___UINT128_T)
|
|
||||||
#undef MP_64BIT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* some default configurations.
|
|
||||||
*
|
|
||||||
* A "mp_digit" must be able to hold DIGIT_BIT + 1 bits
|
|
||||||
* A "mp_word" must be able to hold 2*DIGIT_BIT + 1 bits
|
|
||||||
*
|
|
||||||
* At the very least a mp_digit must be able to hold 7 bits
|
|
||||||
* [any size beyond that is ok provided it doesn't overflow the data type]
|
|
||||||
*/
|
|
||||||
#ifdef MP_8BIT
|
|
||||||
typedef unsigned char mp_digit;
|
|
||||||
typedef unsigned short mp_word;
|
|
||||||
#elif defined(MP_16BIT) || defined(NO_64BIT)
|
|
||||||
typedef unsigned short mp_digit;
|
|
||||||
typedef unsigned int mp_word;
|
|
||||||
#elif defined(MP_64BIT)
|
|
||||||
/* for GCC only on supported platforms */
|
|
||||||
typedef unsigned long long mp_digit; /* 64 bit type, 128 uses mode(TI) */
|
|
||||||
typedef unsigned long mp_word __attribute__ ((mode(TI)));
|
|
||||||
|
|
||||||
#define DIGIT_BIT 60
|
|
||||||
#else
|
|
||||||
/* this is the default case, 28-bit digits */
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
|
||||||
typedef unsigned __int64 ulong64;
|
|
||||||
#else
|
|
||||||
typedef unsigned long long ulong64;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef unsigned int mp_digit; /* long could be 64 now, changed TAO */
|
|
||||||
typedef ulong64 mp_word;
|
|
||||||
|
|
||||||
#ifdef MP_31BIT
|
|
||||||
/* this is an extension that uses 31-bit digits */
|
|
||||||
#define DIGIT_BIT 31
|
|
||||||
#else
|
|
||||||
/* default case is 28-bit digits, defines MP_28BIT as a handy test macro */
|
|
||||||
#define DIGIT_BIT 28
|
|
||||||
#define MP_28BIT
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* otherwise the bits per digit is calculated automatically from the size of
|
|
||||||
a mp_digit */
|
|
||||||
#ifndef DIGIT_BIT
|
|
||||||
#define DIGIT_BIT ((int)((CHAR_BIT * sizeof(mp_digit) - 1)))
|
|
||||||
/* bits per digit */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MP_DIGIT_BIT DIGIT_BIT
|
|
||||||
#define MP_MASK ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1))
|
|
||||||
#define MP_DIGIT_MAX MP_MASK
|
|
||||||
|
|
||||||
/* equalities */
|
|
||||||
#define MP_LT -1 /* less than */
|
|
||||||
#define MP_EQ 0 /* equal to */
|
|
||||||
#define MP_GT 1 /* greater than */
|
|
||||||
|
|
||||||
#define MP_ZPOS 0 /* positive integer */
|
|
||||||
#define MP_NEG 1 /* negative */
|
|
||||||
|
|
||||||
#define MP_OKAY 0 /* ok result */
|
|
||||||
#define MP_MEM -2 /* out of mem */
|
|
||||||
#define MP_VAL -3 /* invalid input */
|
|
||||||
#define MP_RANGE MP_VAL
|
|
||||||
|
|
||||||
#define MP_YES 1 /* yes response */
|
|
||||||
#define MP_NO 0 /* no response */
|
|
||||||
|
|
||||||
/* Primality generation flags */
|
|
||||||
#define LTM_PRIME_BBS 0x0001 /* BBS style prime */
|
|
||||||
#define LTM_PRIME_SAFE 0x0002 /* Safe prime (p-1)/2 == prime */
|
|
||||||
#define LTM_PRIME_2MSB_ON 0x0008 /* force 2nd MSB to 1 */
|
|
||||||
|
|
||||||
typedef int mp_err;
|
|
||||||
|
|
||||||
/* define this to use lower memory usage routines (exptmods mostly) */
|
|
||||||
#define MP_LOW_MEM
|
|
||||||
|
|
||||||
/* default precision */
|
|
||||||
#ifndef MP_PREC
|
|
||||||
#ifndef MP_LOW_MEM
|
|
||||||
#define MP_PREC 32 /* default digits of precision */
|
|
||||||
#else
|
|
||||||
#define MP_PREC 1 /* default digits of precision */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* size of comba arrays, should be at least 2 * 2**(BITS_PER_WORD -
|
|
||||||
BITS_PER_DIGIT*2) */
|
|
||||||
#define MP_WARRAY (1 << (sizeof(mp_word) * CHAR_BIT - 2 * DIGIT_BIT + 1))
|
|
||||||
|
|
||||||
/* the infamous mp_int structure */
|
|
||||||
typedef struct {
|
|
||||||
int used, alloc, sign;
|
|
||||||
mp_digit *dp;
|
|
||||||
} mp_int;
|
|
||||||
|
|
||||||
/* callback for mp_prime_random, should fill dst with random bytes and return
|
|
||||||
how many read [upto len] */
|
|
||||||
typedef int ltm_prime_callback(unsigned char *dst, int len, void *dat);
|
|
||||||
|
|
||||||
|
|
||||||
#define USED(m) ((m)->used)
|
|
||||||
#define DIGIT(m,k) ((m)->dp[(k)])
|
|
||||||
#define SIGN(m) ((m)->sign)
|
|
||||||
|
|
||||||
|
|
||||||
/* ---> Basic Manipulations <--- */
|
|
||||||
#define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO)
|
|
||||||
#define mp_iseven(a) \
|
|
||||||
(((a)->used > 0 && (((a)->dp[0] & 1) == 0)) ? MP_YES : MP_NO)
|
|
||||||
#define mp_isodd(a) \
|
|
||||||
(((a)->used > 0 && (((a)->dp[0] & 1) == 1)) ? MP_YES : MP_NO)
|
|
||||||
|
|
||||||
|
|
||||||
/* number of primes */
|
|
||||||
#ifdef MP_8BIT
|
|
||||||
#define PRIME_SIZE 31
|
|
||||||
#else
|
|
||||||
#define PRIME_SIZE 256
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define mp_prime_random(a, t, size, bbs, cb, dat) \
|
|
||||||
mp_prime_random_ex(a, t, ((size) * 8) + 1, (bbs==1)?LTM_PRIME_BBS:0, cb, dat)
|
|
||||||
|
|
||||||
#define mp_read_raw(mp, str, len) mp_read_signed_bin((mp), (str), (len))
|
|
||||||
#define mp_raw_size(mp) mp_signed_bin_size(mp)
|
|
||||||
#define mp_toraw(mp, str) mp_to_signed_bin((mp), (str))
|
|
||||||
#define mp_read_mag(mp, str, len) mp_read_unsigned_bin((mp), (str), (len))
|
|
||||||
#define mp_mag_size(mp) mp_unsigned_bin_size(mp)
|
|
||||||
#define mp_tomag(mp, str) mp_to_unsigned_bin((mp), (str))
|
|
||||||
|
|
||||||
#define mp_tobinary(M, S) mp_toradix((M), (S), 2)
|
|
||||||
#define mp_tooctal(M, S) mp_toradix((M), (S), 8)
|
|
||||||
#define mp_todecimal(M, S) mp_toradix((M), (S), 10)
|
|
||||||
#define mp_tohex(M, S) mp_toradix((M), (S), 16)
|
|
||||||
|
|
||||||
#define s_mp_mul(a, b, c) s_mp_mul_digs(a, b, c, (a)->used + (b)->used + 1)
|
|
||||||
|
|
||||||
extern const char *mp_s_rmap;
|
|
||||||
|
|
||||||
/* 6 functions needed by Rsa */
|
|
||||||
int mp_init (mp_int * a);
|
|
||||||
void mp_clear (mp_int * a);
|
|
||||||
int mp_unsigned_bin_size(mp_int * a);
|
|
||||||
int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c);
|
|
||||||
int mp_to_unsigned_bin (mp_int * a, unsigned char *b);
|
|
||||||
int mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y);
|
|
||||||
/* end functions needed by Rsa */
|
|
||||||
|
|
||||||
/* functions added to support above needed, removed TOOM and KARATSUBA */
|
|
||||||
int mp_count_bits (mp_int * a);
|
|
||||||
int mp_leading_bit (mp_int * a);
|
|
||||||
int mp_init_copy (mp_int * a, mp_int * b);
|
|
||||||
int mp_copy (mp_int * a, mp_int * b);
|
|
||||||
int mp_grow (mp_int * a, int size);
|
|
||||||
int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d);
|
|
||||||
void mp_zero (mp_int * a);
|
|
||||||
void mp_clamp (mp_int * a);
|
|
||||||
void mp_exch (mp_int * a, mp_int * b);
|
|
||||||
void mp_rshd (mp_int * a, int b);
|
|
||||||
void mp_rshb (mp_int * a, int b);
|
|
||||||
int mp_mod_2d (mp_int * a, int b, mp_int * c);
|
|
||||||
int mp_mul_2d (mp_int * a, int b, mp_int * c);
|
|
||||||
int mp_lshd (mp_int * a, int b);
|
|
||||||
int mp_abs (mp_int * a, mp_int * b);
|
|
||||||
int mp_invmod (mp_int * a, mp_int * b, mp_int * c);
|
|
||||||
int fast_mp_invmod (mp_int * a, mp_int * b, mp_int * c);
|
|
||||||
int mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c);
|
|
||||||
int mp_cmp_mag (mp_int * a, mp_int * b);
|
|
||||||
int mp_cmp (mp_int * a, mp_int * b);
|
|
||||||
int mp_cmp_d(mp_int * a, mp_digit b);
|
|
||||||
void mp_set (mp_int * a, mp_digit b);
|
|
||||||
int mp_mod (mp_int * a, mp_int * b, mp_int * c);
|
|
||||||
int mp_div(mp_int * a, mp_int * b, mp_int * c, mp_int * d);
|
|
||||||
int mp_div_2(mp_int * a, mp_int * b);
|
|
||||||
int mp_add (mp_int * a, mp_int * b, mp_int * c);
|
|
||||||
int s_mp_add (mp_int * a, mp_int * b, mp_int * c);
|
|
||||||
int s_mp_sub (mp_int * a, mp_int * b, mp_int * c);
|
|
||||||
int mp_sub (mp_int * a, mp_int * b, mp_int * c);
|
|
||||||
int mp_reduce_is_2k_l(mp_int *a);
|
|
||||||
int mp_reduce_is_2k(mp_int *a);
|
|
||||||
int mp_dr_is_modulus(mp_int *a);
|
|
||||||
int mp_exptmod_fast (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int);
|
|
||||||
int mp_montgomery_setup (mp_int * n, mp_digit * rho);
|
|
||||||
int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho);
|
|
||||||
int mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho);
|
|
||||||
void mp_dr_setup(mp_int *a, mp_digit *d);
|
|
||||||
int mp_dr_reduce (mp_int * x, mp_int * n, mp_digit k);
|
|
||||||
int mp_reduce_2k(mp_int *a, mp_int *n, mp_digit d);
|
|
||||||
int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs);
|
|
||||||
int s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs);
|
|
||||||
int mp_reduce_2k_setup_l(mp_int *a, mp_int *d);
|
|
||||||
int mp_reduce_2k_l(mp_int *a, mp_int *n, mp_int *d);
|
|
||||||
int mp_reduce (mp_int * x, mp_int * m, mp_int * mu);
|
|
||||||
int mp_reduce_setup (mp_int * a, mp_int * b);
|
|
||||||
int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode);
|
|
||||||
int mp_montgomery_calc_normalization (mp_int * a, mp_int * b);
|
|
||||||
int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs);
|
|
||||||
int s_mp_sqr (mp_int * a, mp_int * b);
|
|
||||||
int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs);
|
|
||||||
int fast_s_mp_sqr (mp_int * a, mp_int * b);
|
|
||||||
int mp_init_size (mp_int * a, int size);
|
|
||||||
int mp_div_3 (mp_int * a, mp_int *c, mp_digit * d);
|
|
||||||
int mp_mul_2(mp_int * a, mp_int * b);
|
|
||||||
int mp_mul (mp_int * a, mp_int * b, mp_int * c);
|
|
||||||
int mp_sqr (mp_int * a, mp_int * b);
|
|
||||||
int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d);
|
|
||||||
int mp_mul_d (mp_int * a, mp_digit b, mp_int * c);
|
|
||||||
int mp_2expt (mp_int * a, int b);
|
|
||||||
int mp_reduce_2k_setup(mp_int *a, mp_digit *d);
|
|
||||||
int mp_add_d (mp_int* a, mp_digit b, mp_int* c);
|
|
||||||
int mp_set_int (mp_int * a, unsigned long b);
|
|
||||||
int mp_sub_d (mp_int * a, mp_digit b, mp_int * c);
|
|
||||||
/* end support added functions */
|
|
||||||
|
|
||||||
/* added */
|
|
||||||
int mp_init_multi(mp_int* a, mp_int* b, mp_int* c, mp_int* d, mp_int* e,
|
|
||||||
mp_int* f);
|
|
||||||
|
|
||||||
#if defined(HAVE_ECC) || defined(CYASSL_KEY_GEN)
|
|
||||||
int mp_sqrmod(mp_int* a, mp_int* b, mp_int* c);
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_ECC
|
|
||||||
int mp_read_radix(mp_int* a, const char* str, int radix);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_KEY_GEN
|
|
||||||
int mp_prime_is_prime (mp_int * a, int t, int *result);
|
|
||||||
int mp_gcd (mp_int * a, mp_int * b, mp_int * c);
|
|
||||||
int mp_lcm (mp_int * a, mp_int * b, mp_int * c);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* USE_FAST_MATH */
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_INTEGER_H */
|
#endif /* CTAO_CRYPT_INTEGER_H */
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* logging.h
|
/* logging.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -25,46 +25,16 @@
|
||||||
#ifndef CYASSL_LOGGING_H
|
#ifndef CYASSL_LOGGING_H
|
||||||
#define CYASSL_LOGGING_H
|
#define CYASSL_LOGGING_H
|
||||||
|
|
||||||
|
/* for fips compatibility @wc_fips */
|
||||||
#ifdef __cplusplus
|
#include <wolfssl/wolfcrypt/logging.h>
|
||||||
extern "C" {
|
#define CYASSL_LEAVE WOLFSSL_LEAVE
|
||||||
|
#define CYASSL_ERROR WOLFSSL_ERROR
|
||||||
|
#define CYASSL_ENTER WOLFSSL_ENTER
|
||||||
|
#define CYASSL_MSG WOLFSSL_MSG
|
||||||
|
/* check old macros possibly declared */
|
||||||
|
#if defined(DEBUG_CYASSL) && !defined(DEBUG_WOLFSSL)
|
||||||
|
#define DEBUG_WOLFSSL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* CYASSL_LOGGING_H */
|
||||||
|
|
||||||
enum CYA_Log_Levels {
|
|
||||||
ERROR_LOG = 0,
|
|
||||||
INFO_LOG,
|
|
||||||
ENTER_LOG,
|
|
||||||
LEAVE_LOG,
|
|
||||||
OTHER_LOG
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef void (*CyaSSL_Logging_cb)(const int logLevel,
|
|
||||||
const char *const logMessage);
|
|
||||||
|
|
||||||
CYASSL_API int CyaSSL_SetLoggingCb(CyaSSL_Logging_cb log_function);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG_CYASSL
|
|
||||||
|
|
||||||
void CYASSL_ENTER(const char* msg);
|
|
||||||
void CYASSL_LEAVE(const char* msg, int ret);
|
|
||||||
|
|
||||||
void CYASSL_ERROR(int);
|
|
||||||
void CYASSL_MSG(const char* msg);
|
|
||||||
|
|
||||||
#else /* DEBUG_CYASSL */
|
|
||||||
|
|
||||||
#define CYASSL_ENTER(m)
|
|
||||||
#define CYASSL_LEAVE(m, r)
|
|
||||||
|
|
||||||
#define CYASSL_ERROR(e)
|
|
||||||
#define CYASSL_MSG(m)
|
|
||||||
|
|
||||||
#endif /* DEBUG_CYASSL */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CYASSL_MEMORY_H */
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* md2.h
|
/* md2.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -20,46 +20,23 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* check for old macro */
|
||||||
|
#if !defined(CYASSL_MD2) && defined(WOLFSSL_MD2)
|
||||||
|
#define CYASSL_MD2
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CYASSL_MD2
|
#ifdef CYASSL_MD2
|
||||||
|
|
||||||
#ifndef CTAO_CRYPT_MD2_H
|
#ifndef CTAO_CRYPT_MD2_H
|
||||||
#define CTAO_CRYPT_MD2_H
|
#define CTAO_CRYPT_MD2_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <wolfssl/wolfcrypt/md2.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#define InitMd2 wc_InitMd2
|
||||||
extern "C" {
|
#define Md2Update wc_Md2Update
|
||||||
#endif
|
#define Md2Final wc_Md2Final
|
||||||
|
#define Md2Hash wc_Md2Hash
|
||||||
|
|
||||||
/* in bytes */
|
|
||||||
enum {
|
|
||||||
MD2 = 6, /* hash type unique */
|
|
||||||
MD2_BLOCK_SIZE = 16,
|
|
||||||
MD2_DIGEST_SIZE = 16,
|
|
||||||
MD2_PAD_SIZE = 16,
|
|
||||||
MD2_X_SIZE = 48
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* Md2 digest */
|
|
||||||
typedef struct Md2 {
|
|
||||||
word32 count; /* bytes % PAD_SIZE */
|
|
||||||
byte X[MD2_X_SIZE];
|
|
||||||
byte C[MD2_BLOCK_SIZE];
|
|
||||||
byte buffer[MD2_BLOCK_SIZE];
|
|
||||||
} Md2;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API void InitMd2(Md2*);
|
|
||||||
CYASSL_API void Md2Update(Md2*, const byte*, word32);
|
|
||||||
CYASSL_API void Md2Final(Md2*, byte*);
|
|
||||||
CYASSL_API int Md2Hash(const byte*, word32, byte*);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_MD2_H */
|
#endif /* CTAO_CRYPT_MD2_H */
|
||||||
#endif /* CYASSL_MD2 */
|
#endif /* CYASSL_MD2 */
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* md4.h
|
/* md4.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -25,39 +25,11 @@
|
||||||
#ifndef CTAO_CRYPT_MD4_H
|
#ifndef CTAO_CRYPT_MD4_H
|
||||||
#define CTAO_CRYPT_MD4_H
|
#define CTAO_CRYPT_MD4_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <wolfssl/wolfcrypt/md4.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#define InitMd4 wc_InitMd4
|
||||||
extern "C" {
|
#define Md4Update wc_Md4Update
|
||||||
#endif
|
#define Md4Final wc_Md4Final
|
||||||
|
|
||||||
|
|
||||||
/* in bytes */
|
|
||||||
enum {
|
|
||||||
MD4_BLOCK_SIZE = 64,
|
|
||||||
MD4_DIGEST_SIZE = 16,
|
|
||||||
MD4_PAD_SIZE = 56
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* MD4 digest */
|
|
||||||
typedef struct Md4 {
|
|
||||||
word32 buffLen; /* in bytes */
|
|
||||||
word32 loLen; /* length in bytes */
|
|
||||||
word32 hiLen; /* length in bytes */
|
|
||||||
word32 digest[MD4_DIGEST_SIZE / sizeof(word32)];
|
|
||||||
word32 buffer[MD4_BLOCK_SIZE / sizeof(word32)];
|
|
||||||
} Md4;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API void InitMd4(Md4*);
|
|
||||||
CYASSL_API void Md4Update(Md4*, const byte*, word32);
|
|
||||||
CYASSL_API void Md4Final(Md4*, byte*);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_MD4_H */
|
#endif /* CTAO_CRYPT_MD4_H */
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* md5.h
|
/* md5.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -24,51 +24,21 @@
|
||||||
#ifndef CTAO_CRYPT_MD5_H
|
#ifndef CTAO_CRYPT_MD5_H
|
||||||
#define CTAO_CRYPT_MD5_H
|
#define CTAO_CRYPT_MD5_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <wolfssl/wolfcrypt/md5.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifndef HAVE_FIPS
|
||||||
extern "C" {
|
#define InitMd5 wc_InitMd5
|
||||||
#endif
|
#define Md5Update wc_Md5Update
|
||||||
|
#define Md5Final wc_Md5Final
|
||||||
|
#define Md5Hash wc_Md5Hash
|
||||||
/* in bytes */
|
#else
|
||||||
enum {
|
/* redfined name so that hmac is calling same function names with fips */
|
||||||
#ifdef STM32F2_HASH
|
#define wc_InitMd5 InitMd5
|
||||||
MD5_REG_SIZE = 4, /* STM32 register size, bytes */
|
#define wc_Md5Update Md5Update
|
||||||
#endif
|
#define wc_Md5Final Md5Final
|
||||||
MD5 = 0, /* hash type unique */
|
#define wc_Md5Hash Md5Hash
|
||||||
MD5_BLOCK_SIZE = 64,
|
|
||||||
MD5_DIGEST_SIZE = 16,
|
|
||||||
MD5_PAD_SIZE = 56
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef CYASSL_PIC32MZ_HASH
|
|
||||||
#include "port/pic32/pic32mz-crypt.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* MD5 digest */
|
|
||||||
typedef struct Md5 {
|
|
||||||
word32 buffLen; /* in bytes */
|
|
||||||
word32 loLen; /* length in bytes */
|
|
||||||
word32 hiLen; /* length in bytes */
|
|
||||||
word32 buffer[MD5_BLOCK_SIZE / sizeof(word32)];
|
|
||||||
#ifndef CYASSL_PIC32MZ_HASH
|
|
||||||
word32 digest[MD5_DIGEST_SIZE / sizeof(word32)];
|
|
||||||
#else
|
|
||||||
word32 digest[PIC32_HASH_SIZE / sizeof(word32)];
|
|
||||||
pic32mz_desc desc ; /* Crypt Engine descripter */
|
|
||||||
#endif
|
|
||||||
} Md5;
|
|
||||||
|
|
||||||
CYASSL_API void InitMd5(Md5*);
|
|
||||||
CYASSL_API void Md5Update(Md5*, const byte*, word32);
|
|
||||||
CYASSL_API void Md5Final(Md5*, byte*);
|
|
||||||
CYASSL_API int Md5Hash(const byte*, word32, byte*);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_MD5_H */
|
#endif /* CTAO_CRYPT_MD5_H */
|
||||||
#endif /* NO_MD5 */
|
#endif /* NO_MD5 */
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* memory.h
|
/* memory.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -25,31 +25,17 @@
|
||||||
#ifndef CYASSL_MEMORY_H
|
#ifndef CYASSL_MEMORY_H
|
||||||
#define CYASSL_MEMORY_H
|
#define CYASSL_MEMORY_H
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#include <wolfssl/wolfcrypt/memory.h>
|
||||||
extern "C" {
|
#define CyaSSL_Malloc_cb wolfSSL_Malloc_cb
|
||||||
#endif
|
#define CyaSSL_Free_cb wolfSSL_Free_cb
|
||||||
|
#define CyaSSL_Realloc_cb wolfSSL_Realloc_cb
|
||||||
|
#define CyaSSL_SetAllocators wolfSSL_SetAllocators
|
||||||
typedef void *(*CyaSSL_Malloc_cb)(size_t size);
|
|
||||||
typedef void (*CyaSSL_Free_cb)(void *ptr);
|
|
||||||
typedef void *(*CyaSSL_Realloc_cb)(void *ptr, size_t size);
|
|
||||||
|
|
||||||
|
|
||||||
/* Public set function */
|
|
||||||
CYASSL_API int CyaSSL_SetAllocators(CyaSSL_Malloc_cb malloc_function,
|
|
||||||
CyaSSL_Free_cb free_function,
|
|
||||||
CyaSSL_Realloc_cb realloc_function);
|
|
||||||
|
|
||||||
/* Public in case user app wants to use XMALLOC/XFREE */
|
/* Public in case user app wants to use XMALLOC/XFREE */
|
||||||
CYASSL_API void* CyaSSL_Malloc(size_t size);
|
#define CyaSSL_Malloc wolfSSL_Malloc
|
||||||
CYASSL_API void CyaSSL_Free(void *ptr);
|
#define CyaSSL_Free wolfSSL_Free
|
||||||
CYASSL_API void* CyaSSL_Realloc(void *ptr, size_t size);
|
#define CyaSSL_Realloc wolfSSL_Realloc
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CYASSL_MEMORY_H */
|
#endif /* CYASSL_MEMORY_H */
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* misc.h
|
/* misc.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -23,50 +23,7 @@
|
||||||
#ifndef CTAO_CRYPT_MISC_H
|
#ifndef CTAO_CRYPT_MISC_H
|
||||||
#define CTAO_CRYPT_MISC_H
|
#define CTAO_CRYPT_MISC_H
|
||||||
|
|
||||||
|
#include <wolfssl/wolfcrypt/misc.h>
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef NO_INLINE
|
|
||||||
CYASSL_LOCAL
|
|
||||||
word32 rotlFixed(word32, word32);
|
|
||||||
CYASSL_LOCAL
|
|
||||||
word32 rotrFixed(word32, word32);
|
|
||||||
|
|
||||||
CYASSL_LOCAL
|
|
||||||
word32 ByteReverseWord32(word32);
|
|
||||||
CYASSL_LOCAL
|
|
||||||
void ByteReverseWords(word32*, const word32*, word32);
|
|
||||||
|
|
||||||
CYASSL_LOCAL
|
|
||||||
void XorWords(word*, const word*, word32);
|
|
||||||
CYASSL_LOCAL
|
|
||||||
void xorbuf(void*, const void*, word32);
|
|
||||||
|
|
||||||
#ifdef WORD64_AVAILABLE
|
|
||||||
CYASSL_LOCAL
|
|
||||||
word64 rotlFixed64(word64, word64);
|
|
||||||
CYASSL_LOCAL
|
|
||||||
word64 rotrFixed64(word64, word64);
|
|
||||||
|
|
||||||
CYASSL_LOCAL
|
|
||||||
word64 ByteReverseWord64(word64);
|
|
||||||
CYASSL_LOCAL
|
|
||||||
void ByteReverseWords64(word64*, const word64*, word32);
|
|
||||||
#endif /* WORD64_AVAILABLE */
|
|
||||||
|
|
||||||
#endif /* NO_INLINE */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_MISC_H */
|
#endif /* CTAO_CRYPT_MISC_H */
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,15 +1,15 @@
|
||||||
/* mpi_superclass.h
|
/* mpi_superclass.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -22,74 +22,5 @@
|
||||||
|
|
||||||
/* super class file for PK algos */
|
/* super class file for PK algos */
|
||||||
|
|
||||||
/* default ... include all MPI */
|
#include <wolfssl/wolfcrypt/mpi_superclass.h>
|
||||||
#define LTM_ALL
|
|
||||||
|
|
||||||
/* RSA only (does not support DH/DSA/ECC) */
|
|
||||||
/* #define SC_RSA_1 */
|
|
||||||
|
|
||||||
/* For reference.... On an Athlon64 optimizing for speed...
|
|
||||||
|
|
||||||
LTM's mpi.o with all functions [striped] is 142KiB in size.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Works for RSA only, mpi.o is 68KiB */
|
|
||||||
#ifdef SC_RSA_1
|
|
||||||
#define BN_MP_SHRINK_C
|
|
||||||
#define BN_MP_LCM_C
|
|
||||||
#define BN_MP_PRIME_RANDOM_EX_C
|
|
||||||
#define BN_MP_INVMOD_C
|
|
||||||
#define BN_MP_GCD_C
|
|
||||||
#define BN_MP_MOD_C
|
|
||||||
#define BN_MP_MULMOD_C
|
|
||||||
#define BN_MP_ADDMOD_C
|
|
||||||
#define BN_MP_EXPTMOD_C
|
|
||||||
#define BN_MP_SET_INT_C
|
|
||||||
#define BN_MP_INIT_MULTI_C
|
|
||||||
#define BN_MP_CLEAR_MULTI_C
|
|
||||||
#define BN_MP_UNSIGNED_BIN_SIZE_C
|
|
||||||
#define BN_MP_TO_UNSIGNED_BIN_C
|
|
||||||
#define BN_MP_MOD_D_C
|
|
||||||
#define BN_MP_PRIME_RABIN_MILLER_TRIALS_C
|
|
||||||
#define BN_REVERSE_C
|
|
||||||
#define BN_PRIME_TAB_C
|
|
||||||
|
|
||||||
/* other modifiers */
|
|
||||||
#define BN_MP_DIV_SMALL /* Slower division, not critical */
|
|
||||||
|
|
||||||
/* here we are on the last pass so we turn things off. The functions classes are still there
|
|
||||||
* but we remove them specifically from the build. This also invokes tweaks in functions
|
|
||||||
* like removing support for even moduli, etc...
|
|
||||||
*/
|
|
||||||
#ifdef LTM_LAST
|
|
||||||
#undef BN_MP_TOOM_MUL_C
|
|
||||||
#undef BN_MP_TOOM_SQR_C
|
|
||||||
#undef BN_MP_KARATSUBA_MUL_C
|
|
||||||
#undef BN_MP_KARATSUBA_SQR_C
|
|
||||||
#undef BN_MP_REDUCE_C
|
|
||||||
#undef BN_MP_REDUCE_SETUP_C
|
|
||||||
#undef BN_MP_DR_IS_MODULUS_C
|
|
||||||
#undef BN_MP_DR_SETUP_C
|
|
||||||
#undef BN_MP_DR_REDUCE_C
|
|
||||||
#undef BN_MP_REDUCE_IS_2K_C
|
|
||||||
#undef BN_MP_REDUCE_2K_SETUP_C
|
|
||||||
#undef BN_MP_REDUCE_2K_C
|
|
||||||
#undef BN_S_MP_EXPTMOD_C
|
|
||||||
#undef BN_MP_DIV_3_C
|
|
||||||
#undef BN_S_MP_MUL_HIGH_DIGS_C
|
|
||||||
#undef BN_FAST_S_MP_MUL_HIGH_DIGS_C
|
|
||||||
#undef BN_FAST_MP_INVMOD_C
|
|
||||||
|
|
||||||
/* To safely undefine these you have to make sure your RSA key won't exceed the Comba threshold
|
|
||||||
* which is roughly 255 digits [7140 bits for 32-bit machines, 15300 bits for 64-bit machines]
|
|
||||||
* which means roughly speaking you can handle upto 2536-bit RSA keys with these defined without
|
|
||||||
* trouble.
|
|
||||||
*/
|
|
||||||
#undef BN_S_MP_MUL_DIGS_C
|
|
||||||
#undef BN_S_MP_SQR_C
|
|
||||||
#undef BN_MP_MONTGOMERY_REDUCE_C
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* pkcs7.h
|
/* pkcs7.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -25,97 +25,26 @@
|
||||||
#ifndef CTAO_CRYPT_PKCS7_H
|
#ifndef CTAO_CRYPT_PKCS7_H
|
||||||
#define CTAO_CRYPT_PKCS7_H
|
#define CTAO_CRYPT_PKCS7_H
|
||||||
|
|
||||||
|
/* pull in compatibility for old includes */
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <cyassl/ctaocrypt/types.h>
|
||||||
#include <cyassl/ctaocrypt/asn.h>
|
#include <cyassl/ctaocrypt/asn.h>
|
||||||
#include <cyassl/ctaocrypt/asn_public.h>
|
#include <cyassl/ctaocrypt/asn_public.h>
|
||||||
#include <cyassl/ctaocrypt/random.h>
|
#include <cyassl/ctaocrypt/random.h>
|
||||||
#include <cyassl/ctaocrypt/des3.h>
|
#include <cyassl/ctaocrypt/des3.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#include <wolfssl/wolfcrypt/pkcs7.h>
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* PKCS#7 content types, ref RFC 2315 (Section 14) */
|
/* for pkcs7 reverse compatibility */
|
||||||
enum PKCS7_TYPES {
|
#define SetContentType wc_SetContentType
|
||||||
PKCS7_MSG = 650, /* 1.2.840.113549.1.7 */
|
#define GetContentType wc_GetContentType
|
||||||
DATA = 651, /* 1.2.840.113549.1.7.1 */
|
#define CreateRecipientInfo wc_CreateRecipientInfo
|
||||||
SIGNED_DATA = 652, /* 1.2.840.113549.1.7.2 */
|
#define PKCS7_InitWithCert wc_PKCS7_InitWithCert
|
||||||
ENVELOPED_DATA = 653, /* 1.2.840.113549.1.7.3 */
|
#define PKCS7_Free wc_PKCS7_Free
|
||||||
SIGNED_AND_ENVELOPED_DATA = 654, /* 1.2.840.113549.1.7.4 */
|
#define PKCS7_EncodeData wc_PKCS7_EncodeData
|
||||||
DIGESTED_DATA = 655, /* 1.2.840.113549.1.7.5 */
|
#define PKCS7_EncodeSignedData wc_PKCS7_EncodeSignedData
|
||||||
ENCRYPTED_DATA = 656 /* 1.2.840.113549.1.7.6 */
|
#define PKCS7_VerifySignedData wc_PKCS7_VerifySignedData
|
||||||
};
|
#define PKCS7_EncodeEnvelopedData wc_PKCS7_EncodeEnvelopedData
|
||||||
|
#define PKCS7_DecodeEnvelopedData wc_PKCS7_DecodeEnvelopedData
|
||||||
enum Pkcs7_Misc {
|
|
||||||
PKCS7_NONCE_SZ = 16,
|
|
||||||
MAX_ENCRYPTED_KEY_SZ = 512, /* max enc. key size, RSA <= 4096 */
|
|
||||||
MAX_CONTENT_KEY_LEN = DES3_KEYLEN, /* highest current cipher is 3DES */
|
|
||||||
MAX_RECIP_SZ = MAX_VERSION_SZ +
|
|
||||||
MAX_SEQ_SZ + ASN_NAME_MAX + MAX_SN_SZ +
|
|
||||||
MAX_SEQ_SZ + MAX_ALGO_SZ + 1 + MAX_ENCRYPTED_KEY_SZ
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct PKCS7Attrib {
|
|
||||||
byte* oid;
|
|
||||||
word32 oidSz;
|
|
||||||
byte* value;
|
|
||||||
word32 valueSz;
|
|
||||||
} PKCS7Attrib;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct PKCS7 {
|
|
||||||
byte* content; /* inner content, not owner */
|
|
||||||
word32 contentSz; /* content size */
|
|
||||||
int contentOID; /* PKCS#7 content type OID sum */
|
|
||||||
|
|
||||||
RNG* rng;
|
|
||||||
|
|
||||||
int hashOID;
|
|
||||||
int encryptOID; /* key encryption algorithm OID */
|
|
||||||
|
|
||||||
byte* singleCert; /* recipient cert, DER, not owner */
|
|
||||||
word32 singleCertSz; /* size of recipient cert buffer, bytes */
|
|
||||||
byte issuerHash[SHA_SIZE]; /* hash of all alt Names */
|
|
||||||
byte* issuer; /* issuer name of singleCert */
|
|
||||||
word32 issuerSz; /* length of issuer name */
|
|
||||||
byte issuerSn[MAX_SN_SZ]; /* singleCert's serial number */
|
|
||||||
word32 issuerSnSz; /* length of serial number */
|
|
||||||
byte publicKey[512];
|
|
||||||
word32 publicKeySz;
|
|
||||||
byte* privateKey; /* private key, DER, not owner */
|
|
||||||
word32 privateKeySz; /* size of private key buffer, bytes */
|
|
||||||
|
|
||||||
PKCS7Attrib* signedAttribs;
|
|
||||||
word32 signedAttribsSz;
|
|
||||||
} PKCS7;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_LOCAL int SetContentType(int pkcs7TypeOID, byte* output);
|
|
||||||
CYASSL_LOCAL int GetContentType(const byte* input, word32* inOutIdx,
|
|
||||||
word32* oid, word32 maxIdx);
|
|
||||||
CYASSL_LOCAL int CreateRecipientInfo(const byte* cert, word32 certSz,
|
|
||||||
int keyEncAlgo, int blockKeySz,
|
|
||||||
RNG* rng, byte* contentKeyPlain,
|
|
||||||
byte* contentKeyEnc,
|
|
||||||
int* keyEncSz, byte* out, word32 outSz);
|
|
||||||
|
|
||||||
CYASSL_API int PKCS7_InitWithCert(PKCS7* pkcs7, byte* cert, word32 certSz);
|
|
||||||
CYASSL_API void PKCS7_Free(PKCS7* pkcs7);
|
|
||||||
CYASSL_API int PKCS7_EncodeData(PKCS7* pkcs7, byte* output, word32 outputSz);
|
|
||||||
CYASSL_API int PKCS7_EncodeSignedData(PKCS7* pkcs7,
|
|
||||||
byte* output, word32 outputSz);
|
|
||||||
CYASSL_API int PKCS7_VerifySignedData(PKCS7* pkcs7,
|
|
||||||
byte* pkiMsg, word32 pkiMsgSz);
|
|
||||||
CYASSL_API int PKCS7_EncodeEnvelopedData(PKCS7* pkcs7,
|
|
||||||
byte* output, word32 outputSz);
|
|
||||||
CYASSL_API int PKCS7_DecodeEnvelopedData(PKCS7* pkcs7, byte* pkiMsg,
|
|
||||||
word32 pkiMsgSz, byte* output,
|
|
||||||
word32 outputSz);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_PKCS7_H */
|
#endif /* CTAO_CRYPT_PKCS7_H */
|
||||||
|
|
||||||
|
|
38
FreeRTOS-Plus/Source/WolfSSL/cyassl/ctaocrypt/poly1305.h
Normal file
38
FreeRTOS-Plus/Source/WolfSSL/cyassl/ctaocrypt/poly1305.h
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
/* poly1305.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
|
*
|
||||||
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
|
*
|
||||||
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef HAVE_POLY1305
|
||||||
|
|
||||||
|
#ifndef CTAO_CRYPT_POLY1305_H
|
||||||
|
#define CTAO_CRYPT_POLY1305_H
|
||||||
|
|
||||||
|
#include <wolfssl/wolfcrypt/poly1305.h>
|
||||||
|
|
||||||
|
/* for poly1305 reverse compatibility */
|
||||||
|
#define Poly1305SetKey wc_Poly1305SetKey
|
||||||
|
#define Poly1305Update wc_Poly1305Update
|
||||||
|
#define Poly1305Final wc_Poly1305Final
|
||||||
|
|
||||||
|
#endif /* CTAO_CRYPT_POLY1305_H */
|
||||||
|
|
||||||
|
#endif /* HAVE_POLY1305 */
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
/* pic32mz-crypt.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
|
*
|
||||||
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
|
*
|
||||||
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef PIC32MZ_CRYPT_H
|
||||||
|
#define PIC32MZ_CRYPT_H
|
||||||
|
|
||||||
|
#include <wolfssl/wolfcrypt/port/pic32/pic32mz-crypt.h>
|
||||||
|
|
||||||
|
#endif /* PIC32MZ_CRYPT_H */
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* pwdbased.h
|
/* pwdbased.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -25,29 +25,12 @@
|
||||||
#ifndef CTAO_CRYPT_PWDBASED_H
|
#ifndef CTAO_CRYPT_PWDBASED_H
|
||||||
#define CTAO_CRYPT_PWDBASED_H
|
#define CTAO_CRYPT_PWDBASED_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
/* for pwdbased reverse compatibility */
|
||||||
#include <cyassl/ctaocrypt/md5.h> /* for hash type */
|
#include <wolfssl/wolfcrypt/pwdbased.h>
|
||||||
#include <cyassl/ctaocrypt/sha.h>
|
#define PBKDF1 wc_PBKDF1
|
||||||
|
#define PBKDF2 wc_PBKDF2
|
||||||
#ifdef __cplusplus
|
#define PKCS12_PBKDF wc_PKCS12_PBKDF
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API int PBKDF1(byte* output, const byte* passwd, int pLen,
|
|
||||||
const byte* salt, int sLen, int iterations, int kLen,
|
|
||||||
int hashType);
|
|
||||||
CYASSL_API int PBKDF2(byte* output, const byte* passwd, int pLen,
|
|
||||||
const byte* salt, int sLen, int iterations, int kLen,
|
|
||||||
int hashType);
|
|
||||||
CYASSL_API int PKCS12_PBKDF(byte* output, const byte* passwd, int pLen,
|
|
||||||
const byte* salt, int sLen, int iterations,
|
|
||||||
int kLen, int hashType, int purpose);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_PWDBASED_H */
|
#endif /* CTAO_CRYPT_PWDBASED_H */
|
||||||
#endif /* NO_PWDBASED */
|
#endif /* NO_PWDBASED */
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* rabbit.h
|
/* rabbit.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -25,41 +25,15 @@
|
||||||
#ifndef CTAO_CRYPT_RABBIT_H
|
#ifndef CTAO_CRYPT_RABBIT_H
|
||||||
#define CTAO_CRYPT_RABBIT_H
|
#define CTAO_CRYPT_RABBIT_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <wolfssl/wolfcrypt/rabbit.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* for rabbit reverse compatibility */
|
||||||
extern "C" {
|
#ifndef NO_RABBIT
|
||||||
#endif
|
#define RabbitProcess wc_RabbitProcess
|
||||||
|
#define RabbitSetKey wc_RabbitSetKey
|
||||||
|
|
||||||
enum {
|
|
||||||
RABBIT_ENC_TYPE = 5 /* cipher unique type */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* Rabbit Context */
|
|
||||||
typedef struct RabbitCtx {
|
|
||||||
word32 x[8];
|
|
||||||
word32 c[8];
|
|
||||||
word32 carry;
|
|
||||||
} RabbitCtx;
|
|
||||||
|
|
||||||
|
|
||||||
/* Rabbit stream cipher */
|
|
||||||
typedef struct Rabbit {
|
|
||||||
RabbitCtx masterCtx;
|
|
||||||
RabbitCtx workCtx;
|
|
||||||
} Rabbit;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API int RabbitProcess(Rabbit*, byte*, const byte*, word32);
|
|
||||||
CYASSL_API int RabbitSetKey(Rabbit*, const byte* key, const byte* iv);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_RABBIT_H */
|
#endif /* CTAO_CRYPT_RABBIT_H */
|
||||||
|
|
||||||
#endif /* NO_RABBIT */
|
#endif /* NO_RABBIT */
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* random.h
|
/* random.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -23,133 +23,16 @@
|
||||||
#ifndef CTAO_CRYPT_RANDOM_H
|
#ifndef CTAO_CRYPT_RANDOM_H
|
||||||
#define CTAO_CRYPT_RANDOM_H
|
#define CTAO_CRYPT_RANDOM_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
/* for random.h compatibility */
|
||||||
|
#include <wolfssl/wolfcrypt/random.h>
|
||||||
|
#define InitRng wc_InitRng
|
||||||
|
#define RNG_GenerateBlock wc_RNG_GenerateBlock
|
||||||
|
#define RNG_GenerateByte wc_RNG_GenerateByte
|
||||||
|
#define FreeRng wc_FreeRng
|
||||||
|
|
||||||
#if defined(HAVE_HASHDRBG) || defined(NO_RC4)
|
#if defined(HAVE_HASHDRBG) || defined(NO_RC4)
|
||||||
#ifdef NO_SHA256
|
#define RNG_HealthTest wc_RNG_HealthTest
|
||||||
#error "Hash DRBG requires SHA-256."
|
#endif /* HAVE_HASHDRBG || NO_RC4 */
|
||||||
#endif /* NO_SHA256 */
|
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/sha256.h>
|
|
||||||
#else /* HAVE_HASHDRBG || NO_RC4 */
|
|
||||||
#include <cyassl/ctaocrypt/arc4.h>
|
|
||||||
#endif /* HAVE_HASHDRBG || NO_RC4 */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(USE_WINDOWS_API)
|
|
||||||
#if defined(_WIN64)
|
|
||||||
typedef unsigned __int64 ProviderHandle;
|
|
||||||
/* type HCRYPTPROV, avoid #include <windows.h> */
|
|
||||||
#else
|
|
||||||
typedef unsigned long ProviderHandle;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* OS specific seeder */
|
|
||||||
typedef struct OS_Seed {
|
|
||||||
#if defined(USE_WINDOWS_API)
|
|
||||||
ProviderHandle handle;
|
|
||||||
#else
|
|
||||||
int fd;
|
|
||||||
#endif
|
|
||||||
} OS_Seed;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_LOCAL
|
|
||||||
int GenerateSeed(OS_Seed* os, byte* seed, word32 sz);
|
|
||||||
|
|
||||||
#if defined(CYASSL_MDK_ARM)
|
|
||||||
#undef RNG
|
|
||||||
#define RNG CyaSSL_RNG /* for avoiding name conflict in "stm32f2xx.h" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(HAVE_HASHDRBG) || defined(NO_RC4)
|
|
||||||
|
|
||||||
|
|
||||||
#define DRBG_SEED_LEN (440/8)
|
|
||||||
|
|
||||||
|
|
||||||
/* Hash-based Deterministic Random Bit Generator */
|
|
||||||
typedef struct RNG {
|
|
||||||
OS_Seed seed;
|
|
||||||
|
|
||||||
Sha256 sha;
|
|
||||||
byte digest[SHA256_DIGEST_SIZE];
|
|
||||||
byte V[DRBG_SEED_LEN];
|
|
||||||
byte C[DRBG_SEED_LEN];
|
|
||||||
word32 reseedCtr;
|
|
||||||
byte status;
|
|
||||||
} RNG;
|
|
||||||
|
|
||||||
|
|
||||||
#else /* HAVE_HASHDRBG || NO_RC4 */
|
|
||||||
|
|
||||||
|
|
||||||
#define CYASSL_RNG_CAVIUM_MAGIC 0xBEEF0004
|
|
||||||
|
|
||||||
/* secure Random Number Generator */
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct RNG {
|
|
||||||
OS_Seed seed;
|
|
||||||
Arc4 cipher;
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
int devId; /* nitrox device id */
|
|
||||||
word32 magic; /* using cavium magic */
|
|
||||||
#endif
|
|
||||||
} RNG;
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
CYASSL_API int InitRngCavium(RNG*, int);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* HAVE_HASH_DRBG || NO_RC4 */
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API int InitRng(RNG*);
|
|
||||||
CYASSL_API int RNG_GenerateBlock(RNG*, byte*, word32 sz);
|
|
||||||
CYASSL_API int RNG_GenerateByte(RNG*, byte*);
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(HAVE_HASHDRBG) || defined(NO_RC4)
|
|
||||||
CYASSL_API int FreeRng(RNG*);
|
|
||||||
CYASSL_API int RNG_HealthTest(int reseed,
|
|
||||||
const byte* entropyA, word32 entropyASz,
|
|
||||||
const byte* entropyB, word32 entropyBSz,
|
|
||||||
const byte* output, word32 outputSz);
|
|
||||||
#endif /* HAVE_HASHDRBG || NO_RC4 */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_FIPS
|
|
||||||
/* fips wrapper calls, user can call direct */
|
|
||||||
CYASSL_API int InitRng_fips(RNG* rng);
|
|
||||||
CYASSL_API int FreeRng_fips(RNG* rng);
|
|
||||||
CYASSL_API int RNG_GenerateBlock_fips(RNG* rng, byte* buf, word32 bufSz);
|
|
||||||
CYASSL_API int RNG_HealthTest_fips(int reseed,
|
|
||||||
const byte* entropyA, word32 entropyASz,
|
|
||||||
const byte* entropyB, word32 entropyBSz,
|
|
||||||
const byte* output, word32 outputSz);
|
|
||||||
#ifndef FIPS_NO_WRAPPERS
|
|
||||||
/* if not impl or fips.c impl wrapper force fips calls if fips build */
|
|
||||||
#define InitRng InitRng_fips
|
|
||||||
#define FreeRng FreeRng_fips
|
|
||||||
#define RNG_GenerateBlock RNG_GenerateBlock_fips
|
|
||||||
#define RNG_HealthTest RNG_HealthTest_fips
|
|
||||||
#endif /* FIPS_NO_WRAPPERS */
|
|
||||||
#endif /* HAVE_FIPS */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_RANDOM_H */
|
#endif /* CTAO_CRYPT_RANDOM_H */
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* ripemd.h
|
/* ripemd.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -20,45 +20,18 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef CYASSL_RIPEMD
|
|
||||||
|
|
||||||
#ifndef CTAO_CRYPT_RIPEMD_H
|
#ifndef CTAO_CRYPT_RIPEMD_H
|
||||||
#define CTAO_CRYPT_RIPEME_H
|
#define CTAO_CRYPT_RIPEME_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <wolfssl/wolfcrypt/ripemd.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* for ripemd reverse compatibility */
|
||||||
extern "C" {
|
#ifdef WOLFSSL_RIPEMD
|
||||||
#endif
|
#define InitRipeMd wc_InitRipeMd
|
||||||
|
#define RipeMdUpdate wc_RipeMdUpdate
|
||||||
|
#define RipeMdFinal wc_RipeMdFinal
|
||||||
/* in bytes */
|
|
||||||
enum {
|
|
||||||
RIPEMD = 3, /* hash type unique */
|
|
||||||
RIPEMD_BLOCK_SIZE = 64,
|
|
||||||
RIPEMD_DIGEST_SIZE = 20,
|
|
||||||
RIPEMD_PAD_SIZE = 56
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* RipeMd 160 digest */
|
|
||||||
typedef struct RipeMd {
|
|
||||||
word32 buffLen; /* in bytes */
|
|
||||||
word32 loLen; /* length in bytes */
|
|
||||||
word32 hiLen; /* length in bytes */
|
|
||||||
word32 digest[RIPEMD_DIGEST_SIZE / sizeof(word32)];
|
|
||||||
word32 buffer[RIPEMD_BLOCK_SIZE / sizeof(word32)];
|
|
||||||
} RipeMd;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API void InitRipeMd(RipeMd*);
|
|
||||||
CYASSL_API void RipeMdUpdate(RipeMd*, const byte*, word32);
|
|
||||||
CYASSL_API void RipeMdFinal(RipeMd*, byte*);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_RIPEMD_H */
|
#endif /* CTAO_CRYPT_RIPEMD_H */
|
||||||
#endif /* CYASSL_RIPEMD */
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* rsa.h
|
/* rsa.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -24,117 +24,31 @@
|
||||||
#ifndef CTAO_CRYPT_RSA_H
|
#ifndef CTAO_CRYPT_RSA_H
|
||||||
#define CTAO_CRYPT_RSA_H
|
#define CTAO_CRYPT_RSA_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <wolfssl/wolfcrypt/rsa.h>
|
||||||
|
/* includes for their compatibility */
|
||||||
#include <cyassl/ctaocrypt/integer.h>
|
#include <cyassl/ctaocrypt/integer.h>
|
||||||
#include <cyassl/ctaocrypt/random.h>
|
#include <cyassl/ctaocrypt/random.h>
|
||||||
|
#include <cyassl/ctaocrypt/settings.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#define InitRsaKey wc_InitRsaKey
|
||||||
extern "C" {
|
#define FreeRsaKey wc_FreeRsaKey
|
||||||
#endif
|
#define RsaPublicEncrypt wc_RsaPublicEncrypt
|
||||||
|
#define RsaPrivateDecryptInline wc_RsaPrivateDecryptInline
|
||||||
|
#define RsaPrivateDecrypt wc_RsaPrivateDecrypt
|
||||||
|
#define RsaSSL_Sign wc_RsaSSL_Sign
|
||||||
|
#define RsaSSL_VerifyInline wc_RsaSSL_VerifyInline
|
||||||
|
#define RsaSSL_Verify wc_RsaSSL_Verify
|
||||||
|
#define RsaEncryptSize wc_RsaEncryptSize
|
||||||
|
#define RsaFlattenPublicKey wc_RsaFlattenPublicKey
|
||||||
|
|
||||||
#define CYASSL_RSA_CAVIUM_MAGIC 0xBEEF0006
|
#ifdef WOLFSSL_KEY_GEN
|
||||||
|
#define MakeRsaKey wc_MakeRsaKey
|
||||||
enum {
|
#define RsaKeyToDer wc_RsaKeyToDer
|
||||||
RSA_PUBLIC = 0,
|
|
||||||
RSA_PRIVATE = 1
|
|
||||||
};
|
|
||||||
|
|
||||||
/* RSA */
|
|
||||||
typedef struct RsaKey {
|
|
||||||
mp_int n, e, d, p, q, dP, dQ, u;
|
|
||||||
int type; /* public or private */
|
|
||||||
void* heap; /* for user memory overrides */
|
|
||||||
#ifdef HAVE_CAVIUM
|
|
||||||
int devId; /* nitrox device id */
|
|
||||||
word32 magic; /* using cavium magic */
|
|
||||||
word64 contextHandle; /* nitrox context memory handle */
|
|
||||||
byte* c_n; /* cavium byte buffers for key parts */
|
|
||||||
byte* c_e;
|
|
||||||
byte* c_d;
|
|
||||||
byte* c_p;
|
|
||||||
byte* c_q;
|
|
||||||
byte* c_dP;
|
|
||||||
byte* c_dQ;
|
|
||||||
byte* c_u; /* sizes in bytes */
|
|
||||||
word16 c_nSz, c_eSz, c_dSz, c_pSz, c_qSz, c_dP_Sz, c_dQ_Sz, c_uSz;
|
|
||||||
#endif
|
|
||||||
} RsaKey;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API int InitRsaKey(RsaKey* key, void*);
|
|
||||||
CYASSL_API int FreeRsaKey(RsaKey* key);
|
|
||||||
|
|
||||||
CYASSL_API int RsaPublicEncrypt(const byte* in, word32 inLen, byte* out,
|
|
||||||
word32 outLen, RsaKey* key, RNG* rng);
|
|
||||||
CYASSL_API int RsaPrivateDecryptInline(byte* in, word32 inLen, byte** out,
|
|
||||||
RsaKey* key);
|
|
||||||
CYASSL_API int RsaPrivateDecrypt(const byte* in, word32 inLen, byte* out,
|
|
||||||
word32 outLen, RsaKey* key);
|
|
||||||
CYASSL_API int RsaSSL_Sign(const byte* in, word32 inLen, byte* out,
|
|
||||||
word32 outLen, RsaKey* key, RNG* rng);
|
|
||||||
CYASSL_API int RsaSSL_VerifyInline(byte* in, word32 inLen, byte** out,
|
|
||||||
RsaKey* key);
|
|
||||||
CYASSL_API int RsaSSL_Verify(const byte* in, word32 inLen, byte* out,
|
|
||||||
word32 outLen, RsaKey* key);
|
|
||||||
CYASSL_API int RsaEncryptSize(RsaKey* key);
|
|
||||||
|
|
||||||
CYASSL_API int RsaPrivateKeyDecode(const byte* input, word32* inOutIdx, RsaKey*,
|
|
||||||
word32);
|
|
||||||
CYASSL_API int RsaPublicKeyDecode(const byte* input, word32* inOutIdx, RsaKey*,
|
|
||||||
word32);
|
|
||||||
#ifdef CYASSL_KEY_GEN
|
|
||||||
CYASSL_API int MakeRsaKey(RsaKey* key, int size, long e, RNG* rng);
|
|
||||||
CYASSL_API int RsaKeyToDer(RsaKey*, byte* output, word32 inLen);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
#ifdef HAVE_CAVIUM
|
||||||
CYASSL_API int RsaInitCavium(RsaKey*, int);
|
#define RsaInitCavium wc_RsaInitCavium
|
||||||
CYASSL_API void RsaFreeCavium(RsaKey*);
|
#define RsaFreeCavium wc_RsaFreeCavium
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_FIPS
|
|
||||||
/* fips wrapper calls, user can call direct */
|
|
||||||
CYASSL_API int InitRsaKey_fips(RsaKey* key, void*);
|
|
||||||
CYASSL_API int FreeRsaKey_fips(RsaKey* key);
|
|
||||||
|
|
||||||
CYASSL_API int RsaPublicEncrypt_fips(const byte* in,word32 inLen,byte* out,
|
|
||||||
word32 outLen, RsaKey* key, RNG* rng);
|
|
||||||
CYASSL_API int RsaPrivateDecryptInline_fips(byte* in, word32 inLen,
|
|
||||||
byte** out, RsaKey* key);
|
|
||||||
CYASSL_API int RsaPrivateDecrypt_fips(const byte* in, word32 inLen,
|
|
||||||
byte* out,word32 outLen,RsaKey* key);
|
|
||||||
CYASSL_API int RsaSSL_Sign_fips(const byte* in, word32 inLen, byte* out,
|
|
||||||
word32 outLen, RsaKey* key, RNG* rng);
|
|
||||||
CYASSL_API int RsaSSL_VerifyInline_fips(byte* in, word32 inLen, byte** out,
|
|
||||||
RsaKey* key);
|
|
||||||
CYASSL_API int RsaSSL_Verify_fips(const byte* in, word32 inLen, byte* out,
|
|
||||||
word32 outLen, RsaKey* key);
|
|
||||||
CYASSL_API int RsaEncryptSize_fips(RsaKey* key);
|
|
||||||
|
|
||||||
CYASSL_API int RsaPrivateKeyDecode_fips(const byte* input, word32* inOutIdx,
|
|
||||||
RsaKey*, word32);
|
|
||||||
CYASSL_API int RsaPublicKeyDecode_fips(const byte* input, word32* inOutIdx,
|
|
||||||
RsaKey*, word32);
|
|
||||||
#ifndef FIPS_NO_WRAPPERS
|
|
||||||
/* if not impl or fips.c impl wrapper force fips calls if fips build */
|
|
||||||
#define InitRsaKey InitRsaKey_fips
|
|
||||||
#define FreeRsaKey FreeRsaKey_fips
|
|
||||||
#define RsaPublicEncrypt RsaPublicEncrypt_fips
|
|
||||||
#define RsaPrivateDecryptInline RsaPrivateDecryptInline_fips
|
|
||||||
#define RsaPrivateDecrypt RsaPrivateDecrypt_fips
|
|
||||||
#define RsaSSL_Sign RsaSSL_Sign_fips
|
|
||||||
#define RsaSSL_VerifyInline RsaSSL_VerifyInline_fips
|
|
||||||
#define RsaSSL_Verify RsaSSL_Verify_fips
|
|
||||||
#define RsaEncryptSize RsaEncryptSize_fips
|
|
||||||
/* no implicit KeyDecodes since in asn.c (not rsa.c) */
|
|
||||||
#endif /* FIPS_NO_WRAPPERS */
|
|
||||||
|
|
||||||
#endif /* HAVE_FIPS */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_RSA_H */
|
#endif /* CTAO_CRYPT_RSA_H */
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* settings.h
|
/* settings.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -26,10 +26,36 @@
|
||||||
#ifndef CTAO_CRYPT_SETTINGS_H
|
#ifndef CTAO_CRYPT_SETTINGS_H
|
||||||
#define CTAO_CRYPT_SETTINGS_H
|
#define CTAO_CRYPT_SETTINGS_H
|
||||||
|
|
||||||
|
/* for reverse compatibility after name change */
|
||||||
|
#include <cyassl/ctaocrypt/settings_comp.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Uncomment next line if using IPHONE */
|
||||||
|
/* #define IPHONE */
|
||||||
|
|
||||||
|
/* Uncomment next line if using ThreadX */
|
||||||
|
/* #define THREADX */
|
||||||
|
|
||||||
|
/* Uncomment next line if using Micrium ucOS */
|
||||||
|
/* #define MICRIUM */
|
||||||
|
|
||||||
|
/* Uncomment next line if using Mbed */
|
||||||
|
/* #define MBED */
|
||||||
|
|
||||||
|
/* Uncomment next line if using Microchip PIC32 ethernet starter kit */
|
||||||
|
/* #define MICROCHIP_PIC32 */
|
||||||
|
|
||||||
|
/* Uncomment next line if using Microchip TCP/IP stack, version 5 */
|
||||||
|
/* #define MICROCHIP_TCPIP_V5 */
|
||||||
|
|
||||||
|
/* Uncomment next line if using Microchip TCP/IP stack, version 6 or later */
|
||||||
|
/* #define MICROCHIP_TCPIP */
|
||||||
|
|
||||||
|
/* Uncomment next line if using PIC32MZ Crypto Engine */
|
||||||
|
/* #define CYASSL_MICROCHIP_PIC32MZ */
|
||||||
|
|
||||||
/* Uncomment next line if using FreeRTOS */
|
/* Uncomment next line if using FreeRTOS */
|
||||||
/* #define FREERTOS */
|
/* #define FREERTOS */
|
||||||
|
@ -67,6 +93,15 @@
|
||||||
/* Uncomment next line if building for IAR EWARM */
|
/* Uncomment next line if building for IAR EWARM */
|
||||||
/* #define CYASSL_IAR_ARM */
|
/* #define CYASSL_IAR_ARM */
|
||||||
|
|
||||||
|
/* Uncomment next line if using TI-RTOS settings */
|
||||||
|
/* #define CYASSL_TIRTOS */
|
||||||
|
|
||||||
|
/* Uncomment next line if building with PicoTCP */
|
||||||
|
/* #define CYASSL_PICOTCP */
|
||||||
|
|
||||||
|
/* Uncomment next line if building for PicoTCP demo bundle */
|
||||||
|
/* #define CYASSL_PICOTCP_DEMO */
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/visibility.h>
|
#include <cyassl/ctaocrypt/visibility.h>
|
||||||
|
|
||||||
#ifdef IPHONE
|
#ifdef IPHONE
|
||||||
|
@ -202,6 +237,27 @@
|
||||||
#define NO_MAIN_DRIVER
|
#define NO_MAIN_DRIVER
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CYASSL_PICOTCP
|
||||||
|
#define errno pico_err
|
||||||
|
#include "pico_defines.h"
|
||||||
|
#include "pico_stack.h"
|
||||||
|
#include "pico_constants.h"
|
||||||
|
#define CUSTOM_RAND_GENERATE pico_rand
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CYASSL_PICOTCP_DEMO
|
||||||
|
#define CYASSL_STM32
|
||||||
|
#define USE_FAST_MATH
|
||||||
|
#define TFM_TIMING_RESISTANT
|
||||||
|
#define XMALLOC(s, h, type) PICO_ZALLOC((s))
|
||||||
|
#define XFREE(p, h, type) PICO_FREE((p))
|
||||||
|
#define SINGLE_THREADED
|
||||||
|
#define NO_WRITEV
|
||||||
|
#define CYASSL_USER_IO
|
||||||
|
#define NO_DEV_RANDOM
|
||||||
|
#define NO_FILESYSTEM
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef FREERTOS_WINSIM
|
#ifdef FREERTOS_WINSIM
|
||||||
#define FREERTOS
|
#define FREERTOS
|
||||||
#define USE_WINDOWS_API
|
#define USE_WINDOWS_API
|
||||||
|
@ -255,6 +311,28 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CYASSL_TIRTOS
|
||||||
|
#define SIZEOF_LONG_LONG 8
|
||||||
|
#define NO_WRITEV
|
||||||
|
#define NO_CYASSL_DIR
|
||||||
|
#define USE_FAST_MATH
|
||||||
|
#define TFM_TIMING_RESISTANT
|
||||||
|
#define NO_DEV_RANDOM
|
||||||
|
#define NO_FILESYSTEM
|
||||||
|
#define USE_CERT_BUFFERS_2048
|
||||||
|
#define NO_ERROR_STRINGS
|
||||||
|
#define USER_TIME
|
||||||
|
|
||||||
|
#ifdef __IAR_SYSTEMS_ICC__
|
||||||
|
#pragma diag_suppress=Pa089
|
||||||
|
#elif !defined(__GNUC__)
|
||||||
|
/* Suppress the sslpro warning */
|
||||||
|
#pragma diag_suppress=11
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <ti/ndk/nettools/mytime/mytime.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef EBSNET
|
#ifdef EBSNET
|
||||||
#include "rtip.h"
|
#include "rtip.h"
|
||||||
|
|
||||||
|
@ -665,4 +743,3 @@
|
||||||
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_SETTINGS_H */
|
#endif /* CTAO_CRYPT_SETTINGS_H */
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
/* settings_comp.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
|
*
|
||||||
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
|
*
|
||||||
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CTAO_CRYPT_SETTINGS_C_H
|
||||||
|
#define CTAO_CRYPT_SETTINGS_C_H
|
||||||
|
|
||||||
|
|
||||||
|
/* since fips overrides rsa.h map compatibility here */
|
||||||
|
#if !defined(NO_RSA)
|
||||||
|
#ifdef WOLFSSL_KEY_GEN
|
||||||
|
#define RsaKeyToDer wc_RsaKeyToDer
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define RsaPrivateKeyDecode wc_RsaPrivateKeyDecode
|
||||||
|
#define RsaPublicKeyDecode wc_RsaPublicKeyDecode
|
||||||
|
#define RsaPublicKeyDecodeRaw wc_RsaPublicKeyDecodeRaw
|
||||||
|
#endif /* have rsa and HAVE_FIPS */
|
||||||
|
|
||||||
|
/* Macro redefinitions for compatibility */
|
||||||
|
#ifdef HAVE_NTRU
|
||||||
|
#define MakeNtruCert wc_MakeNtruCert
|
||||||
|
#endif
|
||||||
|
#if defined(WOLFSSL_SHA512) && !defined(CYASSL_SHA512)
|
||||||
|
#define CYASSL_SHA512
|
||||||
|
#endif
|
||||||
|
#if defined(WOLFSSL_SHA384) && !defined(CYASSL_SHA384)
|
||||||
|
#define CYASSL_SHA384
|
||||||
|
#endif
|
||||||
|
#if defined(WOLFSSL_LEANPSK) && !defined(CYASSL_LEANPSK)
|
||||||
|
#define CYASSL_LEANPSK
|
||||||
|
#endif
|
||||||
|
#if defined(NO_WOLFSSL_MEMORY) && !defined(NO_CYASSL_MEMORY)
|
||||||
|
#define NO_CYASSL_MEMORY
|
||||||
|
#endif
|
||||||
|
#ifdef WOLFSSL_KEY_GEN
|
||||||
|
#define CYASSL_KEY_GEN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* CTAO_CRYPT_SETTINGS_C_H */
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* sha.h
|
/* sha.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -25,67 +25,11 @@
|
||||||
#ifndef CTAO_CRYPT_SHA_H
|
#ifndef CTAO_CRYPT_SHA_H
|
||||||
#define CTAO_CRYPT_SHA_H
|
#define CTAO_CRYPT_SHA_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <wolfssl/wolfcrypt/sha.h>
|
||||||
|
#define InitSha wc_InitSha
|
||||||
#ifdef __cplusplus
|
#define ShaUpdate wc_ShaUpdate
|
||||||
extern "C" {
|
#define ShaFinal wc_ShaFinal
|
||||||
#endif
|
#define ShaHash wc_ShaHash
|
||||||
|
|
||||||
|
|
||||||
/* in bytes */
|
|
||||||
enum {
|
|
||||||
#ifdef STM32F2_HASH
|
|
||||||
SHA_REG_SIZE = 4, /* STM32 register size, bytes */
|
|
||||||
#endif
|
|
||||||
SHA = 1, /* hash type unique */
|
|
||||||
SHA_BLOCK_SIZE = 64,
|
|
||||||
SHA_DIGEST_SIZE = 20,
|
|
||||||
SHA_PAD_SIZE = 56
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef CYASSL_PIC32MZ_HASH
|
|
||||||
#include "port/pic32/pic32mz-crypt.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Sha digest */
|
|
||||||
typedef struct Sha {
|
|
||||||
word32 buffLen; /* in bytes */
|
|
||||||
word32 loLen; /* length in bytes */
|
|
||||||
word32 hiLen; /* length in bytes */
|
|
||||||
word32 buffer[SHA_BLOCK_SIZE / sizeof(word32)];
|
|
||||||
#ifndef CYASSL_PIC32MZ_HASH
|
|
||||||
word32 digest[SHA_DIGEST_SIZE / sizeof(word32)];
|
|
||||||
#else
|
|
||||||
word32 digest[PIC32_HASH_SIZE / sizeof(word32)];
|
|
||||||
pic32mz_desc desc; /* Crypt Engine descripter */
|
|
||||||
#endif
|
|
||||||
} Sha;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API int InitSha(Sha*);
|
|
||||||
CYASSL_API int ShaUpdate(Sha*, const byte*, word32);
|
|
||||||
CYASSL_API int ShaFinal(Sha*, byte*);
|
|
||||||
CYASSL_API int ShaHash(const byte*, word32, byte*);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_FIPS
|
|
||||||
/* fips wrapper calls, user can call direct */
|
|
||||||
CYASSL_API int InitSha_fips(Sha*);
|
|
||||||
CYASSL_API int ShaUpdate_fips(Sha*, const byte*, word32);
|
|
||||||
CYASSL_API int ShaFinal_fips(Sha*, byte*);
|
|
||||||
#ifndef FIPS_NO_WRAPPERS
|
|
||||||
/* if not impl or fips.c impl wrapper force fips calls if fips build */
|
|
||||||
#define InitSha InitSha_fips
|
|
||||||
#define ShaUpdate ShaUpdate_fips
|
|
||||||
#define ShaFinal ShaFinal_fips
|
|
||||||
#endif /* FIPS_NO_WRAPPERS */
|
|
||||||
|
|
||||||
#endif /* HAVE_FIPS */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_SHA_H */
|
#endif /* CTAO_CRYPT_SHA_H */
|
||||||
#endif /* NO_SHA */
|
#endif /* NO_SHA */
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* sha256.h
|
/* sha256.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -28,63 +28,11 @@
|
||||||
#ifndef CTAO_CRYPT_SHA256_H
|
#ifndef CTAO_CRYPT_SHA256_H
|
||||||
#define CTAO_CRYPT_SHA256_H
|
#define CTAO_CRYPT_SHA256_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <wolfssl/wolfcrypt/sha256.h>
|
||||||
|
#define InitSha256 wc_InitSha256
|
||||||
#ifdef __cplusplus
|
#define Sha256Update wc_Sha256Update
|
||||||
extern "C" {
|
#define Sha256Final wc_Sha256Final
|
||||||
#endif
|
#define Sha256Hash wc_Sha256Hash
|
||||||
|
|
||||||
#ifdef CYASSL_PIC32MZ_HASH
|
|
||||||
#include "port/pic32/pic32mz-crypt.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* in bytes */
|
|
||||||
enum {
|
|
||||||
SHA256 = 2, /* hash type unique */
|
|
||||||
SHA256_BLOCK_SIZE = 64,
|
|
||||||
SHA256_DIGEST_SIZE = 32,
|
|
||||||
SHA256_PAD_SIZE = 56
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* Sha256 digest */
|
|
||||||
typedef struct Sha256 {
|
|
||||||
word32 buffLen; /* in bytes */
|
|
||||||
word32 loLen; /* length in bytes */
|
|
||||||
word32 hiLen; /* length in bytes */
|
|
||||||
word32 digest[SHA256_DIGEST_SIZE / sizeof(word32)];
|
|
||||||
word32 buffer[SHA256_BLOCK_SIZE / sizeof(word32)];
|
|
||||||
#ifdef CYASSL_PIC32MZ_HASH
|
|
||||||
pic32mz_desc desc ; /* Crypt Engine descripter */
|
|
||||||
#endif
|
|
||||||
} Sha256;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API int InitSha256(Sha256*);
|
|
||||||
CYASSL_API int Sha256Update(Sha256*, const byte*, word32);
|
|
||||||
CYASSL_API int Sha256Final(Sha256*, byte*);
|
|
||||||
CYASSL_API int Sha256Hash(const byte*, word32, byte*);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_FIPS
|
|
||||||
/* fips wrapper calls, user can call direct */
|
|
||||||
CYASSL_API int InitSha256_fips(Sha256*);
|
|
||||||
CYASSL_API int Sha256Update_fips(Sha256*, const byte*, word32);
|
|
||||||
CYASSL_API int Sha256Final_fips(Sha256*, byte*);
|
|
||||||
#ifndef FIPS_NO_WRAPPERS
|
|
||||||
/* if not impl or fips.c impl wrapper force fips calls if fips build */
|
|
||||||
#define InitSha256 InitSha256_fips
|
|
||||||
#define Sha256Update Sha256Update_fips
|
|
||||||
#define Sha256Final Sha256Final_fips
|
|
||||||
#endif /* FIPS_NO_WRAPPERS */
|
|
||||||
|
|
||||||
#endif /* HAVE_FIPS */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_SHA256_H */
|
#endif /* CTAO_CRYPT_SHA256_H */
|
||||||
#endif /* NO_SHA256 */
|
#endif /* NO_SHA256 */
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* sha512.h
|
/* sha512.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -20,101 +20,21 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef CYASSL_SHA512
|
|
||||||
|
|
||||||
#ifndef CTAO_CRYPT_SHA512_H
|
#ifndef CTAO_CRYPT_SHA512_H
|
||||||
#define CTAO_CRYPT_SHA512_H
|
#define CTAO_CRYPT_SHA512_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <wolfssl/wolfcrypt/sha512.h>
|
||||||
|
#define InitSha512 wc_InitSha512
|
||||||
|
#define Sha512Update wc_Sha512Update
|
||||||
|
#define Sha512Final wc_Sha512Final
|
||||||
|
#define Sha512Hash wc_Sha512Hash
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#if defined(WOLFSSL_SHA384) || defined(HAVE_AESGCM)
|
||||||
extern "C" {
|
#define InitSha384 wc_InitSha384
|
||||||
#endif
|
#define Sha384Update wc_Sha384Update
|
||||||
|
#define Sha384Final wc_Sha384Final
|
||||||
|
#define Sha384Hash wc_Sha384Hash
|
||||||
/* in bytes */
|
#endif /* WOLFSSL_SHA384 */
|
||||||
enum {
|
|
||||||
SHA512 = 4, /* hash type unique */
|
|
||||||
SHA512_BLOCK_SIZE = 128,
|
|
||||||
SHA512_DIGEST_SIZE = 64,
|
|
||||||
SHA512_PAD_SIZE = 112
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* Sha512 digest */
|
|
||||||
typedef struct Sha512 {
|
|
||||||
word32 buffLen; /* in bytes */
|
|
||||||
word32 loLen; /* length in bytes */
|
|
||||||
word32 hiLen; /* length in bytes */
|
|
||||||
word64 digest[SHA512_DIGEST_SIZE / sizeof(word64)];
|
|
||||||
word64 buffer[SHA512_BLOCK_SIZE / sizeof(word64)];
|
|
||||||
} Sha512;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API int InitSha512(Sha512*);
|
|
||||||
CYASSL_API int Sha512Update(Sha512*, const byte*, word32);
|
|
||||||
CYASSL_API int Sha512Final(Sha512*, byte*);
|
|
||||||
CYASSL_API int Sha512Hash(const byte*, word32, byte*);
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(CYASSL_SHA384) || defined(HAVE_AESGCM)
|
|
||||||
|
|
||||||
/* in bytes */
|
|
||||||
enum {
|
|
||||||
SHA384 = 5, /* hash type unique */
|
|
||||||
SHA384_BLOCK_SIZE = 128,
|
|
||||||
SHA384_DIGEST_SIZE = 48,
|
|
||||||
SHA384_PAD_SIZE = 112
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* Sha384 digest */
|
|
||||||
typedef struct Sha384 {
|
|
||||||
word32 buffLen; /* in bytes */
|
|
||||||
word32 loLen; /* length in bytes */
|
|
||||||
word32 hiLen; /* length in bytes */
|
|
||||||
word64 digest[SHA512_DIGEST_SIZE / sizeof(word64)]; /* for transform 512 */
|
|
||||||
word64 buffer[SHA384_BLOCK_SIZE / sizeof(word64)];
|
|
||||||
} Sha384;
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API int InitSha384(Sha384*);
|
|
||||||
CYASSL_API int Sha384Update(Sha384*, const byte*, word32);
|
|
||||||
CYASSL_API int Sha384Final(Sha384*, byte*);
|
|
||||||
CYASSL_API int Sha384Hash(const byte*, word32, byte*);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_FIPS
|
|
||||||
/* fips wrapper calls, user can call direct */
|
|
||||||
CYASSL_API int InitSha512_fips(Sha512*);
|
|
||||||
CYASSL_API int Sha512Update_fips(Sha512*, const byte*, word32);
|
|
||||||
CYASSL_API int Sha512Final_fips(Sha512*, byte*);
|
|
||||||
#ifndef FIPS_NO_WRAPPERS
|
|
||||||
/* if not impl or fips.c impl wrapper force fips calls if fips build */
|
|
||||||
#define InitSha512 InitSha512_fips
|
|
||||||
#define Sha512Update Sha512Update_fips
|
|
||||||
#define Sha512Final Sha512Final_fips
|
|
||||||
#endif /* FIPS_NO_WRAPPERS */
|
|
||||||
|
|
||||||
/* fips wrapper calls, user can call direct */
|
|
||||||
CYASSL_API int InitSha384_fips(Sha384*);
|
|
||||||
CYASSL_API int Sha384Update_fips(Sha384*, const byte*, word32);
|
|
||||||
CYASSL_API int Sha384Final_fips(Sha384*, byte*);
|
|
||||||
#ifndef FIPS_NO_WRAPPERS
|
|
||||||
/* if not impl or fips.c impl wrapper force fips calls if fips build */
|
|
||||||
#define InitSha384 InitSha384_fips
|
|
||||||
#define Sha384Update Sha384Update_fips
|
|
||||||
#define Sha384Final Sha384Final_fips
|
|
||||||
#endif /* FIPS_NO_WRAPPERS */
|
|
||||||
|
|
||||||
#endif /* HAVE_FIPS */
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* CYASSL_SHA384 */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_SHA512_H */
|
#endif /* CTAO_CRYPT_SHA512_H */
|
||||||
#endif /* CYASSL_SHA512 */
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/* tfm.h
|
/* tfm.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of CyaSSL.
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
*
|
*
|
||||||
* CyaSSL is free software; you can redistribute it and/or modify
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* CyaSSL is distributed in the hope that it will be useful,
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
@ -35,665 +35,7 @@
|
||||||
#ifndef CTAO_CRYPT_TFM_H
|
#ifndef CTAO_CRYPT_TFM_H
|
||||||
#define CTAO_CRYPT_TFM_H
|
#define CTAO_CRYPT_TFM_H
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/types.h>
|
#include <wolfssl/wolfcrypt/tfm.h>
|
||||||
#ifndef CHAR_BIT
|
|
||||||
#include <limits.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef MIN
|
|
||||||
#define MIN(x,y) ((x)<(y)?(x):(y))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef MAX
|
|
||||||
#define MAX(x,y) ((x)>(y)?(x):(y))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef NO_64BIT
|
|
||||||
/* autodetect x86-64 and make sure we are using 64-bit digits with x86-64 asm */
|
|
||||||
#if defined(__x86_64__)
|
|
||||||
#if defined(TFM_X86) || defined(TFM_SSE2) || defined(TFM_ARM)
|
|
||||||
#error x86-64 detected, x86-32/SSE2/ARM optimizations are not valid!
|
|
||||||
#endif
|
|
||||||
#if !defined(TFM_X86_64) && !defined(TFM_NO_ASM)
|
|
||||||
#define TFM_X86_64
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#if defined(TFM_X86_64)
|
|
||||||
#if !defined(FP_64BIT)
|
|
||||||
#define FP_64BIT
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
/* use 64-bit digit even if not using asm on x86_64 */
|
|
||||||
#if defined(__x86_64__) && !defined(FP_64BIT)
|
|
||||||
#define FP_64BIT
|
|
||||||
#endif
|
|
||||||
/* if intel compiler doesn't provide 128 bit type don't turn on 64bit */
|
|
||||||
#if defined(FP_64BIT) && defined(__INTEL_COMPILER) && !defined(HAVE___UINT128_T)
|
|
||||||
#undef FP_64BIT
|
|
||||||
#undef TFM_X86_64
|
|
||||||
#endif
|
|
||||||
#endif /* NO_64BIT */
|
|
||||||
|
|
||||||
/* try to detect x86-32 */
|
|
||||||
#if defined(__i386__) && !defined(TFM_SSE2)
|
|
||||||
#if defined(TFM_X86_64) || defined(TFM_ARM)
|
|
||||||
#error x86-32 detected, x86-64/ARM optimizations are not valid!
|
|
||||||
#endif
|
|
||||||
#if !defined(TFM_X86) && !defined(TFM_NO_ASM)
|
|
||||||
#define TFM_X86
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* make sure we're 32-bit for x86-32/sse/arm/ppc32 */
|
|
||||||
#if (defined(TFM_X86) || defined(TFM_SSE2) || defined(TFM_ARM) || defined(TFM_PPC32)) && defined(FP_64BIT)
|
|
||||||
#warning x86-32, SSE2 and ARM, PPC32 optimizations require 32-bit digits (undefining)
|
|
||||||
#undef FP_64BIT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* multi asms? */
|
|
||||||
#ifdef TFM_X86
|
|
||||||
#define TFM_ASM
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_X86_64
|
|
||||||
#ifdef TFM_ASM
|
|
||||||
#error TFM_ASM already defined!
|
|
||||||
#endif
|
|
||||||
#define TFM_ASM
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_SSE2
|
|
||||||
#ifdef TFM_ASM
|
|
||||||
#error TFM_ASM already defined!
|
|
||||||
#endif
|
|
||||||
#define TFM_ASM
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_ARM
|
|
||||||
#ifdef TFM_ASM
|
|
||||||
#error TFM_ASM already defined!
|
|
||||||
#endif
|
|
||||||
#define TFM_ASM
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_PPC32
|
|
||||||
#ifdef TFM_ASM
|
|
||||||
#error TFM_ASM already defined!
|
|
||||||
#endif
|
|
||||||
#define TFM_ASM
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_PPC64
|
|
||||||
#ifdef TFM_ASM
|
|
||||||
#error TFM_ASM already defined!
|
|
||||||
#endif
|
|
||||||
#define TFM_ASM
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_AVR32
|
|
||||||
#ifdef TFM_ASM
|
|
||||||
#error TFM_ASM already defined!
|
|
||||||
#endif
|
|
||||||
#define TFM_ASM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* we want no asm? */
|
|
||||||
#ifdef TFM_NO_ASM
|
|
||||||
#undef TFM_X86
|
|
||||||
#undef TFM_X86_64
|
|
||||||
#undef TFM_SSE2
|
|
||||||
#undef TFM_ARM
|
|
||||||
#undef TFM_PPC32
|
|
||||||
#undef TFM_PPC64
|
|
||||||
#undef TFM_AVR32
|
|
||||||
#undef TFM_ASM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* ECC helpers */
|
|
||||||
#ifdef TFM_ECC192
|
|
||||||
#ifdef FP_64BIT
|
|
||||||
#define TFM_MUL3
|
|
||||||
#define TFM_SQR3
|
|
||||||
#else
|
|
||||||
#define TFM_MUL6
|
|
||||||
#define TFM_SQR6
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef TFM_ECC224
|
|
||||||
#ifdef FP_64BIT
|
|
||||||
#define TFM_MUL4
|
|
||||||
#define TFM_SQR4
|
|
||||||
#else
|
|
||||||
#define TFM_MUL7
|
|
||||||
#define TFM_SQR7
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef TFM_ECC256
|
|
||||||
#ifdef FP_64BIT
|
|
||||||
#define TFM_MUL4
|
|
||||||
#define TFM_SQR4
|
|
||||||
#else
|
|
||||||
#define TFM_MUL8
|
|
||||||
#define TFM_SQR8
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef TFM_ECC384
|
|
||||||
#ifdef FP_64BIT
|
|
||||||
#define TFM_MUL6
|
|
||||||
#define TFM_SQR6
|
|
||||||
#else
|
|
||||||
#define TFM_MUL12
|
|
||||||
#define TFM_SQR12
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef TFM_ECC521
|
|
||||||
#ifdef FP_64BIT
|
|
||||||
#define TFM_MUL9
|
|
||||||
#define TFM_SQR9
|
|
||||||
#else
|
|
||||||
#define TFM_MUL17
|
|
||||||
#define TFM_SQR17
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* some default configurations.
|
|
||||||
*/
|
|
||||||
#if defined(FP_64BIT)
|
|
||||||
/* for GCC only on supported platforms */
|
|
||||||
typedef unsigned long long fp_digit; /* 64bit, 128 uses mode(TI) below */
|
|
||||||
typedef unsigned long fp_word __attribute__ ((mode(TI)));
|
|
||||||
#else
|
|
||||||
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
|
||||||
typedef unsigned __int64 ulong64;
|
|
||||||
#else
|
|
||||||
typedef unsigned long long ulong64;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NO_64BIT
|
|
||||||
typedef unsigned int fp_digit;
|
|
||||||
typedef ulong64 fp_word;
|
|
||||||
#else
|
|
||||||
/* some procs like coldfire prefer not to place multiply into 64bit type
|
|
||||||
even though it exists */
|
|
||||||
typedef unsigned short fp_digit;
|
|
||||||
typedef unsigned int fp_word;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* # of digits this is */
|
|
||||||
#define DIGIT_BIT (int)((CHAR_BIT) * sizeof(fp_digit))
|
|
||||||
|
|
||||||
/* Max size of any number in bits. Basically the largest size you will be
|
|
||||||
* multiplying should be half [or smaller] of FP_MAX_SIZE-four_digit
|
|
||||||
*
|
|
||||||
* It defaults to 4096-bits [allowing multiplications upto 2048x2048 bits ]
|
|
||||||
*/
|
|
||||||
#ifndef FP_MAX_BITS
|
|
||||||
#define FP_MAX_BITS 4096
|
|
||||||
#endif
|
|
||||||
#define FP_MAX_SIZE (FP_MAX_BITS+(8*DIGIT_BIT))
|
|
||||||
|
|
||||||
/* will this lib work? */
|
|
||||||
#if (CHAR_BIT & 7)
|
|
||||||
#error CHAR_BIT must be a multiple of eight.
|
|
||||||
#endif
|
|
||||||
#if FP_MAX_BITS % CHAR_BIT
|
|
||||||
#error FP_MAX_BITS must be a multiple of CHAR_BIT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define FP_MASK (fp_digit)(-1)
|
|
||||||
#define FP_SIZE (FP_MAX_SIZE/DIGIT_BIT)
|
|
||||||
|
|
||||||
/* signs */
|
|
||||||
#define FP_ZPOS 0
|
|
||||||
#define FP_NEG 1
|
|
||||||
|
|
||||||
/* return codes */
|
|
||||||
#define FP_OKAY 0
|
|
||||||
#define FP_VAL 1
|
|
||||||
#define FP_MEM 2
|
|
||||||
|
|
||||||
/* equalities */
|
|
||||||
#define FP_LT -1 /* less than */
|
|
||||||
#define FP_EQ 0 /* equal to */
|
|
||||||
#define FP_GT 1 /* greater than */
|
|
||||||
|
|
||||||
/* replies */
|
|
||||||
#define FP_YES 1 /* yes response */
|
|
||||||
#define FP_NO 0 /* no response */
|
|
||||||
|
|
||||||
/* a FP type */
|
|
||||||
typedef struct {
|
|
||||||
fp_digit dp[FP_SIZE];
|
|
||||||
int used,
|
|
||||||
sign;
|
|
||||||
} fp_int;
|
|
||||||
|
|
||||||
/* externally define this symbol to ignore the default settings, useful for changing the build from the make process */
|
|
||||||
#ifndef TFM_ALREADY_SET
|
|
||||||
|
|
||||||
/* do we want the large set of small multiplications ?
|
|
||||||
Enable these if you are going to be doing a lot of small (<= 16 digit) multiplications say in ECC
|
|
||||||
Or if you're on a 64-bit machine doing RSA as a 1024-bit integer == 16 digits ;-)
|
|
||||||
*/
|
|
||||||
/* need to refactor the function */
|
|
||||||
/*#define TFM_SMALL_SET */
|
|
||||||
|
|
||||||
/* do we want huge code
|
|
||||||
Enable these if you are doing 20, 24, 28, 32, 48, 64 digit multiplications (useful for RSA)
|
|
||||||
Less important on 64-bit machines as 32 digits == 2048 bits
|
|
||||||
*/
|
|
||||||
#if 0
|
|
||||||
#define TFM_MUL3
|
|
||||||
#define TFM_MUL4
|
|
||||||
#define TFM_MUL6
|
|
||||||
#define TFM_MUL7
|
|
||||||
#define TFM_MUL8
|
|
||||||
#define TFM_MUL9
|
|
||||||
#define TFM_MUL12
|
|
||||||
#define TFM_MUL17
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_HUGE_SET
|
|
||||||
#define TFM_MUL20
|
|
||||||
#define TFM_MUL24
|
|
||||||
#define TFM_MUL28
|
|
||||||
#define TFM_MUL32
|
|
||||||
#if (FP_MAX_BITS >= 6144) && defined(FP_64BIT)
|
|
||||||
#define TFM_MUL48
|
|
||||||
#endif
|
|
||||||
#if (FP_MAX_BITS >= 8192) && defined(FP_64BIT)
|
|
||||||
#define TFM_MUL64
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
#define TFM_SQR3
|
|
||||||
#define TFM_SQR4
|
|
||||||
#define TFM_SQR6
|
|
||||||
#define TFM_SQR7
|
|
||||||
#define TFM_SQR8
|
|
||||||
#define TFM_SQR9
|
|
||||||
#define TFM_SQR12
|
|
||||||
#define TFM_SQR17
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_HUGE_SET
|
|
||||||
#define TFM_SQR20
|
|
||||||
#define TFM_SQR24
|
|
||||||
#define TFM_SQR28
|
|
||||||
#define TFM_SQR32
|
|
||||||
#define TFM_SQR48
|
|
||||||
#define TFM_SQR64
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* do we want some overflow checks
|
|
||||||
Not required if you make sure your numbers are within range (e.g. by default a modulus for fp_exptmod() can only be upto 2048 bits long)
|
|
||||||
*/
|
|
||||||
/* #define TFM_CHECK */
|
|
||||||
|
|
||||||
/* Is the target a P4 Prescott
|
|
||||||
*/
|
|
||||||
/* #define TFM_PRESCOTT */
|
|
||||||
|
|
||||||
/* Do we want timing resistant fp_exptmod() ?
|
|
||||||
* This makes it slower but also timing invariant with respect to the exponent
|
|
||||||
*/
|
|
||||||
/* #define TFM_TIMING_RESISTANT */
|
|
||||||
|
|
||||||
#endif /* TFM_ALREADY_SET */
|
|
||||||
|
|
||||||
/* functions */
|
|
||||||
|
|
||||||
/* returns a TFM ident string useful for debugging... */
|
|
||||||
/*const char *fp_ident(void);*/
|
|
||||||
|
|
||||||
/* initialize [or zero] an fp int */
|
|
||||||
#define fp_init(a) (void)XMEMSET((a), 0, sizeof(fp_int))
|
|
||||||
#define fp_zero(a) fp_init(a)
|
|
||||||
|
|
||||||
/* zero/even/odd ? */
|
|
||||||
#define fp_iszero(a) (((a)->used == 0) ? FP_YES : FP_NO)
|
|
||||||
#define fp_iseven(a) (((a)->used >= 0 && (((a)->dp[0] & 1) == 0)) ? FP_YES : FP_NO)
|
|
||||||
#define fp_isodd(a) (((a)->used > 0 && (((a)->dp[0] & 1) == 1)) ? FP_YES : FP_NO)
|
|
||||||
|
|
||||||
/* set to a small digit */
|
|
||||||
void fp_set(fp_int *a, fp_digit b);
|
|
||||||
|
|
||||||
/* copy from a to b */
|
|
||||||
#define fp_copy(a, b) (void)(((a) != (b)) ? ((void)XMEMCPY((b), (a), sizeof(fp_int))) : (void)0)
|
|
||||||
#define fp_init_copy(a, b) fp_copy(b, a)
|
|
||||||
|
|
||||||
/* clamp digits */
|
|
||||||
#define fp_clamp(a) { while ((a)->used && (a)->dp[(a)->used-1] == 0) --((a)->used); (a)->sign = (a)->used ? (a)->sign : FP_ZPOS; }
|
|
||||||
|
|
||||||
/* negate and absolute */
|
|
||||||
#define fp_neg(a, b) { fp_copy(a, b); (b)->sign ^= 1; fp_clamp(b); }
|
|
||||||
#define fp_abs(a, b) { fp_copy(a, b); (b)->sign = 0; }
|
|
||||||
|
|
||||||
/* right shift x digits */
|
|
||||||
void fp_rshd(fp_int *a, int x);
|
|
||||||
|
|
||||||
/* right shift x bits */
|
|
||||||
void fp_rshb(fp_int *a, int x);
|
|
||||||
|
|
||||||
/* left shift x digits */
|
|
||||||
void fp_lshd(fp_int *a, int x);
|
|
||||||
|
|
||||||
/* signed comparison */
|
|
||||||
int fp_cmp(fp_int *a, fp_int *b);
|
|
||||||
|
|
||||||
/* unsigned comparison */
|
|
||||||
int fp_cmp_mag(fp_int *a, fp_int *b);
|
|
||||||
|
|
||||||
/* power of 2 operations */
|
|
||||||
void fp_div_2d(fp_int *a, int b, fp_int *c, fp_int *d);
|
|
||||||
void fp_mod_2d(fp_int *a, int b, fp_int *c);
|
|
||||||
void fp_mul_2d(fp_int *a, int b, fp_int *c);
|
|
||||||
void fp_2expt (fp_int *a, int b);
|
|
||||||
void fp_mul_2(fp_int *a, fp_int *c);
|
|
||||||
void fp_div_2(fp_int *a, fp_int *c);
|
|
||||||
|
|
||||||
/* Counts the number of lsbs which are zero before the first zero bit */
|
|
||||||
/*int fp_cnt_lsb(fp_int *a);*/
|
|
||||||
|
|
||||||
/* c = a + b */
|
|
||||||
void fp_add(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
|
|
||||||
/* c = a - b */
|
|
||||||
void fp_sub(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
|
|
||||||
/* c = a * b */
|
|
||||||
void fp_mul(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
|
|
||||||
/* b = a*a */
|
|
||||||
void fp_sqr(fp_int *a, fp_int *b);
|
|
||||||
|
|
||||||
/* a/b => cb + d == a */
|
|
||||||
int fp_div(fp_int *a, fp_int *b, fp_int *c, fp_int *d);
|
|
||||||
|
|
||||||
/* c = a mod b, 0 <= c < b */
|
|
||||||
int fp_mod(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
|
|
||||||
/* compare against a single digit */
|
|
||||||
int fp_cmp_d(fp_int *a, fp_digit b);
|
|
||||||
|
|
||||||
/* c = a + b */
|
|
||||||
void fp_add_d(fp_int *a, fp_digit b, fp_int *c);
|
|
||||||
|
|
||||||
/* c = a - b */
|
|
||||||
void fp_sub_d(fp_int *a, fp_digit b, fp_int *c);
|
|
||||||
|
|
||||||
/* c = a * b */
|
|
||||||
void fp_mul_d(fp_int *a, fp_digit b, fp_int *c);
|
|
||||||
|
|
||||||
/* a/b => cb + d == a */
|
|
||||||
/*int fp_div_d(fp_int *a, fp_digit b, fp_int *c, fp_digit *d);*/
|
|
||||||
|
|
||||||
/* c = a mod b, 0 <= c < b */
|
|
||||||
/*int fp_mod_d(fp_int *a, fp_digit b, fp_digit *c);*/
|
|
||||||
|
|
||||||
/* ---> number theory <--- */
|
|
||||||
/* d = a + b (mod c) */
|
|
||||||
/*int fp_addmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d);*/
|
|
||||||
|
|
||||||
/* d = a - b (mod c) */
|
|
||||||
/*int fp_submod(fp_int *a, fp_int *b, fp_int *c, fp_int *d);*/
|
|
||||||
|
|
||||||
/* d = a * b (mod c) */
|
|
||||||
int fp_mulmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d);
|
|
||||||
|
|
||||||
/* c = a * a (mod b) */
|
|
||||||
int fp_sqrmod(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
|
|
||||||
/* c = 1/a (mod b) */
|
|
||||||
int fp_invmod(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
|
|
||||||
/* c = (a, b) */
|
|
||||||
/*void fp_gcd(fp_int *a, fp_int *b, fp_int *c);*/
|
|
||||||
|
|
||||||
/* c = [a, b] */
|
|
||||||
/*void fp_lcm(fp_int *a, fp_int *b, fp_int *c);*/
|
|
||||||
|
|
||||||
/* setups the montgomery reduction */
|
|
||||||
int fp_montgomery_setup(fp_int *a, fp_digit *mp);
|
|
||||||
|
|
||||||
/* computes a = B**n mod b without division or multiplication useful for
|
|
||||||
* normalizing numbers in a Montgomery system.
|
|
||||||
*/
|
|
||||||
void fp_montgomery_calc_normalization(fp_int *a, fp_int *b);
|
|
||||||
|
|
||||||
/* computes x/R == x (mod N) via Montgomery Reduction */
|
|
||||||
void fp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp);
|
|
||||||
|
|
||||||
/* d = a**b (mod c) */
|
|
||||||
int fp_exptmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d);
|
|
||||||
|
|
||||||
/* primality stuff */
|
|
||||||
|
|
||||||
/* perform a Miller-Rabin test of a to the base b and store result in "result" */
|
|
||||||
/*void fp_prime_miller_rabin (fp_int * a, fp_int * b, int *result);*/
|
|
||||||
|
|
||||||
/* 256 trial divisions + 8 Miller-Rabins, returns FP_YES if probable prime */
|
|
||||||
/*int fp_isprime(fp_int *a);*/
|
|
||||||
|
|
||||||
/* Primality generation flags */
|
|
||||||
/*#define TFM_PRIME_BBS 0x0001 */ /* BBS style prime */
|
|
||||||
/*#define TFM_PRIME_SAFE 0x0002 */ /* Safe prime (p-1)/2 == prime */
|
|
||||||
/*#define TFM_PRIME_2MSB_OFF 0x0004 */ /* force 2nd MSB to 0 */
|
|
||||||
/*#define TFM_PRIME_2MSB_ON 0x0008 */ /* force 2nd MSB to 1 */
|
|
||||||
|
|
||||||
/* callback for fp_prime_random, should fill dst with random bytes and return how many read [upto len] */
|
|
||||||
/*typedef int tfm_prime_callback(unsigned char *dst, int len, void *dat);*/
|
|
||||||
|
|
||||||
/*#define fp_prime_random(a, t, size, bbs, cb, dat) fp_prime_random_ex(a, t, ((size) * 8) + 1, (bbs==1)?TFM_PRIME_BBS:0, cb, dat)*/
|
|
||||||
|
|
||||||
/*int fp_prime_random_ex(fp_int *a, int t, int size, int flags, tfm_prime_callback cb, void *dat);*/
|
|
||||||
|
|
||||||
/* radix conersions */
|
|
||||||
int fp_count_bits(fp_int *a);
|
|
||||||
int fp_leading_bit(fp_int *a);
|
|
||||||
|
|
||||||
int fp_unsigned_bin_size(fp_int *a);
|
|
||||||
void fp_read_unsigned_bin(fp_int *a, unsigned char *b, int c);
|
|
||||||
void fp_to_unsigned_bin(fp_int *a, unsigned char *b);
|
|
||||||
|
|
||||||
/*int fp_signed_bin_size(fp_int *a);*/
|
|
||||||
/*void fp_read_signed_bin(fp_int *a, unsigned char *b, int c);*/
|
|
||||||
/*void fp_to_signed_bin(fp_int *a, unsigned char *b);*/
|
|
||||||
|
|
||||||
/*int fp_read_radix(fp_int *a, char *str, int radix);*/
|
|
||||||
/*int fp_toradix(fp_int *a, char *str, int radix);*/
|
|
||||||
/*int fp_toradix_n(fp_int * a, char *str, int radix, int maxlen);*/
|
|
||||||
|
|
||||||
|
|
||||||
/* VARIOUS LOW LEVEL STUFFS */
|
|
||||||
void s_fp_add(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
void s_fp_sub(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
void fp_reverse(unsigned char *s, int len);
|
|
||||||
|
|
||||||
void fp_mul_comba(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
|
|
||||||
#ifdef TFM_SMALL_SET
|
|
||||||
void fp_mul_comba_small(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef TFM_MUL3
|
|
||||||
void fp_mul_comba3(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_MUL4
|
|
||||||
void fp_mul_comba4(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_MUL6
|
|
||||||
void fp_mul_comba6(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_MUL7
|
|
||||||
void fp_mul_comba7(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_MUL8
|
|
||||||
void fp_mul_comba8(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_MUL9
|
|
||||||
void fp_mul_comba9(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_MUL12
|
|
||||||
void fp_mul_comba12(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_MUL17
|
|
||||||
void fp_mul_comba17(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef TFM_MUL20
|
|
||||||
void fp_mul_comba20(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_MUL24
|
|
||||||
void fp_mul_comba24(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_MUL28
|
|
||||||
void fp_mul_comba28(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_MUL32
|
|
||||||
void fp_mul_comba32(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_MUL48
|
|
||||||
void fp_mul_comba48(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_MUL64
|
|
||||||
void fp_mul_comba64(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void fp_sqr_comba(fp_int *a, fp_int *b);
|
|
||||||
|
|
||||||
#ifdef TFM_SMALL_SET
|
|
||||||
void fp_sqr_comba_small(fp_int *a, fp_int *b);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef TFM_SQR3
|
|
||||||
void fp_sqr_comba3(fp_int *a, fp_int *b);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_SQR4
|
|
||||||
void fp_sqr_comba4(fp_int *a, fp_int *b);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_SQR6
|
|
||||||
void fp_sqr_comba6(fp_int *a, fp_int *b);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_SQR7
|
|
||||||
void fp_sqr_comba7(fp_int *a, fp_int *b);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_SQR8
|
|
||||||
void fp_sqr_comba8(fp_int *a, fp_int *b);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_SQR9
|
|
||||||
void fp_sqr_comba9(fp_int *a, fp_int *b);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_SQR12
|
|
||||||
void fp_sqr_comba12(fp_int *a, fp_int *b);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_SQR17
|
|
||||||
void fp_sqr_comba17(fp_int *a, fp_int *b);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef TFM_SQR20
|
|
||||||
void fp_sqr_comba20(fp_int *a, fp_int *b);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_SQR24
|
|
||||||
void fp_sqr_comba24(fp_int *a, fp_int *b);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_SQR28
|
|
||||||
void fp_sqr_comba28(fp_int *a, fp_int *b);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_SQR32
|
|
||||||
void fp_sqr_comba32(fp_int *a, fp_int *b);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_SQR48
|
|
||||||
void fp_sqr_comba48(fp_int *a, fp_int *b);
|
|
||||||
#endif
|
|
||||||
#ifdef TFM_SQR64
|
|
||||||
void fp_sqr_comba64(fp_int *a, fp_int *b);
|
|
||||||
#endif
|
|
||||||
/*extern const char *fp_s_rmap;*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used by CyaSSL
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Types */
|
|
||||||
typedef fp_digit mp_digit;
|
|
||||||
typedef fp_word mp_word;
|
|
||||||
typedef fp_int mp_int;
|
|
||||||
|
|
||||||
/* Constants */
|
|
||||||
#define MP_LT FP_LT /* less than */
|
|
||||||
#define MP_EQ FP_EQ /* equal to */
|
|
||||||
#define MP_GT FP_GT /* greater than */
|
|
||||||
#define MP_OKAY FP_OKAY /* ok result */
|
|
||||||
#define MP_NO FP_NO /* yes/no result */
|
|
||||||
#define MP_YES FP_YES /* yes/no result */
|
|
||||||
|
|
||||||
/* Prototypes */
|
|
||||||
int mp_init (mp_int * a);
|
|
||||||
void mp_clear (mp_int * a);
|
|
||||||
int mp_init_multi(mp_int* a, mp_int* b, mp_int* c, mp_int* d, mp_int* e, mp_int* f);
|
|
||||||
|
|
||||||
int mp_add (mp_int * a, mp_int * b, mp_int * c);
|
|
||||||
int mp_sub (mp_int * a, mp_int * b, mp_int * c);
|
|
||||||
int mp_add_d (mp_int * a, mp_digit b, mp_int * c);
|
|
||||||
|
|
||||||
int mp_mul (mp_int * a, mp_int * b, mp_int * c);
|
|
||||||
int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d);
|
|
||||||
int mp_mod(mp_int *a, mp_int *b, mp_int *c);
|
|
||||||
int mp_invmod(mp_int *a, mp_int *b, mp_int *c);
|
|
||||||
int mp_exptmod (mp_int * g, mp_int * x, mp_int * p, mp_int * y);
|
|
||||||
|
|
||||||
int mp_cmp(mp_int *a, mp_int *b);
|
|
||||||
int mp_cmp_d(mp_int *a, mp_digit b);
|
|
||||||
|
|
||||||
int mp_unsigned_bin_size(mp_int * a);
|
|
||||||
int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c);
|
|
||||||
int mp_to_unsigned_bin (mp_int * a, unsigned char *b);
|
|
||||||
|
|
||||||
int mp_sub_d(fp_int *a, fp_digit b, fp_int *c);
|
|
||||||
int mp_copy(fp_int* a, fp_int* b);
|
|
||||||
int mp_isodd(mp_int* a);
|
|
||||||
int mp_iszero(mp_int* a);
|
|
||||||
int mp_count_bits(mp_int *a);
|
|
||||||
int mp_leading_bit(mp_int *a);
|
|
||||||
int mp_set_int(fp_int *a, fp_digit b);
|
|
||||||
void mp_rshb(mp_int *a, int x);
|
|
||||||
|
|
||||||
#ifdef HAVE_ECC
|
|
||||||
int mp_read_radix(mp_int* a, const char* str, int radix);
|
|
||||||
int mp_set(fp_int *a, fp_digit b);
|
|
||||||
int mp_sqr(fp_int *a, fp_int *b);
|
|
||||||
int mp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp);
|
|
||||||
int mp_montgomery_setup(fp_int *a, fp_digit *rho);
|
|
||||||
int mp_div_2(fp_int * a, fp_int * b);
|
|
||||||
int mp_init_copy(fp_int * a, fp_int * b);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(HAVE_ECC) || defined(CYASSL_KEY_GEN)
|
|
||||||
int mp_sqrmod(mp_int* a, mp_int* b, mp_int* c);
|
|
||||||
int mp_montgomery_calc_normalization(mp_int *a, mp_int *b);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CYASSL_KEY_GEN
|
|
||||||
int mp_gcd(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
int mp_lcm(fp_int *a, fp_int *b, fp_int *c);
|
|
||||||
int mp_prime_is_prime(mp_int* a, int t, int* result);
|
|
||||||
#endif /* CYASSL_KEY_GEN */
|
|
||||||
|
|
||||||
CYASSL_API word32 CheckRunTimeFastMath(void);
|
|
||||||
|
|
||||||
/* If user uses RSA, DH, DSA, or ECC math lib directly then fast math FP_SIZE
|
|
||||||
must match, return 1 if a match otherwise 0 */
|
|
||||||
#define CheckFastMathSettings() (FP_SIZE == CheckRunTimeFastMath())
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* CTAO_CRYPT_TFM_H */
|
#endif /* CTAO_CRYPT_TFM_H */
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue