diff options
author | pete <petewicken@gmail.com> | 2013-08-29 22:17:51 +0100 |
---|---|---|
committer | pete <petewicken@gmail.com> | 2013-08-29 22:17:51 +0100 |
commit | 82b8927af7f68bbfbf83bbb5ffbc747de7bc288f (patch) | |
tree | ba83cda597e8146c0d02128fb8424bec9201d730 /other/fun/sign.c | |
parent | 792709e4e091ea587a642c548889ddbb866e9b5e (diff) |
Correct a lot of the grammar and spelling. Also spent a few hours fixing the comments so they follow a standard.
Diffstat (limited to 'other/fun/sign.c')
-rw-r--r-- | other/fun/sign.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/other/fun/sign.c b/other/fun/sign.c index bcf54c3a..44485bb5 100644 --- a/other/fun/sign.c +++ b/other/fun/sign.c | |||
@@ -95,13 +95,13 @@ int main(int argc, char *argv[]) | |||
95 | 95 | ||
96 | if (f == NULL) | 96 | if (f == NULL) |
97 | goto fail; | 97 | goto fail; |
98 | memcpy(sm + smlen, sm, crypto_sign_ed25519_BYTES); //Move signature from beginning to end of file. | 98 | memcpy(sm + smlen, sm, crypto_sign_ed25519_BYTES); // Move signature from beginning to end of file. |
99 | 99 | ||
100 | if (fwrite(sm + (smlen - size), 1, smlen, f) != smlen) | 100 | if (fwrite(sm + (smlen - size), 1, smlen, f) != smlen) |
101 | goto fail; | 101 | goto fail; |
102 | 102 | ||
103 | fclose(f); | 103 | fclose(f); |
104 | printf("Signed successfully\n"); | 104 | printf("Signed successfully.\n"); |
105 | } | 105 | } |
106 | 106 | ||
107 | if (argc == 4 && argv[1][0] == 'c') { | 107 | if (argc == 4 && argv[1][0] == 'c') { |
@@ -113,17 +113,17 @@ int main(int argc, char *argv[]) | |||
113 | goto fail; | 113 | goto fail; |
114 | 114 | ||
115 | char *signe = malloc(size + crypto_sign_ed25519_BYTES); | 115 | char *signe = malloc(size + crypto_sign_ed25519_BYTES); |
116 | memcpy(signe, data + size - crypto_sign_ed25519_BYTES, crypto_sign_ed25519_BYTES);//Move signature from end to beginning of file. | 116 | memcpy(signe, data + size - crypto_sign_ed25519_BYTES, crypto_sign_ed25519_BYTES); // Move signature from end to beginning of file. |
117 | memcpy(signe + crypto_sign_ed25519_BYTES, data, size - crypto_sign_ed25519_BYTES); | 117 | memcpy(signe + crypto_sign_ed25519_BYTES, data, size - crypto_sign_ed25519_BYTES); |
118 | unsigned long long smlen; | 118 | unsigned long long smlen; |
119 | char *m = malloc(size); | 119 | char *m = malloc(size); |
120 | unsigned long long mlen; | 120 | unsigned long long mlen; |
121 | 121 | ||
122 | if (crypto_sign_ed25519_open(m, &mlen, signe, size, public_key) == -1) { | 122 | if (crypto_sign_ed25519_open(m, &mlen, signe, size, public_key) == -1) { |
123 | printf("Failed checking sig\n"); | 123 | printf("Failed checking sig.\n"); |
124 | goto fail; | 124 | goto fail; |
125 | } | 125 | } |
126 | printf("Checked successfully\n"); | 126 | printf("Checked successfully.\n"); |
127 | } | 127 | } |
128 | 128 | ||
129 | return 0; | 129 | return 0; |