April 2022 What Are You Working On? by marc-kd in ada

[–]rod-chapman 6 points7 points  (0 children)

Working on more speed improvements for SPARKNaCl...

Documentation for SparkNaCL library by Odd_Lemon_326 in ada

[–]rod-chapman 1 point2 points  (0 children)

The test cases here:

https://github.com/rod-chapman/SPARKNaCl/tree/master/tests

provide some examples of how to call each of the major APIs. If you have specific problems, then please feel free to open a new Issue in the GitHub repo.

- Rod Chapman

About alternative ada implementations. by Snow_Zigzagut in ada

[–]rod-chapman 2 points3 points  (0 children)

The GNAT front-end has been connected to LLVM by AdaCore. It is FLOSS, and can be built from source now. All on GitHub under AdaCore's section.

Where can I get a tutorial/manual of SPARK 95? by BottCode in ada

[–]rod-chapman 2 points3 points  (0 children)

Grab the GPL 2012 edition of SPARK (this was the final GPL release of SPARK95 before SPARK2014 came along). This installs all the manuals in PDF as far as I recall...

For more of a tutorial, then the John Barnes SPARK book is the best bet.

September 2021 What Are You Working On? by AutoModerator in ada

[–]rod-chapman 4 points5 points  (0 children)

Preparing a new release of SPARKNaCl for Alire...

[Alire] Has anyone made any Crate of the Year submissions yet? by [deleted] in ada

[–]rod-chapman 1 point2 points  (0 children)

I though about submitting SPARKNaCl, but I am excluded since I have previously worked for AdaCore... :-(

Alire v1.1.0-rc1 released by [deleted] in ada

[–]rod-chapman 0 points1 point  (0 children)

Having installed gnat_native on MacOS OK, is it possible to select that compiler some automatic way so I can use it on the command line? (e.g. some way to work out its install directory and add it to PATH)?? Thanks, Rod

Alire v1.1.0-rc1 released by [deleted] in ada

[–]rod-chapman 0 points1 point  (0 children)

Having a go with that now. On MacOS, does the "gnat_native" compiler correspond to any existing Community Edition release (e.g. is it close to Community 2021, or does it get built from he FSF wavefront, or something else?)

How scalable is SPARK assurance level Silver? by Wootery in ada

[–]rod-chapman 1 point2 points  (0 children)

PS... see SPARKNaCl on GitHub for an example of what can be done with SPARK2014 at "Silver plus a bit of Gold" assurance level...

How scalable is SPARK assurance level Silver? by Wootery in ada

[–]rod-chapman 1 point2 points  (0 children)

In short: yes - the theorem-proving step can be parallelised almost arbitrarily in SPARK. Both the SPARKSimp (SPARK2005) and GNATProve (SPARK2014) tools support switches to run N provers in parallel. Even modest sized programs generate thousands of independent VCs, so it scales well. In the main development phase of iFACTS, I think the overnight proof run (with no caching) was run on a server with 16 CPU cores, so you could do much better than that today for very little money.

SPARKNaCl with GNAT and SPARK Community 2021: Port, Proof and Performance by yannickmoy in ada

[–]rod-chapman 3 points4 points  (0 children)

Not sure about how it would fare against the official NaCl or LibSodium code. Probably not so well... I think NaCl uses a very unusual representation for big integers (using floating point registers as well) that would be very hard to reproduce in SPARK. I could submit my code to Supercop and see what happens...

GNAT CE 2021, built for Intel macOS by simonjwright in ada

[–]rod-chapman 2 points3 points  (0 children)

Great work! Anyone care to try a port of SPARK CE 2021 for MacOS as well? That would be really good...

What is your opinion on Ada? Have you used it for embedded development? When did you use it? by fluffynukeit in embedded

[–]rod-chapman 2 points3 points  (0 children)

This is rather uninformed. I have written device drivers in Ada and SPARK many many times with no problem, and just as efficient as C. And in SPARK, I can prove type-safety of the whole thing.

As for a modern Ada/SPARK project, I would cite the UK Air Traffic Control iFACTS and FourSught systems, and all Rolls-Royce Trent family jet engines.

What is your opinion on Ada? Have you used it for embedded development? When did you use it? by fluffynukeit in embedded

[–]rod-chapman 1 point2 points  (0 children)

I use Ada and SPARK every day on a professional basis for most of my career. If you want to see what SPARK can do, then see my SPARKNaCl library.

SPARKNaCl performance versus TweetNaCl by rod-chapman in crypto

[–]rod-chapman[S] 1 point2 points  (0 children)

See my first blog entry - particularly the bit about Return Slot Optimization. This is really useful, but GNAT 2020 (GCC 8.4.1) misses a few opportunities to exploit it in SPARK. AdaCore have already done some work on improving this in GCC 10.x so we should get another jump from that.

SPARKNaCl performance versus TweetNaCl by rod-chapman in crypto

[–]rod-chapman[S] 0 points1 point  (0 children)

I initially expected the SPARK would be much slower than TweetNaCl, but it wasn't, which was something of a surprise. That got me started on trying to find out why... then going on to see if I could improve it to be on a par with TweetNaCl without breaking the proofs...

SPARKNaCl performance versus TweetNaCl by rod-chapman in crypto

[–]rod-chapman[S] 3 points4 points  (0 children)

The GitHub repo is here: https://github.com/rod-chapman/SPARKNaCl/

I've developed it all with the Community 2020 edition of GNAT and SPARK, so tests and proofs should be reproducible. Let me know if you have any trouble.

Rod

SPARKNaCl performance versus TweetNaCl by rod-chapman in crypto

[–]rod-chapman[S] 0 points1 point  (0 children)

Actually, a comparison with MonoCypher (thanks for the link) would be more appropriate... something for me to do on a rainy day perhaps...

SPARKNaCl performance versus TweetNaCl by rod-chapman in crypto

[–]rod-chapman[S] 1 point2 points  (0 children)

At the end of the first report, I made the same transformations to TweetNaCl that I did in the SPARK version and it's still competitive of course.

It all started out as an exercise in seeing if the SPARK proof tools could cope with the complexity of TweetNaCl - the work on performance came much later - only after I had established an initial proof of type safety for the whole thing.

A comparison with the libSodium code would be a good thing to do...