clamav-devel February 2012 archive
Main Archive Page > Month Archives  > clamav-devel archives
clamav-devel: Re: [Clamav-devel] Why the function ac_maketrans d

Re: [Clamav-devel] Why the function ac_maketrans defined size of array is 256?

From: Chatsiri Ratana <chatsiri_at_nospam>
Date: Fri Feb 03 2012 - 01:18:24 GMT
To: ClamAV Development <clamav-devel@lists.clamav.net>

----- Original message -----
> On 02/02/2012 05:53 AM, chatsiri wrote:
> > Hello All,
> >
> > I  debug code of clamav.  Aho-Corasick( AC) Algorithms concepts for
> > matching between virus and signature files. Step for AC is build trie
> > ( keyword tree)  for inserting signature from virus database files. I
> > have question in step build tire before matching with input
> > information. Why source code in "static int ac_maketrans(struct
> > cli_matcher *root)" [1]  define size of array is 256?.
>
> Because the trie matches byte-by-byte, so each node has 256 children,
> and that includes the root.
What's contain in node? My view, Node contains a signature files for matching with virus in files.right? My plan for optimized algorithm code of string matching with GPU.
>
> > In addition, Do you using the Depth First Search Algorithm( DFS) for
> > building trie?
>
> ac_maketrans uses BFS.
>
> Best regards,
> --Edwin
> _______________________________________________
> http://lurker.clamav.net/list/clamav-devel.html
> Please submit your patches to our Bugzilla: http://bugs.clamav.net

_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net