#define PL_multi_open (vTHX->Imulti_open)
#define PL_multi_start (vTHX->Imulti_start)
#define PL_multiline (vTHX->Imultiline)
-#define PL_new_hash_seed (vTHX->Inew_hash_seed)
-#define PL_new_hash_seed_set (vTHX->Inew_hash_seed_set)
#define PL_nexttoke (vTHX->Inexttoke)
#define PL_nexttype (vTHX->Inexttype)
#define PL_nextval (vTHX->Inextval)
#define PL_reentrant_retint (vTHX->Ireentrant_retint)
#define PL_regex_pad (vTHX->Iregex_pad)
#define PL_regex_padav (vTHX->Iregex_padav)
+#define PL_rehash_seed (vTHX->Irehash_seed)
+#define PL_rehash_seed_set (vTHX->Irehash_seed_set)
#define PL_replgv (vTHX->Ireplgv)
#define PL_rsfp (vTHX->Irsfp)
#define PL_rsfp_filters (vTHX->Irsfp_filters)
#define PL_Imulti_open PL_multi_open
#define PL_Imulti_start PL_multi_start
#define PL_Imultiline PL_multiline
-#define PL_Inew_hash_seed PL_new_hash_seed
-#define PL_Inew_hash_seed_set PL_new_hash_seed_set
#define PL_Inexttoke PL_nexttoke
#define PL_Inexttype PL_nexttype
#define PL_Inextval PL_nextval
#define PL_Ireentrant_retint PL_reentrant_retint
#define PL_Iregex_pad PL_regex_pad
#define PL_Iregex_padav PL_regex_padav
+#define PL_Irehash_seed PL_rehash_seed
+#define PL_Irehash_seed_set PL_rehash_seed_set
#define PL_Ireplgv PL_replgv
#define PL_Irsfp PL_rsfp
#define PL_Irsfp_filters PL_rsfp_filters
register const char *s_PeRlHaSh_tmp = str; \
register const unsigned char *s_PeRlHaSh = (const unsigned char *)s_PeRlHaSh_tmp; \
register I32 i_PeRlHaSh = len; \
- register U32 hash_PeRlHaSh = PL_new_hash_seed; \
+ register U32 hash_PeRlHaSh = PL_rehash_seed; \
while (i_PeRlHaSh--) { \
hash_PeRlHaSh += *s_PeRlHaSh++; \
hash_PeRlHaSh += (hash_PeRlHaSh << 10); \
PERLVARI(Icv_has_eval, I32, 0) /* PL_compcv includes an entereval or similar */
-PERLVARI(Inew_hash_seed, UV, 0) /* 582 hash initializer */
+PERLVARI(Irehash_seed, UV, 0) /* 582 hash initializer */
-PERLVARI(Inew_hash_seed_set, bool, FALSE) /* 582 hash initialized? */
+PERLVARI(Irehash_seed_set, bool, FALSE) /* 582 hash initialized? */
/* New variables must be added to the very end, before this comment,
* for binary compatibility (the offsets of the old members must not change).
=cut
sub hash_seed () {
- Internals::new_hash_seed();
+ Internals::rehash_seed();
}
=back
#if defined(USE_HASH_SEED) || defined(USE_HASH_SEED_EXPLICIT)
/* [perl #22371] Algorimic Complexity Attack on Perl 5.6.1, 5.8.0
* This MUST be done before any hash stores or fetches take place.
- * If you set PL_hash_seed (and assumedly also PL_hash_seed_set) yourself,
- * it is your responsibility to provide a good random seed!
+ * If you set PL_rehash_seed (and assumedly also PL_rehash_seed_set)
+ * yourself, it is your responsibility to provide a good random seed!
* You can also define PERL_HASH_SEED in compile time, see hv.h. */
- if (!PL_new_hash_seed_set)
- PL_new_hash_seed = get_hash_seed();
+ if (!PL_rehash_seed_set)
+ PL_rehash_seed = get_hash_seed();
{
char *s = PerlEnv_getenv("PERL_HASH_SEED_DEBUG");
if (i == 1)
PerlIO_printf(Perl_debug_log, "HASH_SEED = %"UVuf"\n",
- PL_new_hash_seed);
+ PL_rehash_seed);
}
}
#endif /* #if defined(USE_HASH_SEED) || defined(USE_HASH_SEED_EXPLICIT) */
#define PL_multi_start (*Perl_Imulti_start_ptr(aTHX))
#undef PL_multiline
#define PL_multiline (*Perl_Imultiline_ptr(aTHX))
-#undef PL_new_hash_seed
-#define PL_new_hash_seed (*Perl_Inew_hash_seed_ptr(aTHX))
-#undef PL_new_hash_seed_set
-#define PL_new_hash_seed_set (*Perl_Inew_hash_seed_set_ptr(aTHX))
#undef PL_nexttoke
#define PL_nexttoke (*Perl_Inexttoke_ptr(aTHX))
#undef PL_nexttype
#define PL_regex_pad (*Perl_Iregex_pad_ptr(aTHX))
#undef PL_regex_padav
#define PL_regex_padav (*Perl_Iregex_padav_ptr(aTHX))
+#undef PL_rehash_seed
+#define PL_rehash_seed (*Perl_Irehash_seed_ptr(aTHX))
+#undef PL_rehash_seed_set
+#define PL_rehash_seed_set (*Perl_Irehash_seed_set_ptr(aTHX))
#undef PL_replgv
#define PL_replgv (*Perl_Ireplgv_ptr(aTHX))
#undef PL_rsfp
PL_glob_index = proto_perl->Iglob_index;
PL_srand_called = proto_perl->Isrand_called;
PL_hash_seed = proto_perl->Ihash_seed;
- PL_new_hash_seed = proto_perl->Inew_hash_seed;
+ PL_rehash_seed = proto_perl->Irehash_seed;
PL_uudmap['M'] = 0; /* reinits on demand */
PL_bitcount = Nullch; /* reinits on demand */
XS(XS_PerlIO_get_layers);
XS(XS_Regexp_DESTROY);
XS(XS_Internals_hash_seed);
-XS(XS_Internals_new_hash_seed);
+XS(XS_Internals_rehash_seed);
XS(XS_Internals_HvREHASH);
void
XS_PerlIO_get_layers, file, "*;@");
newXS("Regexp::DESTROY", XS_Regexp_DESTROY, file);
newXSproto("Internals::hash_seed",XS_Internals_hash_seed, file, "");
- newXSproto("Internals::new_hash_seed",XS_Internals_new_hash_seed, file,
- "");
+ newXSproto("Internals::rehash_seed",XS_Internals_rehash_seed, file, "");
newXSproto("Internals::HvREHASH", XS_Internals_HvREHASH, file, "\\%");
}
XSRETURN_UV(PERL_HASH_SEED);
}
-XS(XS_Internals_new_hash_seed)
+XS(XS_Internals_rehash_seed)
{
/* Using dXSARGS would also have dITEM and dSP,
* which define 2 unused local variables. */
dMARK; dAX;
- XSRETURN_UV(PL_new_hash_seed);
+ XSRETURN_UV(PL_rehash_seed);
}
XS(XS_Internals_HvREHASH) /* Subject to change */
Perl_croak(aTHX_ "Your random numbers are not that random");
}
}
- PL_new_hash_seed_set = TRUE;
+ PL_rehash_seed_set = TRUE;
return myseed;
}