Skip to content

Commit dd9eaf1

Browse files
committed
chore: retain only Skein512, remove other variants
1 parent 7e55615 commit dd9eaf1

File tree

2 files changed

+0
-273
lines changed

2 files changed

+0
-273
lines changed

src/crypto/x11/skein.c

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -669,121 +669,13 @@ skein_big_close(sph_skein_big_context *sc, unsigned ub, unsigned n,
669669
#endif
670670
}
671671

672-
static const sph_u64 IV224[] = {
673-
SPH_C64(0xCCD0616248677224), SPH_C64(0xCBA65CF3A92339EF),
674-
SPH_C64(0x8CCD69D652FF4B64), SPH_C64(0x398AED7B3AB890B4),
675-
SPH_C64(0x0F59D1B1457D2BD0), SPH_C64(0x6776FE6575D4EB3D),
676-
SPH_C64(0x99FBC70E997413E9), SPH_C64(0x9E2CFCCFE1C41EF7)
677-
};
678-
679-
static const sph_u64 IV256[] = {
680-
SPH_C64(0xCCD044A12FDB3E13), SPH_C64(0xE83590301A79A9EB),
681-
SPH_C64(0x55AEA0614F816E6F), SPH_C64(0x2A2767A4AE9B94DB),
682-
SPH_C64(0xEC06025E74DD7683), SPH_C64(0xE7A436CDC4746251),
683-
SPH_C64(0xC36FBAF9393AD185), SPH_C64(0x3EEDBA1833EDFC13)
684-
};
685-
686-
static const sph_u64 IV384[] = {
687-
SPH_C64(0xA3F6C6BF3A75EF5F), SPH_C64(0xB0FEF9CCFD84FAA4),
688-
SPH_C64(0x9D77DD663D770CFE), SPH_C64(0xD798CBF3B468FDDA),
689-
SPH_C64(0x1BC4A6668A0E4465), SPH_C64(0x7ED7D434E5807407),
690-
SPH_C64(0x548FC1ACD4EC44D6), SPH_C64(0x266E17546AA18FF8)
691-
};
692-
693672
static const sph_u64 IV512[] = {
694673
SPH_C64(0x4903ADFF749C51CE), SPH_C64(0x0D95DE399746DF03),
695674
SPH_C64(0x8FD1934127C79BCE), SPH_C64(0x9A255629FF352CB1),
696675
SPH_C64(0x5DB62599DF6CA7B0), SPH_C64(0xEABE394CA9D5C3F4),
697676
SPH_C64(0x991112C71A75B523), SPH_C64(0xAE18A40B660FCC33)
698677
};
699678

700-
/* see sph_skein.h */
701-
void
702-
sph_skein224_init(void *cc)
703-
{
704-
skein_big_init(cc, IV224);
705-
}
706-
707-
/* see sph_skein.h */
708-
void
709-
sph_skein224(void *cc, const void *data, size_t len)
710-
{
711-
skein_big_core(cc, data, len);
712-
}
713-
714-
/* see sph_skein.h */
715-
void
716-
sph_skein224_close(void *cc, void *dst)
717-
{
718-
sph_skein224_addbits_and_close(cc, 0, 0, dst);
719-
}
720-
721-
/* see sph_skein.h */
722-
void
723-
sph_skein224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst)
724-
{
725-
skein_big_close(cc, ub, n, dst, 28);
726-
sph_skein224_init(cc);
727-
}
728-
729-
/* see sph_skein.h */
730-
void
731-
sph_skein256_init(void *cc)
732-
{
733-
skein_big_init(cc, IV256);
734-
}
735-
736-
/* see sph_skein.h */
737-
void
738-
sph_skein256(void *cc, const void *data, size_t len)
739-
{
740-
skein_big_core(cc, data, len);
741-
}
742-
743-
/* see sph_skein.h */
744-
void
745-
sph_skein256_close(void *cc, void *dst)
746-
{
747-
sph_skein256_addbits_and_close(cc, 0, 0, dst);
748-
}
749-
750-
/* see sph_skein.h */
751-
void
752-
sph_skein256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst)
753-
{
754-
skein_big_close(cc, ub, n, dst, 32);
755-
sph_skein256_init(cc);
756-
}
757-
758-
/* see sph_skein.h */
759-
void
760-
sph_skein384_init(void *cc)
761-
{
762-
skein_big_init(cc, IV384);
763-
}
764-
765-
/* see sph_skein.h */
766-
void
767-
sph_skein384(void *cc, const void *data, size_t len)
768-
{
769-
skein_big_core(cc, data, len);
770-
}
771-
772-
/* see sph_skein.h */
773-
void
774-
sph_skein384_close(void *cc, void *dst)
775-
{
776-
sph_skein384_addbits_and_close(cc, 0, 0, dst);
777-
}
778-
779-
/* see sph_skein.h */
780-
void
781-
sph_skein384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst)
782-
{
783-
skein_big_close(cc, ub, n, dst, 48);
784-
sph_skein384_init(cc);
785-
}
786-
787679
/* see sph_skein.h */
788680
void
789681
sph_skein512_init(void *cc)

