Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.12.0 #136

Merged
merged 331 commits into from
Jan 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
331 commits
Select commit Hold shift + click to select a range
8efd8f9
[WIP] Apply Virgil Security OIDs (lib, foundation)
SergeySeroshtan Oct 30, 2019
569369a
[WIP] Post-quantum extend tests (tests, foundation)
SergeySeroshtan Oct 30, 2019
f674989
Fix gcc error
fryziuk Oct 30, 2019
af7d356
Second iteration of fixing gcc error + fix strstr
fryziuk Oct 30, 2019
f4c93dc
Change unsecure strstr to strnstr. Taken from apple realization
fryziuk Oct 30, 2019
9f9fbe0
Fix braking class RecipientCipher invariant (lib, foundation)
SergeySeroshtan Oct 30, 2019
7229001
[WIP] Add support for compound keys to the KeyAlgFactory (lib, founda…
SergeySeroshtan Oct 30, 2019
d9deef3
Add tests for Compound Keys with class RecipientCipher (tests, founda…
SergeySeroshtan Oct 30, 2019
a62f397
Apply Virgil Security OIDs in the comments (lib, foundation)
SergeySeroshtan Oct 30, 2019
644dd90
[WIP] Add support for compound keys - fix verify (lib, foundation)
SergeySeroshtan Oct 30, 2019
9bb15d1
Add complex test of high level sign/verify operations (tests, foundat…
SergeySeroshtan Oct 30, 2019
6eac885
Add strnlen function
fryziuk Oct 30, 2019
f90b0dd
Remove vsc_buffer_write_str and vscf_strlen functions
fryziuk Oct 31, 2019
addb9ec
[WIP] Add compound private key generation to the KeyProvider (lib, fo…
SergeySeroshtan Oct 31, 2019
0887394
Code format
SergeySeroshtan Oct 31, 2019
7797ad5
Extract common use cases tests within KeyProvider tests (tests, found…
SergeySeroshtan Oct 31, 2019
1c9a125
[WIP] Post quantum - add correspond tests for KeyProvider (tests, fou…
SergeySeroshtan Oct 31, 2019
4dea623
Fix memory leak (tests, foundation)
SergeySeroshtan Oct 31, 2019
7a35bf4
Remove stale files (lib, foundation)
SergeySeroshtan Oct 31, 2019
a1c5a47
Add model attribute <require is_optional="1"/> (codegen)
SergeySeroshtan Oct 31, 2019
e072125
Fix compilation when VSCF_POST_QUANTUM feature is OFF (models, build,…
SergeySeroshtan Oct 31, 2019
b1a7454
Convert Go uint* to C types
andrii-iakovenko Oct 29, 2019
56bbb22
Go wrapper. Fix unit test for foundation package
andrii-iakovenko Nov 5, 2019
c8034aa
Go wrapper: fix function declaration
andrii-iakovenko Nov 6, 2019
39a1fbb
Add asn1 deserializer test
fryziuk Nov 6, 2019
1dd75e9
[WIP] Post quantum - finalizing (tests, foundation)
SergeySeroshtan Nov 7, 2019
408fc0c
Fix cross-project dependency to the class "error" (codegen, wasm)
SergeySeroshtan Nov 8, 2019
d5fca11
[WIP] Post quantum - regenerate code (lib, foundation)
SergeySeroshtan Nov 8, 2019
5b0c4ea
[WIP] Post quantum - fix memory leaks (lib, foundation)
SergeySeroshtan Nov 8, 2019
a91df00
[WIP] Post quantum - minimize openssl presence within round5 (build,…
SergeySeroshtan Nov 8, 2019
f0002f3
[WIP] Post quantum - fix compilation errors when VSCF_POST_QUANTUM=OF…
SergeySeroshtan Nov 8, 2019
0d33078
[WIP] Use a custom "CMakeLists.txt" file for the "round5" (cmake)
SergeySeroshtan Nov 11, 2019
c905d16
Fix cross-platform builds by using Python interpreter within host (cm…
SergeySeroshtan Nov 11, 2019
a7cfe08
[WIP] Patch the "round5" library to use MbedTLS crypto engine (cmake,…
SergeySeroshtan Nov 11, 2019
5080cf1
Drop dependency to the OpenSSL (travis-ci)
SergeySeroshtan Nov 11, 2019
0db6fce
Go wrapper: finish code generation for all libraries
andrii-iakovenko Nov 12, 2019
053f646
[WIP] Use a custom "CMakeLists.txt" file for the "keccak" library (cm…
SergeySeroshtan Nov 12, 2019
2d9f905
Go wrapper: leave CGO instrustions in a single file
andrii-iakovenko Nov 12, 2019
7d63661
[WIP] Add installation steps for libraries: keccak, round5, falcon (c…
SergeySeroshtan Nov 12, 2019
38342aa
Enable post quantum for Apple Frameworks (build, pqc)
SergeySeroshtan Nov 12, 2019
f4d42e2
Fix compilation errors when VSCF_COMPOUND_KEY_ALG=OFF (lib, foundation)
SergeySeroshtan Nov 13, 2019
29b0f9a
[WIP] Add options to build "round5" library examples (build, round5)
SergeySeroshtan Nov 13, 2019
fd28ce2
Eliminate platform RNG from the "falcon" library (build, falcon)
SergeySeroshtan Nov 13, 2019
2caf9fd
Add "critical section" synchronization mechanism (lib, all)
SergeySeroshtan Nov 13, 2019
c86f142
Eliminate platform RNG from the "round5" library (build, round5)
SergeySeroshtan Nov 13, 2019
f42ad95
Eliminate platform RNG from the "falcon" library (2) (build, falcon)
SergeySeroshtan Nov 13, 2019
02f4321
Fix "critical section" synchronization mechanism (lib, all)
SergeySeroshtan Nov 13, 2019
ffa5919
Fix usage of the "round5" library in a multi-threading env (build, ro…
SergeySeroshtan Nov 13, 2019
8be4d3b
[WIP] Fix strnstr read memory out of range.
fryziuk Nov 13, 2019
3ed220a
Add strnlen to codegen
fryziuk Nov 13, 2019
f9a4b23
Delete write str from codegen
fryziuk Nov 13, 2019
4d198f1
Go wrapper: add CGO links to project resources
andrii-iakovenko Nov 14, 2019
30c9f1b
Fix missed "extern" keyword for the "round5" global variables (lib, r…
SergeySeroshtan Nov 14, 2019
31faf26
Remove "example.c" source file (lib, round5)
SergeySeroshtan Nov 14, 2019
0800ffc
Fix usage of the "round5" library in a multi-threading env (2) (build…
SergeySeroshtan Nov 14, 2019
d474d33
Fix PVS Studio warnings (static-code-analyzing)
SergeySeroshtan Nov 14, 2019
dad6c1f
Enable post-quantum builds for the C language (jenkins-ci)
SergeySeroshtan Nov 14, 2019
dd54d87
Add private key test
fryziuk Nov 14, 2019
8b18914
Fix include paths for the "keccak" library (build, cmake)
SergeySeroshtan Nov 14, 2019
595b356
Fix usage of the "restrict" C99 keyword for the MSVC (lib, round5)
SergeySeroshtan Nov 14, 2019
7fff74c
Fix usage of the "restrict" C99 keyword for the MSVC (2) (lib, round5)
SergeySeroshtan Nov 14, 2019
0741d90
Fix usage of the "restrict" C99 keyword for the MSVC (3) (lib, round5)
SergeySeroshtan Nov 14, 2019
a9e084c
Fix include paths for the "keccak" library (2) (build, cmake)
SergeySeroshtan Nov 14, 2019
6fc12ff
Fix the "falcon" library build on Linux with GCC 4.8 (build, falcon, …
SergeySeroshtan Nov 14, 2019
9c71e60
Add ability to redefine feature of libraries and classes (codegen)
SergeySeroshtan Nov 14, 2019
cb182cd
Fix build if VIRGIL_POST_QUANTUM=OFF (cmake, build)
SergeySeroshtan Nov 14, 2019
a8c294e
Enable post-quantum builds for the Java, PHP and Python languages (je…
SergeySeroshtan Nov 14, 2019
dd7b2d0
Fix return of readonly interfaces (codegen, swift)
SergeySeroshtan Nov 15, 2019
b906707
Move methods that accept "disown" arguments to the "private" API (cod…
SergeySeroshtan Nov 15, 2019
d63d128
Fix compute shared key for ECC algorithms (lib, foundation)
SergeySeroshtan Nov 18, 2019
f054b91
Bump version to the v0.12.0-dev1 [ci skip]
SergeySeroshtan Nov 18, 2019
6bde116
Update ChangeLog according to the version v0.11.1 [ci skip]
SergeySeroshtan Nov 18, 2019
396266c
Merge branch 'develop' into feature/FUZZY-TESTS
fryziuk Nov 18, 2019
58b4f93
Merge branch 'develop' into feature/post-quantum-crypto
SergeySeroshtan Nov 18, 2019
67081cd
Fix typo
SergeySeroshtan Nov 18, 2019
e1cad0e
Add optional build for the "falcon" library executables (build, lib, …
SergeySeroshtan Nov 18, 2019
acd0f01
Upgrade the "nanopb" 0.3.9.1 -> 0.3.9.4 (lib, nanopb)
SergeySeroshtan Nov 19, 2019
fdabc19
Cleanup Travis-CI config file
SergeySeroshtan Nov 19, 2019
1bbf27a
Delete ASAN. Fix discussions
fryziuk Nov 19, 2019
66f251c
Use function vsc_data() to initialize vsc_data_t strcuture
fryziuk Nov 19, 2019
b82eae5
Run codegen
fryziuk Nov 19, 2019
fe99442
Fix spaces
fryziuk Nov 19, 2019
52c02c9
Fix vscf_memory codegen
fryziuk Nov 19, 2019
d39416e
Fix build
fryziuk Nov 19, 2019
8431f28
Go wrapper: rename interfaces and enums, add finalizers.
andrii-iakovenko Nov 20, 2019
7a0b927
Go wrapper: fix finalizers
andrii-iakovenko Nov 21, 2019
97dd3e6
Go wrapper: fix finalizers
andrii-iakovenko Nov 21, 2019
c9db6f0
Go wrapper: add keepAlive
andrii-iakovenko Nov 21, 2019
a48c759
!!! Change cipher's interface constants to methods (models, foundation)
SergeySeroshtan Nov 21, 2019
c9e9ecf
!!! Extend interface "Cipher" by adding "state()" method (models, fou…
SergeySeroshtan Nov 21, 2019
e54aa7e
Go wrapper: fix dependency methods
andrii-iakovenko Nov 25, 2019
c428f96
Add mingw-std-threads. To fix benchmarks build on Windows
fryziuk Nov 25, 2019
30c96eb
!!! Extend interface "Cipher" by adding "state()" method (2) (models,…
SergeySeroshtan Nov 25, 2019
6f5de74
[WIP] Add class PaddingCipher (lib, foundation)
SergeySeroshtan Nov 25, 2019
53eef17
Fix benchmark build for MSVC
fryziuk Nov 25, 2019
c33711e
Fix double link of benchmark::benchmark lib
fryziuk Nov 25, 2019
76a8ecb
Merge pull request #126 from VirgilSecurity/bug/benchmarks-windows-build
SergeySeroshtan Nov 25, 2019
5b98166
Fix MSVC and MinGW linking to the project's static libraries with (l…
SergeySeroshtan Nov 25, 2019
e32cc24
Fix MSVC and MinGW linking to the project's static libraries (2) (cod…
SergeySeroshtan Nov 26, 2019
0551b9c
Merge branch 'develop' into feature/wrapper-go
fryziuk Nov 26, 2019
e5d984b
Restore "main.xml" to the initial state (codegen, models)
fryziuk Nov 26, 2019
b3e9719
Merge branch 'develop' into feature/FUZZY-TESTS
fryziuk Nov 26, 2019
7d33e7b
remove pythia
tochka Nov 26, 2019
cfd39a8
Add CryptoAgility for class PaddingCipher (lib, foundation)
SergeySeroshtan Nov 26, 2019
72434b6
Fix discussions. Clang-format code
fryziuk Nov 26, 2019
8a18a91
Fix "private" constants for Java (codegen)
SergeySeroshtan Nov 26, 2019
3ce4684
Fix "private" constants for Python (codegen)
SergeySeroshtan Nov 26, 2019
b56ddfd
Merge pull request #124 from VirgilSecurity/feature/FUZZY-TESTS
SergeySeroshtan Nov 26, 2019
703a3c3
Fix "private" constants for Python (2) (codegen)
SergeySeroshtan Nov 26, 2019
bfc4668
Delete useless headers in fuzzy tests
fryziuk Nov 26, 2019
bfbcf6d
Add "alg info der deserializer" and "key provider" import public key …
fryziuk Nov 26, 2019
2f06e00
Fix "private" constants for Python (3) (codegen)
SergeySeroshtan Nov 26, 2019
14e3077
Add test RecipientCipher + PaddingCipher (tests, foundation)
SergeySeroshtan Nov 26, 2019
08e0068
!!! Make "const" methods for next interfaces (models, lib, foundation)
SergeySeroshtan Nov 26, 2019
f8a8dcc
Merge branch 'develop' into feature/cipher-with-padding
SergeySeroshtan Nov 26, 2019
00a36d0
Fix typo
SergeySeroshtan Nov 26, 2019
3127408
Add recipient cipher fuzzy test dectypt message with ed25519 key
fryziuk Nov 26, 2019
84c67da
Merge branch 'develop' into feature/post-quantum-crypto
SergeySeroshtan Nov 27, 2019
ecc7a68
Add fuzzy test with message info
fryziuk Nov 27, 2019
659ea29
Go wrapper: remove Pythia module
andrii-iakovenko Nov 27, 2019
87f09d3
Merge branch 'feature/wrapper-go' of https://github.com/VirgilSecurit…
andrii-iakovenko Nov 27, 2019
5809b7d
Add fuzzytest message info der serializer deserialize
fryziuk Nov 28, 2019
c91c8fa
Fix headers
fryziuk Nov 28, 2019
2f54819
Fix memory leak in fuzzy test. Fix naming
fryziuk Nov 28, 2019
686a3fe
Fix strnstr function (codegen, models)
SergeySeroshtan Nov 28, 2019
73469b8
Fix strnstr function (codegen, models)
SergeySeroshtan Nov 28, 2019
0202ce4
Regenerate code
SergeySeroshtan Nov 28, 2019
d98a726
Fix typo (tests, foundation)
SergeySeroshtan Nov 28, 2019
d1e70b9
Refactor pem unwrap
fryziuk Nov 28, 2019
55f0508
Optimize pem unwrap
fryziuk Nov 28, 2019
d1496db
Remove space
fryziuk Nov 28, 2019
67fe948
Rename tag ending name
fryziuk Nov 28, 2019
16113a7
Implement KeySigner interface by ChainedKeyAlg (lib, foundation)
SergeySeroshtan Nov 28, 2019
8523e58
Merge pull request #128 from VirgilSecurity/feature/FUZZY-TESTS
SergeySeroshtan Nov 28, 2019
e85a8e1
Fix typo (models, lib, foundation)
SergeySeroshtan Nov 28, 2019
e14c1f7
Merge branch 'feature/post-quantum-crypto' into feature/wrapper-go
tochka Nov 29, 2019
08b383b
update codegen
tochka Nov 29, 2019
3217c1c
Go wrapper: remove keepAlive for errors
andrii-iakovenko Nov 29, 2019
4c20575
Reformat code
SergeySeroshtan Nov 29, 2019
0ce3bea
Fix test
SergeySeroshtan Nov 29, 2019
a514a40
Revert "Patch nanopb plug-in with a suitable Python interpreter (cmake)"
SergeySeroshtan Nov 29, 2019
e1713df
Fix test
SergeySeroshtan Nov 29, 2019
a62b847
Replace method "append data" with "write data" where a "buffer" resiz…
SergeySeroshtan Dec 2, 2019
82a19ba
update go wrapper
tochka Dec 2, 2019
6dc8687
Merge branch 'develop' into feature/cipher-with-padding
SergeySeroshtan Dec 3, 2019
f536911
Go wrapper: add new GCO libraries
andrii-iakovenko Dec 4, 2019
038176a
clang format
tochka Dec 4, 2019
d9922ad
remove unused go package
tochka Dec 4, 2019
a18127d
Merge branch 'feature/wrapper-go' of https://github.com/VirgilSecurit…
tochka Dec 4, 2019
2621818
[WIP] Extract padding functionality from the "PaddingCipher" (lib, fo…
SergeySeroshtan Dec 4, 2019
ad9fa0f
[WIP] Hide class "PaddingCipher" to the private scope (lib, foundation)
SergeySeroshtan Dec 5, 2019
d6ddf38
Fix "scoped components" for modules (codegen)
SergeySeroshtan Dec 5, 2019
468af5f
Regenerate code
SergeySeroshtan Dec 5, 2019
7f480c7
Remove quotes from the model that breaks Python (codegen)
SergeySeroshtan Dec 5, 2019
677b8a1
Replace post-quantum key generation mechanism (lib, foundation, pqc)
SergeySeroshtan Dec 6, 2019
3292eca
Fix _vscf_impl_tag.py file generation
Imelstorm Dec 6, 2019
620a465
Add class "KeyInfo" to inspect key details (lib, foundation)
SergeySeroshtan Dec 6, 2019
79a839d
Merge branch 'develop' into feature/post-quantum-crypto
SergeySeroshtan Dec 6, 2019
b79e28e
Merge pull request #125 from VirgilSecurity/feature/post-quantum-crypto
SergeySeroshtan Dec 6, 2019
abfb396
Merge branch 'develop' into feature/cipher-with-padding
SergeySeroshtan Dec 7, 2019
51e1bd8
[WIP] Move class "PaddingCipher" to the internal scope (lib, foundation)
SergeySeroshtan Dec 9, 2019
9b4099f
Revert "!!! Change cipher's interface constants to methods (models, f…
SergeySeroshtan Dec 9, 2019
b03ada0
Regenerate code
SergeySeroshtan Dec 9, 2019
ab9f6d3
Fix IMPL TAG generation (codegen, wasm)
SergeySeroshtan Dec 9, 2019
7a6d7fc
Add default comment to a class property (codegen)
SergeySeroshtan Dec 9, 2019
2cd5b20
Regenerate code
SergeySeroshtan Dec 9, 2019
70c032d
Fix typo in comments
SergeySeroshtan Dec 9, 2019
a8c5898
Merge pull request #127 from VirgilSecurity/feature/cipher-with-padding
SergeySeroshtan Dec 9, 2019
372aacb
Allow model <length argument="arg" cast="data_length"/> (codegen)
SergeySeroshtan Dec 9, 2019
c09b59b
Remove signature from the "compound public key" (lib, foundation)
SergeySeroshtan Dec 10, 2019
5472ffb
Add tests "extractPublicKey(privateKey) == publicKey" (tests, foundat…
SergeySeroshtan Dec 10, 2019
a20f5f9
Merge pull request #129 from VirgilSecurity/review/compound-keys
SergeySeroshtan Dec 10, 2019
96fc321
Use the optimized version of the "round5" (thirdparty)
SergeySeroshtan Dec 11, 2019
06c71ae
Fix recipient cipher with padding encryption and signatures (lib, fou…
SergeySeroshtan Dec 11, 2019
ef2ebde
Remove debug printf (tests)
SergeySeroshtan Dec 11, 2019
7f03fcf
Fix windows build for optimized version of the "round5" (thirdparty)
SergeySeroshtan Dec 11, 2019
cf0e4b9
Fix "includes" within the "round5" model (lib, foundation, pqc)
SergeySeroshtan Dec 12, 2019
59db637
Merge branch 'develop' into improvement/apply-pqc-optimizations
SergeySeroshtan Dec 12, 2019
2190714
merge PQC improvement
tochka Dec 16, 2019
64c025a
update go mod
tochka Dec 16, 2019
04ec877
Fix "round5 always build" inconvenience (cmake, thirdparty, round5)
SergeySeroshtan Dec 16, 2019
dfb89c5
UOKMS prototype
SanjoDeundiak Dec 16, 2019
1c11123
Fixed uokms encrypt/decrypt flow
SanjoDeundiak Dec 17, 2019
1ee4b17
Fixed phe client
SanjoDeundiak Dec 17, 2019
d9dd624
Refactoring proofs
SanjoDeundiak Dec 17, 2019
1d5cf50
Preparing proofs for uokms
SanjoDeundiak Dec 18, 2019
6200d1b
Added proofs for uokms
SanjoDeundiak Dec 19, 2019
672686e
Fixed memory leaks
SanjoDeundiak Dec 19, 2019
c540c2b
Refactor + Docs + Wrappers codegen
SanjoDeundiak Dec 19, 2019
d880370
Fixed memory leak. Added hkdf const
SanjoDeundiak Dec 20, 2019
21cb6af
Added more UOKMS tests
SanjoDeundiak Dec 20, 2019
8d9fd3a
Fixing memory leaks in tests
SanjoDeundiak Dec 20, 2019
1b34532
Fixing tests
SanjoDeundiak Dec 20, 2019
149052a
Replace "chained" key algorithm with a "hybrid" key algorithm (lib, f…
SergeySeroshtan Dec 24, 2019
4039a63
Enable the Post-Quantum by default (lib, foundation, pqc)
SergeySeroshtan Dec 24, 2019
33fa79e
Fix typo
SergeySeroshtan Dec 24, 2019
63fcdc1
Merge pull request #131 from VirgilSecurity/develop-phe-kms
SergeySeroshtan Dec 24, 2019
5f6bd7b
Merge branch 'develop' into improvement/apply-pqc-optimizations
SergeySeroshtan Dec 24, 2019
afa3334
Fix multi-threading test (thridparty, round5)
SergeySeroshtan Dec 24, 2019
ce8a80e
Merge pull request #130 from VirgilSecurity/improvement/apply-pqc-opt…
SergeySeroshtan Dec 24, 2019
b16e08c
Fixing UOKMS protobuf issue
SanjoDeundiak Dec 24, 2019
bfd43df
Merge pull request #132 from VirgilSecurity/develop-uokms-pb-fix
SanjoDeundiak Dec 24, 2019
d2bf89c
Fix interface model "kem" (codegen, models, foundation)
SergeySeroshtan Dec 24, 2019
edf201a
Uncomment accidentally commented tests (tests, foundation)
SergeySeroshtan Dec 25, 2019
1a7bd49
Add test case related to the signed decryption (tests, foundation)
SergeySeroshtan Dec 25, 2019
49138d6
Fix typo
SergeySeroshtan Dec 25, 2019
9e3d966
Fix HKDF OIDs (lib, foundation)
SergeySeroshtan Dec 25, 2019
b0e28a6
merge develop
tochka Dec 25, 2019
a50e05b
Fix padding decryption (lib, foundation)
SergeySeroshtan Dec 25, 2019
d1fc0c4
Merge pull request #133 from VirgilSecurity/bugfix/fix-invalid-hkdf-oids
SanjoDeundiak Dec 25, 2019
a53e60a
Merge branch 'develop' into bugfix/fix-padding-decryption
SanjoDeundiak Dec 25, 2019
20d971c
Merge pull request #134 from VirgilSecurity/bugfix/fix-padding-decryp…
SanjoDeundiak Dec 25, 2019
afb8eb4
Restore script "build_apple_frameworks.sh" [ci skip]
SergeySeroshtan Dec 25, 2019
c2db3fd
Fix interface model "kem" 2 (codegen, models, foundation)
SergeySeroshtan Dec 25, 2019
0aca22b
!!! Remove invalid HKDF OIDs (lib, foundation)
SergeySeroshtan Dec 25, 2019
f08141a
Merge remote-tracking branch 'origin/develop' into feature/wrapper-go
tochka Dec 26, 2019
2aeb3f7
Fix Java tests (wrappers)
SergeySeroshtan Dec 26, 2019
618ab7b
Cleanup decryption cipher when start a new decryption via RecipientCi…
SergeySeroshtan Dec 26, 2019
305b181
Migrate to the 'build-win10' Jenkins node [ci skip]
SergeySeroshtan Dec 26, 2019
ef5869e
Bump version to the v0.12.0-dev2 [ci skip]
SergeySeroshtan Dec 26, 2019
702292a
add generated wrapper for go. tests into go sdk don't pass
tochka Dec 27, 2019
3ea7869
Go wrapper: fix constants and buffer wrapper generation
andrii-iakovenko Dec 27, 2019
8ccc9cb
Allow append data to the empty buffer (lib, common)
SergeySeroshtan Dec 27, 2019
c547240
Fix padding cipher precondition check (lib, foundation)
SergeySeroshtan Dec 27, 2019
cc35948
Fix RecipientCipher decryption (lib, foundation)
SergeySeroshtan Dec 27, 2019
55d66d9
Add functional tests for RecipientCipher (test, foundation)
SergeySeroshtan Dec 27, 2019
397c4e9
Bump version to the v0.12.0-dev3 [ci skip]
SergeySeroshtan Dec 27, 2019
ec9be2d
Go wrapper: map size_t to int
andrii-iakovenko Dec 27, 2019
612c9fb
Fix functional tests for RecipientCipher (test, foundation)
SergeySeroshtan Dec 27, 2019
ee61e2c
Go wrapper: map size_t to uint
andrii-iakovenko Dec 30, 2019
351aac4
Go wrapper: rename private methods that work with buffer
andrii-iakovenko Dec 30, 2019
50b6851
Merge branch 'develop' into feature/wrapper-go-debug
tochka Dec 30, 2019
4acc41a
Go wrapper: generate platform specific CGO directives
andrii-iakovenko Dec 30, 2019
5c6ed39
Merge branch 'feature/wrapper-go-debug' of https://github.com/VirgilS…
andrii-iakovenko Dec 30, 2019
be4c75a
Go wrapper: move CGO directives to platform file
andrii-iakovenko Dec 30, 2019
4355d0f
Merge pull request #135 from VirgilSecurity/feature/wrapper-go
SergeySeroshtan Dec 31, 2019
fc8ea07
Merge branch 'master' into develop
SergeySeroshtan Dec 31, 2019
5972617
Bump version to the v0.12.0-dev4 [ci skip]
SergeySeroshtan Dec 31, 2019
b0680f8
Bump version to the v0.12.0-rc1 [ci skip]
SergeySeroshtan Dec 31, 2019
a2e8879
Update ChangeLog according to the version v0.12.0 [ci skip]
SergeySeroshtan Dec 31, 2019
05b5082
Update README according to the version v0.12.0 [ci skip]
SergeySeroshtan Jan 8, 2020
8e2c6e7
Update release date within ChangeLog according to the version v0.12.0…
SergeySeroshtan Jan 8, 2020
afdf0b0
Bump version to the v0.12.0 [ci skip]
SergeySeroshtan Jan 8, 2020
6d4e831
Changed the PHE service link
Jan 8, 2020
01d259f
Updated the LICENSE file
Jan 8, 2020
1ada849
Updated Copyright info
Jan 8, 2020
f682948
Update copyright dates [ci skip]
SergeySeroshtan Jan 8, 2020
5f60504
Fix the third-party libraries name collision (build, apple, android)
SergeySeroshtan Jan 8, 2020
1b8ffd1
Fix the third-party libraries name collision (build, android)
SergeySeroshtan Jan 9, 2020
f4bd967
Update release date within ChangeLog according to the version v0.12.0…
SergeySeroshtan Jan 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Go wrapper. Fix unit test for foundation package
  • Loading branch information
andrii-iakovenko committed Nov 6, 2019
commit 56bbb22ab0daae287f21bc19c1d5de1a39e96416
204 changes: 169 additions & 35 deletions codegen/go.gsl
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ endfunction
function go_derive_constant_type (constant, instance, go_project)
#check_arguments (my, "constant, instance, go_project", my)

if item_in(my.instance, "enum")
if item_in (my.instance, "enum")
if my.instance.name = "status"
return "int"
else
Expand Down Expand Up @@ -1359,8 +1359,11 @@ function go_create_func_from_constant (instance, constant, destination, go_proje
. = go_format_description (my.constant) ?
.name = go_derive_func_name_by_constant (my.constant)
.visibility = "public"
.is_static = "1"


if !item_in (my.instance, "interface")
.is_static = "1"
endif

my.type = go_derive_constant_type (my.constant, my.instance, my.go_project)

new go_return to go_func
Expand Down Expand Up @@ -1563,7 +1566,7 @@ function go_create_struct_close (go_struct, class, go_project, meta)

new go_func to my.go_struct
. = "/// Release underlying C context."
.name = "close"
.name = "clear"

new go_code to go_func
. = "\
Expand Down Expand Up @@ -2147,7 +2150,7 @@ function go_format_c_proxy_args (class, method)
my.proxy_arg = "$(my.arg_name:)Data"

elsif string_equal (argument.class, "buffer")
my.proxy_arg = "$(my.arg_name:)Buf"
my.proxy_arg = "$(my.arg_name:)Buf.ctx"

elsif string_equal (argument.class, "error")
my.proxy_arg = "&$(my.arg_name:)"
Expand Down Expand Up @@ -2218,6 +2221,8 @@ function go_wrap_c_proxy_call (go_func, proxy_call, proxy_return_type, proxy_ret

# Wrap strings.
for my.go_func.go_argument where is_true (0.is_string)
go_create_import ("unsafe", "unsafe", go_module)

my.string_name = "$(go_argument.name:)Str"

my.strings_init ?= ""
Expand All @@ -2235,34 +2240,21 @@ function go_wrap_c_proxy_call (go_func, proxy_call, proxy_return_type, proxy_ret
echo_debug_item (my.go_func)
endif
assert_attribute (go_return, "length_getter", my)

go_create_import ("unsafe", "unsafe", my.go_module)

my.buffer_name = go_return.name ? "result"

my.buffers_instantiation ?= ""
my.buffer_err_args = go_format_result_nil_args ("$(my.buffer_name:)BufErr", my.go_func, my.go_project)
my.buffers_instantiation += terminator + format_left ("\
$(my.buffer_name:)Count := C.ulong($(go_return.length_getter:))
$(my.buffer_name:)Memory := make([]byte, int(C.vsc_buffer_ctx_size() + $(my.buffer_name:)Count))
$(my.buffer_name:)Buf := (*C.vsc_buffer_t)(unsafe.Pointer(&$(my.buffer_name:)Memory[0]))
$(my.buffer_name:)Data := $(my.buffer_name:)Memory[int(C.vsc_buffer_ctx_size()):]
$(my.buffer_method_init:)($(my.buffer_name:)Buf)
$(my.buffer_method_use:)($(my.buffer_name:)Buf, (*C.byte)(unsafe.Pointer(&$(my.buffer_name:)Data[0])), $(my.buffer_name:)Count)
defer C.vsc_buffer_delete($(my.buffer_name:)Buf)
$(my.buffer_name:)Buf, $(my.buffer_name:)BufErr := bufferNewBuffer(int($(go_return.length_getter:)))
if $(my.buffer_name:)BufErr != nil {
return $(my.buffer_err_args:)
}
defer $(my.buffer_name:)Buf.clear()
")

my.buffers_init ?= ""
#TODO
#my.buffers_init += terminator + format_left("\
# C..(c_project_common_class_buffer_method_use)($(my.buffer_name:)Buf, \
# $(my.buffer_name:)Pointer.bindMemory(to: byte.self).baseAddress, $(my.buffer_name:)Count)
#")

my.buffers_shrink ?= ""
#TODO
#my.buffers_shrink += format_left ("\
# $(my.buffer_name:).count := C..(c_project_common_class_buffer_method_len)($(my.buffer_name:)Buf)
#")
endfor

# Wrap input data.
Expand All @@ -2272,7 +2264,7 @@ function go_wrap_c_proxy_call (go_func, proxy_call, proxy_return_type, proxy_ret

my.buffers_init ?= ""
my.buffers_init += format_left("\
$(my.data_name:) := $(my.data_method_data:)((*C.uint8_t)(&$(go_argument.name:)[0]), C.size_t(len($(go_argument.name:))))
$(my.data_name:) := helperWrapData ($(go_argument.name:))
")
endfor

Expand Down Expand Up @@ -2380,7 +2372,7 @@ function go_wrap_c_returned_value (go_return, go_module, go_project)
scope my.go_return

if is_true (0.is_data)
return "helperDataToBytes($(my.name:)) /* r1 */"
return "helperExtractData($(my.name:)) /* r1 */"

elsif is_true (0.is_buffer) & is_false (0.was_argument)
return "Data.init(bytes: C..(c_project_common_class_buffer_method_bytes)($(my.name:)), " + \
Expand All @@ -2401,7 +2393,7 @@ function go_wrap_c_returned_value (go_return, go_module, go_project)
endif

elsif is_true (0.is_class) & is_true (0.is_buffer)
return "$(my.name:)Data[0:C.vsc_buffer_len($(my.name:)Buf)] /* r7 */"
return "$(my.name:)Buf.getData() /* r7 */"

elsif is_true (0.is_enum)
return "$(my.type:)($(my.name:)) /* r8 */"
Expand Down Expand Up @@ -2565,34 +2557,36 @@ function go_finalize_implementation_helper_modules (go_project, meta)
for my.go_project.go_import
copy go_import to go_module
endfor

go_create_import ("unsafe", "unsafe", go_module)

new go_struct to go_module
.name = "helper"
.visibility = "private"

new go_func to go_struct
.name = "DataToBytes"
.name = "BytesToBytePtr"
.is_static = "1"

new go_argument to go_func
.name = "data"
.type = "C..(c_project_common_class_data_struct_data)"
.type = "[]byte"
endnew

new go_return to go_func
.type = "[]byte"
.type = "*C.uint8_t"
endnew

#TODO
new go_code to go_func
. = format_left("\
return []byte(\"Go\")
return (*C.uint8_t)(&data[0])
")
endnew
endnew

new go_func to go_struct
.name = "BytesToBytePtr"
.name = "WrapData"
.is_static = "1"

new go_argument to go_func
Expand All @@ -2601,17 +2595,157 @@ function go_finalize_implementation_helper_modules (go_project, meta)
endnew

new go_return to go_func
.type = "*C.uint8_t"
.type = "C.vsc_data_t"
endnew

#TODO
new go_code to go_func
. = format_left("\
return (*C.uint8_t)(&data[0])
if len(data) == 0 {
return C..(c_project_common_class_data_method_empty)()
}
return C..(c_project_common_class_data_method_data)((*C.uint8_t)(&data[0]), C.size_t(len(data)))
")
endnew
endnew

new go_func to go_struct
.name = "ExtractData"
.is_static = "1"

new go_argument to go_func
.name = "data"
.type = "C.vsc_data_t"
endnew

new go_return to go_func
.type = "[]byte"
endnew

new go_code to go_func
. = format_left("\
newSize := data.len
//FIXME Verify data is not corrupted
//if newSize < len(data.bytes) {
// panic(\"Underlying C buffer corrupt the memory.\")
//}
return C.GoBytes(unsafe.Pointer(data.bytes), C.int(newSize))
")
endnew
endnew
endnew

new go_struct to go_module
.name = "buffer"
.visibility = "private"

new go_field to go_struct
.name = "memory"
.type = "[]byte"
endnew

new go_field to go_struct
.name = "ctx"
.type = "*C..(c_project_common_class_buffer_struct_buffer)"
endnew

new go_field to go_struct
.name = "data"
.type = "[]byte"
endnew

new go_func to go_struct
.name = "NewBuffer"
.is_static = "1"
.throws = "1"

new go_argument to go_func
.name = "cap"
.type = "int"
endnew

new go_return to go_func
.type = "*buffer"
endnew

new go_code to go_func
. = format_left("\
capacity := C.size_t(cap)
if capacity == 0 {
return nil, &$(go_derive_enum_status_name (my.go_project):){-1,\"Buffer with zero capacity is not allowed.\"}
}

ctxLen := C.vsc_buffer_ctx_size()
memory := make([]byte, int(ctxLen + capacity))
ctx := (*C..(c_project_common_class_buffer_struct_buffer))(unsafe.Pointer(&memory[0]))
data := memory[int(ctxLen):]

C.vsc_buffer_init(ctx)
C.vsc_buffer_use(ctx, (*C.byte)(unsafe.Pointer(&data[0])), capacity)

return &buffer {
memory: memory,
ctx: ctx,
data: data,
}, nil
")
endnew
endnew

new go_func to go_struct
.name = "getData"

new go_return to go_func
.type = "[]byte"
endnew

new go_code to go_func
. = format_left("\
newSize := int(C..(c_project_common_class_buffer_method_len)(this.ctx))
if newSize > len(this.data) {
panic (\"Underlying C buffer corrupt the memory.\")
}
return this.data[:newSize]
")
endnew
endnew

new go_func to go_struct
.name = "cap"

new go_return to go_func
.type = "int"
endnew

new go_code to go_func
. = format_left("\
return int(C..(c_project_common_class_buffer_method_capacity)(this.ctx))
")
endnew
endnew

new go_func to go_struct
.name = "len"

new go_return to go_func
.type = "int"
endnew

new go_code to go_func
. = format_left("\
return int(C..(c_project_common_class_buffer_method_len)(this.ctx))
")
endnew
endnew

new go_func to go_struct
.name = "clear"

new go_code to go_func
. = format_left("\
C..(c_project_common_class_buffer_method_delete)(this.ctx)
")
endnew
endnew
endnew
endnew
endfunction
Expand Down
1 change: 1 addition & 0 deletions codegen/go_codegen.gsl
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ function go_generate_sources (go_project)
newline()

for go_module.go_struct
newline()
go_insert_struct (go_struct)
endfor

Expand Down
Loading