summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2022-04-07 12:14:13 +0200
committerQuentin Carbonneaux2022-04-07 12:14:13 +0200
commitb0c8e46e5450d13a7f0c87cb6891edcf2e8bc973 (patch)
tree500f396e577c293bca38c2660b5e481958c11f80
parent6ccde878522a8ef6ffccb2d57c736202f185196a (diff)
rename slice crypto functions
-rw-r--r--sdar/all.h3
-rw-r--r--sdar/slice.c6
-rw-r--r--sdar/stash.c6
3 files changed, 7 insertions, 8 deletions
diff --git a/sdar/all.h b/sdar/all.h
index 0524489..92d9c25 100644
--- a/sdar/all.h
+++ b/sdar/all.h
@@ -188,8 +188,7 @@ Slice newsl();
void freesl(Slice);
void sldeflate(Slice *, Slice);
int slinflate(Slice *, Slice);
-void slencryptp(Slice *, Slice, uchar[Prepsz], vlong);
-int sldecryptp(Slice *, Slice, uchar[Prepsz], vlong);
+void slencrypt(Slice *, Slice, uchar[Prepsz], vlong);
int decrypt(Slice *, FILE *, long, uchar[Prepsz], vlong);
void slhmac(Slice, hmac_t);
int slwrite(Slice, FILE *);
diff --git a/sdar/slice.c b/sdar/slice.c
index e7bf35b..2e4f4f5 100644
--- a/sdar/slice.c
+++ b/sdar/slice.c
@@ -64,7 +64,7 @@ freesl(Slice s)
}
void
-slencryptp(Slice *sc, Slice sp, uchar prep[Prepsz], vlong nonce)
+slencrypt(Slice *sc, Slice sp, uchar prep[Prepsz], vlong nonce)
{
uchar nbuf[Noncesz] = {0};
@@ -77,7 +77,7 @@ slencryptp(Slice *sc, Slice sp, uchar prep[Prepsz], vlong nonce)
}
int
-sldecryptp(Slice *sp, Slice sc, uchar prep[Prepsz], vlong nonce)
+sldecrypt(Slice *sp, Slice sc, uchar prep[Prepsz], vlong nonce)
{
uchar nbuf[Noncesz] = {0};
@@ -99,7 +99,7 @@ decrypt(Slice *s, FILE *f, long sz, uchar prep[Prepsz], vlong nonce)
sr = newsl();
if ((err = slread(&sr, Cipovh + sz, f)) == 0)
- err = sldecryptp(s, sr, prep, nonce);
+ err = sldecrypt(s, sr, prep, nonce);
freesl(sr);
return err;
}
diff --git a/sdar/stash.c b/sdar/stash.c
index 540a826..cd0f829 100644
--- a/sdar/stash.c
+++ b/sdar/stash.c
@@ -102,7 +102,7 @@ flushraw(Arch *a, hmac_t hmac, int lz4, Slice s)
h = a->logh;
sc = newsl();
- slencryptp(&sc, s, h->segp, h->dlen);
+ slencrypt(&sc, s, h->segp, h->dlen);
if (slwrite(sc, a->data))
goto ioerror;
@@ -211,7 +211,7 @@ writeseg(Arch *a, char *msg, FILE *f)
strncpy(m.msg, msg, sizeof m.msg - 1);
encmeta(&sb, &m);
- slencryptp(&sc, sb, h->segp, -1);
+ slencrypt(&sc, sb, h->segp, -1);
if (slwrite(sc, f))
goto out;
@@ -239,7 +239,7 @@ writeseg(Arch *a, char *msg, FILE *f)
len -= n;
if (slread(&sb, n, a->log))
goto out;
- slencryptp(&sc, sb, h->segp, --idx);
+ slencrypt(&sc, sb, h->segp, --idx);
if (slwrite(sc, f))
goto out;
}