src/crypto/x11/sph_skein.h

Lines changed: 0 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,6 @@ extern "C"{
5050

5151
#if SPH_64
5252

53-
/**
54-
* Output size (in bits) for Skein-224.
55-
*/
56-
#define SPH_SIZE_skein224 224
57-
58-
/**
59-
* Output size (in bits) for Skein-256.
60-
*/
61-
#define SPH_SIZE_skein256 256
62-
63-
/**
64-
* Output size (in bits) for Skein-384.
65-
*/
66-
#define SPH_SIZE_skein384 384
67-
6853
/**
6954
* Output size (in bits) for Skein-512.
7055
*/
@@ -87,161 +72,11 @@ typedef struct {
8772
sph_u64 bcount;
8873
} sph_skein_big_context;
8974

90-
/**
91-
* Type for a Skein-224 context (identical to the common "big" context).
92-
*/
93-
typedef sph_skein_big_context sph_skein224_context;
94-
95-
/**
96-
* Type for a Skein-256 context (identical to the common "big" context).
97-
*/
98-
typedef sph_skein_big_context sph_skein256_context;
99-
100-
/**
101-
* Type for a Skein-384 context (identical to the common "big" context).
102-
*/
103-
typedef sph_skein_big_context sph_skein384_context;
104-
10575
/**
10676
* Type for a Skein-512 context (identical to the common "big" context).
10777
*/
10878
typedef sph_skein_big_context sph_skein512_context;
10979

110-
/**
111-
* Initialize a Skein-224 context. This process performs no memory allocation.
112-
*
113-
* @param cc the Skein-224 context (pointer to a
114-
* <code>sph_skein224_context</code>)
115-
*/
116-
void sph_skein224_init(void *cc);
117-
118-
/**
119-
* Process some data bytes. It is acceptable that <code>len</code> is zero
120-
* (in which case this function does nothing).
121-
*
122-
* @param cc the Skein-224 context
123-
* @param data the input data
124-
* @param len the input data length (in bytes)
125-
*/
126-
void sph_skein224(void *cc, const void *data, size_t len);
127-
128-
/**
129-
* Terminate the current Skein-224 computation and output the result into
130-
* the provided buffer. The destination buffer must be wide enough to
131-
* accomodate the result (28 bytes). The context is automatically
132-
* reinitialized.
133-
*
134-
* @param cc the Skein-224 context
135-
* @param dst the destination buffer
136-
*/
137-
void sph_skein224_close(void *cc, void *dst);
138-
139-
/**
140-
* Add a few additional bits (0 to 7) to the current computation, then
141-
* terminate it and output the result in the provided buffer, which must
142-
* be wide enough to accomodate the result (28 bytes). If bit number i
143-
* in <code>ub</code> has value 2^i, then the extra bits are those
144-
* numbered 7 downto 8-n (this is the big-endian convention at the byte
145-
* level). The context is automatically reinitialized.
146-
*
147-
* @param cc the Skein-224 context
148-
* @param ub the extra bits
149-
* @param n the number of extra bits (0 to 7)
150-
* @param dst the destination buffer
151-
*/
152-
void sph_skein224_addbits_and_close(
153-
void *cc, unsigned ub, unsigned n, void *dst);
154-
155-
/**
156-
* Initialize a Skein-256 context. This process performs no memory allocation.
157-
*
158-
* @param cc the Skein-256 context (pointer to a
159-
* <code>sph_skein256_context</code>)
160-
*/
161-
void sph_skein256_init(void *cc);
162-
163-
/**
164-
* Process some data bytes. It is acceptable that <code>len</code> is zero
165-
* (in which case this function does nothing).
166-
*
167-
* @param cc the Skein-256 context
168-
* @param data the input data
169-
* @param len the input data length (in bytes)
170-
*/
171-
void sph_skein256(void *cc, const void *data, size_t len);
172-
173-
/**
174-
* Terminate the current Skein-256 computation and output the result into
175-
* the provided buffer. The destination buffer must be wide enough to
176-
* accomodate the result (32 bytes). The context is automatically
177-
* reinitialized.
178-
*
179-
* @param cc the Skein-256 context
180-
* @param dst the destination buffer
181-
*/
182-
void sph_skein256_close(void *cc, void *dst);
183-
184-
/**
185-
* Add a few additional bits (0 to 7) to the current computation, then
186-
* terminate it and output the result in the provided buffer, which must
187-
* be wide enough to accomodate the result (32 bytes). If bit number i
188-
* in <code>ub</code> has value 2^i, then the extra bits are those
189-
* numbered 7 downto 8-n (this is the big-endian convention at the byte
190-
* level). The context is automatically reinitialized.
191-
*
192-
* @param cc the Skein-256 context
193-
* @param ub the extra bits
194-
* @param n the number of extra bits (0 to 7)
195-
* @param dst the destination buffer
196-
*/
197-
void sph_skein256_addbits_and_close(
198-
void *cc, unsigned ub, unsigned n, void *dst);
199-
200-
/**
201-
* Initialize a Skein-384 context. This process performs no memory allocation.
202-
*
203-
* @param cc the Skein-384 context (pointer to a
204-
* <code>sph_skein384_context</code>)
205-
*/
206-
void sph_skein384_init(void *cc);
207-
208-
/**
209-
* Process some data bytes. It is acceptable that <code>len</code> is zero
210-
* (in which case this function does nothing).
211-
*
212-
* @param cc the Skein-384 context
213-
* @param data the input data
214-
* @param len the input data length (in bytes)
215-
*/
216-
void sph_skein384(void *cc, const void *data, size_t len);
217-
218-
/**
219-
* Terminate the current Skein-384 computation and output the result into
220-
* the provided buffer. The destination buffer must be wide enough to
221-
* accomodate the result (48 bytes). The context is automatically
222-
* reinitialized.
223-
*
224-
* @param cc the Skein-384 context
225-
* @param dst the destination buffer
226-
*/
227-
void sph_skein384_close(void *cc, void *dst);
228-
229-
/**
230-
* Add a few additional bits (0 to 7) to the current computation, then
231-
* terminate it and output the result in the provided buffer, which must
232-
* be wide enough to accomodate the result (48 bytes). If bit number i
233-
* in <code>ub</code> has value 2^i, then the extra bits are those
234-
* numbered 7 downto 8-n (this is the big-endian convention at the byte
235-
* level). The context is automatically reinitialized.
236-
*
237-
* @param cc the Skein-384 context
238-
* @param ub the extra bits
239-
* @param n the number of extra bits (0 to 7)
240-
* @param dst the destination buffer
241-
*/
242-
void sph_skein384_addbits_and_close(
243-
void *cc, unsigned ub, unsigned n, void *dst);
244-
24580
/**
24681
* Initialize a Skein-512 context. This process performs no memory allocation.
24782
*

0 commit comments

Comments
 (0)