Recent

Author Topic: CryptoLib4Pascal  (Read 1736 times)

Xor-el

  • Sr. Member
  • ****
  • Posts: 411
CryptoLib4Pascal
« on: March 13, 2026, 11:36:08 pm »
CryptoLib4Pascal – Major Update (v3.2)

Hi everyone,

CryptoLib4Pascal has finally received a long-overdue major update. The library has gone through significant internal refactoring and now includes support for several cryptographic algorithms and standards that were previously missing.

The latest version is v3.2.

What's New

Core Updates
  • Major internal code refactoring
  • Improved structure for easier extension and maintenance
  • Various performance and stability improvements

New Algorithm Support

RSA
  • PKCS#1
  • OAEP
  • PSS

Modern Curve/Key Exchange Support
  • Ed448
  • X448
Follows the specifications in RFC 7748 and RFC 8032.

AEAD Algorithms
  • AES-GCM
  • AES-GCM-SIV
  • AES-CCM
  • AES-EAX
  • AES-OCB
  • ChaCha20-Poly1305

Certificate and Key Infrastructure
  • PEM reader/writer with password support
  • PKCS#12 certificate store and builder
  • PKCS#10 certificate request (CSR) builder
  • X.509 certificate infrastructure (generation, parsing, extensions)

Bitcoin Related Cryptography

Schnorr Signatures (BIP-340) updated to match the official specification 
https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki

MuSig2 (BIP-327) multi-signature protocol implemented 
https://github.com/bitcoin/bips/blob/master/bip-0327.mediawiki

Supported Compiler Versions

Delphi
  • 10.4 Sydney or later

FreePascal
  • 3.2.4 or later

Development Branch 
https://github.com/Xor-el/CryptoLib4Pascal/tree/vNext

Examples 
https://github.com/Xor-el/CryptoLib4Pascal/tree/vNext/CryptoLib.Examples/src/Examples

Tests 
https://github.com/Xor-el/CryptoLib4Pascal/tree/vNext/CryptoLib.Tests

Testers are welcome, especially for platforms marked as untested in the README. Any feedback or bug reports are appreciated.

440bx

  • Hero Member
  • *****
  • Posts: 6317
Re: CryptoLib4Pascal
« Reply #1 on: March 14, 2026, 12:14:33 am »
FreePascal
  • 3.2.4 or later
Did you mean 3.2.2 ?  3.2.4 is not released yet and it presumably has no new features, therefore 3.2.2 should be just fine.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Xor-el

  • Sr. Member
  • ****
  • Posts: 411
Re: CryptoLib4Pascal
« Reply #2 on: March 14, 2026, 12:26:47 am »
FreePascal
  • 3.2.4 or later
Did you mean 3.2.2 ?  3.2.4 is not released yet and it presumably has no new features, therefore 3.2.2 should be just fine.

I’m aware that 3.2.4 has not been officially released yet (although snapshots are available and users can build from the 3.2 Fixes branch), and it doesn’t introduce any new features. However, there was a breaking change involving Generics.Collections and Generics.Defaults.

Additionally, there appears to be an issue with IEqualityComparer handling in 3.2.2 that affects TDictionary<T>. This problem is resolved starting from 3.2.3.

For this reason, I increased the minimum supported compiler version to 3.2.4. That said, 3.2.3 will also work if you’re willing to build the compiler from source — I verified this myself during testing.

« Last Edit: March 14, 2026, 12:34:21 am by Xor-el »

440bx

  • Hero Member
  • *****
  • Posts: 6317
Re: CryptoLib4Pascal
« Reply #3 on: March 14, 2026, 12:36:00 am »
Thank you.

At least now it is clear why 3.2.4 is required and 3.2.2 doesn't meet the requirements.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Xor-el

  • Sr. Member
  • ****
  • Posts: 411
Re: CryptoLib4Pascal
« Reply #4 on: March 14, 2026, 12:39:35 am »
Thank you.

At least now it is clear why 3.2.4 is required and 3.2.2 doesn't meet the requirements.

You’re welcome.

jamie

  • Hero Member
  • *****
  • Posts: 7651
Re: CryptoLib4Pascal
« Reply #5 on: March 14, 2026, 05:25:35 pm »
Good luck using the Collections, I have not successfully used those in a larger project yet without the compiler at link time I believe coughing up an error that shows at the end of the Main project file stating ".Lxxx" something not found.

 It works with delphi larger or small but not with 3.2.x yet.

I tried that again the other day using the FPC 3.2.4 on an abandoned project and still fails.

But like I said, works fine with small simple projects.

I can use the FPC generics and the only issue I have with them is at times depending on what I am doing It may not like taking managed strings as types so I use Short strings in those cases.

Jamie
The only true wisdom is knowing you know nothing

Xor-el

  • Sr. Member
  • ****
  • Posts: 411
Re: CryptoLib4Pascal
« Reply #6 on: March 14, 2026, 06:17:32 pm »
Good luck using the Collections, I have not successfully used those in a larger project yet without the compiler at link time I believe coughing up an error that shows at the end of the Main project file stating ".Lxxx" something not found.

 It works with delphi larger or small but not with 3.2.x yet.

I tried that again the other day using the FPC 3.2.4 on an abandoned project and still fails.

But like I said, works fine with small simple projects.

I can use the FPC generics and the only issue I have with them is at times depending on what I am doing It may not like taking managed strings as types so I use Short strings in those cases.

Jamie

I haven’t really encountered any major issues with Generics.Collections from RTL generics. Most of the shortcomings I run into seem to stem from the state of generics support in FPC, particularly when using MODE DELPHI.

Unfortunately, not everyone has the luxury of switching to FPC generics in non-Delphi modes, since many of us have to maintain code that compiles across multiple compilers.

Also, ObjFPC mode tends to feel a bit too verbose for my taste, so I generally prefer to stick with MODE DELPHI.

 

TinyPortal © 2005-2018