Commit Graph

7 Commits (d5968086fe357aa5cf678327295677dba5102fc8)

Author SHA1 Message Date
Andrew Kelley fcbb7426fa use * for pointer type instead of &
See #770

To help automatically translate code, see the
zig-fmt-pointer-reform-2 branch.

This will convert all & into *. Due to the syntax
ambiguity (which is why we are making this change),
even address-of & will turn into *, so you'll have
to manually fix thes instances. You will be guaranteed
to get compile errors for them - expected 'type', found 'foo'
2018-05-31 17:28:07 -04:00
Andrew Kelley ea58f4a5a9 run zig fmt on the codebase 2018-05-30 16:09:11 -04:00
Andrew Kelley 4787127cf6 partial conversion to post-fix pointer deref using zig fmt 2018-05-10 00:29:49 -04:00
Marc Tiehuis f68c2e0a14 Fix off-by-one error in all crypto functions 2018-04-04 21:32:23 +12:00
Marc Tiehuis 7a893691c0 Unroll Sha3 inner loop
Issue #699 since fixed. Nearly a x3 perf improvement.

Using --release-fast.

Sha3_256 (before): 96 Mb/s
Sha3_256  (after): 267 Mb/s

Sha3_512 (before): 53 Mb/s
Sha3_512  (after): 142 Mb/s

No real gains from unrolling other initialization loops in crypto
functions so have been left as is.
2018-03-10 10:00:07 +13:00
Andrew Kelley 3671582c15 syntax: functions require return type. remove `->`
The purpose of this is:

 * Only one way to do things
 * Changing a function with void return type to return a possible
   error becomes a 1 character change, subtly encouraging
   people to use errors.

See #632

Here are some imperfect sed commands for performing this update:

remove arrow:

```
sed -i 's/\(\bfn\b.*\)-> /\1/g' $(find . -name "*.zig")
```

add void:

```
sed -i 's/\(\bfn\b.*\))\s*{/\1) void {/g' $(find ../ -name "*.zig")
```

Some cleanup may be necessary, but this should do the bulk of the work.
2018-01-25 04:10:11 -05:00
Marc Tiehuis 7a3fd89d25 Add Sha3 hashing functions
These are on the slower side and could be improved. No performance optimizations
yet have been done.

```
Cpu: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
```

-- Sha3-256

```
Zig --release-fast
    93 Mb/s
Zig --release-safe
    99 Mb/s
Zig
    4 Mb/s
```

-- Sha3-512

```
Zig --release-fast
    49 Mb/s
Zig --release-safe
    54 Mb/s
Zig
    2 Mb/s
```

Interestingly, release-safe is producing slightly better code than
release-fast.
2018-01-17 21:19:45 +13:00