Compare commits
22 Commits
27232cbdb7
...
79f9a10e35
Author | SHA1 | Date |
---|---|---|
Matéo Duparc | 79f9a10e35 | |
Matéo Duparc | f3b722fdff | |
Jakob Unterwurzacher | 77a0410e2e | |
rfjakob | 403f59b1c0 | |
Jakob Unterwurzacher | 8f3ec5dcaa | |
Jakob Unterwurzacher | 85297cda97 | |
Jakob Unterwurzacher | e9a5b8962b | |
Evgeny | 6dc8c26100 | |
Jakob Unterwurzacher | 88bc0aa607 | |
Gisi0 | 0b5b864a06 | |
a1346054 | 3c1ac3b06b | |
Jakob Unterwurzacher | c4b95cf35a | |
Jakob Unterwurzacher | b2a5cec4dd | |
Jakob Unterwurzacher | 856ccaac10 | |
Jakob Unterwurzacher | 99cdaa0b69 | |
Daniel Theophanes | 439dea1b19 | |
Jakob Unterwurzacher | ff32e99791 | |
Christian Stewart | 7ee4c8e9c3 | |
Val | 0ec7ffbfe9 | |
Jakob Unterwurzacher | f8bd172289 | |
Jakob Unterwurzacher | a55b3cc15a | |
Jakob Unterwurzacher | 59165f0f53 |
9
go.mod
9
go.mod
|
@ -3,15 +3,8 @@ module libgocryptfs/v2
|
||||||
go 1.19
|
go 1.19
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/jacobsa/crypto v0.0.0-20190317225127-9f44e2d11115
|
github.com/aperturerobotics/jacobsa-crypto v1.0.1
|
||||||
github.com/rfjakob/eme v1.1.2
|
github.com/rfjakob/eme v1.1.2
|
||||||
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90
|
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90
|
||||||
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41
|
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
|
||||||
github.com/jacobsa/oglematchers v0.0.0-20150720000706-141901ea67cd // indirect
|
|
||||||
github.com/jacobsa/oglemock v0.0.0-20150831005832-e94d794d06ff // indirect
|
|
||||||
github.com/jacobsa/ogletest v0.0.0-20170503003838-80d50a735a11 // indirect
|
|
||||||
github.com/jacobsa/reqtrace v0.0.0-20150505043853-245c9e0234cb // indirect
|
|
||||||
)
|
|
||||||
|
|
10
go.sum
10
go.sum
|
@ -1,17 +1,13 @@
|
||||||
github.com/jacobsa/crypto v0.0.0-20190317225127-9f44e2d11115 h1:YuDUUFNM21CAbyPOpOP8BicaTD/0klJEKt5p8yuw+uY=
|
github.com/aperturerobotics/jacobsa-crypto v1.0.1 h1:BsIgQFvT0uveYFe+0hc7SwSsCNNIPmxFjm9oi0qGdGM=
|
||||||
github.com/jacobsa/crypto v0.0.0-20190317225127-9f44e2d11115/go.mod h1:LadVJg0XuawGk+8L1rYnIED8451UyNxEMdTWCEt5kmU=
|
github.com/aperturerobotics/jacobsa-crypto v1.0.1/go.mod h1:oR/7BV4/0QbjutdWNOQ2N0PxGPT9qFVDi4gw0UepxDA=
|
||||||
github.com/jacobsa/oglematchers v0.0.0-20150720000706-141901ea67cd h1:9GCSedGjMcLZCrusBZuo4tyKLpKUPenUUqi34AkuFmA=
|
github.com/jacobsa/oglematchers v0.0.0-20150720000706-141901ea67cd h1:9GCSedGjMcLZCrusBZuo4tyKLpKUPenUUqi34AkuFmA=
|
||||||
github.com/jacobsa/oglematchers v0.0.0-20150720000706-141901ea67cd/go.mod h1:TlmyIZDpGmwRoTWiakdr+HA1Tukze6C6XbRVidYq02M=
|
|
||||||
github.com/jacobsa/oglemock v0.0.0-20150831005832-e94d794d06ff h1:2xRHTvkpJ5zJmglXLRqHiZQNjUoOkhUyhTAhEQvPAWw=
|
github.com/jacobsa/oglemock v0.0.0-20150831005832-e94d794d06ff h1:2xRHTvkpJ5zJmglXLRqHiZQNjUoOkhUyhTAhEQvPAWw=
|
||||||
github.com/jacobsa/oglemock v0.0.0-20150831005832-e94d794d06ff/go.mod h1:gJWba/XXGl0UoOmBQKRWCJdHrr3nE0T65t6ioaj3mLI=
|
|
||||||
github.com/jacobsa/ogletest v0.0.0-20170503003838-80d50a735a11 h1:BMb8s3ENQLt5ulwVIHVDWFHp8eIXmbfSExkvdn9qMXI=
|
github.com/jacobsa/ogletest v0.0.0-20170503003838-80d50a735a11 h1:BMb8s3ENQLt5ulwVIHVDWFHp8eIXmbfSExkvdn9qMXI=
|
||||||
github.com/jacobsa/ogletest v0.0.0-20170503003838-80d50a735a11/go.mod h1:+DBdDyfoO2McrOyDemRBq0q9CMEByef7sYl7JH5Q3BI=
|
|
||||||
github.com/jacobsa/reqtrace v0.0.0-20150505043853-245c9e0234cb h1:uSWBjJdMf47kQlXMwWEfmc864bA1wAC+Kl3ApryuG9Y=
|
github.com/jacobsa/reqtrace v0.0.0-20150505043853-245c9e0234cb h1:uSWBjJdMf47kQlXMwWEfmc864bA1wAC+Kl3ApryuG9Y=
|
||||||
github.com/jacobsa/reqtrace v0.0.0-20150505043853-245c9e0234cb/go.mod h1:ivcmUvxXWjb27NsPEaiYK7AidlZXS7oQ5PowUS9z3I4=
|
|
||||||
github.com/rfjakob/eme v1.1.2 h1:SxziR8msSOElPayZNFfQw4Tjx/Sbaeeh3eRvrHVMUs4=
|
github.com/rfjakob/eme v1.1.2 h1:SxziR8msSOElPayZNFfQw4Tjx/Sbaeeh3eRvrHVMUs4=
|
||||||
github.com/rfjakob/eme v1.1.2/go.mod h1:cVvpasglm/G3ngEfcfT/Wt0GwhkuO32pf/poW6Nyk1k=
|
github.com/rfjakob/eme v1.1.2/go.mod h1:cVvpasglm/G3ngEfcfT/Wt0GwhkuO32pf/poW6Nyk1k=
|
||||||
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM=
|
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM=
|
||||||
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE=
|
golang.org/x/net v0.0.0-20220708220712-1185a9018129 h1:vucSRfWwTsoXro7P+3Cjlr6flUMtzCwzlvkxEQtHHB0=
|
||||||
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41 h1:ohgcoMbSofXygzo6AD2I1kz3BFmW1QArPYTtwEM3UXc=
|
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41 h1:ohgcoMbSofXygzo6AD2I1kz3BFmW1QArPYTtwEM3UXc=
|
||||||
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"crypto/cipher"
|
"crypto/cipher"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/jacobsa/crypto/siv"
|
"github.com/aperturerobotics/jacobsa-crypto/siv"
|
||||||
)
|
)
|
||||||
|
|
||||||
type sivAead struct {
|
type sivAead struct {
|
||||||
|
@ -63,7 +63,7 @@ func (s *sivAead) Seal(dst, nonce, plaintext, authData []byte) []byte {
|
||||||
if len(s.key) == 0 {
|
if len(s.key) == 0 {
|
||||||
log.Panic("Key has been wiped?")
|
log.Panic("Key has been wiped?")
|
||||||
}
|
}
|
||||||
// https://github.com/jacobsa/crypto/blob/master/siv/encrypt.go#L48:
|
// https://github.com/aperturerobotics/jacobsa-crypto/blob/master/siv/encrypt.go#L48:
|
||||||
// As per RFC 5297 section 3, you may use this function for nonce-based
|
// As per RFC 5297 section 3, you may use this function for nonce-based
|
||||||
// authenticated encryption by passing a nonce as the last associated
|
// authenticated encryption by passing a nonce as the last associated
|
||||||
// data element.
|
// data element.
|
||||||
|
|
|
@ -16,13 +16,13 @@
|
||||||
// However, OpenSSL has optimized assembly for almost all platforms, which Go
|
// However, OpenSSL has optimized assembly for almost all platforms, which Go
|
||||||
// does not. Example for a 32-bit ARM device (Odroid XU4):
|
// does not. Example for a 32-bit ARM device (Odroid XU4):
|
||||||
//
|
//
|
||||||
// $ gocrypts -speed
|
// $ gocrypts -speed
|
||||||
// gocryptfs v2.1-68-gedf9d4c.stupidchacha; go-fuse v2.1.1-0.20210825171523-3ab5d95a30ae; 2021-09-04 go1.16.7 linux/arm
|
// gocryptfs v2.1-68-gedf9d4c.stupidchacha; go-fuse v2.1.1-0.20210825171523-3ab5d95a30ae; 2021-09-04 go1.16.7 linux/arm
|
||||||
// AES-GCM-256-OpenSSL 56.84 MB/s (selected in auto mode)
|
// AES-GCM-256-OpenSSL 56.84 MB/s (selected in auto mode)
|
||||||
// AES-GCM-256-Go 16.61 MB/s
|
// AES-GCM-256-Go 16.61 MB/s
|
||||||
// AES-SIV-512-Go 16.49 MB/s
|
// AES-SIV-512-Go 16.49 MB/s
|
||||||
// XChaCha20-Poly1305-Go 39.08 MB/s (use via -xchacha flag)
|
// XChaCha20-Poly1305-Go 39.08 MB/s (use via -xchacha flag)
|
||||||
// XChaCha20-Poly1305-OpenSSL 141.82 MB/s
|
// XChaCha20-Poly1305-OpenSSL 141.82 MB/s
|
||||||
//
|
//
|
||||||
// This package is "stupid" in the sense that it only supports a narrow set of
|
// This package is "stupid" in the sense that it only supports a narrow set of
|
||||||
// key- and iv-lengths, and panics if it does not like what you pass it.
|
// key- and iv-lengths, and panics if it does not like what you pass it.
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
// Corrupt ciphertexts never cause a panic. Instead, ErrAuth is returned on
|
// Corrupt ciphertexts never cause a panic. Instead, ErrAuth is returned on
|
||||||
// decryption.
|
// decryption.
|
||||||
//
|
//
|
||||||
// XChaCha20-Poly1305
|
// # XChaCha20-Poly1305
|
||||||
//
|
//
|
||||||
// The XChaCha20-Poly1305 implementation is more complicated than the others,
|
// The XChaCha20-Poly1305 implementation is more complicated than the others,
|
||||||
// because OpenSSL does not support XChaCha20-Poly1305 directly. Follow
|
// because OpenSSL does not support XChaCha20-Poly1305 directly. Follow
|
||||||
|
@ -43,16 +43,16 @@
|
||||||
// Fortunately, XChaCha20-Poly1305 is just ChaCha20-Poly1305 with some key+iv
|
// Fortunately, XChaCha20-Poly1305 is just ChaCha20-Poly1305 with some key+iv
|
||||||
// mixing using HChaCha20 in front:
|
// mixing using HChaCha20 in front:
|
||||||
//
|
//
|
||||||
// key (32 bytes), iv (24 bytes)
|
// key (32 bytes), iv (24 bytes)
|
||||||
// |
|
// |
|
||||||
// v
|
// v
|
||||||
// HChaCha20 (provided by golang.org/x/crypto/chacha20)
|
// HChaCha20 (provided by golang.org/x/crypto/chacha20)
|
||||||
// |
|
// |
|
||||||
// v
|
// v
|
||||||
// key2 (32 bytes), iv2 (16 bytes)
|
// key2 (32 bytes), iv2 (16 bytes)
|
||||||
// |
|
// |
|
||||||
// v
|
// v
|
||||||
// ChaCha20-Poly1305 (OpenSSL EVP_chacha20_poly1305)
|
// ChaCha20-Poly1305 (OpenSSL EVP_chacha20_poly1305)
|
||||||
//
|
//
|
||||||
// As HChaCha20 is very fast, XChaCha20-Poly1305 gets almost the same throughput
|
// As HChaCha20 is very fast, XChaCha20-Poly1305 gets almost the same throughput
|
||||||
// as ChaCha20-Poly1305 (for 4kiB blocks).
|
// as ChaCha20-Poly1305 (for 4kiB blocks).
|
||||||
|
|
|
@ -11,9 +11,9 @@ import (
|
||||||
//
|
//
|
||||||
// Go GCM is only faster if the CPU either:
|
// Go GCM is only faster if the CPU either:
|
||||||
//
|
//
|
||||||
// 1) Is X86_64 && has AES instructions && Go is v1.6 or higher
|
// 1. Is X86_64 && has AES instructions && Go is v1.6 or higher
|
||||||
// 2) Is ARM64 && has AES instructions && Go is v1.11 or higher
|
// 2. Is ARM64 && has AES instructions && Go is v1.11 or higher
|
||||||
// (commit https://github.com/golang/go/commit/4f1f503373cda7160392be94e3849b0c9b9ebbda)
|
// (commit https://github.com/golang/go/commit/4f1f503373cda7160392be94e3849b0c9b9ebbda)
|
||||||
//
|
//
|
||||||
// See https://github.com/rfjakob/gocryptfs/wiki/CPU-Benchmarks
|
// See https://github.com/rfjakob/gocryptfs/wiki/CPU-Benchmarks
|
||||||
// for benchmarks.
|
// for benchmarks.
|
||||||
|
|
Loading…
Reference in New Issue